瀏覽代碼

qcacld-3.0: Fix issue in Tx LDPC enable/disable using INI

qcacld-2.0 to qcacld-3.0 propagation.

FW checks the peer Rx LDPC capability in ht and vht capabilities
to do Tx LPDC. But host sets the Tx LPDC flag in peer_flags.
To disable Tx LDPC reset the Rx LDPC capability in peer ht
and vht caps based on Tx LPDC configuration in INI.

Change-Id: I211fd73fd70a35faaf4cfc2c5dc8d842c7ff1e5a
CRs-Fixed: 894306
Kiran Kumar Lokere 9 年之前
父節點
當前提交
0413ba4ab1
共有 1 個文件被更改,包括 45 次插入9 次删除
  1. 45 9
      core/mac/src/pe/lim/lim_assoc_utils.c

+ 45 - 9
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -2484,8 +2484,17 @@ lim_add_sta(tpAniSirGlobal mac_ctx,
 			add_sta_params->htLdpcCapable = 0;
 			add_sta_params->vhtLdpcCapable = 0;
 		} else {
-			add_sta_params->htLdpcCapable = sta_ds->htLdpcCapable;
-			add_sta_params->vhtLdpcCapable = sta_ds->vhtLdpcCapable;
+			if (session_entry->txLdpcIniFeatureEnabled & 0x1)
+				add_sta_params->htLdpcCapable =
+						sta_ds->htLdpcCapable;
+			else
+				add_sta_params->htLdpcCapable = 0;
+
+			if (session_entry->txLdpcIniFeatureEnabled & 0x2)
+				add_sta_params->vhtLdpcCapable =
+						sta_ds->vhtLdpcCapable;
+			else
+				add_sta_params->vhtLdpcCapable = 0;
 		}
 	} else if (STA_ENTRY_SELF == sta_ds->staType) {
 		/* For Self STA get the LDPC capability from config.ini */
@@ -2625,6 +2634,12 @@ lim_add_sta(tpAniSirGlobal mac_ctx,
 		add_sta_params->htLdpcCapable, add_sta_params->vhtLdpcCapable,
 		add_sta_params->p2pCapableSta);
 
+	if (!add_sta_params->htLdpcCapable)
+		add_sta_params->ht_caps &= ~(1 << SIR_MAC_HT_CAP_ADVCODING_S);
+	if (!add_sta_params->vhtLdpcCapable)
+		add_sta_params->vht_caps &=
+			~(1 << SIR_MAC_VHT_CAP_LDPC_CODING_CAP);
+
 	/*
 	 * we need to defer the message until we get the
 	 * response back from HAL.
@@ -4134,8 +4149,12 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
 			pAddBssParams->staContext.htLdpcCapable = 0;
 			pAddBssParams->staContext.vhtLdpcCapable = 0;
 		} else {
-			pAddBssParams->staContext.htLdpcCapable =
-				(uint8_t) pAssocRsp->HTCaps.advCodingCap;
+			if (psessionEntry->txLdpcIniFeatureEnabled & 0x1)
+				pAddBssParams->staContext.htLdpcCapable =
+				    (uint8_t) pAssocRsp->HTCaps.advCodingCap;
+			else
+				pAddBssParams->staContext.htLdpcCapable = 0;
+
 			if (pAssocRsp->VHTCaps.present)
 				vht_caps = &pAssocRsp->VHTCaps;
 			else if (pAssocRsp->vendor2_ie.VHTCaps.present) {
@@ -4143,9 +4162,12 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
 				lim_log(pMac, LOG1, FL(
 					"VHT Caps is in vendor Specfic IE"));
 			}
-			if (vht_caps != NULL)
+			if (vht_caps != NULL &&
+				(psessionEntry->txLdpcIniFeatureEnabled & 0x2))
 				pAddBssParams->staContext.vhtLdpcCapable =
 					(uint8_t) vht_caps->ldpcCodingCap;
+			else
+				pAddBssParams->staContext.vhtLdpcCapable = 0;
 		}
 
 		if (pBeaconStruct->HTInfo.present)
@@ -4253,6 +4275,13 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
 		       (pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId,
 		       psessionEntry->limMlmState));
 
+	if (!pAddBssParams->staContext.htLdpcCapable)
+		pAddBssParams->staContext.ht_caps &=
+			~(1 << SIR_MAC_HT_CAP_ADVCODING_S);
+	if (!pAddBssParams->staContext.vhtLdpcCapable)
+		pAddBssParams->staContext.vht_caps &=
+			~(1 << SIR_MAC_VHT_CAP_LDPC_CODING_CAP);
+
 	lim_log(pMac, LOG2, FL("staContext wmmEnabled: %d encryptType: %d "
 			       "p2pCapableSta: %d"),
 		pAddBssParams->staContext.wmmEnabled,
@@ -4658,9 +4687,13 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
 			pAddBssParams->staContext.htLdpcCapable = 0;
 			pAddBssParams->staContext.vhtLdpcCapable = 0;
 		} else {
-			pAddBssParams->staContext.htLdpcCapable =
-				(uint8_t) pBeaconStruct->HTCaps.
-				advCodingCap;
+			if (psessionEntry->txLdpcIniFeatureEnabled & 0x1)
+				pAddBssParams->staContext.htLdpcCapable =
+					(uint8_t) pBeaconStruct->HTCaps.
+						advCodingCap;
+			else
+				pAddBssParams->staContext.htLdpcCapable = 0;
+
 			if (pBeaconStruct->VHTCaps.present)
 				vht_caps = &pBeaconStruct->VHTCaps;
 			else if (pBeaconStruct->vendor2_ie.VHTCaps.present) {
@@ -4669,9 +4702,12 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
 				lim_log(pMac, LOG1, FL(
 					"VHT Caps are in vendor Specfic IE"));
 			}
-			if (vht_caps != NULL)
+			if (vht_caps != NULL &&
+				(psessionEntry->txLdpcIniFeatureEnabled & 0x2))
 				pAddBssParams->staContext.vhtLdpcCapable =
 					(uint8_t) vht_caps->ldpcCodingCap;
+			else
+				pAddBssParams->staContext.vhtLdpcCapable = 0;
 		}
 
 		if (pBeaconStruct->HTInfo.present)