diff options
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 43 | ||||
| -rw-r--r-- | core/mac/inc/sir_api.h | 2 | ||||
| -rw-r--r-- | core/mac/src/pe/lim/lim_scan_result_utils.c | 4 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_roam.c | 10 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_scan.c | 4 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_inside_api.h | 3 |
6 files changed, 52 insertions, 14 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 58956a41d1cf..4fe4921893e7 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11110,6 +11110,42 @@ 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 /** * wlan_hdd_cfg80211_inform_bss_frame() - inform bss details to NL80211 @@ -11274,9 +11310,10 @@ struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter, (int)(rssi / 100), bss_desc->timeStamp[0]); - 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); pHddCtx->beacon_probe_rsp_cnt_per_scan++; qdf_mem_free(mgmt); return bss_status; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 10807799d9f3..3cff2f2c1ab3 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -715,7 +715,7 @@ typedef struct sSirBssDescription { /* offset of the ieFields from bssId. */ uint16_t length; tSirMacAddr bssId; - unsigned long scanSysTimeMsec; + unsigned long scansystimensec; uint32_t timeStamp[2]; uint16_t beaconInterval; uint16_t capabilityInfo; diff --git a/core/mac/src/pe/lim/lim_scan_result_utils.c b/core/mac/src/pe/lim/lim_scan_result_utils.c index 3cdd1d5d4253..0f04f7a56202 100644 --- a/core/mac/src/pe/lim/lim_scan_result_utils.c +++ b/core/mac/src/pe/lim/lim_scan_result_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -115,7 +115,7 @@ lim_collect_bss_description(tpAniSirGlobal pMac, (uint8_t *) pHdr->bssId, sizeof(tSirMacAddr)); /* Copy Timestamp, Beacon Interval and Capability Info */ - pBssDescr->scanSysTimeMsec = qdf_mc_timer_get_system_time(); + pBssDescr->scansystimensec = qdf_get_monotonic_boottime_ns(); pBssDescr->timeStamp[0] = pBPR->timeStamp[0]; pBssDescr->timeStamp[1] = pBPR->timeStamp[1]; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 85ab487ff898..14f044aa18da 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1970,16 +1970,16 @@ QDF_STATUS csr_roam_read_tsf(tpAniSirGlobal pMac, uint8_t *pTimestamp, { QDF_STATUS status = QDF_STATUS_SUCCESS; tCsrNeighborRoamBSSInfo handoffNode = {{0} }; - uint32_t timer_diff = 0; + uint64_t timer_diff = 0; uint32_t timeStamp[2]; tpSirBssDescription pBssDescription = NULL; csr_neighbor_roam_get_handoff_ap_info(pMac, &handoffNode, sessionId); pBssDescription = handoffNode.pBssDescription; - /* Get the time diff in milli seconds */ - timer_diff = qdf_mc_timer_get_system_time() - - pBssDescription->scanSysTimeMsec; + /* Get the time diff in nano seconds */ + timer_diff = (qdf_get_monotonic_boottime_ns() - + pBssDescription->scansystimensec); /* Convert msec to micro sec timer */ - timer_diff = (uint32_t) (timer_diff * SYSTEM_TIME_MSEC_TO_USEC); + timer_diff = (timer_diff / SYSTEM_TIME_NSEC_TO_USEC); timeStamp[0] = pBssDescription->timeStamp[0]; timeStamp[1] = pBssDescription->timeStamp[1]; update_cckmtsf(&(timeStamp[0]), &(timeStamp[1]), &timer_diff); diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index d814999c4493..73745b5eeba2 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -7314,10 +7314,10 @@ free_mem: #ifdef FEATURE_WLAN_ESE /* Update the TSF with the difference in system time */ void update_cckmtsf(uint32_t *timeStamp0, uint32_t *timeStamp1, - uint32_t *incr) + uint64_t *incr) { uint64_t timeStamp64 = ((uint64_t) *timeStamp1 << 32) | (*timeStamp0); - timeStamp64 = (uint64_t) (timeStamp64 + (uint64_t) *incr); + timeStamp64 = (uint64_t)(timeStamp64 + (*incr)); *timeStamp0 = (uint32_t) (timeStamp64 & 0xffffffff); *timeStamp1 = (uint32_t) ((timeStamp64 >> 32) & 0xffffffff); } diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 0e7624b71891..a76e5d66749b 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -67,6 +67,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 remvoed from */ /* cache scan result */ @@ -1019,7 +1020,7 @@ static inline void csr_release_command_preauth(tpAniSirGlobal mac_ctx, #if defined(FEATURE_WLAN_ESE) void update_cckmtsf(uint32_t *timeStamp0, uint32_t *timeStamp1, - uint32_t *incr); + uint64_t *incr); #endif QDF_STATUS csr_roam_enqueue_preauth(tpAniSirGlobal pMac, uint32_t sessionId, |
