mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
1b7e528b2e
commit
f9b604f6c2
|
@ -3840,19 +3840,12 @@ void ath9k_hw_settsf64(struct ath_hw *ah, u64 tsf64)
|
||||||
|
|
||||||
void ath9k_hw_reset_tsf(struct ath_hw *ah)
|
void ath9k_hw_reset_tsf(struct ath_hw *ah)
|
||||||
{
|
{
|
||||||
int count;
|
|
||||||
|
|
||||||
ath9k_ps_wakeup(ah->ah_sc);
|
ath9k_ps_wakeup(ah->ah_sc);
|
||||||
count = 0;
|
if (!ath9k_hw_wait(ah, AR_SLP32_MODE, AR_SLP32_TSF_WRITE_STATUS, 0,
|
||||||
while (REG_READ(ah, AR_SLP32_MODE) & AR_SLP32_TSF_WRITE_STATUS) {
|
AH_TSF_WRITE_TIMEOUT))
|
||||||
count++;
|
DPRINTF(ah->ah_sc, ATH_DBG_RESET,
|
||||||
if (count > 10) {
|
"AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
|
||||||
DPRINTF(ah->ah_sc, ATH_DBG_RESET,
|
|
||||||
"AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
udelay(10);
|
|
||||||
}
|
|
||||||
REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE);
|
REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE);
|
||||||
ath9k_ps_restore(ah->ah_sc);
|
ath9k_ps_restore(ah->ah_sc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,7 @@
|
||||||
|
|
||||||
#define MAX_RATE_POWER 63
|
#define MAX_RATE_POWER 63
|
||||||
#define AH_WAIT_TIMEOUT 100000 /* (us) */
|
#define AH_WAIT_TIMEOUT 100000 /* (us) */
|
||||||
|
#define AH_TSF_WRITE_TIMEOUT 100 /* (us) */
|
||||||
#define AH_TIME_QUANTUM 10
|
#define AH_TIME_QUANTUM 10
|
||||||
#define AR_KEYTABLE_SIZE 128
|
#define AR_KEYTABLE_SIZE 128
|
||||||
#define POWER_UP_TIME 200000
|
#define POWER_UP_TIME 200000
|
||||||
|
|
Loading…
Reference in New Issue