diff options
author | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2023-07-23 22:46:02 +0530 |
---|---|---|
committer | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2023-07-25 15:12:52 +0800 |
commit | 77123c4e833bafb43e7740c5afee3a59c690f04a (patch) | |
tree | bedc9639ffa6d4ceb7be4704514d950d0645fcb4 | |
parent | a51b757fc7eef9e993a93e4d8748a02bc4027599 (diff) | |
download | qcacld-android-14.0.0_r0.32.tar.gz |
qcacld-3.0: Validate CSA frequency and bandwidthandroid-u-qpr3-beta-2_r0.1android-u-qpr3-beta-1_r0.6android-u-qpr2-beta-3_r0.1android-u-qpr2-beta-3.1_r0.6android-u-qpr2-beta-1_r0.8android-14.0.0_r0.78android-14.0.0_r0.68android-14.0.0_r0.58android-14.0.0_r0.46android-14.0.0_r0.32android-14.0.0_r0.20android-msm-redbull-4.19-android14-qpr2-betaandroid-msm-redbull-4.19-android14-qpr2android-msm-redbull-4.19-android14-qpr1
Check if the provided channel width and center frequency
are valid in current regulatory domain for CSA. If its not
valid reject the CSA request, since invalid center frequency
sent to firmware in vdev start command can cause abnormal
behavior.
Validate the STA csa frequency in lim_is_csa_channel_allowed()
Bug: 286258190
Test: Regression Test
Change-Id: I40de080bb7a929a350d28eb45352bce4f60a9f1d
CRs-Fixed: 3541748
Signed-off-by: Hsiu-Chang Chen <hsiuchangchen@google.com>
-rw-r--r-- | core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 80746f51af..54a5d97fe6 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1648,6 +1648,9 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, uint16_t chan_space = 0; struct ch_params ch_params = {0}; uint32_t channel_bonding_mode; + uint8_t csa_chan = csa_params->channel, sec_ch_2g = 0; + enum phy_ch_width new_ch_width = csa_params->new_ch_width; + enum channel_state chan_state; tLimWiderBWChannelSwitchInfo *chnl_switch_info = NULL; tLimChannelSwitchInfo *lim_ch_switch = NULL; @@ -1678,6 +1681,28 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, pe_debug("Invalid role to handle CSA"); goto err; } + + if (WLAN_REG_IS_24GHZ_CH(csa_chan) && + wlan_reg_get_bw_value(new_ch_width) > 20) { + if (csa_params->sec_chan_offset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) + sec_ch_2g = csa_chan + 4; + else if (csa_params->sec_chan_offset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY) + sec_ch_2g = csa_chan - 4; + } + + chan_state = wlan_reg_get_bonded_channel_state(mac_ctx->pdev, + csa_chan, new_ch_width, + sec_ch_2g); + if (chan_state == CHANNEL_STATE_INVALID || + chan_state == CHANNEL_STATE_DISABLE) { + pe_err("Invalid csa_chan:%d for provided ch_width:%d. Disconnect", + csa_chan, new_ch_width); + lim_tear_down_link_with_ap(mac_ctx, session_entry->peSessionId, + eSIR_MAC_CHANNEL_SWITCH_FAILED, + eLIM_HOST_DISASSOC); + goto err; + } + /* * on receiving channel switch announcement from AP, delete all * TDLS peers before leaving BSS and proceed for channel switch |