diff options
| author | Deepthi Gowri <c_gowri@qti.qualcomm.com> | 2016-07-05 16:19:02 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-07-29 17:01:35 +0530 |
| commit | cd73d2503ab09e048dcfac509a12822d9ead5f02 (patch) | |
| tree | c6a0f97ee4bd7df692842f4b3107dd39cc9fcc5a | |
| parent | 16047134feace9842865025d0d231105f134162c (diff) | |
qcacld-2.0: Use system time instead of jiffies for BSS received time
prima to qcacld-2.0 propagation
During late suspend jiffies will not be incremented. Because of this
scan results are not age out as the delta of current time and the BSS
received time is not correct.
To address this, use the system time instead of jiffies for the
BSS received time and also make sure to use system time in all
other functions.
CRs-Fixed: 1048047
Change-Id: Ia14b84f1039dc4ffec6ad63550fed21e932f8012
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_scan.c | 4 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 2 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limScanResultUtils.c | 2 | ||||
| -rw-r--r-- | CORE/SME/inc/csrNeighborRoam.h | 2 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiScan.c | 16 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrInsideApi.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrNeighborRoam.c | 9 |
8 files changed, 21 insertions, 17 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 76f9bc67148e..5e82a3c550d7 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -16740,7 +16740,7 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, qie_age->oui_2 = QCOM_OUI2; qie_age->oui_3 = QCOM_OUI3; qie_age->type = QCOM_VENDOR_IE_AGE_TYPE; - qie_age->age = vos_timer_get_system_ticks() - bss_desc->nReceivedTime; + qie_age->age = vos_timer_get_system_time() - bss_desc->nReceivedTime; qie_age->tsf_delta = bss_desc->tsf_delta; #endif diff --git a/CORE/HDD/src/wlan_hdd_scan.c b/CORE/HDD/src/wlan_hdd_scan.c index 83d8871b7a72..5388421ec2de 100644 --- a/CORE/HDD/src/wlan_hdd_scan.c +++ b/CORE/HDD/src/wlan_hdd_scan.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -498,7 +498,7 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu event.cmd = IWEVCUSTOM; p = custom; p += scnprintf(p, MAX_CUSTOM_LEN, " Age: %lu", - vos_timer_get_system_ticks() - descriptor->nReceivedTime); + vos_timer_get_system_time() - descriptor->nReceivedTime); event.u.data.length = p - custom; current_event = iwe_stream_add_point (scanInfo->info,current_event, end, &event, custom); diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index b2f372b9d5a9..2a6ca39bf1fa 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -721,7 +721,7 @@ typedef struct sSirBssDescription //used only in scan case. tANI_U8 channelIdSelf; tANI_U8 sSirBssDescriptionRsvd[3]; - tANI_TIMESTAMP nReceivedTime; //base on a tick count. It is a time stamp, not a relative time. + v_TIME_t nReceivedTime; //base on a tick count. It is a time stamp, not a relative time. #if defined WLAN_FEATURE_VOWIFI tANI_U32 parentTSF; tANI_U32 startTSF[2]; diff --git a/CORE/MAC/src/pe/lim/limScanResultUtils.c b/CORE/MAC/src/pe/lim/limScanResultUtils.c index e482609ef8e7..200423e1d33d 100644 --- a/CORE/MAC/src/pe/lim/limScanResultUtils.c +++ b/CORE/MAC/src/pe/lim/limScanResultUtils.c @@ -240,7 +240,7 @@ limCollectBssDescription(tpAniSirGlobal pMac, //SINR no longer reported by HW pBssDescr->sinr = 0; - pBssDescr->nReceivedTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + pBssDescr->nReceivedTime = vos_timer_get_system_time(); pBssDescr->tsf_delta = WDA_GET_RX_TSF_DELTA(pRxPacketInfo); limLog(pMac, LOG1, diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h index 1de1430f345c..c321b084dbf6 100644 --- a/CORE/SME/inc/csrNeighborRoam.h +++ b/CORE/SME/inc/csrNeighborRoam.h @@ -178,7 +178,7 @@ typedef struct sCsrNeighborRoamControlInfo tANI_U8 currentOpportunisticThresholdDiff; tANI_U8 currentRoamRescanRssiDiff; tANI_BOOLEAN scanRspPending; - tANI_TIMESTAMP scanRequestTimeStamp; + v_TIME_t scanRequestTimeStamp; tDblLinkList roamableAPList; // List of current FT candidates tCsrRoamProfile csrNeighborRoamProfile; #ifdef WLAN_FEATURE_VOWIFI_11R diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index 388b81b79f71..a22c910c75b6 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -3391,9 +3391,8 @@ 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); + v_TIME_t oldest_entry = 0; + v_TIME_t curr_time = vos_timer_get_system_time(); csrLLLock(&mac_ctx->scan.scanResultList); pentry = csrLLPeekHead(&mac_ctx->scan.scanResultList, LL_ACCESS_NOLOCK); @@ -5685,7 +5684,8 @@ tANI_BOOLEAN csrScanAgeOutBss(tpAniSirGlobal pMac, tCsrScanResult *pResult) FL(" Connected BSS, Set Aging Count=%d for BSS "MAC_ADDRESS_STR" "), pResult->AgingCount, MAC_ADDR_ARRAY(pResult->Result.BssDescriptor.bssId)); - pResult->Result.BssDescriptor.nReceivedTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + pResult->Result.BssDescriptor.nReceivedTime = + vos_timer_get_system_time(); return (fRet); } @@ -6887,8 +6887,10 @@ static void csrPurgeScanResultByAge(void *pv) tpAniSirGlobal pMac = PMAC_STRUCT( pv ); tListElem *pEntry, *tmpEntry; tCsrScanResult *pResult; - tANI_TIMESTAMP ageOutTime = pMac->scan.scanResultCfgAgingTime * PAL_TICKS_PER_SECOND; - tANI_TIMESTAMP curTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + v_TIME_t ageOutTime = + (v_TIME_t)(pMac->scan.scanResultCfgAgingTime * SYSTEM_TIME_SEC_TO_MSEC); + v_TIME_t curTime = vos_timer_get_system_time(); + csrLLLock(&pMac->scan.scanResultList); pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_NOLOCK ); @@ -8665,7 +8667,7 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, pBssDescr->timeStamp[1] = pParsedFrame->timeStamp[1]; pBssDescr->capabilityInfo = *((tANI_U16 *)&pParsedFrame->capabilityInfo); vos_mem_copy((tANI_U8 *) &pBssDescr->bssId, (tANI_U8 *) macHeader->bssId, sizeof(tSirMacAddr)); - pBssDescr->nReceivedTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + pBssDescr->nReceivedTime = vos_timer_get_system_time(); smsLog( pMac, LOG2, "(%s):Bssid= "MAC_ADDRESS_STR " chan= %d, rssi = %d", __func__, diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h index 9401f81d9765..b2e78095e430 100644 --- a/CORE/SME/src/csr/csrInsideApi.h +++ b/CORE/SME/src/csr/csrInsideApi.h @@ -73,6 +73,7 @@ #define CSR_MAX_BSS_SUPPORT 512 #define SYSTEM_TIME_MSEC_TO_USEC 1000 +#define SYSTEM_TIME_SEC_TO_MSEC 1000 /* This number minus 1 means the number of times a channel is scanned before a BSS is removed from cache scan result */ diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c index 6fa7ce23476e..5b62068b0faa 100644 --- a/CORE/SME/src/csr/csrNeighborRoam.c +++ b/CORE/SME/src/csr/csrNeighborRoam.c @@ -3972,7 +3972,7 @@ void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) /* We are gonna scan now. Remember the time stamp to filter out results only after this time stamp */ - pNeighborRoamInfo->scanRequestTimeStamp = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + pNeighborRoamInfo->scanRequestTimeStamp = vos_timer_get_system_time(); /* Now ready for neighbor scan based on the channel list created */ status = vos_timer_start(&pNeighborRoamInfo->neighborScanTimer, @@ -4376,7 +4376,8 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac, pNeighborRoamInfo->lookupDOWNRssi, pNeighborRoamInfo->cfgParams.neighborReassocThreshold*(-1)); - pNeighborRoamInfo->scanRequestTimeStamp = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + pNeighborRoamInfo->scanRequestTimeStamp = + vos_timer_get_system_time(); vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); @@ -4566,7 +4567,7 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac, /* We are gonna scan now. Remember the time stamp to filter out results only after this time stamp */ - pNeighborRoamInfo->scanRequestTimeStamp = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + pNeighborRoamInfo->scanRequestTimeStamp = vos_timer_get_system_time(); vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); status = vos_timer_start(&pNeighborRoamInfo->neighborScanTimer, @@ -5609,7 +5610,7 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac, tANI_U8 sessionId) } #endif /* Initialize this with the current tick count */ - pNeighborRoamInfo->scanRequestTimeStamp = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); + pNeighborRoamInfo->scanRequestTimeStamp = vos_timer_get_system_time(); CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT, sessionId) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; |
