diff --git a/core/hdd/inc/wlan_hdd_nan.h b/core/hdd/inc/wlan_hdd_nan.h index 50b376e7cc0a..57ec6b2604fc 100644 --- a/core/hdd/inc/wlan_hdd_nan.h +++ b/core/hdd/inc/wlan_hdd_nan.h @@ -36,7 +36,7 @@ int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy, const void *data, int data_len); -bool wlan_hdd_nan_is_supported(void); +bool wlan_hdd_nan_is_supported(struct hdd_context *hdd_ctx); /** * wlan_hdd_cfg80211_nan_callback() - cfg80211 NAN event handler @@ -52,7 +52,7 @@ bool wlan_hdd_nan_is_supported(void); */ void wlan_hdd_cfg80211_nan_callback(hdd_handle_t hdd_handle, tSirNanEvent *msg); #else -static inline bool wlan_hdd_nan_is_supported(void) +static inline bool wlan_hdd_nan_is_supported(struct hdd_context *hdd_ctx) { return false; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 8e3f481df1f4..6febfa2169a4 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3045,7 +3045,7 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, fset |= WIFI_FEATURE_EXTSCAN | WIFI_FEATURE_HAL_EPNO; } #endif - if (wlan_hdd_nan_is_supported()) { + if (wlan_hdd_nan_is_supported(hdd_ctx)) { hdd_debug("NAN is supported by firmware"); fset |= WIFI_FEATURE_NAN; } diff --git a/core/hdd/src/wlan_hdd_nan.c b/core/hdd/src/wlan_hdd_nan.c index 7125683223cd..4d0b177cebe0 100644 --- a/core/hdd/src/wlan_hdd_nan.c +++ b/core/hdd/src/wlan_hdd_nan.c @@ -148,13 +148,15 @@ void wlan_hdd_cfg80211_nan_callback(hdd_handle_t hdd_handle, tSirNanEvent *msg) /** * wlan_hdd_nan_is_supported() - HDD NAN support query function + * @hdd_ctx: Pointer to hdd context * * This function is called to determine if NAN is supported by the * driver and by the firmware. * * Return: true if NAN is supported by the driver and firmware */ -bool wlan_hdd_nan_is_supported(void) +bool wlan_hdd_nan_is_supported(struct hdd_context *hdd_ctx) { - return sme_is_feature_supported_by_fw(NAN); + return cfg_nan_get_enable(hdd_ctx->hdd_psoc) && + sme_is_feature_supported_by_fw(NAN); }