From 45eb08feb98d5672afad989eb0e17e4b4486d8ff Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Tue, 10 Jul 2018 19:17:38 +0530 Subject: [PATCH] qcacld-3.0: Strip OMN IE from additional IEs for NSS update As part of nss update request, operating mode is updated in beacon template. OMN IE can also present in additional IEs which will result in OMN IE included twice in beacon. Fix is to strip OMN IE from additional IEs if beacon template is updated as part of nss update request. Change-Id: Ic0cd6b76738e16eb73de7a7ba406cd727c2f8dc4 CRs-Fixed: 2274027 --- core/mac/inc/sir_mac_prot_def.h | 2 ++ core/mac/src/pe/sch/sch_beacon_gen.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 13436dc962c6..45ec349cb627 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -199,6 +199,8 @@ #define SIR_MAC_VHT_GID_NOTIFICATION 1 #define SIR_MAC_VHT_OPMODE_NOTIFICATION 2 +#define SIR_MAC_VHT_OPMODE_SIZE 3 + #define NUM_OF_SOUNDING_DIMENSIONS 1 /*Nss - 1, (Nss = 2 for 2x2)*/ /* HT Action Field Codes */ #define SIR_MAC_SM_POWER_SAVE 1 diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c index f6b04a759564..53e2f68ee905 100644 --- a/core/mac/src/pe/sch/sch_beacon_gen.c +++ b/core/mac/src/pe/sch/sch_beacon_gen.c @@ -457,9 +457,6 @@ sch_set_fixed_beacon_fields(tpAniSirGlobal mac_ctx, tpPESession session) /* populate_dot11f_vht_ext_bss_load( mac_ctx, &bcn2.VHTExtBssLoad); */ - if (session->gLimOperatingMode.present) - populate_dot11f_operating_mode(mac_ctx, - &bcn_2->OperatingMode, session); } if (lim_is_session_he_capable(session)) { @@ -583,6 +580,14 @@ sch_set_fixed_beacon_fields(tpAniSirGlobal mac_ctx, tpPESession session) } + if (session->vhtCapability && session->gLimOperatingMode.present) { + populate_dot11f_operating_mode(mac_ctx, &bcn_2->OperatingMode, + session); + lim_strip_ie(mac_ctx, addn_ie, &addn_ielen, + SIR_MAC_VHT_OPMODE_EID, ONE_BYTE, NULL, 0, + NULL, SIR_MAC_VHT_OPMODE_SIZE - 2); + } + n_status = dot11f_pack_beacon2(mac_ctx, bcn_2, session->pSchBeaconFrameEnd, SCH_MAX_BEACON_SIZE, &n_bytes);