Browse Source

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
Nachiket Kukade 6 years ago
parent
commit
989bb351cb
3 changed files with 7 additions and 5 deletions
  1. 2 2
      core/hdd/inc/wlan_hdd_nan.h
  2. 1 1
      core/hdd/src/wlan_hdd_cfg80211.c
  3. 4 2
      core/hdd/src/wlan_hdd_nan.c

+ 2 - 2
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;
 }

+ 1 - 1
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;
 	}

+ 4 - 2
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);
 }