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
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
12 Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
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);
21 + tsf += le64_to_cpu(avp->tsf_adjust);
23 mutex_unlock(&sc->mutex);
25 @@ -1850,6 +1851,7 @@ static void ath9k_set_tsf(struct ieee802
27 mutex_lock(&sc->mutex);
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);