From 81ab80dfb1090efef7c7febd0362bbf2fa5c8db0 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Thu, 8 Jun 2017 12:21:39 +0530 Subject: [PATCH] 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 --- core/mac/inc/sir_api.h | 7 ++++++- core/mac/src/pe/include/lim_global.h | 5 +++++ core/mac/src/pe/lim/lim_types.h | 7 ++++++- core/sme/src/csr/csr_inside_api.h | 9 ++++++--- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index e43e1e0fe31d..2f7c0d6cee14 100644 --- a/core/mac/inc/sir_api.h +++ b/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 */ diff --git a/core/mac/src/pe/include/lim_global.h b/core/mac/src/pe/include/lim_global.h index 6672d6eb6a65..014ee6ae9856 100644 --- a/core/mac/src/pe/include/lim_global.h +++ b/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 { diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 2435b71d33bc..9c50a84d4a9f 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/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 { diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 7bb95b12cd6b..e2c23282c836 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/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 {