aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-06-20 18:02:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:26 -0400
commitf9b604f6c24ad161e9c9e30a138d5899724225c8 (patch)
treec8fcd6b608911370a63a0c461dc7157ae6202b2c
parent1b7e528b2e39bfed37228eedaaf0665196d8ddc9 (diff)
ath9k: make use ath9k_hw_wait int ath9k_hw_reset_tsf
We have a dedicated function for this kind of checks, use that instead of duplicating the code. Changes-licensed-under: ISC Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 98537698be22..605803ae9ed8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -3840,19 +3840,12 @@ void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64)
3840 3840
3841void ath9k_hw_reset_tsf(struct ath_hw *ah) 3841void ath9k_hw_reset_tsf(struct ath_hw *ah)
3842{ 3842{
3843 int count;
3844
3845 ath9k_ps_wakeup(ah->ah_sc); 3843 ath9k_ps_wakeup(ah->ah_sc);
3846 count = 0; 3844 if (!ath9k_hw_wait(ah, AR_SLP32_MODE, AR_SLP32_TSF_WRITE_STATUS, 0,
3847 while (REG_READ(ah, AR_SLP32_MODE) & AR_SLP32_TSF_WRITE_STATUS) { 3845 AH_TSF_WRITE_TIMEOUT))
3848 count++; 3846 DPRINTF(ah->ah_sc, ATH_DBG_RESET,
3849 if (count > 10) { 3847 "AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
3850 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 3848
3851 "AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
3852 break;
3853 }
3854 udelay(10);
3855 }
3856 REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE); 3849 REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE);
3857 ath9k_ps_restore(ah->ah_sc); 3850 ath9k_ps_restore(ah->ah_sc);
3858} 3851}
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 9a4570d7ecbe..28bffdb365a2 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -95,6 +95,7 @@
95 95
96#define MAX_RATE_POWER 63 96#define MAX_RATE_POWER 63
97#define AH_WAIT_TIMEOUT 100000 /* (us) */ 97#define AH_WAIT_TIMEOUT 100000 /* (us) */
98#define AH_TSF_WRITE_TIMEOUT 100 /* (us) */
98#define AH_TIME_QUANTUM 10 99#define AH_TIME_QUANTUM 10
99#define AR_KEYTABLE_SIZE 128 100#define AR_KEYTABLE_SIZE 128
100#define POWER_UP_TIME 200000 101#define POWER_UP_TIME 200000