diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-11-03 16:10:46 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-11 17:09:04 -0500 |
commit | 30cbd42265546a3efa146d4eb3456165325c83a7 (patch) | |
tree | 4091f40bbba4a83bf383e2e4fc598bf08a059cd3 /drivers/net/wireless/ath/ath9k/hw.c | |
parent | 26ab2645b478fd98aa1d10a07eb07f2235bc1f1c (diff) | |
download | op-kernel-dev-30cbd42265546a3efa146d4eb3456165325c83a7.zip op-kernel-dev-30cbd42265546a3efa146d4eb3456165325c83a7.tar.gz |
ath9k_hw: move ath_extend_tsf() to hw code to share as ath9k_hw_extend_tsf()
This will be shared between ath9k and ath9k_htc.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 111ff04..b25eedf 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -3710,6 +3710,21 @@ void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting) } EXPORT_SYMBOL(ath9k_hw_set_tsfadjust); +/* + * Extend 15-bit time stamp from rx descriptor to + * a full 64-bit TSF using the current h/w TSF. +*/ +u64 ath9k_hw_extend_tsf(struct ath_hw *ah, u32 rstamp) +{ + u64 tsf; + + tsf = ath9k_hw_gettsf64(ah); + if ((tsf & 0x7fff) < rstamp) + tsf -= 0x8000; + return (tsf & ~0x7fff) | rstamp; +} +EXPORT_SYMBOL(ath9k_hw_extend_tsf); + bool ath9k_hw_setslottime(struct ath_hw *ah, u32 us) { if (us < ATH9K_SLOT_TIME_9 || us > ath9k_hw_mac_to_usec(ah, 0xffff)) { |