Parcourir la source

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
Yeshwanth Sriram Guntuka il y a 7 ans
Parent
commit
77dd515056
1 fichiers modifiés avec 21 ajouts et 1 suppressions
  1. 21 1
      core/mac/src/pe/sch/sch_beacon_gen.c

+ 21 - 1
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.
  *
@@ -105,6 +105,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 &&
@@ -113,8 +114,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 = (uint8_t *)limGetP2pIEPtr(mac_ctx, &add_ie[0], addn_ielen);
 	if ((p2p_ie != NULL) && !mac_ctx->beacon_offload) {
 		/* get NoA attribute stream P2P IE */