Jelajahi Sumber

qcacld-3.0: Connect STA in 80MHz if AP is 160MHz with Nss > 1

If AP's channel width is greater than 80MHz and
AP supports Nss > 1 in 160MHz mode then connect the
STA  in 2x2 80MHz mode instead of connecting in 160MHz
mode.

Change-Id: Icf179b34603397642f517944e45714d830f909e7
CRs-Fixed: 1059532
Kiran Kumar Lokere 8 tahun lalu
induk
melakukan
9e58d23246

+ 11 - 0
core/mac/src/pe/lim/lim_prop_exts_utils.c

@@ -186,6 +186,17 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie,
 
 		fw_vht_ch_wd = wma_get_vht_ch_width();
 		vht_ch_wd = QDF_MIN(fw_vht_ch_wd, ap_bcon_ch_width);
+		/*
+		 * If the supported channel width is greater than 80MHz and
+		 * AP supports Nss > 1 in 160MHz mode then connect the STA
+		 * in 2x2 80MHz mode instead of connecting in 160MHz mode.
+		 */
+		if (vht_ch_wd > WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) {
+			if (!(IS_VHT_NSS_1x1(beacon_struct->VHTCaps.txMCSMap))
+					&&
+			   (!IS_VHT_NSS_1x1(beacon_struct->VHTCaps.rxMCSMap)))
+				vht_ch_wd = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
+		}
 		/*
 		 * VHT OP IE old definition:
 		 * vht_op->chanCenterFreqSeg1: center freq of 80MHz/160MHz/

+ 2 - 0
core/mac/src/pe/lim/lim_utils.h

@@ -64,6 +64,8 @@ typedef enum {
 #define VHT_MCS_3x3_MASK    0x30
 #define VHT_MCS_2x2_MASK    0x0C
 
+#define IS_VHT_NSS_1x1(__mcs_map)	((__mcs_map & 0xFFFC) == 0xFFFC)
+
 #ifdef WLAN_FEATURE_11W
 typedef union uPmfSaQueryTimerId {
 	struct {