From b9e93fa1edb2f565df256a09b199d8baf1deaccc Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Fri, 14 Aug 2020 04:04:30 +0530 Subject: [PATCH] qcacld-3.0: Get country code using wlan_reg_read_current_country In lim_handle_csa_offload_msg(), mac->scan.countryCodeCurrent is passed in regulatory API wlan_reg_dmn_get_chanwidth_from_opclass to get the opclass. mac_ctx->scan.countryCodeCurrent is no more updated after the regulatory componentization so get country using wlan_reg_read_current_country() instead of it. Change-Id: Ic56e4bf33784fa5f64aedd431ebe41275a7666b2 CRs-Fixed: 2742068 --- core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 ebc2083d7b..33c801e47b 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 @@ -1568,6 +1568,7 @@ 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 country_code[CDS_COUNTRY_CODE_LEN + 1]; tLimWiderBWChannelSwitchInfo *chnl_switch_info = NULL; tLimChannelSwitchInfo *lim_ch_switch = NULL; @@ -1647,7 +1648,7 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, channel_bonding_mode); session_entry->htSupportedChannelWidthSet = false; - + wlan_reg_read_current_country(mac_ctx->psoc, country_code); if (channel_bonding_mode && ((session_entry->vhtCapability && session_entry->htCapability) || lim_is_session_he_capable(session_entry))) { @@ -1680,7 +1681,7 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, } else { chan_space = wlan_reg_dmn_get_chanwidth_from_opclass( - mac_ctx->scan.countryCodeCurrent, + country_code, csa_params->channel, csa_params->new_op_class); } @@ -1753,7 +1754,7 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, & lim_xcsa_ie_present) { chan_space = wlan_reg_dmn_get_chanwidth_from_opclass( - mac_ctx->scan.countryCodeCurrent, + country_code, csa_params->channel, csa_params->new_op_class); lim_ch_switch->state =