ath9k: Fix NF calibration for single stream cards
PATCH 1/3 ath9k: Fix NF calibration for single stream cards
From: Sujith Manoharan <[email protected]>
Rather than using the chip ID to read only chain-0 CCA registers and avoid reading chain-1, use the RX chainmask instead. There are some 1-stream PCI devices based on AR9287 such as TL-WN751ND. Improper NF calibration might result in DMA errors/timeouts.
--- drivers/net/wireless/ath/ath9k/ar9002_phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9002_phy.c +1 -1
@@ -485,7 +485,7 @@ static void ar9002_hw_do_getnf(struct ath_hw *ah,if (IS_CHAN_HT40 (ah->curchan)) nfarray[3 ] =sign_extend32 (nf,8 ); -if (AR_SREV_9285 (ah) ||AR_SREV_9271 (ah)) +if (!(ah->rxchainmask &BIT (1 )))return ; nf =MS (REG_READ (ah,AR_PHY_CH1_CCA ),AR9280_PHY_CH1_MINCCA_PWR );
Signature · 1 line
1.8.4
PATCH 2/3 ath9k: Handle FATAL interrupts correctly
From: Sujith Manoharan <[email protected]>
When a FATAL interrupt is received, a full chip reset is required, which is done in the main tasklet. But since the reset routine is scheduled as a work item, make sure that interrupts are not enabled in the tasklet before the reset is done.
--- drivers/net/wireless/ath/ath9k/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +8 -2
@@ -362,6 +362,13 @@ void ath9k_tasklet(unsigned long data) type =RESET_TYPE_BB_WATCHDOG ;ath9k_queue_reset (sc, type); + +/* +* Increment the ref. counter here so that +* interrupts are enabled in the reset routine. +*/ +atomic_inc (&ah->intr_ref_cnt); +ath_dbg (common,ANY ,"FATAL: Skipping interrupts\n" ); goto out; }
@@ -400,10 +407,9 @@ void ath9k_tasklet(unsigned long data)ath9k_btcoex_handle_interrupt (sc, status); -out:/* re-enable hardware interrupt */ ath9k_hw_enable_interrupts (ah); - +out:spin_unlock (&sc->sc_pcu_lock);ath9k_ps_restore (sc); }
Signature · 1 line
1.8.4
PATCH 3/3 ath9k: Remove incorrect diversity initialization
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Fast antenna diversity is required only for single chain chips and the diversity initialization is done in the per-family board setup routines. Enabling of diversity should be done based on the calibrated EEPROM/OTP data, doing it for all chips is incorrect.
Remove the code that sets the fast_div bit for all cards, since the documentation for the AR_PHY_CCK_DETECT register says:
reg 642: sig_detect_cckenable_ant_fast_div : Only used for single chain chips.
--- drivers/net/wireless/ath/ath9k/ar5008_phy.c | 3 --- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 3 --- 2 files changed, 6 deletions(-)
drivers/net/wireless/ath/ath9k/ar5008_phy.c +0 -3
@@ -631,9 +631,6 @@ static void ar5008_hw_override_ini(struct ath_hw *ah,REG_WRITE (ah,AR_PCU_MISC_MODE2 , val); } -REG_SET_BIT (ah,AR_PHY_CCK_DETECT , -AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV ); -if (AR_SREV_9280_20_OR_LATER (ah))return ;/*
drivers/net/wireless/ath/ath9k/ar9003_phy.c +0 -3
@@ -632,9 +632,6 @@ static void ar9003_hw_override_ini(struct ath_hw *ah)AR_PCU_MISC_MODE2_CFP_IGNORE ;REG_WRITE (ah,AR_PCU_MISC_MODE2 , val); -REG_SET_BIT (ah,AR_PHY_CCK_DETECT , -AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV ); -if (AR_SREV_9462 (ah) ||AR_SREV_9565 (ah)) {REG_WRITE (ah,AR_GLB_SWREG_DISCONT_MODE ,AR_GLB_SWREG_DISCONT_EN_BT_WLAN );
Signature · 1 line
1.8.4