qcacld-3.0: Calculate supported rates according to different case
Fix the regression issue introduced by change "Change-Id: Ica336398865a8b5e16297e4555dbb7de5e79567e". The issue is that it will always include driver default rates. In some case it only needs to calculate supported rates from hostapd.conf file. Define ini item gChanSwitchHostapdRateEnabled to configure supported rates calculated from hostapd.conf file or driver default rates when doing SAP channel switch. Change-Id: I45eeea5134dd80929bdd1f61246bdc66e1857e22 CRs-fixed: 2103714
This commit is contained in:
parent
a0e5b59824
commit
16d6e08812
@ -12010,6 +12010,35 @@ enum hdd_external_acs_freq_band {
|
||||
#define CFG_SCAN_11D_INTERVAL_MIN (1000)
|
||||
#define CFG_SCAN_11D_INTERVAL_MAX (36000000)
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gChanSwitchHostapdRateEnabled - Enable/disable hostapd rate when doing SAP
|
||||
* channel switch
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* This ini is used to set supported rates calculated from hostapd.conf file
|
||||
* or not when doing SAP channel switch. It must set it to 0 when cross-band
|
||||
* channel switch happens such as from 2G to 5G or 5G to 2G.
|
||||
*
|
||||
* Related: When doing SAP channel switch, if gChanSwitchHostapdRateEnabled is
|
||||
* set to 1, supported rates will be calculated from hostapd.conf file,
|
||||
* if gChanSwitchHostapdRateEnabled is set to 0, supported rates will be
|
||||
* calculated from driver default rates.
|
||||
*
|
||||
* Supported Feature: SAP
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_NAME \
|
||||
"gChanSwitchHostapdRateEnabled"
|
||||
#define CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_MIN (0)
|
||||
#define CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_MAX (1)
|
||||
#define CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_DEFAULT (0)
|
||||
|
||||
/*
|
||||
* Type declarations
|
||||
*/
|
||||
@ -12820,6 +12849,7 @@ struct hdd_config {
|
||||
int8_t rssi_thresh_offset_5g;
|
||||
bool is_ndi_mac_randomized;
|
||||
uint32_t scan_11d_interval;
|
||||
bool chan_switch_hostapd_rate_enabled;
|
||||
};
|
||||
|
||||
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
|
||||
|
@ -4859,6 +4859,14 @@ struct reg_table_entry g_registry_table[] = {
|
||||
CFG_SCAN_11D_INTERVAL_DEFAULT,
|
||||
CFG_SCAN_11D_INTERVAL_MIN,
|
||||
CFG_SCAN_11D_INTERVAL_MAX),
|
||||
|
||||
REG_VARIABLE(CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_NAME,
|
||||
WLAN_PARAM_Integer,
|
||||
struct hdd_config, chan_switch_hostapd_rate_enabled,
|
||||
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
|
||||
CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_DEFAULT,
|
||||
CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_MIN,
|
||||
CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_MAX),
|
||||
};
|
||||
|
||||
|
||||
@ -6518,11 +6526,14 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx)
|
||||
CFG_DTIM_1CHRX_ENABLE_NAME,
|
||||
hdd_ctx->config->enable_dtim_1chrx);
|
||||
hdd_debug("Name = [%s] value = [%u]",
|
||||
CFG_RANDOMIZE_NDI_MAC_NAME,
|
||||
hdd_ctx->config->is_ndi_mac_randomized);
|
||||
CFG_RANDOMIZE_NDI_MAC_NAME,
|
||||
hdd_ctx->config->is_ndi_mac_randomized);
|
||||
hdd_debug("Name = [%s] value = [%u]",
|
||||
CFG_DOT11P_MODE_NAME,
|
||||
hdd_ctx->config->dot11p_mode);
|
||||
hdd_debug("Name = [%s] value = [%u]",
|
||||
CFG_CHAN_SWITCH_HOSTAPD_RATE_ENABLED_NAME,
|
||||
hdd_ctx->config->chan_switch_hostapd_rate_enabled);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7872,6 +7872,9 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *pHostapdAdapter,
|
||||
/* Protection parameter to enable or disable */
|
||||
pConfig->protEnabled = iniConfig->apProtEnabled;
|
||||
|
||||
pConfig->chan_switch_hostapd_rate_enabled =
|
||||
iniConfig->chan_switch_hostapd_rate_enabled;
|
||||
|
||||
pConfig->enOverLapCh = iniConfig->gEnableOverLapCh;
|
||||
pConfig->dtim_period = pBeacon->dtim_period;
|
||||
hdd_debug("acs_mode %d", pConfig->acs_cfg.acs_mode);
|
||||
@ -8317,6 +8320,8 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *pHostapdAdapter,
|
||||
(int)pConfig->RSNWPAReqIELength, pConfig->UapsdEnable);
|
||||
hdd_debug("ProtEnabled = %d, OBSSProtEnabled = %d",
|
||||
pConfig->protEnabled, pConfig->obssProtEnabled);
|
||||
hdd_debug("ChanSwitchHostapdRateEnabled = %d",
|
||||
pConfig->chan_switch_hostapd_rate_enabled);
|
||||
|
||||
if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) {
|
||||
wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_ALL);
|
||||
|
@ -632,6 +632,7 @@ typedef struct sap_Config {
|
||||
/* beacon count before channel switch */
|
||||
uint8_t sap_chanswitch_beacon_cnt;
|
||||
uint8_t sap_chanswitch_mode;
|
||||
bool chan_switch_hostapd_rate_enabled;
|
||||
} tsap_Config_t;
|
||||
|
||||
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
|
||||
|
@ -3727,6 +3727,9 @@ sapconvert_to_csr_profile(tsap_Config_t *pconfig_params, eCsrRoamBssType bssType
|
||||
pconfig_params->extended_rates.numRates;
|
||||
}
|
||||
|
||||
profile->chan_switch_hostapd_rate_enabled =
|
||||
pconfig_params->chan_switch_hostapd_rate_enabled;
|
||||
|
||||
return eSAP_STATUS_SUCCESS; /* Success. */
|
||||
}
|
||||
|
||||
|
@ -2433,8 +2433,6 @@ wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel)
|
||||
ch_params->center_freq_seg0;
|
||||
sapContext->csr_roamProfile.ch_params.center_freq_seg1 =
|
||||
ch_params->center_freq_seg1;
|
||||
sapContext->csr_roamProfile.supported_rates.numRates = 0;
|
||||
sapContext->csr_roamProfile.extended_rates.numRates = 0;
|
||||
sap_dfs_set_current_channel(sapContext);
|
||||
|
||||
qdf_ret_status = sme_roam_channel_change_req(hHal, sapContext->bssid,
|
||||
|
@ -1008,6 +1008,7 @@ typedef struct tagCsrRoamProfile {
|
||||
bool fils_connection;
|
||||
struct cds_fils_connection_info *fils_con_info;
|
||||
#endif
|
||||
bool chan_switch_hostapd_rate_enabled;
|
||||
} tCsrRoamProfile;
|
||||
|
||||
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
|
||||
|
@ -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);
|
||||
profile->supported_rates.numRates,
|
||||
profile->extended_rates.numRates);
|
||||
|
||||
if (supported_rates->numRates > SIR_MAC_RATESET_EID_MAX)
|
||||
supported_rates->numRates = SIR_MAC_RATESET_EID_MAX;
|
||||
if (profile->supported_rates.numRates > SIR_MAC_RATESET_EID_MAX)
|
||||
profile->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;
|
||||
if (profile->extended_rates.numRates > SIR_MAC_RATESET_EID_MAX)
|
||||
profile->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]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
opr_rates->numRates = profile->supported_rates.numRates;
|
||||
qdf_mem_copy(opr_rates->rate,
|
||||
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]);
|
||||
}
|
||||
|
||||
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]);
|
||||
|
||||
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;
|
||||
qdf_mem_copy(opr_rates->rate,
|
||||
rates.rate,
|
||||
MAX_NUM_SUPPORTED_RATES);
|
||||
ext_rates->numRates = rates.num_rates - MAX_NUM_SUPPORTED_RATES;
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user