qcacld-3.0: Use chan frequency for phy mode population

Use channel number will get invalid band.
Change csr_roam_get_phy_mode_band_for_bss API
and CSR_GET_BAND to use channel frequency as parameter.

Change-Id: I0c4d39f6b5689bc330e4e09302d84deaf209b9cb
CRs-Fixed: 2518428
这个提交包含在:
Liangwei Dong
2019-08-30 14:50:37 +08:00
提交者 nshrivas
父节点 cf340dd8e7
当前提交 e2ac31beea
修改 3 个文件,包含 59 行新增43 行删除

查看文件

@@ -821,8 +821,10 @@ struct csr_roamstruct {
#define CSR_IS_OPERATING_BG_BAND(mac) \ #define CSR_IS_OPERATING_BG_BAND(mac) \
(CSR_IS_OPEARTING_DUAL_BAND((mac)) || \ (CSR_IS_OPEARTING_DUAL_BAND((mac)) || \
CSR_IS_RADIO_BG_ONLY((mac)) || CSR_IS_24_BAND_ONLY((mac))) CSR_IS_RADIO_BG_ONLY((mac)) || CSR_IS_24_BAND_ONLY((mac)))
#define CSR_GET_BAND(ch_num) \
((WLAN_REG_IS_24GHZ_CH(ch_num)) ? BAND_2G : BAND_5G) #define CSR_GET_BAND(ch_freq) \
((wlan_reg_is_24ghz_ch_freq((ch_freq))) ? BAND_2G : BAND_5G)
#define CSR_IS_ROAMING(pSession) \ #define CSR_IS_ROAMING(pSession) \
((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \ ((CSR_IS_LOSTLINK_ROAMING((pSession)->roamingReason)) || \
(eCsrDynamicRoaming == (pSession)->roamingReason) || \ (eCsrDynamicRoaming == (pSession)->roamingReason) || \

查看文件

@@ -441,7 +441,7 @@ static void csr_roam_link_down(struct mac_context *mac, uint32_t sessionId);
static enum csr_cfgdot11mode static enum csr_cfgdot11mode
csr_roam_get_phy_mode_band_for_bss(struct mac_context *mac, csr_roam_get_phy_mode_band_for_bss(struct mac_context *mac,
struct csr_roam_profile *pProfile, struct csr_roam_profile *pProfile,
uint8_t operationChn, uint32_t bss_op_ch_freq,
enum band_info *pBand); enum band_info *pBand);
static QDF_STATUS csr_roam_get_qos_info_from_bss( static QDF_STATUS csr_roam_get_qos_info_from_bss(
struct mac_context *mac, struct bss_description *bss_desc); struct mac_context *mac, struct bss_description *bss_desc);
@@ -3955,7 +3955,7 @@ QDF_STATUS csr_roam_prepare_bss_config_from_profile(
struct bss_description *bss_desc) struct bss_description *bss_desc)
{ {
QDF_STATUS status = QDF_STATUS_SUCCESS; QDF_STATUS status = QDF_STATUS_SUCCESS;
uint8_t operationChannel = 0; uint32_t bss_op_ch_freq = 0;
uint8_t qAPisEnabled = false; uint8_t qAPisEnabled = false;
/* SSID */ /* SSID */
pBssConfig->SSID.length = 0; pBssConfig->SSID.length = 0;
@@ -3981,11 +3981,10 @@ QDF_STATUS csr_roam_prepare_bss_config_from_profile(
pBssConfig->band = mac->mlme_cfg->gen.band; pBssConfig->band = mac->mlme_cfg->gen.band;
/* phymode */ /* phymode */
if (pProfile->ChannelInfo.freq_list) if (pProfile->ChannelInfo.freq_list)
operationChannel = wlan_reg_freq_to_chan( bss_op_ch_freq = pProfile->ChannelInfo.freq_list[0];
mac->pdev, pProfile->ChannelInfo.freq_list[0]); pBssConfig->uCfgDot11Mode = csr_roam_get_phy_mode_band_for_bss(
pBssConfig->uCfgDot11Mode = csr_roam_get_phy_mode_band_for_bss(mac, mac, pProfile, bss_op_ch_freq,
pProfile, operationChannel, &pBssConfig->band);
&pBssConfig->band);
/* QOS */ /* QOS */
/* Is this correct to always set to this // *** */ /* Is this correct to always set to this // *** */
if (pBssConfig->BssCap.ess == 1) { if (pBssConfig->BssCap.ess == 1) {
@@ -4535,14 +4534,13 @@ static void csr_set_cfg_rate_set_from_profile(struct mac_context *mac,
uint8_t ExtendedOperationalRates uint8_t ExtendedOperationalRates
[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX]; [CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
qdf_size_t ExtendedOperationalRatesLength = 0; qdf_size_t ExtendedOperationalRatesLength = 0;
uint8_t operationChannel = 0; uint32_t bss_op_ch_freq = 0;
if (pProfile->ChannelInfo.freq_list) if (pProfile->ChannelInfo.freq_list)
operationChannel = wlan_reg_freq_to_chan( bss_op_ch_freq = pProfile->ChannelInfo.freq_list[0];
mac->pdev, pProfile->ChannelInfo.freq_list[0]);
cfgDot11Mode = csr_roam_get_phy_mode_band_for_bss(mac, pProfile, cfgDot11Mode = csr_roam_get_phy_mode_band_for_bss(mac, pProfile,
operationChannel, bss_op_ch_freq,
&band); &band);
/* For 11a networks, the 11a rates go into the Operational Rate set. /* For 11a networks, the 11a rates go into the Operational Rate set.
* For 11b and 11g networks, the 11b rates appear in the Operational * For 11b and 11g networks, the 11b rates appear in the Operational
* Rate set. In either case, we can blindly put the rates we support * Rate set. In either case, we can blindly put the rates we support
@@ -13077,10 +13075,10 @@ QDF_STATUS csr_process_del_vdev_command(struct mac_context *mac_ctx,
/** /**
* csr_compute_mode_and_band() - computes dot11mode * csr_compute_mode_and_band() - computes dot11mode
* @mac: mac global context * @mac: mac global context
* @dot11_mode: out param, do11 mode calculated * @dot11_mode: out param, do11 mode calculated
* @band: out param, band caclculated * @band: out param, band caclculated
* @opr_ch: operating channels * @opr_ch_freq: operating channel freq in MHz
* *
* This function finds dot11 mode based on current mode, operating channel and * This function finds dot11 mode based on current mode, operating channel and
* fw supported modes. * fw supported modes.
@@ -13091,7 +13089,7 @@ static void
csr_compute_mode_and_band(struct mac_context *mac_ctx, csr_compute_mode_and_band(struct mac_context *mac_ctx,
enum csr_cfgdot11mode *dot11_mode, enum csr_cfgdot11mode *dot11_mode,
enum band_info *band, enum band_info *band,
uint8_t opr_ch) uint32_t opr_ch_freq)
{ {
bool vht_24_ghz = mac_ctx->mlme_cfg->vht_caps.vht_cap_info.b24ghz_band; bool vht_24_ghz = mac_ctx->mlme_cfg->vht_caps.vht_cap_info.b24ghz_band;
@@ -13110,7 +13108,7 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
break; break;
case eCSR_CFG_DOT11_MODE_11N: case eCSR_CFG_DOT11_MODE_11N:
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
*band = CSR_GET_BAND(opr_ch); *band = CSR_GET_BAND(opr_ch_freq);
break; break;
case eCSR_CFG_DOT11_MODE_11AC: case eCSR_CFG_DOT11_MODE_11AC:
if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) { if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) {
@@ -13118,7 +13116,8 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
* If the operating channel is in 2.4 GHz band, check * If the operating channel is in 2.4 GHz band, check
* for INI item to disable VHT operation in 2.4 GHz band * for INI item to disable VHT operation in 2.4 GHz band
*/ */
if (WLAN_REG_IS_24GHZ_CH(opr_ch) && !vht_24_ghz) if (WLAN_REG_IS_24GHZ_CH_FREQ(opr_ch_freq) &&
!vht_24_ghz)
/* Disable 11AC operation */ /* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
else else
@@ -13126,7 +13125,7 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
} else { } else {
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
} }
*band = CSR_GET_BAND(opr_ch); *band = CSR_GET_BAND(opr_ch_freq);
break; break;
case eCSR_CFG_DOT11_MODE_11AC_ONLY: case eCSR_CFG_DOT11_MODE_11AC_ONLY:
if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) { if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AC)) {
@@ -13134,7 +13133,8 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
* If the operating channel is in 2.4 GHz band, check * If the operating channel is in 2.4 GHz band, check
* for INI item to disable VHT operation in 2.4 GHz band * for INI item to disable VHT operation in 2.4 GHz band
*/ */
if (WLAN_REG_IS_24GHZ_CH(opr_ch) && !vht_24_ghz) if (WLAN_REG_IS_24GHZ_CH_FREQ(opr_ch_freq) &&
!vht_24_ghz)
/* Disable 11AC operation */ /* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
else else
@@ -13142,7 +13142,7 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
} else { } else {
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
} }
*band = CSR_GET_BAND(opr_ch); *band = CSR_GET_BAND(opr_ch_freq);
break; break;
case eCSR_CFG_DOT11_MODE_11AX: case eCSR_CFG_DOT11_MODE_11AX:
case eCSR_CFG_DOT11_MODE_11AX_ONLY: case eCSR_CFG_DOT11_MODE_11AX_ONLY:
@@ -13153,7 +13153,8 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
* If the operating channel is in 2.4 GHz band, check * If the operating channel is in 2.4 GHz band, check
* for INI item to disable VHT operation in 2.4 GHz band * for INI item to disable VHT operation in 2.4 GHz band
*/ */
if (WLAN_REG_IS_24GHZ_CH(opr_ch) && !vht_24_ghz) if (WLAN_REG_IS_24GHZ_CH_FREQ(opr_ch_freq) &&
!vht_24_ghz)
/* Disable 11AC operation */ /* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
else else
@@ -13161,7 +13162,7 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
} else { } else {
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
} }
*band = CSR_GET_BAND(opr_ch); *band = CSR_GET_BAND(opr_ch_freq);
break; break;
case eCSR_CFG_DOT11_MODE_AUTO: case eCSR_CFG_DOT11_MODE_AUTO:
if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) { if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX)) {
@@ -13172,8 +13173,8 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
* check for INI item to disable VHT operation * check for INI item to disable VHT operation
* in 2.4 GHz band * in 2.4 GHz band
*/ */
if (WLAN_REG_IS_24GHZ_CH(opr_ch) if (WLAN_REG_IS_24GHZ_CH_FREQ(opr_ch_freq) &&
&& !vht_24_ghz) !vht_24_ghz)
/* Disable 11AC operation */ /* Disable 11AC operation */
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
else else
@@ -13181,14 +13182,14 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
} else { } else {
*dot11_mode = eCSR_CFG_DOT11_MODE_11N; *dot11_mode = eCSR_CFG_DOT11_MODE_11N;
} }
*band = CSR_GET_BAND(opr_ch); *band = CSR_GET_BAND(opr_ch_freq);
break; break;
default: default:
/* /*
* Global dot11 Mode setting is 11a/b/g. use the channel number * Global dot11 Mode setting is 11a/b/g. use the channel number
* to determine the Mode setting. * to determine the Mode setting.
*/ */
if (eCSR_OPERATING_CHANNEL_AUTO == opr_ch) { if (eCSR_OPERATING_CHANNEL_AUTO == opr_ch_freq) {
*band = mac_ctx->mlme_cfg->gen.band; *band = mac_ctx->mlme_cfg->gen.band;
if (BAND_2G == *band) { if (BAND_2G == *band) {
/* /*
@@ -13201,7 +13202,7 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
*band = BAND_5G; *band = BAND_5G;
*dot11_mode = eCSR_CFG_DOT11_MODE_11A; *dot11_mode = eCSR_CFG_DOT11_MODE_11A;
} }
} else if (WLAN_REG_IS_24GHZ_CH(opr_ch)) { } else if (WLAN_REG_IS_24GHZ_CH_FREQ(opr_ch_freq)) {
/* /*
* WiFi tests require IBSS networks to start in 11b mode * WiFi tests require IBSS networks to start in 11b mode
* without any change to the default parameter settings * without any change to the default parameter settings
@@ -13235,8 +13236,8 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
* information. * information.
* @mac_ctx: mac global context * @mac_ctx: mac global context
* @profile: bss profile * @profile: bss profile
* @bss_op_ch_freq:operating channel freq in MHz
* @band: out param, band caclculated * @band: out param, band caclculated
* @opr_ch: operating channels
* *
* This function finds dot11 mode based on current mode, operating channel and * This function finds dot11 mode based on current mode, operating channel and
* fw supported modes. The only tricky part is that if phyMode is set to 11abg, * fw supported modes. The only tricky part is that if phyMode is set to 11abg,
@@ -13248,16 +13249,21 @@ csr_compute_mode_and_band(struct mac_context *mac_ctx,
static enum csr_cfgdot11mode static enum csr_cfgdot11mode
csr_roam_get_phy_mode_band_for_bss(struct mac_context *mac_ctx, csr_roam_get_phy_mode_band_for_bss(struct mac_context *mac_ctx,
struct csr_roam_profile *profile, struct csr_roam_profile *profile,
uint8_t opr_chn, uint32_t bss_op_ch_freq,
enum band_info *p_band) enum band_info *p_band)
{ {
enum band_info band; enum band_info band;
enum csr_cfgdot11mode curr_mode = mac_ctx->roam.configParam.uCfgDot11Mode; uint8_t opr_chn = eCSR_OPERATING_CHANNEL_AUTO;
enum csr_cfgdot11mode curr_mode =
mac_ctx->roam.configParam.uCfgDot11Mode;
enum csr_cfgdot11mode cfg_dot11_mode = enum csr_cfgdot11mode cfg_dot11_mode =
csr_get_cfg_dot11_mode_from_csr_phy_mode(profile, csr_get_cfg_dot11_mode_from_csr_phy_mode(
profile,
(eCsrPhyMode) profile->phyMode, (eCsrPhyMode) profile->phyMode,
mac_ctx->roam.configParam.ProprietaryRatesEnabled); mac_ctx->roam.configParam.ProprietaryRatesEnabled);
if (bss_op_ch_freq)
opr_chn = wlan_reg_freq_to_chan(mac_ctx->pdev, bss_op_ch_freq);
/* /*
* If the global setting for dot11Mode is set to auto/abg, we overwrite * If the global setting for dot11Mode is set to auto/abg, we overwrite
* the setting in the profile. * the setting in the profile.
@@ -13268,7 +13274,7 @@ enum csr_cfgdot11mode curr_mode = mac_ctx->roam.configParam.uCfgDot11Mode;
|| (eCSR_CFG_DOT11_MODE_AUTO == cfg_dot11_mode) || (eCSR_CFG_DOT11_MODE_AUTO == cfg_dot11_mode)
|| (eCSR_CFG_DOT11_MODE_ABG == cfg_dot11_mode)) { || (eCSR_CFG_DOT11_MODE_ABG == cfg_dot11_mode)) {
csr_compute_mode_and_band(mac_ctx, &cfg_dot11_mode, csr_compute_mode_and_band(mac_ctx, &cfg_dot11_mode,
&band, opr_chn); &band, bss_op_ch_freq);
} /* if( eCSR_CFG_DOT11_MODE_ABG == cfg_dot11_mode ) */ } /* if( eCSR_CFG_DOT11_MODE_ABG == cfg_dot11_mode ) */
else { else {
/* dot11 mode is set, lets pick the band */ /* dot11 mode is set, lets pick the band */
@@ -13280,18 +13286,18 @@ enum csr_cfgdot11mode curr_mode = mac_ctx->roam.configParam.uCfgDot11Mode;
band = BAND_5G; band = BAND_5G;
} }
} else{ } else{
band = CSR_GET_BAND(opr_chn); band = CSR_GET_BAND(bss_op_ch_freq);
} }
} }
if (p_band) if (p_band)
*p_band = band; *p_band = band;
if (opr_chn == 14) { if (opr_chn == 14 && wlan_reg_is_24ghz_ch_freq(bss_op_ch_freq)) {
sme_err("Switching to Dot11B mode"); sme_err("Switching to Dot11B mode");
cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11B; cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11B;
} }
if (IS_24G_CH(opr_chn) && if (wlan_reg_is_24ghz_ch_freq(bss_op_ch_freq) &&
!mac_ctx->mlme_cfg->vht_caps.vht_cap_info.b24ghz_band && !mac_ctx->mlme_cfg->vht_caps.vht_cap_info.b24ghz_band &&
(eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode || (eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode ||
eCSR_CFG_DOT11_MODE_11AC_ONLY == cfg_dot11_mode)) eCSR_CFG_DOT11_MODE_11AC_ONLY == cfg_dot11_mode))
@@ -13308,12 +13314,13 @@ enum csr_cfgdot11mode curr_mode = mac_ctx->roam.configParam.uCfgDot11Mode;
(eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode) || (eCSR_CFG_DOT11_MODE_11AC == cfg_dot11_mode) ||
(eCSR_CFG_DOT11_MODE_11AX == cfg_dot11_mode))) { (eCSR_CFG_DOT11_MODE_11AX == cfg_dot11_mode))) {
/* We cannot do 11n here */ /* We cannot do 11n here */
if (WLAN_REG_IS_24GHZ_CH(opr_chn)) if (wlan_reg_is_24ghz_ch_freq(bss_op_ch_freq))
cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11G; cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11G;
else else
cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11A; cfg_dot11_mode = eCSR_CFG_DOT11_MODE_11A;
} }
sme_debug("dot11mode: %d", cfg_dot11_mode); sme_debug("dot11mode: %d phyMode %d fw sup AX %d", cfg_dot11_mode,
profile->phyMode, IS_FEATURE_SUPPORTED_BY_FW(DOT11AX));
return cfg_dot11_mode; return cfg_dot11_mode;
} }
@@ -13963,7 +13970,7 @@ csr_roam_get_bss_start_parms(struct mac_context *mac,
pParam->uCfgDot11Mode = pParam->uCfgDot11Mode =
csr_roam_get_phy_mode_band_for_bss(mac, pProfile, csr_roam_get_phy_mode_band_for_bss(mac, pProfile,
wlan_reg_freq_to_chan(mac->pdev, tmp_opr_ch_freq), tmp_opr_ch_freq,
&band); &band);
if (((pProfile->csrPersona == QDF_P2P_CLIENT_MODE) if (((pProfile->csrPersona == QDF_P2P_CLIENT_MODE)
@@ -14223,7 +14230,7 @@ QDF_STATUS csr_roam_issue_start_bss(struct mac_context *mac, uint32_t sessionId,
pParam->uCfgDot11Mode = pParam->uCfgDot11Mode =
csr_roam_get_phy_mode_band_for_bss(mac, pProfile, csr_roam_get_phy_mode_band_for_bss(mac, pProfile,
wlan_reg_freq_to_chan(mac->pdev, pParam->operation_chan_freq), pParam->operation_chan_freq,
&band); &band);
pParam->bssPersona = pProfile->csrPersona; pParam->bssPersona = pProfile->csrPersona;

查看文件

@@ -1675,7 +1675,14 @@ QDF_STATUS csr_get_phy_mode_from_bss(struct mac_context *mac,
phyMode = eCSR_DOT11_MODE_11ac; phyMode = eCSR_DOT11_MODE_11ac;
if (pIes->he_cap.present) if (pIes->he_cap.present)
phyMode = eCSR_DOT11_MODE_11ax; phyMode = eCSR_DOT11_MODE_11ax;
} else if (WLAN_REG_IS_6GHZ_CHAN_FREQ(
pBSSDescription->chan_freq)) {
if (pIes->he_cap.present)
phyMode = eCSR_DOT11_MODE_11ax;
else
sme_debug("Warning - 6Ghz AP no he cap");
} }
*pPhyMode = phyMode; *pPhyMode = phyMode;
} }