Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

kernel: Commit

kernel


Commit MetaInfo

Revision4383711c2e6d8ec9ee23fd6bb33972d4914c934d (tree)
Time2018-02-12 13:42:55
Authorlambdadroid <lambdadroid@gmai...>
CommiterChih-Wei Huang

Log Message

ANDROID: brcmfmac: Use monotonic boot time for BSS TSF (v2)

Reverts 8e6cffb3b42f "brmc80211: dont use jiffies for BSS TSF".
v2: Use monotonic boot time instead of jiffies to avoid overflow
after 5 minutes and problems after system goes into suspend.

Android uses the TSF as timestamp when scanning for WiFi networks
and discards scan results entirely if the TSF is before the time
the scan started.

Use the monotonic boot time to avoid discarding all scan results
when using brcmfmac on Android.

Fixes: 8e6cffb3b42f "brmc80211: dont use jiffies for BSS TSF"

Change Summary

Incremental Difference

--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -2780,6 +2780,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
27802780 struct brcmu_chan ch;
27812781 u16 channel;
27822782 u32 freq;
2783+ u64 notify_timestamp;
27832784 u16 notify_capability;
27842785 u16 notify_interval;
27852786 u8 *notify_ie;
@@ -2806,6 +2807,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
28062807 freq = ieee80211_channel_to_frequency(channel, band->band);
28072808 notify_channel = ieee80211_get_channel(wiphy, freq);
28082809
2810+ notify_timestamp = ktime_to_us(ktime_get_boottime());
28092811 notify_capability = le16_to_cpu(bi->capability);
28102812 notify_interval = le16_to_cpu(bi->beacon_period);
28112813 notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
@@ -2817,11 +2819,12 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
28172819 brcmf_dbg(CONN, "Capability: %X\n", notify_capability);
28182820 brcmf_dbg(CONN, "Beacon interval: %d\n", notify_interval);
28192821 brcmf_dbg(CONN, "Signal: %d\n", notify_signal);
2822+ brcmf_dbg(CONN, "Timestamp: %llu\n", notify_timestamp);
28202823
28212824 bss = cfg80211_inform_bss(wiphy, notify_channel,
28222825 CFG80211_BSS_FTYPE_UNKNOWN,
28232826 (const u8 *)bi->BSSID,
2824- 0, notify_capability,
2827+ notify_timestamp, notify_capability,
28252828 notify_interval, notify_ie,
28262829 notify_ielen, notify_signal,
28272830 GFP_KERNEL);
@@ -2879,6 +2882,7 @@ static s32 brcmf_inform_ibss(struct brcmf_cfg80211_info *cfg,
28792882 u8 *buf = NULL;
28802883 s32 err = 0;
28812884 u32 freq;
2885+ u64 notify_timestamp;
28822886 u16 notify_capability;
28832887 u16 notify_interval;
28842888 u8 *notify_ie;
@@ -2916,6 +2920,7 @@ static s32 brcmf_inform_ibss(struct brcmf_cfg80211_info *cfg,
29162920 cfg->channel = freq;
29172921 notify_channel = ieee80211_get_channel(wiphy, freq);
29182922
2923+ notify_timestamp = ktime_to_us(ktime_get_boottime());
29192924 notify_capability = le16_to_cpu(bi->capability);
29202925 notify_interval = le16_to_cpu(bi->beacon_period);
29212926 notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
@@ -2926,9 +2931,10 @@ static s32 brcmf_inform_ibss(struct brcmf_cfg80211_info *cfg,
29262931 brcmf_dbg(CONN, "capability: %X\n", notify_capability);
29272932 brcmf_dbg(CONN, "beacon interval: %d\n", notify_interval);
29282933 brcmf_dbg(CONN, "signal: %d\n", notify_signal);
2934+ brcmf_dbg(CONN, "timestamp: %llu\n", notify_timestamp);
29292935
29302936 bss = cfg80211_inform_bss(wiphy, notify_channel,
2931- CFG80211_BSS_FTYPE_UNKNOWN, bssid, 0,
2937+ CFG80211_BSS_FTYPE_UNKNOWN, bssid, notify_timestamp,
29322938 notify_capability, notify_interval,
29332939 notify_ie, notify_ielen, notify_signal,
29342940 GFP_KERNEL);
Show on old repository browser