]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.128/wlcore-set-rx_status-boottime_ns-field-on-rx.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.9.128 / wlcore-set-rx_status-boottime_ns-field-on-rx.patch
1 From foo@baz Mon Sep 17 12:22:41 CEST 2018
2 From: Loic Poulain <loic.poulain@linaro.org>
3 Date: Fri, 27 Jul 2018 18:30:23 +0200
4 Subject: wlcore: Set rx_status boottime_ns field on rx
5
6 From: Loic Poulain <loic.poulain@linaro.org>
7
8 [ Upstream commit 37a634f60fd6dfbda2c312657eec7ef0750546e7 ]
9
10 When receiving a beacon or probe response, we should update the
11 boottime_ns field which is the timestamp the frame was received at.
12 (cf mac80211.h)
13
14 This fixes a scanning issue with Android since it relies on this
15 timestamp to determine when the AP has been seen for the last time
16 (via the nl80211 BSS_LAST_SEEN_BOOTTIME parameter).
17
18 Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
19 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
20 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 drivers/net/wireless/ti/wlcore/rx.c | 8 ++++++--
24 1 file changed, 6 insertions(+), 2 deletions(-)
25
26 --- a/drivers/net/wireless/ti/wlcore/rx.c
27 +++ b/drivers/net/wireless/ti/wlcore/rx.c
28 @@ -59,7 +59,7 @@ static u32 wlcore_rx_get_align_buf_size(
29 static void wl1271_rx_status(struct wl1271 *wl,
30 struct wl1271_rx_descriptor *desc,
31 struct ieee80211_rx_status *status,
32 - u8 beacon)
33 + u8 beacon, u8 probe_rsp)
34 {
35 memset(status, 0, sizeof(struct ieee80211_rx_status));
36
37 @@ -106,6 +106,9 @@ static void wl1271_rx_status(struct wl12
38 }
39 }
40
41 + if (beacon || probe_rsp)
42 + status->boottime_ns = ktime_get_boot_ns();
43 +
44 if (beacon)
45 wlcore_set_pending_regdomain_ch(wl, (u16)desc->channel,
46 status->band);
47 @@ -194,7 +197,8 @@ static int wl1271_rx_handle_data(struct
48 if (ieee80211_is_data_present(hdr->frame_control))
49 is_data = 1;
50
51 - wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon);
52 + wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon,
53 + ieee80211_is_probe_resp(hdr->frame_control));
54 wlcore_hw_set_rx_csum(wl, desc, skb);
55
56 seq_num = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;