aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-11-03 19:10:46 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-11 17:09:04 -0500
commit30cbd42265546a3efa146d4eb3456165325c83a7 (patch)
tree4091f40bbba4a83bf383e2e4fc598bf08a059cd3 /drivers
parent26ab2645b478fd98aa1d10a07eb07f2235bc1f1c (diff)
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')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c15
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c16
3 files changed, 17 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 111ff049f75d..b25eedf67e0b 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)
3710} 3710}
3711EXPORT_SYMBOL(ath9k_hw_set_tsfadjust); 3711EXPORT_SYMBOL(ath9k_hw_set_tsfadjust);
3712 3712
3713/*
3714 * Extend 15-bit time stamp from rx descriptor to
3715 * a full 64-bit TSF using the current h/w TSF.
3716*/
3717u64 ath9k_hw_extend_tsf(struct ath_hw *ah, u32 rstamp)
3718{
3719 u64 tsf;
3720
3721 tsf = ath9k_hw_gettsf64(ah);
3722 if ((tsf & 0x7fff) < rstamp)
3723 tsf -= 0x8000;
3724 return (tsf & ~0x7fff) | rstamp;
3725}
3726EXPORT_SYMBOL(ath9k_hw_extend_tsf);
3727
3713bool ath9k_hw_setslottime(struct ath_hw *ah, u32 us) 3728bool ath9k_hw_setslottime(struct ath_hw *ah, u32 us)
3714{ 3729{
3715 if (us < ATH9K_SLOT_TIME_9 || us > ath9k_hw_mac_to_usec(ah, 0xffff)) { 3730 if (us < ATH9K_SLOT_TIME_9 || us > ath9k_hw_mac_to_usec(ah, 0xffff)) {
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index c7b0c4d5f75a..6d3e314c4bea 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -689,6 +689,7 @@ u64 ath9k_hw_gettsf64(struct ath_hw *ah);
689void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64); 689void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64);
690void ath9k_hw_reset_tsf(struct ath_hw *ah); 690void ath9k_hw_reset_tsf(struct ath_hw *ah);
691void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting); 691void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting);
692u64 ath9k_hw_extend_tsf(struct ath_hw *ah, u32 rstamp);
692bool ath9k_hw_setslottime(struct ath_hw *ah, u32 us); 693bool ath9k_hw_setslottime(struct ath_hw *ah, u32 us);
693void ath9k_hw_set11nmac2040(struct ath_hw *ah); 694void ath9k_hw_set11nmac2040(struct ath_hw *ah);
694void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period); 695void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index fd45f775e1f6..b27ea89bbc97 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -87,20 +87,6 @@ static void ath_setdefantenna(struct ath_softc *sc, u32 antenna)
87} 87}
88 88
89/* 89/*
90 * Extend 15-bit time stamp from rx descriptor to
91 * a full 64-bit TSF using the current h/w TSF.
92*/
93static u64 ath_extend_tsf(struct ath_softc *sc, u32 rstamp)
94{
95 u64 tsf;
96
97 tsf = ath9k_hw_gettsf64(sc->sc_ah);
98 if ((tsf & 0x7fff) < rstamp)
99 tsf -= 0x8000;
100 return (tsf & ~0x7fff) | rstamp;
101}
102
103/*
104 * For Decrypt or Demic errors, we only mark packet status here and always push 90 * For Decrypt or Demic errors, we only mark packet status here and always push
105 * up the frame up to let mac80211 handle the actual error case, be it no 91 * up the frame up to let mac80211 handle the actual error case, be it no
106 * decryption key or real decryption error. This let us keep statistics there. 92 * decryption key or real decryption error. This let us keep statistics there.
@@ -223,7 +209,7 @@ static int ath_rx_prepare(struct ieee80211_hw *hw,
223 if (ieee80211_is_beacon(fc)) 209 if (ieee80211_is_beacon(fc))
224 sc->sc_ah->stats.avgbrssi = rx_stats->rs_rssi; 210 sc->sc_ah->stats.avgbrssi = rx_stats->rs_rssi;
225 211
226 rx_status->mactime = ath_extend_tsf(sc, rx_stats->rs_tstamp); 212 rx_status->mactime = ath9k_hw_extend_tsf(sc->sc_ah, rx_stats->rs_tstamp);
227 rx_status->band = hw->conf.channel->band; 213 rx_status->band = hw->conf.channel->band;
228 rx_status->freq = hw->conf.channel->center_freq; 214 rx_status->freq = hw->conf.channel->center_freq;
229 rx_status->noise = sc->ani.noise_floor; 215 rx_status->noise = sc->ani.noise_floor;