Ver Fonte

qcacld-3.0: Ignore rates from hostapd when doing SAP channel switch

When softap mode comes up, hostapd provides OFDM/CCK supported rates
based on hardware mode and channel. If same softap changes channel
from 2G to 5G or 5G to 2G then provided hostapd rates become invalid.

To avoid above condition, use basic rates generated within driver while
doing softap channel switch operation.

Ignore hostapd rates when pre-cac adapter is generated to handle radar
detection as pre-cap adapter is temporary & its not actual adapter.

CRs-Fixed: 1103673
Change-Id: Iec4b79ad848dec560b8a44cbaaa320416be62cb1
Krunal Soni há 8 anos atrás
pai
commit
8f8507cc5b
2 ficheiros alterados com 16 adições e 6 exclusões
  1. 2 1
      core/hdd/src/wlan_hdd_hostapd.c
  2. 14 5
      core/sme/src/csr/csr_api_roam.c

+ 2 - 1
core/hdd/src/wlan_hdd_hostapd.c

@@ -7468,7 +7468,8 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
 			acl_entry++;
 		}
 	}
-	if (!pHddCtx->config->force_sap_acs) {
+	if (!pHddCtx->config->force_sap_acs &&
+	    (0 != qdf_mem_cmp(ssid, PRE_CAC_SSID, ssid_len))) {
 		pIe = wlan_hdd_cfg80211_get_ie_ptr(
 				&pMgmt_frame->u.beacon.variable[0],
 				pBeacon->head_len, WLAN_EID_SUPP_RATES);

+ 14 - 5
core/sme/src/csr/csr_api_roam.c

@@ -12718,6 +12718,7 @@ static void csr_populate_supported_rates_from_hostapd(tSirMacRateSet *opr_rates,
  * @pMac:          mac global context
  * @pProfile:      roam profile
  * @pParam:        out param, start bss params
+ * @skip_hostapd_rate: to skip given hostapd's rate
  *
  * This function populates start bss param from roam profile
  *
@@ -12726,7 +12727,8 @@ static void csr_populate_supported_rates_from_hostapd(tSirMacRateSet *opr_rates,
 static void
 csr_roam_get_bss_start_parms(tpAniSirGlobal pMac,
 			     tCsrRoamProfile *pProfile,
-			     tCsrRoamStartBssParams *pParam)
+			     tCsrRoamStartBssParams *pParam,
+			     bool skip_hostapd_rate)
 {
 	eCsrBand band;
 	uint8_t opr_ch = 0;
@@ -12761,8 +12763,8 @@ csr_roam_get_bss_start_parms(tpAniSirGlobal pMac,
 	 * ignore basic and extended rates from hostapd.conf and should
 	 * populate default rates.
 	 */
-	if (pProfile->supported_rates.numRates ||
-			pProfile->extended_rates.numRates) {
+	if (!skip_hostapd_rate && (pProfile->supported_rates.numRates ||
+				   pProfile->extended_rates.numRates)) {
 		csr_populate_supported_rates_from_hostapd(opr_rates,
 				ext_rates, pProfile);
 		pParam->operationChn = tmp_opr_ch;
@@ -13038,7 +13040,8 @@ void csr_roam_prepare_bss_params(tpAniSirGlobal pMac, uint32_t sessionId,
 				&pSession->selfMacAddr);
 		}
 	} else {
-		csr_roam_get_bss_start_parms(pMac, pProfile, &pSession->bssParams);
+		csr_roam_get_bss_start_parms(pMac, pProfile,
+					     &pSession->bssParams, false);
 		/* Use the first SSID */
 		if (pProfile->SSIDs.numOfSSIDs)
 			qdf_mem_copy(&pSession->bssParams.ssId,
@@ -18541,7 +18544,13 @@ QDF_STATUS csr_roam_channel_change_req(tpAniSirGlobal pMac,
 	tSirChanChangeRequest *pMsg;
 	tCsrRoamStartBssParams param;
 
-	csr_roam_get_bss_start_parms(pMac, profile, &param);
+	/*
+	 * while changing the channel, use basic rates given by driver
+	 * and not by hostapd as there is a chance that hostapd might
+	 * give us rates based on original channel which may not be
+	 * suitable for new channel
+	 */
+	csr_roam_get_bss_start_parms(pMac, profile, &param, true);
 	pMsg = qdf_mem_malloc(sizeof(tSirChanChangeRequest));
 	if (!pMsg) {
 		return QDF_STATUS_E_NOMEM;