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
This commit is contained in:
Chandrasekaran Manishekar 2016-03-07 19:09:20 +05:30 • committed by Gerrit - the friendly Code Review server
commit 4fcb7f5feb
3 changed files with 25 additions and 1 deletions

View file

@ -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;

View file

@ -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

View file

@ -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,