diff options
| author | Chandrasekaran, Manishekar <cmshekar@qti.qualcomm.com> | 2014-03-21 11:42:46 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-03-24 15:36:25 -0700 |
| commit | 2bb543af2d477c5006817e6357763a89f09a239a (patch) | |
| tree | d75218169569e7428472358fbd070b9fad43e7d4 | |
| parent | 763bcf6ec341bf3f9d50ded2c0e31566b1638a80 (diff) | |
qcacld: Flush p2p results in LIM cache before starting scan
Stale entries exist in LIM cache and these are being passed
on to SME. This results in the supplicant choosing invalid
parameters from the stale entries to send action packets.
This fix will clear only the p2p scan results before scan.
Change-Id: Ie50a4b4bdd6ff27940fb4cf81fd531db21289788
CRs-Fixed: 634775
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 6 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limScanResultUtils.c | 70 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limScanResultUtils.h | 1 |
3 files changed, 77 insertions, 0 deletions
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 011624c7be52..31bd56c11ea4 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -1268,6 +1268,9 @@ __limProcessSmeScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) */ if (__limFreshScanReqd(pMac, pScanReq->returnFreshResults)) { + if (pMac->fScanOffload) + limFlushp2pScanResults(pMac); + if (pScanReq->returnFreshResults & SIR_BG_SCAN_PURGE_RESUTLS) { // Discard previously cached scan results @@ -1496,6 +1499,9 @@ __limProcessSmeScanReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } #endif + if (pMac->fScanOffload) + limFlushp2pScanResults(pMac); + if (pScanReq->returnFreshResults & SIR_BG_SCAN_PURGE_RESUTLS) { // Discard previously cached scan results diff --git a/CORE/MAC/src/pe/lim/limScanResultUtils.c b/CORE/MAC/src/pe/lim/limScanResultUtils.c index bf5c4e68525a..fa381d93e81f 100644 --- a/CORE/MAC/src/pe/lim/limScanResultUtils.c +++ b/CORE/MAC/src/pe/lim/limScanResultUtils.c @@ -1193,7 +1193,77 @@ limDeleteCachedScanResults(tpAniSirGlobal pMac) pMac->lim.gLimSmeScanResultLength = 0; } /****** end limDeleteCachedScanResults() ******/ +/** + * limFlushp2pScanResults() + * + *FUNCTION: + * This function is called before scan to flush the + * the p2p scan entries from LIM + * + *LOGIC: + * + *ASSUMPTIONS: + * NA + * + *NOTE: + * NA + * + * @param pMac - Pointer to Global MAC structure + * @return None + */ + +void +limFlushp2pScanResults(tpAniSirGlobal pMac) +{ + tLimScanResultNode *pNode, *pNextNode, *pPrev, *pHead, *pTemp; + tANI_U16 i; + tANI_U8 *pSsidStr; + tSirMacSSid *pSsid; + for (i = 0; i < LIM_MAX_NUM_OF_SCAN_RESULTS; i++) + { + if ((pNode = pMac->lim.gLimCachedScanHashTable[i]) != NULL) + { + pPrev = pNode; + pHead = pNode; + while (pNode) + { + pSsid = (tSirMacSSid *)((tANI_U8 *)&pNode->bssDescription.ieFields + 1); + pSsidStr = pSsid->ssId; + if (vos_mem_compare(pSsidStr, "DIRECT-", 7)) + { + if (pNode == pHead) + { + pTemp = pNode; + pNode = pNode->next; + pMac->lim.gLimSmeScanResultLength -= + (pTemp->bssDescription.length + + sizeof(pTemp->bssDescription.length)); + pPrev = pNode; + pHead = pNode; + vos_mem_free(pTemp); + pMac->lim.gLimCachedScanHashTable[i]= pHead; + } + else + { + pNextNode = pNode->next; + pMac->lim.gLimSmeScanResultLength -= + (pNode->bssDescription.length + + sizeof(pNode->bssDescription.length)); + vos_mem_free(pNode); + pPrev->next = pNextNode; + pNode = pNextNode; + } + } + else + { + pPrev = pNode; + pNode = pNode->next; + } + } + } + } +} /****** end limFlushp2pScanResults() ******/ /** * limReInitScanResults() diff --git a/CORE/MAC/src/pe/lim/limScanResultUtils.h b/CORE/MAC/src/pe/lim/limScanResultUtils.h index 090dc29b9c60..7f04c94a49fc 100644 --- a/CORE/MAC/src/pe/lim/limScanResultUtils.h +++ b/CORE/MAC/src/pe/lim/limScanResultUtils.h @@ -46,6 +46,7 @@ void limInitHashTable(tpAniSirGlobal); eHalStatus limLookupNaddHashEntry(tpAniSirGlobal, tLimScanResultNode *, tANI_U8, tANI_U8); void limDeleteHashEntry(tLimScanResultNode *); +void limFlushp2pScanResults(tpAniSirGlobal); void limDeleteCachedScanResults(tpAniSirGlobal); void limRestorePreScanState(tpAniSirGlobal); void limCopyScanResult(tpAniSirGlobal, tANI_U8 *); |
