From 989bb351cb7c63b39b8d1a9b438092d7f5769ef5 Mon Sep 17 00:00:00 2001 From: Nachiket Kukade Date: Tue, 31 Jul 2018 18:01:17 +0530 Subject: [PATCH] qcacld-3.0: Advertise NAN support only if INI is enabled Under get_supported_features vendor command driver is advertising NAN capability by checking only the Firmware support. If NAN is disabled through INI it should not advertize this support. Add an INI parameter check before advertizing NAN capability. Change-Id: Ib48044a04500d6619b97d5ca1c3431ee64d7e096 CRs-Fixed: 2288204 --- core/hdd/inc/wlan_hdd_nan.h | 4 ++-- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- core/hdd/src/wlan_hdd_nan.c | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) 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); }