diff options
| author | Arunk Khandavalli <akhandav@codeaurora.org> | 2016-10-26 12:27:53 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-11-11 19:50:42 +0530 |
| commit | ec2911393f217392ec31a9481acbfb06afe23dd8 (patch) | |
| tree | 281c57fc80a5b8820013901ed7c928c859e5d78d | |
| parent | ee7906e5c8c1013ddd40fa1710b7c2bfe603d98f (diff) | |
qcacld-2.0: update timestamp of bss while informing frame to kernel
Inform the bss using the new API cfg80211_inform_bss_frame_data() which
also has the ability to inform the timestamp when the frame has
been received.
If the support is not present in the kernel fallback to the legacy
inform bss.
Change-Id: Iaa512248a5e56d77cff39da562e0c9ee4eaeeefd
CRs-Fixed: 1082423
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 43 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 2 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limScanResultUtils.c | 2 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSerDesUtils.c | 4 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 11 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiScan.c | 4 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrInsideApi.h | 3 | ||||
| -rw-r--r-- | CORE/VOSS/inc/vos_api.h | 6 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_api.c | 8 |
9 files changed, 69 insertions, 14 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 62984a6070fa..4695c960680b 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -17125,6 +17125,43 @@ struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_list( return bss; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4 , 3, 0)) || \ + defined (CFG80211_INFORM_BSS_FRAME_DATA) +static struct cfg80211_bss * +wlan_hdd_cfg80211_inform_bss_frame_data(struct wiphy *wiphy, + struct ieee80211_channel *chan, + struct ieee80211_mgmt *mgmt, + size_t frame_len, + int rssi, gfp_t gfp, + uint64_t boottime_ns) +{ + struct cfg80211_bss *bss_status = NULL; + struct cfg80211_inform_bss data = {0}; + + data.chan = chan; + data.boottime_ns = boottime_ns; + data.signal = rssi; + bss_status = cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, + frame_len, gfp); + return bss_status; +} +#else +static struct cfg80211_bss * +wlan_hdd_cfg80211_inform_bss_frame_data(struct wiphy *wiphy, + struct ieee80211_channel *chan, + struct ieee80211_mgmt *mgmt, + size_t frame_len, + int rssi, gfp_t gfp, + uint64_t boottime_ns) +{ + struct cfg80211_bss *bss_status = NULL; + + bss_status = cfg80211_inform_bss_frame(wiphy, chan, mgmt, frame_len, + rssi, gfp); + return bss_status; +} +#endif + /* * FUNCTION: wlan_hdd_cfg80211_inform_bss_frame * This function is used to inform the BSS details to nl80211 interface. @@ -17286,8 +17323,10 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, MAC_ADDR_ARRAY(mgmt->bssid), vos_freq_to_chan(chan->center_freq),(int)(rssi/100)); - bss_status = cfg80211_inform_bss_frame(wiphy, chan, mgmt, frame_len, rssi, - GFP_KERNEL); + bss_status = wlan_hdd_cfg80211_inform_bss_frame_data(wiphy, chan, mgmt, + frame_len, rssi, + GFP_KERNEL, + bss_desc->scansystimensec); kfree(mgmt); return bss_status; } diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index fcc86e61115e..0017b1532391 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -715,7 +715,7 @@ typedef struct sSirBssDescription //offset of the ieFields from bssId. tANI_U16 length; tSirMacAddr bssId; - v_TIME_t scanSysTimeMsec; + v_TIME_t scansystimensec; tANI_U32 timeStamp[2]; tANI_U16 beaconInterval; tANI_U16 capabilityInfo; diff --git a/CORE/MAC/src/pe/lim/limScanResultUtils.c b/CORE/MAC/src/pe/lim/limScanResultUtils.c index 772f2ed4dd0a..195463e76bf4 100644 --- a/CORE/MAC/src/pe/lim/limScanResultUtils.c +++ b/CORE/MAC/src/pe/lim/limScanResultUtils.c @@ -179,7 +179,7 @@ limCollectBssDescription(tpAniSirGlobal pMac, sizeof(tSirMacAddr)); // Copy Timestamp, Beacon Interval and Capability Info - pBssDescr->scanSysTimeMsec = vos_timer_get_system_time(); + pBssDescr->scansystimensec = vos_get_monotonic_boottime_ns(); pBssDescr->timeStamp[0] = pBPR->timeStamp[0]; pBssDescr->timeStamp[1] = pBPR->timeStamp[1]; diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c index c911c50d0f3f..ff4d68f8d7b3 100644 --- a/CORE/MAC/src/pe/lim/limSerDesUtils.c +++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c @@ -126,8 +126,8 @@ limGetBssDescription( tpAniSirGlobal pMac, tSirBssDescription *pBssDescription, return eSIR_FAILURE; // Extract timer - vos_mem_copy( (tANI_U8 *) (&pBssDescription->scanSysTimeMsec), - pBuf, sizeof(v_TIME_t)); + vos_mem_copy( (tANI_U8 *) (&pBssDescription->scansystimensec), + pBuf, sizeof(v_TIME_t)); pBuf += sizeof(v_TIME_t); len -= sizeof(v_TIME_t); if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE) diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index 86dc496f1867..8279eb9eae68 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -19382,7 +19382,7 @@ eHalStatus csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp, tANI_U8 sessionId) { tCsrNeighborRoamBSSInfo handoffNode = {{0}}; - tANI_U32 timer_diff = 0; + uint64_t timer_diff = 0; tANI_U32 timeStamp[2]; tpSirBssDescription pBssDescription = NULL; @@ -19391,10 +19391,11 @@ eHalStatus csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp, return eHAL_STATUS_FAILURE; } pBssDescription = handoffNode.pBssDescription; - // Get the time diff in milli seconds - timer_diff = vos_timer_get_system_time() - pBssDescription->scanSysTimeMsec; - // Convert msec to micro sec timer - timer_diff = (tANI_U32)(timer_diff * SYSTEM_TIME_MSEC_TO_USEC); + // Get the time diff in nano seconds + timer_diff = (vos_get_monotonic_boottime_ns() - + pBssDescription->scansystimensec); + // Convert nano to micro sec timer + timer_diff = (timer_diff / SYSTEM_TIME_NSEC_TO_USEC); timeStamp[0] = pBssDescription->timeStamp[0]; timeStamp[1] = pBssDescription->timeStamp[1]; UpdateCCKMTSF(&(timeStamp[0]), &(timeStamp[1]), &timer_diff); diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index 400f96db1561..a1dfb33aafd5 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -8940,10 +8940,10 @@ eHalStatus csrScanCreateEntryInScanCache(tpAniSirGlobal pMac, tANI_U32 sessionId #ifdef FEATURE_WLAN_ESE // Update the TSF with the difference in system time -void UpdateCCKMTSF(tANI_U32 *timeStamp0, tANI_U32 *timeStamp1, tANI_U32 *incr) +void UpdateCCKMTSF(tANI_U32 *timeStamp0, tANI_U32 *timeStamp1, uint64_t *incr) { tANI_U64 timeStamp64 = ((tANI_U64)*timeStamp1 << 32) | (*timeStamp0); - timeStamp64 = (tANI_U64)(timeStamp64 + (tANI_U64)*incr); + timeStamp64 = (tANI_U64)(timeStamp64 + (*incr)); *timeStamp0 = (tANI_U32)(timeStamp64 & 0xffffffff); *timeStamp1 = (tANI_U32)((timeStamp64 >> 32) & 0xffffffff); } diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h index b2e78095e430..570c4a62d64c 100644 --- a/CORE/SME/src/csr/csrInsideApi.h +++ b/CORE/SME/src/csr/csrInsideApi.h @@ -74,6 +74,7 @@ #define CSR_MAX_BSS_SUPPORT 512 #define SYSTEM_TIME_MSEC_TO_USEC 1000 #define SYSTEM_TIME_SEC_TO_MSEC 1000 +#define SYSTEM_TIME_NSEC_TO_USEC 1000 /* This number minus 1 means the number of times a channel is scanned before a BSS is removed from cache scan result */ @@ -1034,7 +1035,7 @@ void csrEseSendAdjacentApRepMsg(tpAniSirGlobal pMac, tCsrRoamSession *pSession); #endif #if defined(FEATURE_WLAN_ESE) -void UpdateCCKMTSF(tANI_U32 *timeStamp0, tANI_U32 *timeStamp1, tANI_U32 *incr); +void UpdateCCKMTSF(tANI_U32 *timeStamp0, tANI_U32 *timeStamp1, uint64_t *incr); #endif eHalStatus csrGetDefaultCountryCodeFrmNv(tpAniSirGlobal pMac, tANI_U8 *pCountry); diff --git a/CORE/VOSS/inc/vos_api.h b/CORE/VOSS/inc/vos_api.h index 77e146c4f210..624289638d43 100644 --- a/CORE/VOSS/inc/vos_api.h +++ b/CORE/VOSS/inc/vos_api.h @@ -341,6 +341,12 @@ v_BOOL_t vos_is_packet_log_enabled(void); v_U64_t vos_get_monotonic_boottime(void); +/** + * vos_get_monotonic_boottime_ns - Get kenel boottime in ns + * + * Return: kernel boottime in nano sec + */ +v_U64_t vos_get_monotonic_boottime_ns(void); void vos_trigger_recovery(bool); #ifdef FEATURE_WLAN_D0WOW diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index eb4b20f1f0e8..156393185407 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -3074,3 +3074,11 @@ void vos_svc_fw_shutdown_ind(struct device *dev) { hdd_svc_fw_shutdown_ind(dev); } + +v_U64_t vos_get_monotonic_boottime_ns(void) +{ + struct timespec ts; + + ktime_get_ts(&ts); + return timespec_to_ns(&ts); +} |
