qcacld-3.0: Update OFDM rates only if oper freq is 5GHz

In PE session, host updates supported rates from beacon IE stored
in BSS descriptor. If OFDM rates are present in beacon while
operating frequency is not from 5GHz band, host copies them into
PE session's supported rated.
Hence add a check to avoid adding OFDM rates while operating
frequency is not 5GHz.

Change-Id: Ia3b39b31269b79e6d1f96d3a0bddb185597c0303
CRs-Fixed: 2948058
This commit is contained in:
Abhishek Ambure 2021-05-20 10:45:19 +05:30 • committed by Madan Koyyalamudi
commit f56674e2b9

View file

@ -4448,6 +4448,27 @@ static QDF_STATUS csr_set_qos_to_cfg(struct mac_context *mac, uint32_t sessionId
return status;
}
static bool is_ofdm_rates(uint16_t rate)
{
uint16_t n = BITS_OFF(rate, CSR_DOT11_BASIC_RATE_MASK);
switch (n) {
case SIR_MAC_RATE_6:
case SIR_MAC_RATE_9:
case SIR_MAC_RATE_12:
case SIR_MAC_RATE_18:
case SIR_MAC_RATE_24:
case SIR_MAC_RATE_36:
case SIR_MAC_RATE_48:
case SIR_MAC_RATE_54:
return true;
default:
break;
}
return false;
}
static QDF_STATUS csr_get_rate_set(struct mac_context *mac,
struct csr_roam_profile *pProfile,
eCsrPhyMode phyMode,
@ -4461,6 +4482,7 @@ static QDF_STATUS csr_get_rate_set(struct mac_context *mac,
enum csr_cfgdot11mode cfgDot11Mode;
uint8_t *pDstRate;
uint16_t rateBitmap = 0;
bool is_5ghz_freq;
qdf_mem_zero(pOpRateSet, sizeof(tSirMacRateSet));
qdf_mem_zero(pExRateSet, sizeof(tSirMacRateSet));
@ -4473,6 +4495,7 @@ static QDF_STATUS csr_get_rate_set(struct mac_context *mac,
csr_is_phy_mode_match(mac, phyMode, bss_desc, pProfile,
&cfgDot11Mode, pIes);
is_5ghz_freq = wlan_reg_is_5ghz_ch_freq(bss_desc->chan_freq);
/*
* Originally, we thought that for 11a networks, the 11a rates
* are always in the Operational Rate set & for 11b and 11g
@ -4488,6 +4511,10 @@ static QDF_STATUS csr_get_rate_set(struct mac_context *mac,
pDstRate = pOpRateSet->rate;
if (pIes->SuppRates.present) {
for (i = 0; i < pIes->SuppRates.num_rates; i++) {
if (is_5ghz_freq &&
!is_ofdm_rates(pIes->SuppRates.rates[i]))
continue;
if (csr_rates_is_dot11_rate_supported(mac,
pIes->SuppRates.rates[i]) &&
!csr_check_rate_bitmap(