summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornadlabak <pavel@doshaska.net>2016-04-28 00:20:28 +0200
committerMichael Gernoth <michael@gernoth.net>2016-07-21 01:05:22 -0700
commitcf2fc758751add0553b9b8ad91232755c186e562 (patch)
treeca2de3d791221f2731c1fe470f2d09565fd77604
parent0d6fc9dc0513a9b2071780ad882d8bb70905f410 (diff)
downloadandroid_hardware_ti_wlan-cm-14.0.tar.gz
android_hardware_ti_wlan-cm-14.0.tar.bz2
android_hardware_ti_wlan-cm-14.0.zip
wlan:(backport) Fix scan timestamps to android expectationsstable/cm-13.0-ZNH5Ycm-14.0
Marshmallow started to use timestamps in visibility decisions. If the actual frame timestamp is used, getVisibility in ScanDetailCache can report a long lost AP as still visible, preventing the switch to an actually currently available AP. This fixes the automatic re-connection to an AP, when moving between different places with different remembered APs. Change-Id: I1805e4da120c41479f5d8870b2bf4e69baa9f355
-rw-r--r--mac80211/compat_wl12xx/net/wireless/scan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mac80211/compat_wl12xx/net/wireless/scan.c b/mac80211/compat_wl12xx/net/wireless/scan.c
index f8e36d34..860700ae 100644
--- a/mac80211/compat_wl12xx/net/wireless/scan.c
+++ b/mac80211/compat_wl12xx/net/wireless/scan.c
@@ -861,6 +861,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
size_t ielen = len - offsetof(struct ieee80211_mgmt,
u.probe_resp.variable);
size_t privsz;
+ struct timespec ts;
if (WARN_ON(!mgmt))
return NULL;
@@ -884,7 +885,10 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
memcpy(res->pub.bssid, mgmt->bssid, ETH_ALEN);
res->pub.channel = channel;
res->pub.signal = signal;
- res->pub.tsf = le64_to_cpu(mgmt->u.probe_resp.timestamp);
+ /* Android does not want the timestamp from the frame.
+ Instead it wants a monotonic increasing value */
+ get_monotonic_boottime(&ts);
+ res->pub.tsf = ((u64)ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
res->pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int);
res->pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info);
INIT_LIST_HEAD(&res->list_aliases);