Ver Fonte

qcacld-3.0: Properly check max supported EHT bandwidth

Per 11BE Spec, only 320 MHz support in 6 GHz is defined in EHT
PHY capabilities. Therefore when deciding max target supported
EHT bandwidth, 320 MHz support is first checked using target
advertised EHT phy caps. If 320 MHz is not supported, fall back
to VHT channel width supported, which includes 160 MHz and 80 MHz.

Change-Id: I26ddfa250db66d72ca55a3c9f966d71740cb0414
CRs-Fixed: 3190474
Jia Ding há 2 anos atrás
pai
commit
307406f111

+ 2 - 2
core/hdd/src/wlan_hdd_eht.c

@@ -209,10 +209,10 @@ void hdd_update_wiphy_eht_cap(struct hdd_context *hdd_ctx)
 		hdd_ctx->iftype_data_5g->eht_cap.has_eht = eht_cap_cfg.present;
 		if (hdd_ctx->iftype_data_5g->eht_cap.has_eht) {
 			hdd_ctx->iftype_data_5g->he_cap.has_he = true;
-			if (max_fw_bw >= WNI_CFG_EHT_CHANNEL_WIDTH_80MHZ)
+			if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ)
 				phy_info_5g[0] |=
 					CHAN_WIDTH_SET_40MHZ_80MHZ_IN_5G;
-			if (max_fw_bw >= WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ)
+			if (max_fw_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
 				phy_info_5g[0] |=
 					CHAN_WIDTH_SET_160MHZ_IN_5G;
 		}

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -1177,7 +1177,7 @@ static enum phy_ch_width hdd_get_eht_phy_ch_width_from_target(void)
 
 	if (max_fw_bw == WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ)
 		return CH_WIDTH_320MHZ;
-	else if (max_fw_bw == WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ)
+	else if (max_fw_bw == WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
 		return CH_WIDTH_160MHZ;
 	else
 		return CH_WIDTH_80MHZ;

+ 2 - 3
core/mac/inc/sir_mac_prop_exts.h

@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2011-2015, 2017-2019, 2021 The Linux Foundation.
  * All rights reserved.
+ * Copyright (c) 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
@@ -82,9 +83,7 @@
 #define WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ	3
 
 #ifdef WLAN_FEATURE_11BE
-#define WNI_CFG_EHT_CHANNEL_WIDTH_80MHZ 4
-#define WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ 5
-#define WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ 6
+#define WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ 4
 #endif
 
 #endif /* __MAC_PROP_EXTS_H */

+ 3 - 3
core/sap/src/sap_module.c

@@ -1187,10 +1187,10 @@ wlansap_get_target_eht_phy_ch_width(void)
 {
 	uint32_t max_fw_bw = sme_get_eht_ch_width();
 
-	if (max_fw_bw == WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ)
-		return CH_WIDTH_160MHZ;
-	else if (max_fw_bw == WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ)
+	if (max_fw_bw == WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ)
 		return CH_WIDTH_320MHZ;
+	else if (max_fw_bw == WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ)
+		return CH_WIDTH_160MHZ;
 	else
 		return CH_WIDTH_80MHZ;
 }

+ 15 - 19
core/wma/src/wma_utils.c

@@ -5055,28 +5055,24 @@ int wma_oem_event_handler(void *wma_ctx, uint8_t *event_buff, uint32_t len)
 #ifdef WLAN_FEATURE_11BE
 uint32_t wma_get_eht_ch_width(void)
 {
-#ifdef TBD
-	uint32_t fw_ch_wd = WNI_CFG_EHT_CHANNEL_WIDTH_80MHZ;
-	tp_wma_handle wm_hdl = cds_get_context(QDF_MODULE_ID_WMA);
-	struct target_psoc_info *tgt_hdl;
-	int eht_cap_info;
+	tDot11fIEeht_cap eht_cap;
+	tp_wma_handle wma;
 
-	if (!wm_hdl)
-		return fw_ch_wd;
+	wma = cds_get_context(QDF_MODULE_ID_WMA);
+	if (qdf_unlikely(!wma)) {
+		wma_err_rl("wma handle is NULL");
+		goto vht_ch_width;
+	}
 
-	tgt_hdl = wlan_psoc_get_tgt_if_handle(wm_hdl->psoc);
-	if (!tgt_hdl)
-		return fw_ch_wd;
+	if (QDF_IS_STATUS_ERROR(mlme_cfg_get_eht_caps(wma->psoc, &eht_cap))) {
+		wma_err_rl("Failed to get eht caps");
+		goto vht_ch_width;
+	}
 
-	eht_cap_info = target_if_get_eht_cap_info(tgt_hdl);
-	if (eht_cap_info & WMI_EHT_CAP_CH_WIDTH_160MHZ)
-		fw_ch_wd = WNI_CFG_EHT_CHANNEL_WIDTH_160MHZ;
-	else if (eht_cap_info & WMI_EHT_CAP_CH_WIDTH_320MHZ)
-		fw_ch_wd = WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ;
+	if (eht_cap.support_320mhz_6ghz)
+		return WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ;
 
-	return fw_ch_wd;
-#else
-	return WNI_CFG_EHT_CHANNEL_WIDTH_320MHZ;
-#endif
+vht_ch_width:
+	return wma_get_vht_ch_width();
 }
 #endif