1 From 9a0a0221024ddb4ddf0e33bb6fdbb3b02eaaf292 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Sat, 20 Jun 2009 23:57:23 +0200
4 Subject: [PATCH] ath9k: make use ath9k_hw_wait int ath9k_hw_reset_tsf
6 We have a dedicated function for this kind of checks, use that
7 instead of duplicating the code.
9 Changes-licensed-under: ISC
10 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
12 drivers/net/wireless/ath/ath9k/hw.c | 17 +++++------------
13 drivers/net/wireless/ath/ath9k/hw.h | 1 +
14 2 files changed, 6 insertions(+), 12 deletions(-)
16 --- a/drivers/net/wireless/ath/ath9k/hw.c
17 +++ b/drivers/net/wireless/ath/ath9k/hw.c
18 @@ -3801,19 +3801,12 @@ void ath9k_hw_settsf64(struct ath_hw *ah
20 void ath9k_hw_reset_tsf(struct ath_hw *ah)
24 ath9k_ps_wakeup(ah->ah_sc);
26 - while (REG_READ(ah, AR_SLP32_MODE) & AR_SLP32_TSF_WRITE_STATUS) {
29 - DPRINTF(ah->ah_sc, ATH_DBG_RESET,
30 - "AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
35 + if (!ath9k_hw_wait(ah, AR_SLP32_MODE, AR_SLP32_TSF_WRITE_STATUS, 0,
36 + AH_TSF_WRITE_TIMEOUT))
37 + DPRINTF(ah->ah_sc, ATH_DBG_RESET,
38 + "AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
40 REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE);
41 ath9k_ps_restore(ah->ah_sc);
43 --- a/drivers/net/wireless/ath/ath9k/hw.h
44 +++ b/drivers/net/wireless/ath/ath9k/hw.h
47 #define MAX_RATE_POWER 63
48 #define AH_WAIT_TIMEOUT 100000 /* (us) */
49 +#define AH_TSF_WRITE_TIMEOUT 100 /* (us) */
50 #define AH_TIME_QUANTUM 10
51 #define AR_KEYTABLE_SIZE 128
52 #define POWER_UP_TIME 200000