Browse Source

qcacld-3.0: Update basic rates if rates not present in probe resp/bcn

Some IOT APs set supported rates to zero in probe response. Host uses
probe response/beacon to update scan cache. Host uses supported rates
from scan cache to update in assoc request.

As the supported rates in probe response are zeros, host doesn't
add supported rate IE in assoc request which leads to association
failure. Hence add BSS basic rates in assoc request if supported
rates in scan cache is not present.

Change-Id: I1eb56f437c39494f386e7c97aac4b4bc56b156c8
CRs-Fixed: 2813072
Abhishek Ambure 4 years ago
parent
commit
dd1ef0c18b
1 changed files with 21 additions and 19 deletions
  1. 21 19
      core/sme/src/csr/csr_api_roam.c

+ 21 - 19
core/sme/src/csr/csr_api_roam.c

@@ -14905,6 +14905,19 @@ csr_update_sae_single_pmk_ap_cap(struct mac_context *mac,
 }
 #endif
 
+static void csr_get_basic_rates(tSirMacRateSet *b_rates, uint32_t chan_freq)
+{
+	/*
+	 * Some IOT APs don't send supported rates in
+	 * probe resp, hence add BSS basic rates in
+	 * supported rates IE of assoc request.
+	 */
+	if (WLAN_REG_IS_24GHZ_CH_FREQ(chan_freq))
+		csr_populate_basic_rates(b_rates, false, true);
+	else if (WLAN_REG_IS_5GHZ_CH_FREQ(chan_freq))
+		csr_populate_basic_rates(b_rates, true, true);
+}
+
 /**
  * The communication between HDD and LIM is thru mailbox (MB).
  * Both sides will access the data structure "struct join_req".
@@ -15248,17 +15261,11 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 				qdf_mem_copy(&csr_join_req->operationalRateSet.
 						rate, OpRateSet.rate,
 						OpRateSet.numRates);
-			} else if (pProfile->phyMode == eCSR_DOT11_MODE_AUTO &&
-				   WLAN_REG_IS_24GHZ_CH_FREQ(
-						pBssDescription->chan_freq)) {
-				/*
-				 * Some IOT APs don't send supported rates in
-				 * probe resp, hence add BSS basic rates in
-				 * supported rates IE of assoc request.
-				 */
-				tSirMacRateSet b_rates;
+			} else if (pProfile->phyMode == eCSR_DOT11_MODE_AUTO) {
+				tSirMacRateSet b_rates = {0};
 
-				csr_populate_basic_rates(&b_rates, false, true);
+				csr_get_basic_rates(&b_rates,
+						    pBssDescription->chan_freq);
 				csr_join_req->operationalRateSet = b_rates;
 			}
 			/* ExtendedRateSet */
@@ -15271,16 +15278,11 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 			} else {
 				csr_join_req->extendedRateSet.numRates = 0;
 			}
-		} else if (pProfile->phyMode == eCSR_DOT11_MODE_AUTO &&
-			   WLAN_REG_IS_24GHZ_CH_FREQ(
-					pBssDescription->chan_freq)) {
-			/*
-			 * To connect IOT AP, add basic rates in supported
-			 * rates IE of assoc req.
-			 */
-			tSirMacRateSet b_rates;
+		} else if (pProfile->phyMode == eCSR_DOT11_MODE_AUTO) {
+			tSirMacRateSet b_rates = {0};
 
-			csr_populate_basic_rates(&b_rates, false, true);
+			csr_get_basic_rates(&b_rates,
+					    pBssDescription->chan_freq);
 			csr_join_req->operationalRateSet = b_rates;
 		} else {
 			csr_join_req->operationalRateSet.numRates = 0;