From 4fcb7f5feb0415b395decc04ba0fc73c7e481860 Mon Sep 17 00:00:00 2001 From: Chandrasekaran Manishekar Date: Mon, 7 Mar 2016 19:09:20 +0530 Subject: [PATCH] qcacld-3.0: Fix enum mismatch while calculating regulatory class Fix the enum value used while calculating the regulatory class from the operating channel. Currently, the channel width is of type 'enum ch_width' whereas the expected enum is of type 'offset_t'. Fixing the same by performing the enum conversion before calculating the regulatory class to avoid incorrect value of regulatory class. Change-Id: I6aabb8ae78836e3c640f41b27e10830adc91a57e CRs-Fixed: 986246 --- .../src/pe/lim/lim_process_sme_req_messages.c | 2 ++ .../src/sys/legacy/src/utils/src/parser_api.c | 17 ++++++++++++++++- core/sap/src/sap_module.c | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 1d2058b81c5e..1fb2a93fdf0f 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -5623,6 +5623,8 @@ static void lim_process_sme_dfs_csa_ie_request(tpAniSirGlobal mac_ctx, session_entry->gLimChannelSwitch.switchCount = LIM_MAX_CSA_IE_UPDATES; session_entry->gLimChannelSwitch.ch_width = dfs_csa_ie_req->ch_params.ch_width; + session_entry->gLimChannelSwitch.sec_ch_offset = + dfs_csa_ie_req->ch_params.sec_ch_offset; if (mac_ctx->sap.SapDfsInfo.disable_dfs_ch_switch == false) session_entry->gLimChannelSwitch.switchMode = 1; 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 d25eec71fc2d..fbe40637a5f5 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 @@ -248,16 +248,31 @@ void populate_dot_11_f_ext_chann_switch_ann(tpAniSirGlobal mac_ptr, tDot11fIEext_chan_switch_ann *dot_11_ptr, tpPESession session_entry) { + uint8_t ch_offset; + + if (session_entry->gLimChannelSwitch.ch_width == CH_WIDTH_80MHZ) + ch_offset = BW80; + else + ch_offset = session_entry->gLimChannelSwitch.sec_ch_offset; + dot_11_ptr->switch_mode = session_entry->gLimChannelSwitch.switchMode; dot_11_ptr->new_reg_class = cds_regdm_get_opclass_from_channel( mac_ptr->scan.countryCodeCurrent, session_entry->gLimChannelSwitch.primaryChannel, - session_entry->gLimChannelSwitch.ch_width); + ch_offset); dot_11_ptr->new_channel = session_entry->gLimChannelSwitch.primaryChannel; dot_11_ptr->switch_count = session_entry->gLimChannelSwitch.switchCount; dot_11_ptr->present = 1; + + dot11f_log(mac_ptr, LOG1, + FL("country:%s chan:%d width:%d reg:%d off:%d"), + mac_ptr->scan.countryCodeCurrent, + session_entry->gLimChannelSwitch.primaryChannel, + session_entry->gLimChannelSwitch.ch_width, + dot_11_ptr->new_reg_class, + session_entry->gLimChannelSwitch.sec_ch_offset); } void diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 07fd12772816..d93a79361aeb 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -2437,6 +2437,13 @@ QDF_STATUS wlansap_dfs_send_csa_ie_request(void *pSapCtx) pMac->sap.SapDfsInfo.target_channel, 0, &pMac->sap.SapDfsInfo.new_ch_params); + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, + "%s: chan:%d req:%d width:%d off:%d", + __func__, pMac->sap.SapDfsInfo.target_channel, + pMac->sap.SapDfsInfo.csaIERequired, + pMac->sap.SapDfsInfo.new_ch_params.ch_width, + pMac->sap.SapDfsInfo.new_ch_params.sec_ch_offset); + qdf_ret_status = sme_roam_csa_ie_request(hHal, sapContext->bssid, pMac->sap.SapDfsInfo.target_channel,