Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k: Clear TSF2 properly

Chips in the AR9003 family have a second TSF, which
needs to be cleared when putting the card to
sleep.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Sujith Manoharan and committed by
Kalle Valo
23ee7c33 b6f68b1e

+11
+9
drivers/net/wireless/ath/ath9k/ar9003_wow.c
··· 35 35 return; 36 36 } 37 37 38 + if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { 39 + if (!REG_READ(ah, AR_MAC_PCU_GEN_TIMER_TSF_SEL)) 40 + REG_CLR_BIT(ah, AR_DIRECT_CONNECT, AR_DC_TSF2_ENABLE); 41 + } else if (AR_SREV_9485(ah)){ 42 + if (!(REG_READ(ah, AR_NDP2_TIMER_MODE) & 43 + AR_GEN_TIMERS2_MODE_ENABLE_MASK)) 44 + REG_CLR_BIT(ah, AR_DIRECT_CONNECT, AR_DC_TSF2_ENABLE); 45 + } 46 + 38 47 REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_ON_INT); 39 48 } 40 49
+2
drivers/net/wireless/ath/ath9k/reg.h
··· 1883 1883 #define AR_FIRST_NDP_TIMER 7 1884 1884 #define AR_NDP2_PERIOD 0x81a0 1885 1885 #define AR_NDP2_TIMER_MODE 0x81c0 1886 + #define AR_GEN_TIMERS2_MODE_ENABLE_MASK 0x000000FF 1886 1887 1887 1888 #define AR_GEN_TIMERS(_i) (0x8200 + ((_i) << 2)) 1888 1889 #define AR_NEXT_TBTT_TIMER AR_GEN_TIMERS(0) ··· 1979 1978 1980 1979 #define AR_DIRECT_CONNECT 0x83a0 1981 1980 #define AR_DC_AP_STA_EN 0x00000001 1981 + #define AR_DC_TSF2_ENABLE 0x00000001 1982 1982 1983 1983 #define AR_AES_MUTE_MASK0 0x805c 1984 1984 #define AR_AES_MUTE_MASK0_FC 0x0000FFFF