소스 검색

qcacld-3.0: Set secure NAN feature to kernel

Currently, there is no provision to identify that the driver supports
NAN pairing protocol. So, new kernel will start exchanging PASN frames
without realization that old driver is loaded and thus, frames will be
drops in driver.

So, to resolve the backward compatibility issue, kernel introduces new
feature flag "NL80211_EXT_FEATURE_SECURE_NAN".
Firmware send "max_pairing_session" parameter in NAN capabilities and
host driver extracts the parameter and set the feature flag to kernel
when max pairing session has non-zero value.

Change-Id: I3b83a771c99bf2e91a4ed1a14acafe584d6e17ec
CRs-Fixed: 3493345
Rahul Gusain 1 년 전
부모
커밋
bba075a057
4개의 변경된 파일62개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      Kbuild
  2. 19 0
      core/hdd/src/wlan_hdd_cfg80211.c
  3. 4 0
      core/mac/src/include/sir_params.h
  4. 33 0
      core/wma/src/wma_main.c

+ 6 - 0
Kbuild

@@ -3298,6 +3298,12 @@ ifeq ($(findstring yes, $(found)), yes)
 ccflags-y += -DCFG80211_EXTERNAL_AUTH_MLO_SUPPORT
 ccflags-y += -DCFG80211_EXTERNAL_AUTH_MLO_SUPPORT
 endif
 endif
 
 
+
+found = $(shell if grep -qF "NL80211_EXT_FEATURE_SECURE_NAN" $(srctree)/include/uapi/linux/nl80211.h; then echo "yes"; else echo "no"; fi;)
+ifeq ($(findstring yes, $(found)), yes)
+ccflags-y += -DCFG80211_EXT_FEATURE_SECURE_NAN
+endif
+
 ifeq (qca_cld3, $(WLAN_WEAR_CHIPSET))
 ifeq (qca_cld3, $(WLAN_WEAR_CHIPSET))
 	ccflags-y += -DWLAN_WEAR_CHIPSET
 	ccflags-y += -DWLAN_WEAR_CHIPSET
 endif
 endif

+ 19 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -19594,6 +19594,24 @@ static void wlan_hdd_set_nan_supported_bands(struct wiphy *wiphy)
 }
 }
 #endif
 #endif
 
 
+#if defined(WLAN_FEATURE_NAN) && defined(WLAN_EXT_FEATURE_SECURE_NAN)
+/**
+ * wlan_hdd_set_nan_secure_mode - Populate Secure NAN supported by driver
+ * @wiphy: wiphy
+ *
+ * Return: void
+ */
+static void wlan_hdd_set_nan_secure_mode(struct wiphy *wiphy)
+{
+	if (sme_is_feature_supported_by_fw(SECURE_NAN))
+		wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_SECURE_NAN);
+}
+#else
+static void wlan_hdd_set_nan_secure_mode(struct wiphy *wiphy)
+{
+}
+#endif
+
 /**
 /**
  * wlan_hdd_update_akm_suit_info() - Populate akm suits supported by driver
  * wlan_hdd_update_akm_suit_info() - Populate akm suits supported by driver
  * @wiphy: wiphy
  * @wiphy: wiphy
@@ -20184,6 +20202,7 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx)
 	wlan_hdd_set_mlo_wiphy_ext_feature(wiphy, hdd_ctx);
 	wlan_hdd_set_mlo_wiphy_ext_feature(wiphy, hdd_ctx);
 	wlan_hdd_set_ext_kek_kck_support(wiphy);
 	wlan_hdd_set_ext_kek_kck_support(wiphy);
 	wlan_hdd_set_32bytes_kck_support(wiphy);
 	wlan_hdd_set_32bytes_kck_support(wiphy);
+	wlan_hdd_set_nan_secure_mode(wiphy);
 }
 }
 
 
 /**
 /**

+ 4 - 0
core/mac/src/include/sir_params.h

@@ -86,6 +86,7 @@ typedef enum {
  * RTT - indicate RTT
  * RTT - indicate RTT
  * DOT11AX - indicate 11ax
  * DOT11AX - indicate 11ax
  * DOT11BE - indicate 11be
  * DOT11BE - indicate 11be
+ * SECURE_NAN - indicate NAN Pairing protocol
  * WOW - indicate WOW
  * WOW - indicate WOW
  * WLAN_ROAM_SCAN_OFFLOAD - indicate Roam scan offload
  * WLAN_ROAM_SCAN_OFFLOAD - indicate Roam scan offload
  * WLAN_PERIODIC_TX_PTRN - indicate WLAN_PERIODIC_TX_PTRN
  * WLAN_PERIODIC_TX_PTRN - indicate WLAN_PERIODIC_TX_PTRN
@@ -116,6 +117,9 @@ enum cap_bitmap {
 	DOT11AX = 13,
 	DOT11AX = 13,
 #ifdef WLAN_FEATURE_11BE
 #ifdef WLAN_FEATURE_11BE
 	DOT11BE = 14,
 	DOT11BE = 14,
+#endif
+#ifdef WLAN_FEATURE_NAN
+	SECURE_NAN = 15,
 #endif
 #endif
 	WOW = 22,
 	WOW = 22,
 	WLAN_ROAM_SCAN_OFFLOAD = 23,
 	WLAN_ROAM_SCAN_OFFLOAD = 23,

+ 33 - 0
core/wma/src/wma_main.c

@@ -5182,6 +5182,38 @@ static inline void wma_get_dynamic_vdev_macaddr_support(
 }
 }
 #endif
 #endif
 
 
+#ifdef WLAN_FEATURE_NAN
+/**
+ * wma_nan_set_pairing_feature() - set feature bit for Secure NAN if max
+ * pairing session has non-zero value.
+ *
+ * Return: none
+ */
+static void wma_nan_set_pairing_feature(void)
+{
+	tp_wma_handle wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
+	struct target_psoc_info *tgt_hdl;
+	struct wlan_objmgr_psoc *psoc;
+
+	if (!wma_handle) {
+		wma_err("wma handle is null");
+		return;
+	}
+
+	psoc = wma_handle->psoc;
+	tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
+	if (!tgt_hdl) {
+		wma_err("tgt_hdl is null");
+		return;
+	}
+
+	if (tgt_hdl->info.service_ext2_param.max_nan_pairing_sessions) {
+		wma_set_fw_wlan_feat_caps(SECURE_NAN);
+		wma_debug("Secure NAN is enabled");
+	}
+}
+#endif /* WLAN_FEATURE_NAN */
+
 /**
 /**
  * wma_update_target_services() - update target services from wma handle
  * wma_update_target_services() - update target services from wma handle
  * @wmi_handle: Unified wmi handle
  * @wmi_handle: Unified wmi handle
@@ -5274,6 +5306,7 @@ static inline void wma_update_target_services(struct wmi_unified *wmi_handle,
 #ifdef WLAN_FEATURE_NAN
 #ifdef WLAN_FEATURE_NAN
 	if (wmi_service_enabled(wmi_handle, wmi_service_nan))
 	if (wmi_service_enabled(wmi_handle, wmi_service_nan))
 		g_fw_wlan_feat_caps |= (1 << NAN);
 		g_fw_wlan_feat_caps |= (1 << NAN);
+	wma_nan_set_pairing_feature();
 #endif /* WLAN_FEATURE_NAN */
 #endif /* WLAN_FEATURE_NAN */
 
 
 	if (wmi_service_enabled(wmi_handle, wmi_service_rtt))
 	if (wmi_service_enabled(wmi_handle, wmi_service_rtt))