|
@@ -7949,6 +7949,8 @@ QDF_STATUS csr_roam_copy_profile(tpAniSirGlobal pMac,
|
|
|
}
|
|
|
pDstProfile->cac_duration_ms = pSrcProfile->cac_duration_ms;
|
|
|
pDstProfile->dfs_regdomain = pSrcProfile->dfs_regdomain;
|
|
|
+ pDstProfile->chan_switch_hostapd_rate_enabled =
|
|
|
+ pSrcProfile->chan_switch_hostapd_rate_enabled;
|
|
|
end:
|
|
|
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
csr_release_profile(pMac, pDstProfile);
|
|
@@ -13395,112 +13397,50 @@ csr_convert_mode_to_nw_type(enum csr_cfgdot11mode dot11_mode, eCsrBand band)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * csr_merge_supported_and_extended_rates() - merge supported rates and
|
|
|
- * extended rates
|
|
|
- * @rates: merged rates
|
|
|
- * @supported_rates: supported rates
|
|
|
- * @extended_rates: extended rates
|
|
|
+ * csr_populate_supported_rates_from_hostapd() - populates operational
|
|
|
+ * and extended rates.
|
|
|
+ * from hostapd.conf file
|
|
|
+ * @opr_rates: rate struct to populate operational rates
|
|
|
+ * @ext_rates: rate struct to populate extended rates
|
|
|
+ * @profile: bss profile
|
|
|
*
|
|
|
- * Return: None
|
|
|
+ * Return: void
|
|
|
*/
|
|
|
-static void csr_merge_supported_and_extended_rates(
|
|
|
- struct merged_mac_rate_set *rates,
|
|
|
- tSirMacRateSet *supported_rates,
|
|
|
- tSirMacRateSet *extended_rates)
|
|
|
+static void csr_populate_supported_rates_from_hostapd(tSirMacRateSet *opr_rates,
|
|
|
+ tSirMacRateSet *ext_rates,
|
|
|
+ tCsrRoamProfile *profile)
|
|
|
{
|
|
|
- int i;
|
|
|
+ int i = 0;
|
|
|
|
|
|
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
FL("supported_rates: %d extended_rates: %d"),
|
|
|
- supported_rates->numRates, extended_rates->numRates);
|
|
|
-
|
|
|
- if (supported_rates->numRates > SIR_MAC_RATESET_EID_MAX)
|
|
|
- supported_rates->numRates = SIR_MAC_RATESET_EID_MAX;
|
|
|
-
|
|
|
- if (extended_rates->numRates > SIR_MAC_RATESET_EID_MAX)
|
|
|
- extended_rates->numRates = SIR_MAC_RATESET_EID_MAX;
|
|
|
-
|
|
|
- qdf_mem_copy(rates->rate,
|
|
|
- supported_rates->rate,
|
|
|
- supported_rates->numRates);
|
|
|
- rates->num_rates = supported_rates->numRates;
|
|
|
-
|
|
|
- qdf_mem_copy(rates->rate + rates->num_rates,
|
|
|
- extended_rates->rate,
|
|
|
- extended_rates->numRates);
|
|
|
- rates->num_rates += extended_rates->numRates;
|
|
|
-
|
|
|
- for (i = 0; i < rates->num_rates; i++)
|
|
|
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
- FL("Merge rate is %2x"), rates->rate[i]);
|
|
|
-}
|
|
|
+ profile->supported_rates.numRates,
|
|
|
+ profile->extended_rates.numRates);
|
|
|
|
|
|
-/**
|
|
|
- * csr_populate_intersection_driver_and_hostpd_rates() - populate
|
|
|
- * intersection of driver rates and hostapd rates
|
|
|
- * @pParam: csr roam start bss params
|
|
|
- * @driver_rates: rates generated by driver
|
|
|
- * @hostapd_rates: rates generated by hostapd
|
|
|
- *
|
|
|
- * Return: None
|
|
|
- */
|
|
|
-static void csr_populate_intersection_driver_and_hostpd_rates(
|
|
|
- struct csr_roamstart_bssparams *param,
|
|
|
- struct merged_mac_rate_set *driver_rates,
|
|
|
- struct merged_mac_rate_set *hostapd_rates)
|
|
|
-{
|
|
|
- int i, j;
|
|
|
- struct merged_mac_rate_set rates;
|
|
|
- uint8_t driver_rate, hostapd_rate;
|
|
|
- tSirMacRateSet *opr_rates = ¶m->operationalRateSet;
|
|
|
- tSirMacRateSet *ext_rates = ¶m->extendedRateSet;
|
|
|
-
|
|
|
- rates.num_rates = 0;
|
|
|
-
|
|
|
- for (i = 0; i < driver_rates->num_rates; i++) {
|
|
|
- driver_rate = driver_rates->rate[i];
|
|
|
- if (CSR_IS_BASIC_RATE(driver_rate))
|
|
|
- BITS_OFF(driver_rate,
|
|
|
- CSR_DOT11_BASIC_RATE_MASK);
|
|
|
-
|
|
|
- for (j = 0; j < hostapd_rates->num_rates; j++) {
|
|
|
- hostapd_rate = hostapd_rates->rate[j];
|
|
|
- if (CSR_IS_BASIC_RATE(hostapd_rate))
|
|
|
- BITS_OFF(hostapd_rate,
|
|
|
- CSR_DOT11_BASIC_RATE_MASK);
|
|
|
-
|
|
|
- if (driver_rate == hostapd_rate) {
|
|
|
- if (CSR_IS_BASIC_RATE(driver_rates->rate[i]) ||
|
|
|
- CSR_IS_BASIC_RATE(hostapd_rates->rate[j]))
|
|
|
- BITS_ON(driver_rate,
|
|
|
- CSR_DOT11_BASIC_RATE_MASK);
|
|
|
-
|
|
|
- rates.rate[rates.num_rates++] = driver_rate;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (profile->supported_rates.numRates > SIR_MAC_RATESET_EID_MAX)
|
|
|
+ profile->supported_rates.numRates = SIR_MAC_RATESET_EID_MAX;
|
|
|
|
|
|
- for (i = 0; i < rates.num_rates; i++)
|
|
|
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
- FL("Intersection rate is %2x"), rates.rate[i]);
|
|
|
+ if (profile->extended_rates.numRates > SIR_MAC_RATESET_EID_MAX)
|
|
|
+ profile->extended_rates.numRates = SIR_MAC_RATESET_EID_MAX;
|
|
|
|
|
|
- opr_rates->numRates = 0;
|
|
|
- ext_rates->numRates = 0;
|
|
|
- if (rates.num_rates <= MAX_NUM_SUPPORTED_RATES) {
|
|
|
- opr_rates->numRates = rates.num_rates;
|
|
|
- qdf_mem_copy(opr_rates->rate,
|
|
|
- rates.rate,
|
|
|
- opr_rates->numRates);
|
|
|
- } else {
|
|
|
- opr_rates->numRates = MAX_NUM_SUPPORTED_RATES;
|
|
|
+ if (profile->supported_rates.numRates) {
|
|
|
+ opr_rates->numRates = profile->supported_rates.numRates;
|
|
|
qdf_mem_copy(opr_rates->rate,
|
|
|
- rates.rate,
|
|
|
- MAX_NUM_SUPPORTED_RATES);
|
|
|
- ext_rates->numRates = rates.num_rates - MAX_NUM_SUPPORTED_RATES;
|
|
|
+ profile->supported_rates.rate,
|
|
|
+ profile->supported_rates.numRates);
|
|
|
+ for (i = 0; i < opr_rates->numRates; i++)
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
+ FL("Supported Rate is %2x"), opr_rates->rate[i]);
|
|
|
+ }
|
|
|
+ if (profile->extended_rates.numRates) {
|
|
|
+ ext_rates->numRates =
|
|
|
+ profile->extended_rates.numRates;
|
|
|
qdf_mem_copy(ext_rates->rate,
|
|
|
- rates.rate + MAX_NUM_SUPPORTED_RATES,
|
|
|
- ext_rates->numRates);
|
|
|
+ profile->extended_rates.rate,
|
|
|
+ profile->extended_rates.numRates);
|
|
|
+ for (i = 0; i < ext_rates->numRates; i++)
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
+ FL("Extended Rate is %2x"), ext_rates->rate[i]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -13547,8 +13487,20 @@ csr_roam_get_bss_start_parms(tpAniSirGlobal pMac,
|
|
|
|
|
|
nw_type = csr_convert_mode_to_nw_type(pParam->uCfgDot11Mode, band);
|
|
|
ext_rates->numRates = 0;
|
|
|
-
|
|
|
- switch (nw_type) {
|
|
|
+ /*
|
|
|
+ * hostapd.conf will populate its basic and extended rates
|
|
|
+ * as per hw_mode, but if acs in ini is enabled driver should
|
|
|
+ * ignore basic and extended rates from hostapd.conf and should
|
|
|
+ * populate default rates.
|
|
|
+ */
|
|
|
+ if (!cds_is_sub_20_mhz_enabled() && !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;
|
|
|
+ } else {
|
|
|
+ switch (nw_type) {
|
|
|
default:
|
|
|
sme_err(
|
|
|
"sees an unknown pSirNwType (%d)",
|
|
@@ -13561,9 +13513,9 @@ csr_roam_get_bss_start_parms(tpAniSirGlobal pMac,
|
|
|
}
|
|
|
opr_ch = csr_roam_get_ibss_start_channel_number50(pMac);
|
|
|
if (0 == opr_ch &&
|
|
|
- CSR_IS_PHY_MODE_DUAL_BAND(pProfile->phyMode) &&
|
|
|
- CSR_IS_PHY_MODE_DUAL_BAND(
|
|
|
- pMac->roam.configParam.phyMode)) {
|
|
|
+ CSR_IS_PHY_MODE_DUAL_BAND(pProfile->phyMode) &&
|
|
|
+ CSR_IS_PHY_MODE_DUAL_BAND(
|
|
|
+ pMac->roam.configParam.phyMode)) {
|
|
|
/*
|
|
|
* We could not find a 5G channel by auto pick,
|
|
|
* let's try 2.4G channels. We only do this here
|
|
@@ -13574,7 +13526,7 @@ csr_roam_get_bss_start_parms(tpAniSirGlobal pMac,
|
|
|
opr_ch =
|
|
|
csr_roam_get_ibss_start_channel_number24(pMac);
|
|
|
csr_populate_basic_rates(opr_rates, false,
|
|
|
- true);
|
|
|
+ true);
|
|
|
}
|
|
|
break;
|
|
|
case eSIR_11B_NW_TYPE:
|
|
@@ -13588,15 +13540,15 @@ csr_roam_get_bss_start_parms(tpAniSirGlobal pMac,
|
|
|
case eSIR_11G_NW_TYPE:
|
|
|
/* For P2P Client and P2P GO, disable 11b rates */
|
|
|
if ((pProfile->csrPersona == QDF_P2P_CLIENT_MODE) ||
|
|
|
- (pProfile->csrPersona == QDF_P2P_GO_MODE) ||
|
|
|
- (eCSR_CFG_DOT11_MODE_11G_ONLY ==
|
|
|
- pParam->uCfgDot11Mode)) {
|
|
|
+ (pProfile->csrPersona == QDF_P2P_GO_MODE) ||
|
|
|
+ (eCSR_CFG_DOT11_MODE_11G_ONLY ==
|
|
|
+ pParam->uCfgDot11Mode)) {
|
|
|
csr_populate_basic_rates(opr_rates, true, true);
|
|
|
} else {
|
|
|
csr_populate_basic_rates(opr_rates, false,
|
|
|
- true);
|
|
|
+ true);
|
|
|
csr_populate_basic_rates(ext_rates, true,
|
|
|
- false);
|
|
|
+ false);
|
|
|
}
|
|
|
if (eCSR_OPERATING_CHANNEL_ANY == tmp_opr_ch)
|
|
|
opr_ch =
|
|
@@ -13605,35 +13557,7 @@ csr_roam_get_bss_start_parms(tpAniSirGlobal pMac,
|
|
|
opr_ch = tmp_opr_ch;
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
- pParam->operationChn = opr_ch;
|
|
|
-
|
|
|
- if (pProfile->supported_rates.numRates ||
|
|
|
- pProfile->extended_rates.numRates) {
|
|
|
- struct merged_mac_rate_set rates_driver, rates_hostapd;
|
|
|
-
|
|
|
- qdf_mem_zero(&rates_driver,
|
|
|
- sizeof(struct merged_mac_rate_set));
|
|
|
- qdf_mem_zero(&rates_hostapd,
|
|
|
- sizeof(struct merged_mac_rate_set));
|
|
|
-
|
|
|
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
- "Merge rates driver");
|
|
|
- csr_merge_supported_and_extended_rates(&rates_driver,
|
|
|
- opr_rates,
|
|
|
- ext_rates);
|
|
|
-
|
|
|
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
- "Merge rates hostapd");
|
|
|
- csr_merge_supported_and_extended_rates(&rates_hostapd,
|
|
|
- &pProfile->supported_rates,
|
|
|
- &pProfile->extended_rates);
|
|
|
-
|
|
|
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
|
|
|
- "Populate rates intersection");
|
|
|
- csr_populate_intersection_driver_and_hostpd_rates(pParam,
|
|
|
- &rates_driver,
|
|
|
- &rates_hostapd);
|
|
|
+ pParam->operationChn = opr_ch;
|
|
|
}
|
|
|
|
|
|
pParam->sirNwType = nw_type;
|
|
@@ -19444,6 +19368,7 @@ QDF_STATUS csr_roam_channel_change_req(tpAniSirGlobal pMac,
|
|
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
tSirChanChangeRequest *pMsg;
|
|
|
struct csr_roamstart_bssparams param;
|
|
|
+ bool skip_hostapd_rate = !profile->chan_switch_hostapd_rate_enabled;
|
|
|
|
|
|
/*
|
|
|
* while changing the channel, use basic rates given by driver
|
|
@@ -19453,7 +19378,7 @@ QDF_STATUS csr_roam_channel_change_req(tpAniSirGlobal pMac,
|
|
|
*/
|
|
|
qdf_mem_zero(¶m, sizeof(struct csr_roamstart_bssparams));
|
|
|
|
|
|
- csr_roam_get_bss_start_parms(pMac, profile, ¶m, true);
|
|
|
+ csr_roam_get_bss_start_parms(pMac, profile, ¶m, skip_hostapd_rate);
|
|
|
|
|
|
pMsg = qdf_mem_malloc(sizeof(tSirChanChangeRequest));
|
|
|
if (!pMsg)
|