c95ab7e644c4c932b619ae9b09a16a91347fc8da
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 315-ath9k-Expose-tsf_adjustment-in-mac80211-tsf-getters-.patch
1 From: Benjamin Berg <benjamin.berg@open-mesh.com>
2 Date: Mon, 4 Jul 2016 14:37:23 +0200
3 Subject: [PATCH] ath9k: Expose tsf_adjustment in mac80211 tsf getters and
4 setters.
5
6 The ath9k driver modifies the TSF for VIFs for the purpose of sending
7 beacons in a staggered fashion. This patch exposes this VIF specific
8 adjustment of the TSF value to mac80211. Without the change the TSF
9 routines handle the hardware TSF value instead of the actual TSF value as
10 seen on the air.
11
12 Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
13 ---
14
15 --- a/drivers/net/wireless/ath/ath9k/main.c
16 +++ b/drivers/net/wireless/ath/ath9k/main.c
17 @@ -1835,6 +1835,7 @@ static u64 ath9k_get_tsf(struct ieee8021
18 tsf = sc->cur_chan->tsf_val +
19 ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL);
20 }
21 + tsf += le64_to_cpu(avp->tsf_adjust);
22 ath9k_ps_restore(sc);
23 mutex_unlock(&sc->mutex);
24
25 @@ -1850,6 +1851,7 @@ static void ath9k_set_tsf(struct ieee802
26
27 mutex_lock(&sc->mutex);
28 ath9k_ps_wakeup(sc);
29 + tsf -= le64_to_cpu(avp->tsf_adjust);
30 getrawmonotonic(&avp->chanctx->tsf_ts);
31 if (sc->cur_chan == avp->chanctx)
32 ath9k_hw_settsf64(sc->sc_ah, tsf);