ath9k: merge a few bugfixes
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 300-pending_work.patch
1 --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
3 @@ -829,7 +829,7 @@ static bool ar9002_hw_init_cal(struct at
4 if (AR_SREV_9271(ah)) {
5 if (!ar9285_hw_cl_cal(ah, chan))
6 return false;
7 - } else if (AR_SREV_9285_12_OR_LATER(ah)) {
8 + } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) {
9 if (!ar9285_hw_clc(ah, chan))
10 return false;
11 } else {
12 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
13 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
14 @@ -1381,3 +1381,25 @@ void ar9003_hw_bb_watchdog_dbg_info(stru
15 "==== BB update: done ====\n\n");
16 }
17 EXPORT_SYMBOL(ar9003_hw_bb_watchdog_dbg_info);
18 +
19 +void ar9003_hw_disable_phy_restart(struct ath_hw *ah)
20 +{
21 + u32 val;
22 +
23 + /* While receiving unsupported rate frame rx state machine
24 + * gets into a state 0xb and if phy_restart happens in that
25 + * state, BB would go hang. If RXSM is in 0xb state after
26 + * first bb panic, ensure to disable the phy_restart.
27 + */
28 + if (!((MS(ah->bb_watchdog_last_status,
29 + AR_PHY_WATCHDOG_RX_OFDM_SM) == 0xb) ||
30 + ah->bb_hang_rx_ofdm))
31 + return;
32 +
33 + ah->bb_hang_rx_ofdm = true;
34 + val = REG_READ(ah, AR_PHY_RESTART);
35 + val &= ~AR_PHY_RESTART_ENA;
36 +
37 + REG_WRITE(ah, AR_PHY_RESTART, val);
38 +}
39 +EXPORT_SYMBOL(ar9003_hw_disable_phy_restart);
40 --- a/drivers/net/wireless/ath/ath9k/hw.c
41 +++ b/drivers/net/wireless/ath/ath9k/hw.c
42 @@ -1555,9 +1555,12 @@ int ath9k_hw_reset(struct ath_hw *ah, st
43 if (ah->btcoex_hw.enabled)
44 ath9k_hw_btcoex_enable(ah);
45
46 - if (AR_SREV_9300_20_OR_LATER(ah))
47 + if (AR_SREV_9300_20_OR_LATER(ah)) {
48 ar9003_hw_bb_watchdog_config(ah);
49
50 + ar9003_hw_disable_phy_restart(ah);
51 + }
52 +
53 ath9k_hw_apply_gpio_override(ah);
54
55 return 0;
56 --- a/drivers/net/wireless/ath/ath9k/hw.h
57 +++ b/drivers/net/wireless/ath/ath9k/hw.h
58 @@ -842,6 +842,7 @@ struct ath_hw {
59
60 u32 bb_watchdog_last_status;
61 u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */
62 + u8 bb_hang_rx_ofdm; /* true if bb hang due to rx_ofdm */
63
64 unsigned int paprd_target_power;
65 unsigned int paprd_training_power;
66 @@ -990,6 +991,7 @@ void ar9002_hw_enable_wep_aggregation(st
67 void ar9003_hw_bb_watchdog_config(struct ath_hw *ah);
68 void ar9003_hw_bb_watchdog_read(struct ath_hw *ah);
69 void ar9003_hw_bb_watchdog_dbg_info(struct ath_hw *ah);
70 +void ar9003_hw_disable_phy_restart(struct ath_hw *ah);
71 void ar9003_paprd_enable(struct ath_hw *ah, bool val);
72 void ar9003_paprd_populate_single_table(struct ath_hw *ah,
73 struct ath9k_hw_cal_data *caldata,
74 --- a/drivers/net/wireless/ath/ath9k/main.c
75 +++ b/drivers/net/wireless/ath/ath9k/main.c
76 @@ -670,7 +670,8 @@ void ath9k_tasklet(unsigned long data)
77 u32 status = sc->intrstatus;
78 u32 rxmask;
79
80 - if (status & ATH9K_INT_FATAL) {
81 + if ((status & ATH9K_INT_FATAL) ||
82 + (status & ATH9K_INT_BB_WATCHDOG)) {
83 ath_reset(sc, true);
84 return;
85 }
86 @@ -737,6 +738,7 @@ irqreturn_t ath_isr(int irq, void *dev)
87 {
88 #define SCHED_INTR ( \
89 ATH9K_INT_FATAL | \
90 + ATH9K_INT_BB_WATCHDOG | \
91 ATH9K_INT_RXORN | \
92 ATH9K_INT_RXEOL | \
93 ATH9K_INT_RX | \