浏览代码

qcacld-3.0: Fix 80Mhz BW allowed for PEER in 2.4GHz SAP

In case PEER send BW as 80Mhz in OPmode IE in 2.4Ghz, driver doesn't check
the SAP session BW and allow this BW in PEER assoc command to firmware.

Fix this by limiting the PEER BW to less than or equal to SAP session
BW.

Change-Id: Icf9e53fec32d30e5620e51b8664b0e92ba2b26d6
CRs-Fixed: 2346537
Abhishek Singh 6 年之前
父节点
当前提交
1d8bd6255d
共有 2 个文件被更改,包括 20 次插入3 次删除
  1. 13 3
      core/mac/src/pe/lim/lim_process_assoc_req_frame.c
  2. 7 0
      core/wma/src/wma_mgmt.c

+ 13 - 3
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -1402,13 +1402,18 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
 			(sta_ds->htSupportedChannelWidthSet) ?
 				session->htSecondaryChannelOffset : 0;
 		if (assoc_req->operMode.present) {
+			enum phy_ch_width ch_width;
+
+			ch_width = assoc_req->operMode.chanWidth;
+			if (session->ch_width < ch_width)
+				ch_width = session->ch_width;
+
 			sta_ds->vhtSupportedChannelWidthSet =
-				(uint8_t) ((assoc_req->operMode.chanWidth ==
-				eHT_CHANNEL_WIDTH_80MHZ) ?
+				(uint8_t) ((ch_width == CH_WIDTH_80MHZ) ?
 				WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ :
 				WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ);
 			sta_ds->htSupportedChannelWidthSet =
-				(uint8_t) (assoc_req->operMode.chanWidth ?
+				(uint8_t) (ch_width ?
 				eHT_CHANNEL_WIDTH_40MHZ :
 				eHT_CHANNEL_WIDTH_20MHZ);
 		} else if ((vht_caps != NULL) && vht_caps->present) {
@@ -1432,6 +1437,11 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
 			session->htSupportedChannelWidthSet) ?
 			sta_ds->htSupportedChannelWidthSet :
 			session->htSupportedChannelWidthSet;
+
+		if (!sta_ds->htSupportedChannelWidthSet)
+			sta_ds->vhtSupportedChannelWidthSet =
+					WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
+
 		sta_ds->baPolicyFlag = 0xFF;
 		sta_ds->htLdpcCapable =
 			(uint8_t) assoc_req->HTCaps.advCodingCap;

+ 7 - 0
core/wma/src/wma_mgmt.c

@@ -1225,6 +1225,13 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
 	qdf_mem_zero(cmd, sizeof(struct peer_assoc_params));
 
 	is_he = wma_is_peer_he_capable(params);
+	if ((params->ch_width > CH_WIDTH_40MHZ) &&
+	    ((nw_type == eSIR_11G_NW_TYPE) ||
+	     (nw_type == eSIR_11B_NW_TYPE))) {
+		WMA_LOGE("ch_width %d sent in 11G, configure to 40MHz",
+			 params->ch_width);
+		params->ch_width = CH_WIDTH_40MHZ;
+	}
 	phymode = wma_peer_phymode(nw_type, params->staType,
 				   params->htCapable, params->ch_width,
 				   params->vhtCapable, is_he);