Explorar el Código

qcacld-3.0: Allow TDLS connection on 6GHz only if fw supports

Allow TDLS connection on 6GHz only if FW supports TDLS on 6GHz.

Change-Id: I663bd6d73235664c21029d8956f465da5a5b39c6
CRs-Fixed: 3223677
Utkarsh Bhatnagar hace 2 años
padre
commit
5b8626946b

+ 5 - 1
components/tdls/core/src/wlan_tdls_main.c

@@ -34,6 +34,7 @@
 #include "wlan_scan_ucfg_api.h"
 #include "wlan_tdls_ucfg_api.h"
 #include "wlan_cm_roam_api.h"
+#include "wlan_cfg80211_tdls.h"
 
 /* Global tdls soc pvt object
  * this is useful for some functions which does not receive either vdev or psoc
@@ -846,7 +847,7 @@ QDF_STATUS tdls_update_fw_tdls_state(struct tdls_soc_priv_obj *tdls_soc_obj,
 
 #ifdef WLAN_FEATURE_11AX
 bool tdls_is_6g_freq_allowed(struct wlan_objmgr_vdev *vdev,
-				    qdf_freq_t freq)
+			     qdf_freq_t freq)
 {
 	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(vdev);
 	struct regulatory_channel chan[NUM_CHANNELS] = {0};
@@ -859,6 +860,9 @@ bool tdls_is_6g_freq_allowed(struct wlan_objmgr_vdev *vdev,
 	if (!wlan_reg_is_6ghz_chan_freq(freq))
 		goto error;
 
+	if (!wlan_cfg80211_tdls_is_fw_6ghz_capable(vdev))
+		goto error;
+
 	if (!pdev)
 		goto error;
 

+ 2 - 0
components/tdls/core/src/wlan_tdls_main.h

@@ -193,6 +193,7 @@ struct tdls_set_state_info {
  * @tdls_osif_init_cb: Callback to initialize the tdls private
  * @tdls_osif_deinit_cb: Callback to deinitialize the tdls private
  * @fw_tdls_11ax_capablity: bool for tdls 11ax fw capability
+ * @fw_tdls_6g_capability: bool for tdls 6g fw capability
  * @bss_sta_power: bss sta power
  * @@bss_sta_power_type: bss sta power type
  */
@@ -245,6 +246,7 @@ struct tdls_soc_priv_obj {
 	tdls_vdev_deinit_cb tdls_osif_deinit_cb;
 #ifdef WLAN_FEATURE_11AX
 	bool fw_tdls_11ax_capability;
+	bool fw_tdls_6g_capability;
 	uint8_t bss_sta_power;
 	uint8_t bss_sta_power_type;
 #endif

+ 32 - 0
components/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h

@@ -87,6 +87,17 @@ QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc,
 void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
 					 bool is_fw_tdls_11ax_capable);
 
+/**
+ * ucfg_tdls_update_fw_6g_support() - Update FW TDLS 6g capability in TLDS
+ *                                    Component
+ * @psoc: psoc object
+ * @is_fw_tdls_6g_capable: set to true if firmware supports TDLS on 6G band
+ *
+ * Return: void
+ */
+void ucfg_update_fw_tdls_6g_capability(struct wlan_objmgr_psoc *psoc,
+				       bool is_fw_tdls_6g_capable);
+
 /**
  * ucfg_tdls_is_fw_11ax_supported() - Get FW TDLS 11ax capability from TLDS
  *                                    component.
@@ -96,6 +107,15 @@ void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
  */
 bool ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * ucfg_tdls_is_fw_6g_capable() - Get FW TDLS 6g capability from TLDS
+ *                                component.
+ * @psoc: psoc object
+ *
+ * Return: true if fw supports tdls on 6ghz band
+ */
+bool ucfg_tdls_is_fw_6g_capable(struct wlan_objmgr_psoc *psoc);
+
 #else
 static inline
 void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
@@ -108,6 +128,18 @@ bool  ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc)
 {
 return false;
 }
+
+static inline
+void ucfg_update_fw_tdls_6g_capability(struct wlan_objmgr_psoc *psoc,
+				       bool is_fw_tdls_6g_capable)
+{
+}
+
+static inline
+bool  ucfg_tdls_is_fw_6g_capable(struct wlan_objmgr_psoc *psoc)
+{
+return false;
+}
 #endif
 
 /**

+ 31 - 0
components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c

@@ -334,6 +334,21 @@ void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
 	soc_obj->fw_tdls_11ax_capability = is_fw_tdls_11ax_capable;
 }
 
+void ucfg_update_fw_tdls_6g_capability(struct wlan_objmgr_psoc *psoc,
+				       bool is_fw_tdls_6g_capable)
+{
+	struct tdls_soc_priv_obj *soc_obj;
+
+	soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
+							WLAN_UMAC_COMP_TDLS);
+	if (!soc_obj) {
+		tdls_err("Failed to get tdls psoc component");
+		return;
+	}
+
+	soc_obj->fw_tdls_6g_capability = is_fw_tdls_6g_capable;
+}
+
 bool  ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc)
 {
 	struct tdls_soc_priv_obj *soc_obj;
@@ -348,6 +363,22 @@ bool  ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc)
 
 	return soc_obj->fw_tdls_11ax_capability;
 }
+
+bool  ucfg_tdls_is_fw_6g_capable(struct wlan_objmgr_psoc *psoc)
+{
+	struct tdls_soc_priv_obj *soc_obj;
+
+	soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
+							WLAN_UMAC_COMP_TDLS);
+	if (!soc_obj) {
+		tdls_err("Failed to get tdls psoc component");
+		return false;
+	}
+	tdls_debug("FW 6g capability %d", soc_obj->fw_tdls_6g_capability);
+
+	return soc_obj->fw_tdls_6g_capability;
+}
+
 #endif
 
 QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc,

+ 16 - 0
core/hdd/src/wlan_hdd_main.c

@@ -1837,17 +1837,32 @@ static void hdd_update_fw_tdls_11ax_capability(struct hdd_context *hdd_ctx,
 	ucfg_tdls_update_fw_11ax_capability(hdd_ctx->psoc,
 					    cfg->en_tdls_11ax_support);
 }
+
+static void hdd_update_fw_tdls_6g_capability(struct hdd_context *hdd_ctx,
+					     struct wma_tgt_services *cfg)
+{
+	ucfg_update_fw_tdls_6g_capability(hdd_ctx->psoc,
+					  cfg->en_tdls_6g_support);
+}
 #else
 static inline
 void hdd_update_fw_tdls_11ax_capability(struct hdd_context *hdd_ctx,
 					struct wma_tgt_services *cfg)
 {}
+static inline
+void hdd_update_fw_tdls_6g_capability(struct hdd_context *hdd_ctx,
+				      struct wma_tgt_services *cfg)
+{}
 #endif
 #else
 static inline
 void hdd_update_fw_tdls_11ax_capability(struct hdd_context *hdd_ctx,
 					struct wma_tgt_services *cfg)
 {}
+static inline
+void hdd_update_fw_tdls_6g_capability(struct hdd_context *hdd_ctx,
+				      struct wma_tgt_services *cfg)
+{}
 #endif
 
 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
@@ -1956,6 +1971,7 @@ static void hdd_update_tgt_services(struct hdd_context *hdd_ctx,
 					CFG_THERMAL_MITIGATION_ENABLE);
 	hdd_update_fw_tdls_11ax_capability(hdd_ctx, cfg);
 	hdd_set_dynamic_macaddr_update_capability(hdd_ctx, cfg);
+	hdd_update_fw_tdls_6g_capability(hdd_ctx, cfg);
 }
 
 /**

+ 3 - 1
core/wma/inc/wma_tgt_cfg.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -39,6 +39,7 @@
  * @en_tdls_uapsd_buf_sta: enable sta tdls uapsd buf
  * @en_tdls_uapsd_sleep_sta: enable sta tdls uapsd sleep
  * @en_tdls_11ax_support: Get TDLS ax support
+ * @en_tdls_6g_support: Get TDLS 6g fw capability
  * @en_roam_offload: enable roam offload
  * @en_11ax: enable 11ax
  * @is_fw_mawc_capable: Motion Aided Wireless Connectivity feature
@@ -75,6 +76,7 @@ struct wma_tgt_services {
 	bool en_tdls_uapsd_sleep_sta;
 #ifdef WLAN_FEATURE_11AX
 	bool en_tdls_11ax_support;
+	bool en_tdls_6g_support;
 #endif
 #endif /* FEATURE_WLAN_TDLS */
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD

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

@@ -4734,17 +4734,36 @@ wma_get_tdls_ax_support(struct wmi_unified *wmi_handle,
 						wmi_handle,
 						wmi_service_tdls_ax_support);
 }
+
+static inline void
+wma_get_tdls_6g_support(struct wmi_unified *wmi_handle,
+			struct wma_tgt_services *cfg)
+{
+	cfg->en_tdls_6g_support = wmi_service_enabled(
+						wmi_handle,
+						wmi_service_tdls_6g_support);
+}
 #else
 static inline void
 wma_get_tdls_ax_support(struct wmi_unified *wmi_handle,
 			struct wma_tgt_services *cfg)
 {}
+
+static inline void
+wma_get_tdls_6g_support(struct wmi_unified *wmi_handle,
+			struct wma_tgt_services *cfg)
+{}
 #endif
 #else
 static inline void
 wma_get_tdls_ax_support(struct wmi_unified *wmi_handle,
 			struct wma_tgt_services *cfg)
 {}
+
+static inline void
+wma_get_tdls_6g_support(struct wmi_unified *wmi_handle,
+			struct wma_tgt_services *cfg)
+{}
 #endif
 
 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
@@ -4906,6 +4925,7 @@ static inline void wma_update_target_services(struct wmi_unified *wmi_handle,
 
 	wma_get_igmp_offload_enable(wmi_handle, cfg);
 	wma_get_tdls_ax_support(wmi_handle, cfg);
+	wma_get_tdls_6g_support(wmi_handle, cfg);
 
 	wma_get_dynamic_vdev_macaddr_support(wmi_handle, cfg);
 }

+ 10 - 0
os_if/tdls/inc/wlan_cfg80211_tdls.h

@@ -164,6 +164,16 @@ int wlan_cfg80211_tdls_oper(struct wlan_objmgr_vdev *vdev,
 int wlan_cfg80211_tdls_get_all_peers(struct wlan_objmgr_vdev *vdev,
 				char *buf, int buflen);
 
+#ifdef WLAN_FEATURE_11AX
+/**
+ * hdd_tdls_is_fw_6ghz_capable() - Check whether fw supports 6ghz band tdls
+ * @vdev:     Pointer to vdev
+ *
+ * Return: true if fw supports 6ghz tdls connection
+ */
+bool wlan_cfg80211_tdls_is_fw_6ghz_capable(struct wlan_objmgr_vdev *vdev);
+#endif
+
 /**
  * wlan_cfg80211_tdls_mgmt() - process tdls management frames from the supplicant
  * @vdev: vdev object

+ 25 - 6
os_if/tdls/src/wlan_cfg80211_tdls.c

@@ -263,7 +263,8 @@ wlan_cfg80211_tdls_extract_6ghz_params(struct tdls_update_peer_params *req_info,
 
 static void
 wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info,
-				     struct station_parameters *params)
+				     struct station_parameters *params,
+				     bool tdls_6g_support)
 {
 	if (params->he_capa_len < MIN_TDLS_HE_CAP_LEN) {
 		osif_debug("he_capa_len %d less than MIN_TDLS_HE_CAP_LEN",
@@ -283,7 +284,8 @@ wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info,
 	qdf_mem_copy(&req_info->he_cap, params->he_capa,
 		     req_info->he_cap_len);
 
-	wlan_cfg80211_tdls_extract_6ghz_params(req_info, params);
+	if (tdls_6g_support)
+		wlan_cfg80211_tdls_extract_6ghz_params(req_info, params);
 
 	return;
 }
@@ -291,7 +293,8 @@ wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info,
 #else
 static void
 wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info,
-				     struct station_parameters *params)
+				     struct station_parameters *params,
+				     bool tdls_6g_support)
 {
 }
 #endif
@@ -299,7 +302,7 @@ wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info,
 static void
 wlan_cfg80211_tdls_extract_params(struct tdls_update_peer_params *req_info,
 				  struct station_parameters *params,
-				  bool tdls_11ax_support)
+				  bool tdls_11ax_support, bool tdls_6g_support)
 {
 	int i;
 
@@ -380,7 +383,8 @@ wlan_cfg80211_tdls_extract_params(struct tdls_update_peer_params *req_info,
 		req_info->is_pmf = 1;
 	}
 	if (tdls_11ax_support)
-		wlan_cfg80211_tdls_extract_he_params(req_info, params);
+		wlan_cfg80211_tdls_extract_he_params(req_info, params,
+						     tdls_6g_support);
 	else
 		osif_debug("tdls ax disabled");
 }
@@ -396,6 +400,7 @@ int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_vdev *vdev,
 	unsigned long rc;
 	struct wlan_objmgr_psoc *psoc;
 	bool tdls_11ax_support = false;
+	bool tdls_6g_support = false;
 
 	status = wlan_cfg80211_tdls_validate_mac_addr(mac);
 
@@ -416,7 +421,9 @@ int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_vdev *vdev,
 	}
 
 	tdls_11ax_support = ucfg_tdls_is_fw_11ax_capable(psoc);
-	wlan_cfg80211_tdls_extract_params(req_info, params, tdls_11ax_support);
+	tdls_6g_support = ucfg_tdls_is_fw_6g_capable(psoc);
+	wlan_cfg80211_tdls_extract_params(req_info, params, tdls_11ax_support,
+					  tdls_6g_support);
 
 	osif_priv = wlan_vdev_get_ospriv(vdev);
 	if (!osif_priv || !osif_priv->osif_tdls) {
@@ -736,6 +743,18 @@ error_get_tdls_peers:
 	return len;
 }
 
+#ifdef WLAN_FEATURE_11AX
+bool wlan_cfg80211_tdls_is_fw_6ghz_capable(struct wlan_objmgr_vdev *vdev)
+{
+	struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
+
+	if (!psoc)
+		return false;
+
+	return ucfg_tdls_is_fw_6g_capable(psoc);
+}
+#endif
+
 int wlan_cfg80211_tdls_mgmt(struct wlan_objmgr_vdev *vdev,
 			    const uint8_t *peer_mac,
 			    uint8_t action_code, uint8_t dialog_token,