Ver código fonte

qcacld-3.0: Cleanup HT capability global configurations

UMAC maintains CFG item for each individual field of the HT
capability IE along with the global CFG item for HT cap IE.
This leads to update two global CFG items whenever there
is a change in HT capability IE field.

Remove the duplicate configuration items.
Update LIM code to read the capablities from the session
not from the globals.

Change-Id: Idf5c4358ab67983778a56e2fe3a2f21d1adc19e1
CRs-Fixed: 1029145
Sandeep Puligilla 9 anos atrás
pai
commit
607f34a72e

+ 23 - 16
core/hdd/src/wlan_hdd_cfg.c

@@ -6113,11 +6113,31 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
 	struct hdd_config *pConfig = pHddCtx->config;
 	tSirMacHTCapabilityInfo *phtCapInfo;
 
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_SHORT_GI_20MHZ,
-			    pConfig->ShortGI20MhzEnable) ==
+	/*
+	 * During the initialization both 2G and 5G capabilities should be same.
+	 * So read 5G HT capablity and update 2G and 5G capablities.
+	 */
+	if (sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO,
+			    &val) ==
+			QDF_STATUS_E_FAILURE) {
+		fStatus = false;
+		hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
+	}
+	if (pConfig->ShortGI20MhzEnable)
+		val |= HT_CAPS_SHORT_GI20;
+	else
+		val &= ~(HT_CAPS_SHORT_GI20);
+
+	if (pConfig->ShortGI40MhzEnable)
+		val |= HT_CAPS_SHORT_GI40;
+	else
+		val &= ~(HT_CAPS_SHORT_GI40);
+
+	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO,
+			  val) ==
 			QDF_STATUS_E_FAILURE) {
 		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_SHORT_GI_20MHZ to CFG");
+		hdd_err("Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
 	}
 
 	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate)
@@ -6470,13 +6490,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
 		       "Could not pass on WNI_CFG_TX_PWR_CTRL_ENABLE to CFG");
 	}
 
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_SHORT_GI_40MHZ,
-			    pConfig->ShortGI40MhzEnable) ==
-			QDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_SHORT_GI_40MHZ to CFG");
-	}
-
 	if (sme_cfg_set_int
 		    (pHddCtx->hHal, WNI_CFG_ENABLE_MC_ADDR_LIST,
 		    pConfig->fEnableMCAddrList) == QDF_STATUS_E_FAILURE) {
@@ -6552,12 +6565,6 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx)
 		}
 	}
 
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_RX_STBC,
-			    pConfig->enableRxSTBC) == QDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_HT_RX_STBC to CFG");
-	}
-
 	sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val);
 	val16 = (uint16_t) val;
 	phtCapInfo = (tSirMacHTCapabilityInfo *) &val16;

+ 24 - 1
core/mac/inc/sir_api.h

@@ -535,7 +535,8 @@ typedef struct sSirHtConfig {
 	/* Enable/Disable RX STBC */
 	uint32_t ht_rx_stbc:2;
 	/* Enable/Disable SGI */
-	uint32_t ht_sgi:1;
+	uint32_t ht_sgi20:1;
+	uint32_t ht_sgi40:1;
 	uint32_t unused:27;
 } qdf_packed tSirHTConfig, *tpSirHTConfig;
 
@@ -5843,4 +5844,26 @@ struct sir_bpf_get_offload {
 	uint32_t remaining_bytes_for_bpf_inst;
 };
 
+/**
+ * enum ht_capability_fields - HT Capabilities bit fields
+ * @HT_CAPS_LDPC: ldpc coding capability bit field
+ * @HT_CAPS_SUPPORTED_CHANNEL_SET: channel width set bit field
+ * @HT_CAPS_SM_PWR_SAVE: SM power save bit field
+ * @HT_CAPS_GREENFIELD: greenfield capability bit field
+ * @HT_CAPS_SHORT_GI20: short GI 20 bit field
+ * @HT_CAPS_SHORT_GI40: short GI 40 bit field
+ * @HT_CAPS_TX_STBC: Tx STBC bit field
+ * @HT_CAPS_RX_STBC: Rx STBC bit fields
+ */
+enum ht_capability_fields {
+	HT_CAPS_LDPC = 0x0001,
+	HT_CAPS_SUPPORTED_CHANNEL_SET = 0x0002,
+	HT_CAPS_SM_PWR_SAVE = 0x000c,
+	HT_CAPS_GREENFIELD = 0x0010,
+	HT_CAPS_SHORT_GI20 = 0x0020,
+	HT_CAPS_SHORT_GI40 = 0x0040,
+	HT_CAPS_TX_STBC = 0x0080,
+	HT_CAPS_RX_STBC = 0x0300
+};
+
 #endif /* __SIR_API_H */

+ 0 - 5
core/mac/inc/wni_cfg.h

@@ -141,7 +141,6 @@ enum {
 	WNI_CFG_DYNAMIC_THRESHOLD_TWO,
 	WNI_CFG_SCAN_CONTROL_LIST,
 	WNI_CFG_BLOCK_ACK_ENABLED,
-	WNI_CFG_HT_RX_STBC,
 	WNI_CFG_HT_CAP_INFO,
 	WNI_CFG_HT_AMPDU_PARAMS,
 	WNI_CFG_SUPPORTED_MCS_SET,
@@ -153,7 +152,6 @@ enum {
 	WNI_CFG_HT_INFO_FIELD3,
 	WNI_CFG_BASIC_MCS_SET,
 	WNI_CFG_CURRENT_MCS_SET,
-	WNI_CFG_GREENFIELD_CAPABILITY,
 	WNI_CFG_VHT_MAX_MPDU_LENGTH,
 	WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
 	WNI_CFG_VHT_LDPC_CODING_CAP,
@@ -183,11 +181,8 @@ enum {
 	WNI_CFG_VHT_40MHZ_UTILIZATION,
 	WNI_CFG_VHT_80MHZ_UTILIZATION,
 	WNI_CFG_VHT_160MHZ_UTILIZATION,
-	WNI_CFG_MAX_AMSDU_LENGTH,
 	WNI_CFG_MPDU_DENSITY,
 	WNI_CFG_MAX_RX_AMPDU_FACTOR,
-	WNI_CFG_SHORT_GI_20MHZ,
-	WNI_CFG_SHORT_GI_40MHZ,
 	WNI_CFG_MAX_PS_POLL,
 	WNI_CFG_RSSI_FILTER_PERIOD,
 	WNI_CFG_SCAN_IN_POWERSAVE,

+ 0 - 30
core/mac/src/cfg/cfg_proc_msg.c

@@ -549,12 +549,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
 	WNI_CFG_BLOCK_ACK_ENABLED_STAMIN,
 	WNI_CFG_BLOCK_ACK_ENABLED_STAMAX,
 	WNI_CFG_BLOCK_ACK_ENABLED_STADEF},
-	{WNI_CFG_HT_RX_STBC,
-	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
-	CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
-	WNI_CFG_HT_RX_STBC_STAMIN,
-	WNI_CFG_HT_RX_STBC_STAMAX,
-	WNI_CFG_HT_RX_STBC_STADEF},
 	{WNI_CFG_HT_CAP_INFO,
 	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
 	CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
@@ -615,12 +609,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
 	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_SAVE |
 	CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
 	0, 0, 0},
-	{WNI_CFG_GREENFIELD_CAPABILITY,
-	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT | CFG_CTL_RESTART |
-	CFG_CTL_NTF_LIM,
-	WNI_CFG_GREENFIELD_CAPABILITY_STAMIN,
-	WNI_CFG_GREENFIELD_CAPABILITY_STAMAX,
-	WNI_CFG_GREENFIELD_CAPABILITY_STADEF},
 	{WNI_CFG_VHT_MAX_MPDU_LENGTH,
 	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
 	CFG_CTL_NTF_LIM,
@@ -795,12 +783,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
 	WNI_CFG_VHT_80MHZ_UTILIZATION_STADEF,
 	WNI_CFG_VHT_160MHZ_UTILIZATION_STAMAX,
 	WNI_CFG_VHT_160MHZ_UTILIZATION_STADEF},
-	{WNI_CFG_MAX_AMSDU_LENGTH,
-	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
-	CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
-	WNI_CFG_MAX_AMSDU_LENGTH_STAMIN,
-	WNI_CFG_MAX_AMSDU_LENGTH_STAMAX,
-	WNI_CFG_MAX_AMSDU_LENGTH_STADEF},
 	{WNI_CFG_MPDU_DENSITY,
 	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
 	CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
@@ -813,18 +795,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
 	WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMIN,
 	WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX,
 	WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX},
-	{WNI_CFG_SHORT_GI_20MHZ,
-	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
-	CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
-	WNI_CFG_SHORT_GI_20MHZ_STAMIN,
-	WNI_CFG_SHORT_GI_20MHZ_STAMAX,
-	WNI_CFG_SHORT_GI_20MHZ_STADEF},
-	{WNI_CFG_SHORT_GI_40MHZ,
-	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
-	CFG_CTL_RESTART | CFG_CTL_NTF_LIM,
-	WNI_CFG_SHORT_GI_40MHZ_STAMIN,
-	WNI_CFG_SHORT_GI_40MHZ_STAMAX,
-	WNI_CFG_SHORT_GI_40MHZ_STADEF},
 	{WNI_CFG_MAX_PS_POLL,
 	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT |
 	CFG_CTL_NTF_LIM,

+ 0 - 33
core/mac/src/pe/lim/lim_api.c

@@ -408,39 +408,6 @@ static tSirRetStatus __lim_init_config(tpAniSirGlobal pMac)
 		pMac->sys.gSysEnableLinkMonitorMode = 1;
 	}
 
-	/* WNI_CFG_SHORT_GI_20MHZ */
-
-	if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) != eSIR_SUCCESS) {
-		PELOGE(lim_log(pMac, LOGE, FL("could not retrieve HT Cap CFG"));)
-		return eSIR_FAILURE;
-	}
-	if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_20MHZ, &val2) != eSIR_SUCCESS) {
-		PELOGE(lim_log
-			       (pMac, LOGE, FL("could not retrieve shortGI 20Mhz CFG"));
-		       )
-		return eSIR_FAILURE;
-	}
-	if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_40MHZ, &val3) != eSIR_SUCCESS) {
-		PELOGE(lim_log
-			       (pMac, LOGE, FL("could not retrieve shortGI 40Mhz CFG"));
-		       )
-		return eSIR_FAILURE;
-	}
-
-	val16 = (uint16_t) val1;
-	pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
-	pHTCapabilityInfo->shortGI20MHz = (uint16_t) val2;
-	pHTCapabilityInfo->shortGI40MHz = (uint16_t) val3;
-
-	if (cfg_set_int
-		    (pMac, WNI_CFG_HT_CAP_INFO,
-		    *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS) {
-		PELOGE(lim_log
-			       (pMac, LOGE, FL("could not update HT Cap Info CFG"));
-		       )
-		return eSIR_FAILURE;
-	}
-
 	/* WNI_CFG_MAX_RX_AMPDU_FACTOR */
 
 	if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) !=

+ 27 - 121
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -2657,8 +2657,6 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta,
 	tSirRetStatus retCode = eSIR_SUCCESS;
 	tSirMacAddr staMac;
 	uint32_t listenInterval = WNI_CFG_LISTEN_INTERVAL_STADEF;
-	uint32_t shortGi20MhzSupport;
-	uint32_t shortGi40MhzSupport;
 	uint32_t ampduLenExponent = 0;
 	/*This self Sta dot 11 mode comes from the cfg and the expectation here is
 	 * that cfg carries the systemwide capability that device under
@@ -2762,51 +2760,10 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta,
 			pAddStaParams->fDsssCckMode40Mhz =
 				lim_get_ht_capability(pMac, eHT_DSSS_CCK_MODE_40MHZ,
 						      psessionEntry);
-			/*
-			 * We will read the gShortGI20Mhz from ini file, and if it is set
-			 * to 1 then we will tell Peer that we support 40Mhz short GI
-			 */
-			if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
-							  (pMac, WNI_CFG_SHORT_GI_20MHZ,
-							  &shortGi20MhzSupport))) {
-				if (true == shortGi20MhzSupport) {
-					pAddStaParams->fShortGI20Mhz =
-						WNI_CFG_SHORT_GI_20MHZ_STAMAX;
-				} else {
-					pAddStaParams->fShortGI20Mhz = false;
-				}
-			} else {
-				PELOGE(lim_log
-					       (pMac, LOGE,
-					       FL("could not retrieve shortGI 20Mhz"
-						  "CFG,setting value to default"));
-				       )
-				pAddStaParams->fShortGI20Mhz =
-					WNI_CFG_SHORT_GI_20MHZ_STADEF;
-			}
-
-			/*
-			 * We will read the gShortGI40Mhz from ini file, and if it is set
-			 * to 1 then we will tell Peer that we support 40Mhz short GI
-			 */
-			if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
-							  (pMac, WNI_CFG_SHORT_GI_40MHZ,
-							  &shortGi40MhzSupport))) {
-				if (true == shortGi40MhzSupport) {
-					pAddStaParams->fShortGI40Mhz =
-						WNI_CFG_SHORT_GI_40MHZ_STAMAX;
-				} else {
-					pAddStaParams->fShortGI40Mhz = false;
-				}
-			} else {
-				PELOGE(lim_log
-					       (pMac, LOGE,
-					       FL("could not retrieve shortGI 40Mhz"
-						  "CFG,setting value to default"));
-				       )
-				pAddStaParams->fShortGI40Mhz =
-					WNI_CFG_SHORT_GI_40MHZ_STADEF;
-			}
+			pAddStaParams->fShortGI20Mhz =
+					psessionEntry->htConfig.ht_sgi20;
+			pAddStaParams->fShortGI40Mhz =
+					psessionEntry->htConfig.ht_sgi40;
 			lim_log(pMac, LOG2,
 				FL(" greenFieldCapable: %d maxAmpduDensity = %d "
 				   "maxAmpduSize = %d"),
@@ -3543,8 +3500,6 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
 	uint32_t retCode;
 	tpDphHashNode pStaDs = NULL;
 	uint8_t chanWidthSupp = 0;
-	uint32_t shortGi20MhzSupport;
-	uint32_t shortGi40MhzSupport;
 	uint32_t enableTxBF20MHz;
 	tDot11fIEVHTCaps *vht_caps = NULL;
 	tDot11fIEVHTOperation *vht_oper = NULL;
@@ -3853,47 +3808,23 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp,
 			(uint8_t) pAssocRsp->HTCaps.dsssCckMode40MHz;
 		/*
 		 * We will check gShortGI20Mhz and gShortGI40Mhz from
-		 * ini file. if they are set then we will use what ever
+		 * session entry  if they are set then we will use what ever
 		 * Assoc response coming from AP supports. If these
-		 * values are set as 0 in ini file then we will
+		 * values are set as 0 in session entry then we will
 		 * hardcode this values to 0.
 		 */
-		if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
-					(pMac, WNI_CFG_SHORT_GI_20MHZ,
-					 &shortGi20MhzSupport))) {
-			if (true == shortGi20MhzSupport) {
-				pAddBssParams->staContext.
-					fShortGI20Mhz =
-					(uint8_t) pAssocRsp->HTCaps.
-					shortGI20MHz;
-			} else {
-				pAddBssParams->staContext.
-					fShortGI20Mhz = false;
-			}
-		} else {
-			lim_log(pMac, LOGE, FL(
-				"failed to get shortGI 20Mhz, set default"));
+		if (psessionEntry->htConfig.ht_sgi20) {
 				pAddBssParams->staContext.fShortGI20Mhz =
-				WNI_CFG_SHORT_GI_20MHZ_STADEF;
-		}
-
-		if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
-					(pMac, WNI_CFG_SHORT_GI_40MHZ,
-					 &shortGi40MhzSupport))) {
-			if (true == shortGi40MhzSupport) {
-				pAddBssParams->staContext.
-					fShortGI40Mhz =
-					(uint8_t) pAssocRsp->HTCaps.
-					shortGI40MHz;
+					(uint8_t)pAssocRsp->HTCaps.shortGI20MHz;
 			} else {
-				pAddBssParams->staContext.
-					fShortGI40Mhz = false;
+				pAddBssParams->staContext.fShortGI20Mhz = false;
 			}
+
+		if (psessionEntry->htConfig.ht_sgi40) {
+			pAddBssParams->staContext.fShortGI40Mhz =
+				(uint8_t) pAssocRsp->HTCaps.shortGI40MHz;
 		} else {
-			lim_log(pMac, LOGE, FL(
-				"failed to get shortGI 40Mhz, set default"));
-				pAddBssParams->staContext.fShortGI40Mhz =
-				WNI_CFG_SHORT_GI_40MHZ_STADEF;
+				pAddBssParams->staContext.fShortGI40Mhz = false;
 		}
 
 		if (!pAddBssParams->staContext.vhtCapable)
@@ -4091,8 +4022,6 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
 	uint32_t retCode;
 	tSchBeaconStruct *pBeaconStruct;
 	uint8_t chanWidthSupp = 0;
-	uint32_t shortGi20MhzSupport;
-	uint32_t shortGi40MhzSupport;
 	tDot11fIEVHTOperation *vht_oper = NULL;
 	tDot11fIEVHTCaps *vht_caps = NULL;
 
@@ -4374,12 +4303,11 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
 					vht_oper->chanWidth)
 				pAddBssParams->staContext.ch_width =
 					vht_oper->chanWidth + 1;
-			lim_log(pMac, LOG2, FL(
-					"StaCtx: vhtCap %d ch_bw %d TxBF %d"),
-					pAddBssParams->staContext.vhtCapable,
-					pAddBssParams->staContext.ch_width,
-					pAddBssParams->staContext.
-					vhtTxBFCapable);
+			lim_log(pMac, LOG2,
+				   FL("StaCtx: vhtCap %d ch_bw %d TxBF %d"),
+				   pAddBssParams->staContext.vhtCapable,
+				   pAddBssParams->staContext.ch_width,
+				   pAddBssParams->staContext.vhtTxBFCapable);
 		} else {
 			pAddBssParams->staContext.ch_width =
 				CH_WIDTH_20MHZ;
@@ -4399,40 +4327,18 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update
 		 * from AP supports. If these values are set as 0 in ini file
 		 * then we will hardcode this values to 0.
 		 */
-		if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
-					(pMac, WNI_CFG_SHORT_GI_20MHZ,
-					 &shortGi20MhzSupport))) {
-			if (true == shortGi20MhzSupport)
-				pAddBssParams->staContext.fShortGI20Mhz =
+		if (true == psessionEntry->htConfig.ht_sgi20)
+			pAddBssParams->staContext.fShortGI20Mhz =
 				(uint8_t)pBeaconStruct->HTCaps.shortGI20MHz;
-			else
+		else
 				pAddBssParams->staContext.fShortGI20Mhz =
 					false;
-		} else {
-			lim_log(pMac, LOGE, FL(
-				"get shortGI 20Mhz failed, set default"));
-				pAddBssParams->staContext.fShortGI20Mhz =
-				WNI_CFG_SHORT_GI_20MHZ_STADEF;
-		}
 
-		if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int
-					(pMac, WNI_CFG_SHORT_GI_40MHZ,
-					 &shortGi40MhzSupport))) {
-			if (true == shortGi40MhzSupport) {
-				pAddBssParams->staContext.
-					fShortGI40Mhz =
-					(uint8_t) pBeaconStruct->HTCaps.
-					shortGI40MHz;
-			} else {
-				pAddBssParams->staContext.
-					fShortGI40Mhz = false;
-			}
-		} else {
-			lim_log(pMac, LOGE, FL(
-				"get shortGI 40Mhz failed, set default"));
-				pAddBssParams->staContext.fShortGI40Mhz =
-				WNI_CFG_SHORT_GI_40MHZ_STADEF;
-		}
+		if (true == psessionEntry->htConfig.ht_sgi40)
+			pAddBssParams->staContext.fShortGI40Mhz =
+				(uint8_t) pBeaconStruct->HTCaps.shortGI40MHz;
+		else
+			pAddBssParams->staContext.fShortGI40Mhz = false;
 
 		pAddBssParams->staContext.maxAmpduSize =
 			pBeaconStruct->HTCaps.maxRxAMPDUFactor;

+ 2 - 16
core/mac/src/pe/lim/lim_process_assoc_req_frame.c

@@ -1211,7 +1211,6 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
 			      bool *assoc_req_copied, uint16_t peer_idx,
 			      tHalBitVal qos_mode, bool pmf_connection)
 {
-	uint32_t cfg_short_gi_20, cfg_short_gi_40;
 	tHalBitVal wme_mode, wsm_mode;
 	uint8_t *ht_cap_ie = NULL;
 #ifdef WLAN_FEATURE_11W
@@ -1296,14 +1295,7 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
 		/* assoc_req will be copied to session->parsedAssocReq later */
 		ht_cap_ie = ((uint8_t *) &assoc_req->HTCaps) + 1;
 
-		/* check whether AP is enabled with shortGI */
-		if (wlan_cfg_get_int(mac_ctx, WNI_CFG_SHORT_GI_20MHZ,
-				&cfg_short_gi_20) != eSIR_SUCCESS) {
-			PELOGE(lim_log(mac_ctx, LOGE,
-				FL("could not retrieve shortGI 20Mhz CFG"));)
-			return false;
-		}
-		if (cfg_short_gi_20) {
+		if (session->htConfig.ht_sgi20) {
 			sta_ds->htShortGI20Mhz =
 				(uint8_t)assoc_req->HTCaps.shortGI20MHz;
 		} else {
@@ -1312,13 +1304,7 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr,
 			sta_ds->htShortGI20Mhz = 0;
 		}
 
-		if (wlan_cfg_get_int(mac_ctx, WNI_CFG_SHORT_GI_40MHZ,
-				&cfg_short_gi_40) != eSIR_SUCCESS) {
-			PELOGE(lim_log(mac_ctx, LOGE,
-				FL("could not retrieve shortGI 40Mhz CFG"));)
-			return false;
-		}
-		if (cfg_short_gi_40) {
+		if (session->htConfig.ht_sgi40) {
 			sta_ds->htShortGI40Mhz =
 				(uint8_t)assoc_req->HTCaps.shortGI40MHz;
 		} else {

+ 8 - 28
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -75,8 +75,6 @@ static void lim_update_stads_htcap(tpAniSirGlobal mac_ctx,
 {
 	uint16_t highest_rxrate = 0;
 	tDot11fIEHTCaps *ht_caps;
-	uint32_t shortgi_20mhz_support;
-	uint32_t shortgi_40mhz_support;
 
 	ht_caps = &assoc_rsp->HTCaps;
 	sta_ds->mlmStaContext.htCapability = assoc_rsp->HTCaps.present;
@@ -123,35 +121,17 @@ static void lim_update_stads_htcap(tpAniSirGlobal mac_ctx,
 		/* Check if we have support for gShortGI20Mhz and
 		 * gShortGI40Mhz from ini file
 		 */
-		if (eSIR_SUCCESS == wlan_cfg_get_int(mac_ctx,
-						WNI_CFG_SHORT_GI_20MHZ,
-						&shortgi_20mhz_support)) {
-			if (true == shortgi_20mhz_support)
-				sta_ds->htShortGI20Mhz =
-				      (uint8_t)assoc_rsp->HTCaps.shortGI20MHz;
-			else
-				sta_ds->htShortGI20Mhz = false;
-		} else {
-			lim_log(mac_ctx, LOGE,
-				FL("could not retrieve shortGI 20Mhz CFG, setting value to default"));
+		if (session_entry->htConfig.ht_sgi20)
 			sta_ds->htShortGI20Mhz =
-				WNI_CFG_SHORT_GI_20MHZ_STADEF;
-		}
+			      (uint8_t)assoc_rsp->HTCaps.shortGI20MHz;
+		else
+			sta_ds->htShortGI20Mhz = false;
 
-		if (eSIR_SUCCESS == wlan_cfg_get_int(mac_ctx,
-						WNI_CFG_SHORT_GI_40MHZ,
-						&shortgi_40mhz_support)) {
-			if (true == shortgi_40mhz_support)
-				sta_ds->htShortGI40Mhz =
-				      (uint8_t)assoc_rsp->HTCaps.shortGI40MHz;
-			else
-				sta_ds->htShortGI40Mhz = false;
-		} else {
-			lim_log(mac_ctx, LOGE,
-				FL("could not retrieve shortGI 40Mhz CFG,setting value to default"));
+		if (session_entry->htConfig.ht_sgi40)
 			sta_ds->htShortGI40Mhz =
-				WNI_CFG_SHORT_GI_40MHZ_STADEF;
-		}
+				      (uint8_t)assoc_rsp->HTCaps.shortGI40MHz;
+		else
+			sta_ds->htShortGI40Mhz = false;
 	}
 }
 

+ 0 - 143
core/mac/src/pe/lim/lim_process_cfg_updates.c

@@ -206,7 +206,6 @@ void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId)
 {
 	uint32_t val1, val2;
 	uint16_t val16;
-	tSirMacHTCapabilityInfo *pHTCapabilityInfo;
 	tSirMacHTParametersInfo *pAmpduParamInfo;
 
 	PELOG3(lim_log
@@ -262,149 +261,7 @@ void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId)
 			       )
 			break;
 	}
-	case WNI_CFG_GREENFIELD_CAPABILITY:
-		if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve HT Cap Info CFG"));
-			       )
-			break;
-		}
-		if (wlan_cfg_get_int(pMac, WNI_CFG_GREENFIELD_CAPABILITY, &val2)
-		    != eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve GreenField CFG"));
-			       )
-			break;
-		}
-		val16 = (uint16_t) val1;
-		pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
-		pHTCapabilityInfo->greenField = (uint16_t) val2;
-		if (cfg_set_int
-			    (pMac, WNI_CFG_HT_CAP_INFO,
-			    *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not update HT Cap Info CFG"));
-			       )
-			break;
-
-	case WNI_CFG_HT_RX_STBC:
-		if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve WNI_CFG_HT_CAP_INFO "));
-			       )
-			break;
-		}
-		if (wlan_cfg_get_int(pMac, WNI_CFG_HT_RX_STBC, &val2) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve WNI_CFG_HT_RX_STBC"));
-			       )
-			break;
-		}
-		val16 = (uint16_t) val1;
-		pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
-		pHTCapabilityInfo->rxSTBC = (uint16_t) val2;
-		if (cfg_set_int
-			    (pMac, WNI_CFG_HT_CAP_INFO,
-			    *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not update HT Cap Info CFG"));
-			       )
-			break;
-
-	case WNI_CFG_MAX_AMSDU_LENGTH:
-		if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve HT Cap Info CFG"));
-			       )
-			break;
-		}
-		if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_AMSDU_LENGTH, &val2) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve Max AMSDU Length CFG"));
-			       )
-			break;
-		}
-		val16 = (uint16_t) val1;
-		pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
-		pHTCapabilityInfo->maximalAMSDUsize = (uint16_t) val2;
-		if (cfg_set_int
-			    (pMac, WNI_CFG_HT_CAP_INFO,
-			    *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not update HT Cap Info CFG"));
-			       )
-			break;
 
-	case WNI_CFG_SHORT_GI_20MHZ:
-		if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve HT Cap CFG"));
-			       )
-			break;
-		}
-		if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_20MHZ, &val2) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve shortGI 20Mhz CFG"));
-			       )
-			break;
-		}
-		val16 = (uint16_t) val1;
-		pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
-		pHTCapabilityInfo->shortGI20MHz = (uint16_t) val2;
-		if (cfg_set_int
-			    (pMac, WNI_CFG_HT_CAP_INFO,
-			    *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not update HT Cap Info CFG"));
-			       )
-			break;
-	case WNI_CFG_SHORT_GI_40MHZ:
-		if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &val1) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve HT Cap CFG"));
-			       )
-			break;
-		}
-		if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_GI_40MHZ, &val2) !=
-		    eSIR_SUCCESS) {
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not retrieve shortGI 40Mhz CFG"));
-			       )
-			break;
-		}
-		val16 = (uint16_t) val1;
-		pHTCapabilityInfo = (tSirMacHTCapabilityInfo *) &val16;
-		pHTCapabilityInfo->shortGI40MHz = (uint16_t) val2;
-		if (cfg_set_int
-			    (pMac, WNI_CFG_HT_CAP_INFO,
-			    *(uint16_t *) pHTCapabilityInfo) != eSIR_SUCCESS)
-			PELOGE(lim_log
-				       (pMac, LOGE,
-				       FL("could not update HT Cap Info CFG"));
-			       )
-			break;
 	case WNI_CFG_MPDU_DENSITY:
 		if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) !=
 		    eSIR_SUCCESS) {

+ 4 - 6
core/mac/src/pe/lim/lim_utils.c

@@ -2947,15 +2947,13 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac,
 		break;
 
 	case eHT_SHORT_GI_40MHZ:
-		retVal = (uint8_t)
-			 (psessionEntry->htConfig.ht_sgi) ? macHTCapabilityInfo.
-			 shortGI40MHz : 0;
+		retVal = (uint8_t) (psessionEntry->htConfig.ht_sgi40) ?
+			 macHTCapabilityInfo.shortGI40MHz : 0;
 		break;
 
 	case eHT_SHORT_GI_20MHZ:
-		retVal = (uint8_t)
-			 (psessionEntry->htConfig.ht_sgi) ? macHTCapabilityInfo.
-			 shortGI20MHz : 0;
+		retVal = (uint8_t) (psessionEntry->htConfig.ht_sgi20) ?
+			 macHTCapabilityInfo.shortGI20MHz : 0;
 		break;
 
 	case eHT_GREENFIELD:

+ 4 - 8
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -733,12 +733,8 @@ populate_dot11f_ht_caps(tpAniSirGlobal pMac,
 			psessionEntry->htSupportedChannelWidthSet;
 		pDot11f->txSTBC = psessionEntry->htConfig.ht_tx_stbc;
 		pDot11f->rxSTBC = psessionEntry->htConfig.ht_rx_stbc;
-		if (psessionEntry->htConfig.ht_sgi) {
-			pDot11f->shortGI20MHz =
-				uHTCapabilityInfo.htCapInfo.shortGI20MHz;
-			pDot11f->shortGI40MHz =
-				uHTCapabilityInfo.htCapInfo.shortGI40MHz;
-		}
+		pDot11f->shortGI20MHz = psessionEntry->htConfig.ht_sgi20;
+		pDot11f->shortGI40MHz = psessionEntry->htConfig.ht_sgi40;
 	}
 
 	/* Ensure that shortGI40MHz is Disabled if supportedChannelWidthSet is
@@ -972,7 +968,7 @@ populate_dot11f_vht_caps(tpAniSirGlobal pMac,
 			 pDot11f->shortGI80MHz = 0;
 		} else {
 			nCfgValue = 0;
-			if (psessionEntry->htConfig.ht_sgi)
+			if (psessionEntry->htConfig.ht_sgi20)
 				CFG_GET_INT(nStatus, pMac,
 					    WNI_CFG_VHT_SHORT_GI_80MHZ,
 					    nCfgValue);
@@ -983,7 +979,7 @@ populate_dot11f_vht_caps(tpAniSirGlobal pMac,
 			pDot11f->shortGI160and80plus80MHz = 0;
 		} else {
 			nCfgValue = 0;
-			if (psessionEntry->htConfig.ht_sgi)
+			if (psessionEntry->htConfig.ht_sgi20)
 				CFG_GET_INT(nStatus, pMac,
 				WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ,
 				nCfgValue);

+ 5 - 2
core/sme/src/common/sme_api.c

@@ -11697,8 +11697,9 @@ int16_t sme_get_ht_config(tHalHandle hHal, uint8_t session_id, uint16_t ht_capab
 	case WNI_CFG_HT_CAP_INFO_RX_STBC:
 		return pSession->htConfig.ht_rx_stbc;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ:
+		return pSession->htConfig.ht_sgi20;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ:
-		return pSession->htConfig.ht_sgi;
+		return pSession->htConfig.ht_sgi40;
 	default:
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  "invalid ht capability");
@@ -11735,8 +11736,10 @@ int sme_update_ht_config(tHalHandle hHal, uint8_t sessionId, uint16_t htCapab,
 		pSession->htConfig.ht_rx_stbc = value;
 		break;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ:
+		pSession->htConfig.ht_sgi20 = value;
+		break;
 	case WNI_CFG_HT_CAP_INFO_SHORT_GI_40MHZ:
-		pSession->htConfig.ht_sgi = value;
+		pSession->htConfig.ht_sgi40 = value;
 		break;
 	}
 

+ 4 - 1
core/sme/src/csr/csr_api_roam.c

@@ -15081,7 +15081,10 @@ QDF_STATUS csr_roam_open_session(tpAniSirGlobal pMac,
 				uHTCapabilityInfo.htCapInfo.txSTBC;
 			pSession->htConfig.ht_rx_stbc =
 				uHTCapabilityInfo.htCapInfo.rxSTBC;
-			pSession->htConfig.ht_sgi = true;
+			pSession->htConfig.ht_sgi20 =
+				uHTCapabilityInfo.htCapInfo.shortGI20MHz;
+			pSession->htConfig.ht_sgi40 =
+				uHTCapabilityInfo.htCapInfo.shortGI40MHz;
 			status =
 				csr_issue_add_sta_for_session_req(pMac, i, pSelfMacAddr,
 								  type, subType);