瀏覽代碼

qcacld-3.0: Keep bssDescription at the end of tSirSmeJoinReq struct

Move bssDescription to the end of tSirSmeJoinReq since bssDescription
has ieFields at its end which would be corrupted if we dont keep it
at the end of bssDescription. This results in not detecting the IE's
properly after assoc response processing, not setting wpa_rsn flag
in PEER_ASSOC_CMD to fw. The subsequent LFR3 roam if happens in fw
fails because of this.

Keep bssDescription at the end of tSirSmeJoinReq struct and other
structs where bssDescription is used.

Change-Id: I7096f7da0a475b0c63078f3c77fba240a41dfb00
CRs-Fixed: 2058223
Selvaraj, Sridhar 7 年之前
父節點
當前提交
81ab80dfb1

+ 6 - 1
core/mac/inc/sir_api.h

@@ -1197,8 +1197,13 @@ typedef struct sSirSmeJoinReq {
 	tAniBool spectrumMgtIndicator;
 	tSirMacPowerCapInfo powerCap;
 	tSirSupChnl supportedChannels;
-	tSirBssDescription bssDescription;
 	bool enable_bcast_probe_rsp;
+	tSirBssDescription bssDescription;
+	/*
+	 * WARNING: Pls make bssDescription as last variable in struct
+	 * tSirSmeJoinReq as it has ieFields followed after this bss
+	 * description. Adding a variable after this corrupts the ieFields
+	 */
 } tSirSmeJoinReq, *tpSirSmeJoinReq;
 
 /* / Definition for reponse message to previously issued join request */

+ 5 - 0
core/mac/src/pe/include/lim_global.h

@@ -237,6 +237,11 @@ typedef struct sLimMlmJoinReq {
 	tSirMacRateSet operationalRateSet;
 	uint8_t sessionId;
 	tSirBssDescription bssDescription;
+	/*
+	 * WARNING: Pls make bssDescription as last variable in struct
+	 * tLimMlmJoinReq as it has ieFields followed after this bss
+	 * description. Adding a variable after this corrupts the ieFields
+	 */
 } tLimMlmJoinReq, *tpLimMlmJoinReq;
 
 typedef struct sLimMlmScanReq {

+ 6 - 1
core/mac/src/pe/lim/lim_types.h

@@ -210,8 +210,13 @@ typedef struct sLimMlmStartCnf {
 typedef struct sLimMlmScanCnf {
 	tSirResultCodes resultCode;
 	uint16_t scanResultLength;
-	tSirBssDescription bssDescription[1];
 	uint8_t sessionId;
+	tSirBssDescription bssDescription[1];
+	/*
+	 * WARNING: Pls make bssDescription as last variable in struct
+	 * tLimMlmScanCnf as it has ieFields followed after this bss
+	 * description. Adding a variable after this corrupts the ieFields
+	 */
 } tLimMlmScanCnf, *tpLimMlmScanCnf;
 
 typedef struct sLimScanResult {

+ 6 - 3
core/sme/src/csr/csr_inside_api.h

@@ -154,14 +154,17 @@ typedef struct tagCsrScanResult {
 	int32_t AgingCount;     /* This BSS is removed when it reaches 0 or less */
 	uint32_t preferValue;   /* The bigger the number, the better the BSS. This value override capValue */
 	uint32_t capValue;      /* The biggger the better. This value is in use only if we have equal preferValue */
-	/* This member must be the last in the structure because the end of tSirBssDescription (inside) is an */
-	/*    array with nonknown size at this time */
-
 	eCsrEncryptionType ucEncryptionType;    /* Preferred Encryption type that matched with profile. */
 	eCsrEncryptionType mcEncryptionType;
 	eCsrAuthType authType;  /* Preferred auth type that matched with the profile. */
 
 	tCsrScanResultInfo Result;
+	/*
+	 * WARNING - Do not add any element here
+	 * This member Result must be the last in the structure because the end
+	 * of tSirBssDescription (inside) is an array with nonknown size at
+	 * this time.
+	 */
 } tCsrScanResult;
 
 typedef struct {