浏览代码

qcacld-3.0: Allow TDLS connection in wideband only if fw supports

Irrespective of 6 GHz, wideband can be supported.
So, Allow TDLS connection in wideband only if FW supports TDLS
on 6Ghz.
If Fw doesn't support wideband then restrict the TDLS connection
BW to APs Bw.

Change-Id: If726233f381921a8eda25ac7a2705942db79d410
CRs-Fixed: 3223760
Utkarsh Bhatnagar 2 年之前
父节点
当前提交
4d9e51e8a7

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

@@ -196,6 +196,7 @@ struct tdls_set_state_info {
  * @fw_tdls_6g_capability: bool for tdls 6g fw capability
  * @bss_sta_power: bss sta power
  * @@bss_sta_power_type: bss sta power type
+ * @fw_tdls_wideband_capability: bool for tdls wideband fw capability
  */
 struct tdls_soc_priv_obj {
 	struct wlan_objmgr_psoc *soc;
@@ -250,6 +251,7 @@ struct tdls_soc_priv_obj {
 	uint8_t bss_sta_power;
 	uint8_t bss_sta_power_type;
 #endif
+	bool fw_tdls_wideband_capability;
 };
 
 /**

+ 24 - 3
components/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h

@@ -75,10 +75,31 @@ QDF_STATUS ucfg_tdls_psoc_close(struct wlan_objmgr_psoc *psoc);
 QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc,
 				   struct tdls_start_params *req);
 
+/**
+ * ucfg_tdls_update_fw_wideband_capability() - Update FW TDLS wideband
+ *                                             capability in TDLS component
+ *
+ * @psoc: psoc object
+ * @is_fw_tdls_wideband_capable: if fw is tdls wideband capable then it is true
+ *
+ * Return: void
+ */
+void ucfg_tdls_update_fw_wideband_capability(struct wlan_objmgr_psoc *psoc,
+					     bool is_fw_tdls_wideband_capable);
+
+/**
+ * ucfg_tdls_is_fw_wideband_capable() - Get FW TDLS wideband capability from
+ *                                      TDLS component.
+ * @psoc: psoc object
+ *
+ * Return: true if fw supports tdls wideband
+ */
+bool ucfg_tdls_is_fw_wideband_capable(struct wlan_objmgr_psoc *psoc);
+
 #ifdef WLAN_FEATURE_11AX
 /**
- * ucfg_tdls_update_fw_11ax_support() - Update FW TDLS 11ax capability in TLDS
- *                                      Component
+ * ucfg_tdls_update_fw_11ax_capability() - Update FW TDLS 11ax capability in
+ *                                      TDLS Component
  * @psoc: psoc object
  * @is_fw_tdls_11ax_capable: bool if fw is tdls 11ax capable then it is true
  *
@@ -88,7 +109,7 @@ 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
+ * ucfg_update_fw_tdls_6g_capability() - Update FW TDLS 6g capability in TDLS
  *                                    Component
  * @psoc: psoc object
  * @is_fw_tdls_6g_capable: set to true if firmware supports TDLS on 6G band

+ 32 - 1
components/tdls/dispatcher/src/wlan_tdls_ucfg_api.c

@@ -320,6 +320,38 @@ QDF_STATUS ucfg_tdls_psoc_open(struct wlan_objmgr_psoc *psoc)
 	return status;
 }
 
+void ucfg_tdls_update_fw_wideband_capability(struct wlan_objmgr_psoc *psoc,
+					     bool is_fw_tdls_wideband_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_wideband_capability = is_fw_tdls_wideband_capable;
+}
+
+bool ucfg_tdls_is_fw_wideband_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 wideband capability %d",
+		   soc_obj->fw_tdls_wideband_capability);
+
+	return soc_obj->fw_tdls_wideband_capability;
+}
+
 #ifdef WLAN_FEATURE_11AX
 void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
 					 bool is_fw_tdls_11ax_capable)
@@ -380,7 +412,6 @@ bool  ucfg_tdls_is_fw_6g_capable(struct wlan_objmgr_psoc *psoc)
 
 	return soc_obj->fw_tdls_6g_capability;
 }
-
 #endif
 
 QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc,

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

@@ -1829,6 +1829,13 @@ hdd_intersect_igmp_offload_setting(struct wlan_objmgr_psoc *psoc,
 #endif
 
 #ifdef FEATURE_WLAN_TDLS
+static void hdd_update_fw_tdls_wideband_capability(struct hdd_context *hdd_ctx,
+						   struct wma_tgt_services *cfg)
+{
+	ucfg_tdls_update_fw_wideband_capability(hdd_ctx->psoc,
+						cfg->en_tdls_wideband_support);
+}
+
 #ifdef WLAN_FEATURE_11AX
 static void hdd_update_fw_tdls_11ax_capability(struct hdd_context *hdd_ctx,
 					       struct wma_tgt_services *cfg)
@@ -1843,6 +1850,7 @@ static void hdd_update_fw_tdls_6g_capability(struct hdd_context *hdd_ctx,
 	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,
@@ -1858,10 +1866,16 @@ 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)
 {}
+
+static inline
+void hdd_update_fw_tdls_wideband_capability(struct hdd_context *hdd_ctx,
+					    struct wma_tgt_services *cfg)
+{}
 #endif
 
 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
@@ -1971,6 +1985,7 @@ static void hdd_update_tgt_services(struct hdd_context *hdd_ctx,
 	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);
+	hdd_update_fw_tdls_wideband_capability(hdd_ctx, cfg);
 }
 
 /**

+ 8 - 3
core/mac/src/pe/lim/lim_process_tdls.c

@@ -73,6 +73,8 @@
 #include "wlan_mlme_public_struct.h"
 #include "wlan_mlme_api.h"
 #include "wlan_tdls_public_structs.h"
+#include "wlan_cfg80211_tdls.h"
+
 
 /* define NO_PAD_TDLS_MIN_8023_SIZE to NOT padding: See CR#447630
    There was IOT issue with cisco 1252 open mode, where it pads
@@ -353,7 +355,8 @@ static void populate_dot11f_tdls_ext_capability(struct mac_context *mac,
 	/*
 	 * For supporting wider bandwidth set tdls_wider_bw set as 1
 	 */
-	p_ext_cap->tdls_wider_bw = 1;
+	if (wlan_cfg80211_tdls_is_fw_wideband_capable(pe_session->vdev))
+		p_ext_cap->tdls_wider_bw = 1;
 
 	extCapability->present = 1;
 	extCapability->num_bytes = lim_compute_ext_cap_ie_length(extCapability);
@@ -934,7 +937,8 @@ static void populate_dot11f_set_tdls_he_cap(struct mac_context *mac,
 {
 	if (IS_DOT11_MODE_HE(selfDot11Mode)) {
 		populate_dot11f_he_caps(mac, NULL, heCap);
-		lim_tdls_set_he_chan_width(mac, heCap, session, true);
+		lim_tdls_set_he_chan_width(mac, heCap, session,
+		      wlan_cfg80211_tdls_is_fw_wideband_capable(session->vdev));
 		lim_tdls_populate_ppe_caps(mac, session, heCap);
 		lim_log_he_cap(mac, heCap);
 		lim_populate_tdls_setup_6g_cap(mac, hecap_6g, session);
@@ -2991,7 +2995,8 @@ static void lim_tdls_update_hash_node_info(struct mac_context *mac,
 		sta->rmfEnabled = add_sta_req->is_pmf;
 	}
 
-	wide_band_peer = lim_is_wide_band_set(add_sta_req->extn_capability);
+	wide_band_peer = lim_is_wide_band_set(add_sta_req->extn_capability) &&
+		    wlan_cfg80211_tdls_is_fw_wideband_capable(pe_session->vdev);
 	htCaps = &htCap;
 	if (htCaps->present) {
 		sta->mlmStaContext.htCapability = 1;

+ 2 - 0
core/wma/inc/wma_tgt_cfg.h

@@ -38,6 +38,7 @@
  * @en_tdls_offchan: enable tdls offchan
  * @en_tdls_uapsd_buf_sta: enable sta tdls uapsd buf
  * @en_tdls_uapsd_sleep_sta: enable sta tdls uapsd sleep
+ * @en_tdls_wideband_support: Get TDLS wideband support
  * @en_tdls_11ax_support: Get TDLS ax support
  * @en_tdls_6g_support: Get TDLS 6g fw capability
  * @en_roam_offload: enable roam offload
@@ -74,6 +75,7 @@ struct wma_tgt_services {
 	bool en_tdls_offchan;
 	bool en_tdls_uapsd_buf_sta;
 	bool en_tdls_uapsd_sleep_sta;
+	bool en_tdls_wideband_support;
 #ifdef WLAN_FEATURE_11AX
 	bool en_tdls_11ax_support;
 	bool en_tdls_6g_support;

+ 26 - 2
core/wma/src/wma_main.c

@@ -4717,8 +4717,25 @@ wma_get_igmp_offload_enable(struct wmi_unified *wmi_handle,
 {}
 #endif
 
-#ifdef WLAN_FEATURE_11AX
 #ifdef FEATURE_WLAN_TDLS
+/**
+ * wma_get_tdls_wideband_support() - update tgt service with service tdls
+ *                                   wideband support
+ * @wmi_handle: Unified wmi handle
+ * @cfg: target services
+ *
+ * Return: none
+ */
+static inline void
+wma_get_tdls_wideband_support(struct wmi_unified *wmi_handle,
+			      struct wma_tgt_services *cfg)
+{
+	cfg->en_tdls_wideband_support = wmi_service_enabled(
+					     wmi_handle,
+					     wmi_service_tdls_wideband_support);
+}
+
+#ifdef WLAN_FEATURE_11AX
 /**
  * wma_get_tdls_ax_support() - update tgt service with service tdls ax support
  * @wmi_handle: Unified wmi handle
@@ -4743,6 +4760,7 @@ wma_get_tdls_6g_support(struct wmi_unified *wmi_handle,
 						wmi_handle,
 						wmi_service_tdls_6g_support);
 }
+
 #else
 static inline void
 wma_get_tdls_ax_support(struct wmi_unified *wmi_handle,
@@ -4753,6 +4771,7 @@ static inline void
 wma_get_tdls_6g_support(struct wmi_unified *wmi_handle,
 			struct wma_tgt_services *cfg)
 {}
+
 #endif
 #else
 static inline void
@@ -4764,6 +4783,11 @@ static inline void
 wma_get_tdls_6g_support(struct wmi_unified *wmi_handle,
 			struct wma_tgt_services *cfg)
 {}
+
+static inline void
+wma_get_tdls_wideband_support(struct wmi_unified *wmi_handle,
+			      struct wma_tgt_services *cfg)
+{}
 #endif
 
 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
@@ -4926,7 +4950,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_tdls_wideband_support(wmi_handle, cfg);
 	wma_get_dynamic_vdev_macaddr_support(wmi_handle, cfg);
 }
 

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

@@ -164,6 +164,15 @@ 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);
 
+/**
+ * wlan_cfg80211_tdls_is_fw_wideband_capable() - Check whether fw supports
+ *                                                wideband
+ * @vdev:     Pointer to vdev
+ *
+ * Return: true if fw supports 6ghz tdls connection
+ */
+bool wlan_cfg80211_tdls_is_fw_wideband_capable(struct wlan_objmgr_vdev *vdev);
+
 #ifdef WLAN_FEATURE_11AX
 /**
  * hdd_tdls_is_fw_6ghz_capable() - Check whether fw supports 6ghz band tdls

+ 10 - 0
os_if/tdls/src/wlan_cfg80211_tdls.c

@@ -743,6 +743,16 @@ error_get_tdls_peers:
 	return len;
 }
 
+bool wlan_cfg80211_tdls_is_fw_wideband_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_wideband_capable(psoc);
+}
+
 #ifdef WLAN_FEATURE_11AX
 bool wlan_cfg80211_tdls_is_fw_6ghz_capable(struct wlan_objmgr_vdev *vdev)
 {