Lines Matching refs:gWifiCacheState
57 static struct chreWifiScanCacheState gWifiCacheState; variable
73 return gWifiCacheState.numWifiEventsPendingRelease == 0; in areAllScanEventsReleased()
82 uint64_t timeNs = gWifiCacheState.event.referenceTime; in paramsMatchScanCache()
95 (gWifiCacheState.event.scanType == CHRE_WIFI_SCAN_TYPE_ACTIVE) || in paramsMatchScanCache()
96 (gWifiCacheState.event.scanType == CHRE_WIFI_SCAN_TYPE_PASSIVE); in paramsMatchScanCache()
98 bool cache_all_freq = (gWifiCacheState.event.scannedFreqListLen == 0); in paramsMatchScanCache()
99 bool cache_all_ssid = (gWifiCacheState.event.ssidSetSize == 0); in paramsMatchScanCache()
107 if (gWifiCacheState.started) { in isWifiScanCacheBusy()
124 gWifiCacheState.event.resultTotal); in chreWifiScanCacheDispatchAll()
125 if (gWifiCacheState.event.resultTotal == 0) { in chreWifiScanCacheDispatchAll()
126 gWifiCacheState.event.eventIndex = 0; in chreWifiScanCacheDispatchAll()
127 gWifiCacheState.event.resultCount = 0; in chreWifiScanCacheDispatchAll()
128 gWifiCacheState.event.results = NULL; in chreWifiScanCacheDispatchAll()
129 gCallbacks->scanEventCallback(&gWifiCacheState.event); in chreWifiScanCacheDispatchAll()
132 for (uint16_t i = 0; i < gWifiCacheState.event.resultTotal; in chreWifiScanCacheDispatchAll()
134 gWifiCacheState.event.resultCount = in chreWifiScanCacheDispatchAll()
136 (uint8_t)(gWifiCacheState.event.resultTotal - i)); in chreWifiScanCacheDispatchAll()
137 gWifiCacheState.event.eventIndex = eventIndex++; in chreWifiScanCacheDispatchAll()
138 gWifiCacheState.event.results = &gWifiCacheState.resultList[i]; in chreWifiScanCacheDispatchAll()
143 gWifiCacheState.numWifiEventsPendingRelease++; in chreWifiScanCacheDispatchAll()
144 gCallbacks->scanEventCallback(&gWifiCacheState.event); in chreWifiScanCacheDispatchAll()
151 for (uint8_t i = 0; i < gWifiCacheState.event.resultTotal; i++) { in isWifiScanResultInCache()
153 &gWifiCacheState.resultList[i]; in isWifiScanResultInCache()
179 memset(&gWifiCacheState, 0, sizeof(gWifiCacheState)); in chreWifiScanCacheInit()
206 memset(&gWifiCacheState, 0, sizeof(gWifiCacheState)); in chreWifiScanCacheScanEventBegin()
208 gWifiCacheState.event.version = CHRE_WIFI_SCAN_EVENT_VERSION; in chreWifiScanCacheScanEventBegin()
209 gWifiCacheState.event.scanType = scanType; in chreWifiScanCacheScanEventBegin()
210 gWifiCacheState.event.ssidSetSize = ssidSetSize; in chreWifiScanCacheScanEventBegin()
215 memcpy(gWifiCacheState.scannedFreqList, scannedFreqList, in chreWifiScanCacheScanEventBegin()
218 gWifiCacheState.event.scannedFreqListLen = scannedFreqListLength; in chreWifiScanCacheScanEventBegin()
219 gWifiCacheState.event.radioChainPref = radioChainPref; in chreWifiScanCacheScanEventBegin()
221 gWifiCacheState.activeScanResult = activeScanResult; in chreWifiScanCacheScanEventBegin()
222 gWifiCacheState.started = true; in chreWifiScanCacheScanEventBegin()
234 if (!gWifiCacheState.started) { in chreWifiScanCacheScanEventAdd()
239 if (!exists && gWifiCacheState.event.resultTotal >= in chreWifiScanCacheScanEventAdd()
242 gWifiCacheState.numWifiScanResultsDropped++; in chreWifiScanCacheScanEventAdd()
246 index = gWifiCacheState.event.resultTotal; in chreWifiScanCacheScanEventAdd()
247 gWifiCacheState.event.resultTotal++; in chreWifiScanCacheScanEventAdd()
250 memcpy(&gWifiCacheState.resultList[index], result, in chreWifiScanCacheScanEventAdd()
254 gWifiCacheState.resultList[index].ageMs = (uint32_t)( in chreWifiScanCacheScanEventAdd()
261 if (gWifiCacheState.started) { in chreWifiScanCacheScanEventEnd()
262 if (gWifiCacheState.numWifiScanResultsDropped > 0) { in chreWifiScanCacheScanEventEnd()
265 gWifiCacheState.numWifiScanResultsDropped); in chreWifiScanCacheScanEventEnd()
267 if (gWifiCacheState.activeScanResult) { in chreWifiScanCacheScanEventEnd()
273 (gWifiCacheState.activeScanResult || gScanMonitoringEnabled)) { in chreWifiScanCacheScanEventEnd()
274 gWifiCacheState.event.referenceTime = gSystemApi->getCurrentTime(); in chreWifiScanCacheScanEventEnd()
275 gWifiCacheState.event.scannedFreqList = gWifiCacheState.scannedFreqList; in chreWifiScanCacheScanEventEnd()
278 gWifiCacheState.event.referenceTime / kOneMillisecondInNanoseconds); in chreWifiScanCacheScanEventEnd()
279 for (uint16_t i = 0; i < gWifiCacheState.event.resultTotal; i++) { in chreWifiScanCacheScanEventEnd()
280 gWifiCacheState.resultList[i].ageMs = in chreWifiScanCacheScanEventEnd()
281 referenceTimeMs - gWifiCacheState.resultList[i].ageMs; in chreWifiScanCacheScanEventEnd()
287 gWifiCacheState.started = false; in chreWifiScanCacheScanEventEnd()
288 gWifiCacheState.activeScanResult = false; in chreWifiScanCacheScanEventEnd()
317 if (event != &gWifiCacheState.event) { in chreWifiScanCacheReleaseScanEvent()
319 } else if (gWifiCacheState.numWifiEventsPendingRelease > 0) { in chreWifiScanCacheReleaseScanEvent()
320 gWifiCacheState.numWifiEventsPendingRelease--; in chreWifiScanCacheReleaseScanEvent()