From ef4bac4c134a278e56e625c60466a0c07e9b09fb Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 16 Aug 2021 10:09:42 +0800 Subject: [PATCH] qcacld-3.0: Fix 2.4G assoc request bandwidth info wrong With the commit I630423de03636e6c4ca07638dce6966c3ca381f9, driver will enable HT40 capability field in assoc request frame to 2.4G AP. In some countries, the 40Mhz is disallowed in 2.4G. Fix by disable HT40 if regulatory disallow Change-Id: I8a1e6b2c59c486373c49cba0e3c635b34f443e1c CRs-Fixed: 3012747 --- .../src/sys/legacy/src/utils/src/parser_api.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 47234b547974..91ca42224929 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -912,6 +912,7 @@ populate_dot11f_ht_caps(struct mac_context *mac, qdf_size_t ncfglen; QDF_STATUS nSirStatus; uint8_t disable_high_ht_mcs_2x2 = 0; + struct ch_params ch_params = {0}; tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; tSirMacASCapabilityInfo *pASCapabilityInfo; @@ -943,11 +944,22 @@ populate_dot11f_ht_caps(struct mac_context *mac, if (WLAN_REG_IS_24GHZ_CH_FREQ(pe_session->curr_op_freq) && LIM_IS_STA_ROLE(pe_session) && WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != - mac->roam.configParam.channelBondingMode24GHz) + mac->roam.configParam.channelBondingMode24GHz) { pDot11f->supportedChannelWidthSet = 1; - else + ch_params.ch_width = CH_WIDTH_40MHZ; + wlan_reg_set_channel_params_for_freq( + mac->pdev, pe_session->curr_op_freq, 0, + &ch_params); + if (ch_params.ch_width != CH_WIDTH_40MHZ) + pDot11f->supportedChannelWidthSet = 0; + pe_debug("pe ch offset %d ch_width %d htcap ch width set %d", + pe_session->htSecondaryChannelOffset, + ch_params.ch_width, + pDot11f->supportedChannelWidthSet); + } else { pDot11f->supportedChannelWidthSet = pe_session->htSupportedChannelWidthSet; + } pDot11f->advCodingCap = pe_session->ht_config.ht_rx_ldpc; pDot11f->txSTBC = pe_session->ht_config.ht_tx_stbc;