From 93b7f70f803b54456a3f4ea5d77d9656d20a2d35 Mon Sep 17 00:00:00 2001 From: Vignesh Viswanathan Date: Tue, 19 Dec 2017 17:48:45 +0530 Subject: [PATCH] qcacld-3.0: Add WiderBWChanSwitchAnn IE to ext_chan_switch_ann action frame Add the WiderBWChanSwitchAnn to ext_chan_switch_ann action frame as optional IE. Currently WiderBWChanSwitchAnn is added only in beacon frames. Change-Id: I4f76479bdb2befa93fcb83238590007a555af210 CRs-Fixed: 2141529 --- core/mac/src/cfg/cfgUtil/dot11f.frms | 1 + core/mac/src/include/dot11f.h | 3 ++- .../src/pe/lim/lim_send_management_frames.c | 21 +++++++++++++++++++ .../mac/src/sys/legacy/src/utils/src/dot11f.c | 6 +++++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index 690a0a66ccca..5e9dc5e19ab4 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -4247,6 +4247,7 @@ FRAME ext_channel_switch_action_frame FF Category; FF Action; FF ext_chan_switch_ann_action; + OPTIE WiderBWChanSwitchAnn; } FRAME p2p_oper_chan_change_confirm diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 86c1dc097065..4435778feb81 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -35,7 +35,7 @@ * * * This file was automatically generated by 'framesc' - * Wed Dec 13 10:10:49 2017 from the following file(s): + * Tue Dec 19 17:48:07 2017 from the following file(s): * * dot11f.frms * @@ -11002,6 +11002,7 @@ typedef struct sDot11fext_channel_switch_action_frame{ tDot11fFfCategory Category; tDot11fFfAction Action; tDot11fFfext_chan_switch_ann_action ext_chan_switch_ann_action; + tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; } tDot11fext_channel_switch_action_frame; #define DOT11F_EXT_CHANNEL_SWITCH_ACTION_FRAME (49) diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index ac388c0df587..752062c72b29 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -3562,6 +3562,8 @@ lim_send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx, QDF_STATUS qdf_status; uint8_t txFlag = 0; uint8_t sme_session_id = 0; + uint8_t ch_spacing; + tLimWiderBWChannelSwitchInfo *wide_bw_ie; if (session_entry == NULL) { pe_err("Session entry is NULL!!!"); @@ -3580,6 +3582,25 @@ lim_send_extended_chan_switch_action_frame(tpAniSirGlobal mac_ctx, frm.ext_chan_switch_ann_action.new_channel = new_channel; frm.ext_chan_switch_ann_action.switch_count = count; + ch_spacing = wlan_reg_dmn_get_chanwidth_from_opclass( + mac_ctx->scan.countryCodeCurrent, new_channel, + new_op_class); + pe_debug("wrapper: ch_spacing %hu", ch_spacing); + + if ((ch_spacing == 80) || (ch_spacing == 160)) { + wide_bw_ie = &session_entry->gLimWiderBWChannelSwitch; + frm.WiderBWChanSwitchAnn.newChanWidth = + wide_bw_ie->newChanWidth; + frm.WiderBWChanSwitchAnn.newCenterChanFreq0 = + wide_bw_ie->newCenterChanFreq0; + frm.WiderBWChanSwitchAnn.newCenterChanFreq1 = + wide_bw_ie->newCenterChanFreq1; + frm.WiderBWChanSwitchAnn.present = 1; + pe_debug("wrapper: width:%d f0:%d f1:%d", + frm.WiderBWChanSwitchAnn.newChanWidth, + frm.WiderBWChanSwitchAnn.newCenterChanFreq0, + frm.WiderBWChanSwitchAnn.newCenterChanFreq1); + } status = dot11f_get_packed_ext_channel_switch_action_frame_size(mac_ctx, &frm, &n_payload); diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index 3758d2f5fe96..35a4906cb87c 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -33,7 +33,7 @@ * * * This file was automatically generated by 'framesc' - * Wed Dec 13 10:10:49 2017 from the following file(s): + * Tue Dec 19 17:48:07 2017 from the following file(s): * * dot11f.frms * @@ -10176,6 +10176,10 @@ static const tFFDefn FFS_ext_channel_switch_action_frame[] = { }; static const tIEDefn IES_ext_channel_switch_action_frame[] = { + { offsetof(tDot11fext_channel_switch_action_frame, + WiderBWChanSwitchAnn), offsetof(tDot11fIEWiderBWChanSwitchAnn, present), + 0, "WiderBWChanSwitchAnn", 0, 5, 5, SigIeWiderBWChanSwitchAnn, + {0, 0, 0, 0, 0}, 0, DOT11F_EID_WIDERBWCHANSWITCHANN, 0, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, },}; uint32_t dot11f_unpack_ext_channel_switch_action_frame(tpAniSirGlobal pCtx,