|
@@ -10323,214 +10323,6 @@ QDF_STATUS sme_check_ch_in_band(tpAniSirGlobal mac_ctx, uint8_t start_ch,
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-void sme_set_160bw_params(tpAniSirGlobal mac_ctx, uint8_t channel,
|
|
|
- struct ch_params_s *ch_params)
|
|
|
-{
|
|
|
- uint8_t start_ch = 0;
|
|
|
- QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
-
|
|
|
- if (channel >= 36 && channel <= 64) {
|
|
|
- ch_params->center_freq_seg0 = 50;
|
|
|
- start_ch = 36;
|
|
|
- } else if (channel >= 100 && channel <= 128) {
|
|
|
- ch_params->center_freq_seg0 = 114;
|
|
|
- start_ch = 100;
|
|
|
- } else {
|
|
|
- ch_params->ch_width = CH_WIDTH_80MHZ;
|
|
|
- }
|
|
|
-
|
|
|
- if (ch_params->ch_width == CH_WIDTH_160MHZ)
|
|
|
- status = sme_check_ch_in_band(mac_ctx, start_ch, 8);
|
|
|
-
|
|
|
- if (QDF_STATUS_SUCCESS != status)
|
|
|
- ch_params->ch_width = CH_WIDTH_80MHZ;
|
|
|
-}
|
|
|
-
|
|
|
-void sme_set_80bw_params(tpAniSirGlobal mac_ctx, uint8_t channel,
|
|
|
- struct ch_params_s *ch_params)
|
|
|
-{
|
|
|
- uint8_t start_ch = 0;
|
|
|
- QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
-
|
|
|
- if (channel >= 36 && channel <= 48) {
|
|
|
- ch_params->center_freq_seg0 = 42;
|
|
|
- start_ch = 36;
|
|
|
- } else if (channel >= 52 && channel <= 64) {
|
|
|
- ch_params->center_freq_seg0 = 58;
|
|
|
- start_ch = 52;
|
|
|
- } else if (channel >= 100 && channel <= 112) {
|
|
|
- ch_params->center_freq_seg0 = 106;
|
|
|
- start_ch = 100;
|
|
|
- } else if (channel >= 116 && channel <= 128) {
|
|
|
- ch_params->center_freq_seg0 = 122;
|
|
|
- start_ch = 116;
|
|
|
- } else if (channel >= 132 && channel <= 144) {
|
|
|
- ch_params->center_freq_seg0 = 138;
|
|
|
- start_ch = 132;
|
|
|
- } else if (channel >= 149 && channel <= 161) {
|
|
|
- ch_params->center_freq_seg0 = 155;
|
|
|
- start_ch = 149;
|
|
|
- } else {
|
|
|
- ch_params->ch_width = CH_WIDTH_40MHZ;
|
|
|
- }
|
|
|
-
|
|
|
- if (ch_params->ch_width == CH_WIDTH_80MHZ)
|
|
|
- status = sme_check_ch_in_band(mac_ctx, start_ch, 4);
|
|
|
-
|
|
|
- if (QDF_STATUS_SUCCESS != status)
|
|
|
- ch_params->ch_width = CH_WIDTH_40MHZ;
|
|
|
-}
|
|
|
-
|
|
|
-void sme_set_40bw_params(tpAniSirGlobal mac_ctx, uint8_t channel,
|
|
|
- struct ch_params_s *ch_params, uint8_t is_11ac_mode)
|
|
|
-{
|
|
|
- uint8_t tmp;
|
|
|
- uint8_t center_freq = 0;
|
|
|
- uint8_t start_ch = 0;
|
|
|
- QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
-
|
|
|
- if (channel == 165) {
|
|
|
- ch_params->ch_width = CH_WIDTH_20MHZ;
|
|
|
- ch_params->center_freq_seg0 = 0;
|
|
|
- ch_params->sec_ch_offset = PHY_SINGLE_CHANNEL_CENTERED;
|
|
|
- return;
|
|
|
- }
|
|
|
- tmp = channel % 2;
|
|
|
- if ((channel - tmp) % 8) {
|
|
|
- ch_params->sec_ch_offset = PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
|
|
|
- center_freq = channel + 2;
|
|
|
- } else {
|
|
|
- ch_params->sec_ch_offset = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
|
|
|
- center_freq = channel - 2;
|
|
|
- }
|
|
|
- if ((!is_11ac_mode) || (is_11ac_mode &&
|
|
|
- (ch_params->ch_width == CH_WIDTH_40MHZ))) {
|
|
|
- ch_params->ch_width = CH_WIDTH_40MHZ;
|
|
|
- ch_params->center_freq_seg0 = center_freq;
|
|
|
-
|
|
|
- if (channel <= 40)
|
|
|
- start_ch = 36;
|
|
|
- else if (channel <= 48)
|
|
|
- start_ch = 44;
|
|
|
- else if (channel <= 56)
|
|
|
- start_ch = 52;
|
|
|
- else if (channel <= 64)
|
|
|
- start_ch = 60;
|
|
|
- else if (channel <= 104)
|
|
|
- start_ch = 100;
|
|
|
- else if (channel <= 112)
|
|
|
- start_ch = 108;
|
|
|
- else if (channel <= 120)
|
|
|
- start_ch = 116;
|
|
|
- else if (channel <= 128)
|
|
|
- start_ch = 124;
|
|
|
- else if (channel <= 136)
|
|
|
- start_ch = 132;
|
|
|
- else if (channel <= 144)
|
|
|
- start_ch = 140;
|
|
|
- else if (channel <= 153)
|
|
|
- start_ch = 149;
|
|
|
- else if (channel <= 161)
|
|
|
- start_ch = 157;
|
|
|
-
|
|
|
- status = sme_check_ch_in_band(mac_ctx, start_ch, 2);
|
|
|
-
|
|
|
- if (QDF_STATUS_SUCCESS != status) {
|
|
|
- ch_params->ch_width = CH_WIDTH_20MHZ;
|
|
|
- ch_params->center_freq_seg0 = 0;
|
|
|
- ch_params->sec_ch_offset = PHY_SINGLE_CHANNEL_CENTERED;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/*
|
|
|
- * SME API to determine the channel bonding mode
|
|
|
- */
|
|
|
-QDF_STATUS sme_set_ch_params(tHalHandle hHal, eCsrPhyMode eCsrPhyMode,
|
|
|
- uint8_t channel, uint8_t ht_sec_ch,
|
|
|
- struct ch_params_s *ch_params)
|
|
|
-{
|
|
|
- tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal);
|
|
|
- int is_11ac_mode = CSR_IS_PHY_MODE_11ac(eCsrPhyMode);
|
|
|
-
|
|
|
- if (!CSR_IS_PHY_MODE_11n(eCsrPhyMode) ||
|
|
|
- ch_params->ch_width == CH_WIDTH_20MHZ ||
|
|
|
- QDF_STATUS_SUCCESS != csr_is_valid_channel(mac_ctx, channel)) {
|
|
|
- QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
|
|
- "%s: Invalid Channel/phymode config: CB Mode disabled",
|
|
|
- __func__);
|
|
|
- ch_params->ch_width = CH_WIDTH_20MHZ;
|
|
|
- ch_params->sec_ch_offset = PHY_SINGLE_CHANNEL_CENTERED;
|
|
|
- if (channel <= 14)
|
|
|
- mac_ctx->roam.configParam.channelBondingMode24GHz =
|
|
|
- PHY_SINGLE_CHANNEL_CENTERED;
|
|
|
- else
|
|
|
- mac_ctx->roam.configParam.channelBondingMode5GHz =
|
|
|
- PHY_SINGLE_CHANNEL_CENTERED;
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
- }
|
|
|
-
|
|
|
- sms_log(mac_ctx, LOGW, "%s: channel - %d, vht channel width - %d",
|
|
|
- __func__, channel, ch_params->ch_width);
|
|
|
-
|
|
|
- if (CDS_IS_CHANNEL_5GHZ(channel)) {
|
|
|
- if (ch_params->ch_width == CH_WIDTH_160MHZ)
|
|
|
- sme_set_160bw_params(mac_ctx, channel, ch_params);
|
|
|
- if ((ch_params->ch_width == CH_WIDTH_80MHZ) ||
|
|
|
- (ch_params->ch_width == CH_WIDTH_80P80MHZ))
|
|
|
- sme_set_80bw_params(mac_ctx, channel, ch_params);
|
|
|
-
|
|
|
- sme_set_40bw_params(mac_ctx, channel,
|
|
|
- ch_params, is_11ac_mode);
|
|
|
-
|
|
|
- mac_ctx->roam.configParam.channelBondingMode5GHz =
|
|
|
- ch_params->sec_ch_offset;
|
|
|
- } else if (CDS_IS_CHANNEL_24GHZ(channel)) {
|
|
|
- if (channel >= 1 && channel < 5) {
|
|
|
- ch_params->ch_width = CH_WIDTH_40MHZ;
|
|
|
- ch_params->sec_ch_offset =
|
|
|
- PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
|
|
|
- ch_params->center_freq_seg0 = channel + 2;
|
|
|
- } else if (channel >= 5 && channel <= 9) {
|
|
|
- ch_params->ch_width = CH_WIDTH_40MHZ;
|
|
|
- if (0 != ht_sec_ch) {
|
|
|
- if (ht_sec_ch > channel) {
|
|
|
- ch_params->sec_ch_offset =
|
|
|
- PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
|
|
|
- ch_params->center_freq_seg0 =
|
|
|
- channel + 2;
|
|
|
- } else {
|
|
|
- ch_params->sec_ch_offset =
|
|
|
- PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
|
|
|
- ch_params->center_freq_seg0 =
|
|
|
- channel - 2;
|
|
|
- }
|
|
|
- } else {
|
|
|
- /* in case ht_sec_ch is not set by ACS or
|
|
|
- * calling function, set the secondary channel
|
|
|
- * offset value to lower channel
|
|
|
- */
|
|
|
- ch_params->sec_ch_offset =
|
|
|
- PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
|
|
|
- ch_params->center_freq_seg0 = channel - 2;
|
|
|
- }
|
|
|
- } else if (channel > 9 && channel <= 13) {
|
|
|
- ch_params->ch_width = CH_WIDTH_40MHZ;
|
|
|
- ch_params->sec_ch_offset =
|
|
|
- PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
|
|
|
- ch_params->center_freq_seg0 = channel - 2;
|
|
|
- } else if (channel == 14) {
|
|
|
- ch_params->ch_width = CH_WIDTH_20MHZ;
|
|
|
- ch_params->sec_ch_offset =
|
|
|
- PHY_SINGLE_CHANNEL_CENTERED;
|
|
|
- ch_params->center_freq_seg0 = 0;
|
|
|
- }
|
|
|
- mac_ctx->roam.configParam.channelBondingMode24GHz =
|
|
|
- ch_params->sec_ch_offset;
|
|
|
- }
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-}
|
|
|
-
|
|
|
/*convert the ini value to the ENUM used in csr and MAC for CB state*/
|
|
|
ePhyChanBondState sme_get_cb_phy_state_from_cb_ini_value(uint32_t cb_ini_value)
|
|
|
{
|