summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeshwanth Sriram Guntuka <ysriramg@codeaurora.org>2018-03-15 19:04:55 +0530
committernshrivas <nshrivas@codeaurora.org>2018-03-16 07:14:46 -0700
commit78a50f267c0a955aca2c0ce74f9e420fbf2d287d (patch)
treeab9012bef32ca87242bd571f359ed8d5c970bc30
parentc7706a64b173077efa5824dd1ae3e1ee1005a0fc (diff)
qcacld-3.0: Add P2P IE at end of beacon buffer
P2P IE extracted in wlan_hdd_add_hostapd_conf_vsie may not be at the end of additional IE buffer as it depends on the order of IEs coming from supplicant.LIM and WMA expect P2P IE at the end of beacon buffer and beacon template is sent without including P2P IE at end which is sent using separate WMI command. This could result in beacon corruption if P2P IE is not present at the end of beacon buffer. Fix is to strip the P2P IE and append it at the end of beacon buffer. Change-Id: I59ecb31cd2441880c444cb6e1408d668da59c8c2 CRs-Fixed: 2207040
-rw-r--r--core/mac/src/pe/sch/sch_beacon_gen.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c
index 66b55451325c..f99ad43e52b5 100644
--- a/core/mac/src/pe/sch/sch_beacon_gen.c
+++ b/core/mac/src/pe/sch/sch_beacon_gen.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -104,6 +104,7 @@ sch_append_addn_ie(tpAniSirGlobal mac_ctx, tpPESession session,
uint8_t *p2p_ie = NULL;
uint8_t noa_len = 0;
uint8_t noa_strm[SIR_MAX_NOA_ATTR_LEN + SIR_P2P_IE_HEADER_LEN];
+ uint8_t ext_p2p_ie[DOT11F_IE_P2PBEACON_MAX_LEN + 2];
bool valid_ie;
valid_ie = (addn_ielen <= WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA_LEN &&
@@ -112,8 +113,27 @@ sch_append_addn_ie(tpAniSirGlobal mac_ctx, tpPESession session,
if (!valid_ie)
return status;
+ qdf_mem_zero(&ext_p2p_ie[0], DOT11F_IE_P2PBEACON_MAX_LEN + 2);
+ /*
+ * P2P IE extracted in wlan_hdd_add_hostapd_conf_vsie may not
+ * be at the end of additional IE buffer. The buffer sent to WMA
+ * expect P2P IE at the end of beacon buffer and will result in
+ * beacon corruption if P2P IE is not at end of beacon buffer.
+ */
+ status = lim_strip_ie(mac_ctx, addn_ie, &addn_ielen, SIR_MAC_EID_VENDOR,
+ ONE_BYTE, SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE,
+ ext_p2p_ie, DOT11F_IE_P2PBEACON_MAX_LEN);
+
qdf_mem_copy(&add_ie[0], addn_ie, addn_ielen);
+ if (status == eSIR_SUCCESS && ext_p2p_ie[0] == SIR_MAC_EID_VENDOR &&
+ !qdf_mem_cmp(&ext_p2p_ie[2], SIR_MAC_P2P_OUI,
+ SIR_MAC_P2P_OUI_SIZE)) {
+ qdf_mem_copy(&add_ie[addn_ielen], ext_p2p_ie,
+ ext_p2p_ie[1] + 2);
+ addn_ielen += ext_p2p_ie[1] + 2;
+ }
+
p2p_ie = limGetP2pIEPtr(mac_ctx, &add_ie[0], addn_ielen);
if ((p2p_ie != NULL) && !mac_ctx->beacon_offload) {
/* get NoA attribute stream P2P IE */