ath9k: use timespec64 for tsf_ts
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 Jun 2018 15:11:17 +0000 (17:11 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 29 Jun 2018 11:44:49 +0000 (14:44 +0300)
ath9k is the last remaining user of the deprecated getrawmonotonic()
interface. There is nothing wrong with this usage, but migrating
to a timespec64 based interface lets us clean up the old API.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/channel.c
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/hw.h
drivers/net/wireless/ath/ath9k/main.c

index ef0de4f1312c369ed47dffac19f4681375e1e912..21ba20981a80bfd4b96133c0b0a9ecd6c51f6c41 100644 (file)
@@ -342,7 +342,7 @@ struct ath_chanctx {
 
        struct ath_beacon_config beacon;
        struct ath9k_hw_cal_data caldata;
-       struct timespec tsf_ts;
+       struct timespec64 tsf_ts;
        u64 tsf_val;
        u32 last_beacon;
 
@@ -1021,7 +1021,7 @@ struct ath_softc {
        struct ath_offchannel offchannel;
        struct ath_chanctx *next_chan;
        struct completion go_beacon;
-       struct timespec last_event_time;
+       struct timespec64 last_event_time;
 #endif
 
        unsigned long driver_data;
index 1b05b5d7a03867ecc299f9941dbab3466159e9c9..fd61ae4782b63632c7f8a7ccc9a107e7274bd587 100644 (file)
@@ -233,9 +233,9 @@ static const char *chanctx_state_string(enum ath_chanctx_state state)
 static u32 chanctx_event_delta(struct ath_softc *sc)
 {
        u64 ms;
-       struct timespec ts, *old;
+       struct timespec64 ts, *old;
 
-       getrawmonotonic(&ts);
+       ktime_get_raw_ts64(&ts);
        old = &sc->last_event_time;
        ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
        ms -= old->tv_sec * 1000 + old->tv_nsec / 1000000;
@@ -334,7 +334,7 @@ ath_chanctx_get_next(struct ath_softc *sc, struct ath_chanctx *ctx)
 static void ath_chanctx_adjust_tbtt_delta(struct ath_softc *sc)
 {
        struct ath_chanctx *prev, *cur;
-       struct timespec ts;
+       struct timespec64 ts;
        u32 cur_tsf, prev_tsf, beacon_int;
        s32 offset;
 
@@ -346,7 +346,7 @@ static void ath_chanctx_adjust_tbtt_delta(struct ath_softc *sc)
        if (!prev->switch_after_beacon)
                return;
 
-       getrawmonotonic(&ts);
+       ktime_get_raw_ts64(&ts);
        cur_tsf = (u32) cur->tsf_val +
                  ath9k_hw_get_tsf_offset(&cur->tsf_ts, &ts);
 
@@ -1230,7 +1230,7 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
 {
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
        struct ath_chanctx *old_ctx;
-       struct timespec ts;
+       struct timespec64 ts;
        bool measure_time = false;
        bool send_ps = false;
        bool queues_stopped = false;
@@ -1260,7 +1260,7 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
                spin_unlock_bh(&sc->chan_lock);
 
                if (sc->next_chan == &sc->offchannel.chan) {
-                       getrawmonotonic(&ts);
+                       ktime_get_raw_ts64(&ts);
                        measure_time = true;
                }
 
@@ -1277,7 +1277,7 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
                spin_lock_bh(&sc->chan_lock);
 
                if (sc->cur_chan != &sc->offchannel.chan) {
-                       getrawmonotonic(&sc->cur_chan->tsf_ts);
+                       ktime_get_raw_ts64(&sc->cur_chan->tsf_ts);
                        sc->cur_chan->tsf_val = ath9k_hw_gettsf64(sc->sc_ah);
                }
        }
index e60bea4604e4104dbcc837ddf23ecd890a299e2e..e8e1f785bc5c77ae185ae3a547d50c0f49a242a3 100644 (file)
@@ -1835,13 +1835,13 @@ fail:
        return -EINVAL;
 }
 
-u32 ath9k_hw_get_tsf_offset(struct timespec *last, struct timespec *cur)
+u32 ath9k_hw_get_tsf_offset(struct timespec64 *last, struct timespec64 *cur)
 {
-       struct timespec ts;
+       struct timespec64 ts;
        s64 usec;
 
        if (!cur) {
-               getrawmonotonic(&ts);
+               ktime_get_raw_ts64(&ts);
                cur = &ts;
        }
 
@@ -1859,7 +1859,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
        u32 saveLedState;
        u32 saveDefAntenna;
        u32 macStaId1;
-       struct timespec tsf_ts;
+       struct timespec64 tsf_ts;
        u32 tsf_offset;
        u64 tsf = 0;
        int r;
@@ -1905,7 +1905,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
        macStaId1 = REG_READ(ah, AR_STA_ID1) & AR_STA_ID1_BASE_RATE_11B;
 
        /* Save TSF before chip reset, a cold reset clears it */
-       getrawmonotonic(&tsf_ts);
+       ktime_get_raw_ts64(&tsf_ts);
        tsf = ath9k_hw_gettsf64(ah);
 
        saveLedState = REG_READ(ah, AR_CFG_LED) &
index 9804a24a2dc0949539fb58f8981086b69dad9ff5..68956cdc8c9ae21c0d974466ced9c57b85294ce9 100644 (file)
@@ -1060,7 +1060,7 @@ u32 ath9k_hw_gettsf32(struct ath_hw *ah);
 u64 ath9k_hw_gettsf64(struct ath_hw *ah);
 void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64);
 void ath9k_hw_reset_tsf(struct ath_hw *ah);
-u32 ath9k_hw_get_tsf_offset(struct timespec *last, struct timespec *cur);
+u32 ath9k_hw_get_tsf_offset(struct timespec64 *last, struct timespec64 *cur);
 void ath9k_hw_set_tsfadjust(struct ath_hw *ah, bool set);
 void ath9k_hw_init_global_settings(struct ath_hw *ah);
 u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah);
index 5eb1c0aea41d7d8b5706c8c4be0e881f28fe0954..1049773378f274e2f8c4ccf1050cb58f50858366 100644 (file)
@@ -1865,7 +1865,7 @@ static void ath9k_set_tsf(struct ieee80211_hw *hw,
        mutex_lock(&sc->mutex);
        ath9k_ps_wakeup(sc);
        tsf -= le64_to_cpu(avp->tsf_adjust);
-       getrawmonotonic(&avp->chanctx->tsf_ts);
+       ktime_get_raw_ts64(&avp->chanctx->tsf_ts);
        if (sc->cur_chan == avp->chanctx)
                ath9k_hw_settsf64(sc->sc_ah, tsf);
        avp->chanctx->tsf_val = tsf;
@@ -1881,7 +1881,7 @@ static void ath9k_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
        mutex_lock(&sc->mutex);
 
        ath9k_ps_wakeup(sc);
-       getrawmonotonic(&avp->chanctx->tsf_ts);
+       ktime_get_raw_ts64(&avp->chanctx->tsf_ts);
        if (sc->cur_chan == avp->chanctx)
                ath9k_hw_reset_tsf(sc->sc_ah);
        avp->chanctx->tsf_val = 0;