summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepthi Gowri <c_gowri@qti.qualcomm.com>2016-03-17 12:26:27 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-03-18 16:05:38 +0530
commitcd0f622b0e134ef3948a5a3a8967eb2d5ef4c58a (patch)
tree3588cff99baaa99e096d6265ba47453e9c209d56
parent6fe0a858d3e489c44daae57fe103cad182a25065 (diff)
qcacld-2.0: Purge old scan entries if max BSS limit reached
In the driver, while processing the scan results, if the max BSS limit is reached, all the newest scan results are dropped and stale scan results are updated to upper layers. To address this, remove the oldest scan entry if the max BSS limit is reached. Change-Id: Ib85a8a3b66fbf903311002887a3c5c3d10bfbccf CRs-Fixed: 991417
-rw-r--r--CORE/SME/src/csr/csrApiScan.c65
-rw-r--r--CORE/SME/src/csr/csrInsideApi.h2
2 files changed, 55 insertions, 12 deletions
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index c6847d919546..d6d97eb79502 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -111,6 +111,7 @@ eHalStatus csrSetBGScanChannelList( tpAniSirGlobal pMac, tANI_U8 *pAdjustChannel
void csrReleaseCmdSingle(tpAniSirGlobal pMac, tSmeCmd *pCommand);
tANI_BOOLEAN csrRoamIsValidChannel( tpAniSirGlobal pMac, tANI_U8 channel );
void csrPruneChannelListForMode( tpAniSirGlobal pMac, tCsrChannel *pChannelList );
+void csr_purge_old_scan_results(tpAniSirGlobal mac_ctx);
#define CSR_IS_SOCIAL_CHANNEL(channel) (((channel) == 1) || ((channel) == 6) || ((channel) == 11) )
@@ -3285,16 +3286,8 @@ static void csrMoveTempScanResultsToMainList(tpAniSirGlobal pMac,
#endif
)
{
- //Limit reach
- smsLog(pMac, LOGW, FL(" BSS limit reached"));
- //Free the resources
- if( (pBssDescription->Result.pvIes == NULL) && pIesLocal )
- {
- vos_mem_free(pIesLocal);
- }
- csrFreeScanResultEntry(pMac, pBssDescription);
- //Continue because there may be duplicated BSS
- continue;
+ smsLog(pMac, LOG1, FL("########## BSS Limit reached ###########"));
+ csr_purge_old_scan_results(pMac);
}
// check for duplicate scan results
if ( !fDupBss )
@@ -3401,6 +3394,53 @@ end:
return;
}
+/**
+ * csr_purge_old_scan_results() - This function removes old scan entries
+ * @mac_ctx: pointer to Global MAC structure
+ *
+ * This function removes old scan entries
+ *
+ * Return: None
+ */
+
+void csr_purge_old_scan_results(tpAniSirGlobal mac_ctx)
+{
+ tListElem *pentry, *tmp_entry;
+ tCsrScanResult *presult, *oldest_bss = NULL;
+ tANI_TIMESTAMP oldest_entry = 0;
+ tANI_TIMESTAMP curr_time =
+ (tANI_TIMESTAMP)palGetTickCount(mac_ctx->hHdd);
+
+ csrLLLock(&mac_ctx->scan.scanResultList);
+ pentry = csrLLPeekHead(&mac_ctx->scan.scanResultList, LL_ACCESS_NOLOCK);
+ while(pentry)
+ {
+ tmp_entry = csrLLNext(&mac_ctx->scan.scanResultList, pentry,
+ LL_ACCESS_NOLOCK);
+ presult = GET_BASE_ADDR(pentry, tCsrScanResult, Link);
+ if((curr_time - presult->Result.BssDescriptor.nReceivedTime) >
+ oldest_entry) {
+ oldest_entry = curr_time -
+ presult->Result.BssDescriptor.nReceivedTime;
+ oldest_bss = presult;
+ }
+ pentry = tmp_entry;
+ }
+ if (oldest_bss) {
+ /* Free the old BSS Entries */
+ if(csrLLRemoveEntry(&mac_ctx->scan.scanResultList,
+ &oldest_bss->Link, LL_ACCESS_NOLOCK)) {
+ smsLog(mac_ctx, LOG1,
+ FL("Current time delta (%d) of BSSID to be removed" MAC_ADDRESS_STR),
+ (curr_time -
+ oldest_bss->Result.BssDescriptor.nReceivedTime),
+ MAC_ADDR_ARRAY(
+ oldest_bss->Result.BssDescriptor.bssId));
+ csrFreeScanResultEntry(mac_ctx, oldest_bss);
+ }
+ }
+ csrLLUnlock(&mac_ctx->scan.scanResultList);
+}
static tCsrScanResult *
csrScanSaveBssDescription(tpAniSirGlobal pMac,
@@ -6823,14 +6863,17 @@ static void csrScanResultCfgAgingTimerHandler(void *pv)
csrLLLock(&pMac->scan.scanResultList);
pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_NOLOCK );
+ smsLog(pMac, LOG1, FL(" Ageout time=%d"),ageOutTime);
while( pEntry )
{
tmpEntry = csrLLNext(&pMac->scan.scanResultList, pEntry,
LL_ACCESS_NOLOCK);
pResult = GET_BASE_ADDR( pEntry, tCsrScanResult, Link );
+
if((curTime - pResult->Result.BssDescriptor.nReceivedTime) > ageOutTime)
{
- smsLog(pMac, LOGW, " age out due to time out");
+ smsLog(pMac, LOG1, FL("age out due to time out for BSSID" MAC_ADDRESS_STR),
+ MAC_ADDR_ARRAY(pResult->Result.BssDescriptor.bssId));
csrScanAgeOutBss(pMac, pResult);
}
pEntry = tmpEntry;
diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h
index 9cf60d4a105c..f42fca4f31a9 100644
--- a/CORE/SME/src/csr/csrInsideApi.h
+++ b/CORE/SME/src/csr/csrInsideApi.h
@@ -71,7 +71,7 @@
#define CSR_MAX_2_4_GHZ_SUPPORTED_CHANNELS 14
-#define CSR_MAX_BSS_SUPPORT 250
+#define CSR_MAX_BSS_SUPPORT 512
#define SYSTEM_TIME_MSEC_TO_USEC 1000
/* This number minus 1 means the number of times a channel is scanned