From 5c509f36e8abcb23256020e7123958f4abaafbe6 Mon Sep 17 00:00:00 2001 From: gaolez Date: Mon, 17 Apr 2017 18:24:40 +0800 Subject: [PATCH] qcacld-3.0: fix miss CSA IE when band switch qcacld-2.0 to qcacld-3.0 propagation Setting CSA IE if not all the STA devices support ECSA while configure the macro CHANNEL_HOPPING_ALL_BANDS. Otherwise, SAP will miss CSA IE when switch band from 5G to 2G. Change-Id: I7aad2bb0d967e73c0ea87acb9820bebdc0455410 CRs-Fixed: 2024425 --- core/mac/src/pe/sch/sch_beacon_gen.c | 29 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c index d7f9872d6259..d53ce3dfccc4 100644 --- a/core/mac/src/pe/sch/sch_beacon_gen.c +++ b/core/mac/src/pe/sch/sch_beacon_gen.c @@ -276,18 +276,28 @@ sch_set_fixed_beacon_fields(tpAniSirGlobal mac_ctx, tpPESession session) /* Initialize the 'new' fields at the end of the beacon */ if ((session->limSystemRole == eLIM_AP_ROLE) && - session->dfsIncludeChanSwIe == true) { + session->dfsIncludeChanSwIe == true) { if (!CHAN_HOP_ALL_BANDS_ENABLE || session->lim_non_ecsa_cap_num == 0) { + tDot11fIEext_chan_switch_ann *ext_csa = + &bcn_2->ext_chan_switch_ann; populate_dot_11_f_ext_chann_switch_ann(mac_ctx, - &bcn_2->ext_chan_switch_ann, - session); + ext_csa, + session); pe_info("ecsa: mode:%d reg:%d chan:%d count:%d", - bcn_2->ext_chan_switch_ann.switch_mode, - bcn_2->ext_chan_switch_ann.new_reg_class, - bcn_2->ext_chan_switch_ann.new_channel, - bcn_2->ext_chan_switch_ann.switch_count); - } + ext_csa->switch_mode, + ext_csa->new_reg_class, + ext_csa->new_channel, + ext_csa->switch_count); + } else { + populate_dot11f_chan_switch_ann(mac_ctx, + &bcn_2->ChanSwitchAnn, + session); + pe_info("csa: mode:%d chan:%d count:%d", + bcn_2->ChanSwitchAnn.switchMode, + bcn_2->ChanSwitchAnn.newChannel, + bcn_2->ChanSwitchAnn.switchCount); + } } populate_dot11_supp_operating_classes(mac_ctx, @@ -310,8 +320,7 @@ sch_set_fixed_beacon_fields(tpAniSirGlobal mac_ctx, tpPESession session) * and SAP has instructed to announce channel switch IEs * in beacon and probe responses */ - if (!CHAN_HOP_ALL_BANDS_ENABLE || - session->lim_non_ecsa_cap_num > 0) { + if (!CHAN_HOP_ALL_BANDS_ENABLE) { populate_dot11f_chan_switch_ann(mac_ctx, &bcn_2->ChanSwitchAnn, session); pe_debug("csa: mode:%d chan:%d count:%d",