ath9k: backport ps wakeup/restore fixes from r25058
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 570-ath9k_fix_ps_wakeup_issues.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -2111,9 +2111,7 @@ static void ath_tx_complete_poll_work(st
4 if (needreset) {
5 ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_RESET,
6 "tx hung, resetting the chip\n");
7 - ath9k_ps_wakeup(sc);
8 ath_reset(sc, true);
9 - ath9k_ps_restore(sc);
10 }
11
12 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
13 --- a/drivers/net/wireless/ath/ath9k/main.c
14 +++ b/drivers/net/wireless/ath/ath9k/main.c
15 @@ -592,19 +592,16 @@ void ath9k_tasklet(unsigned long data)
16 struct ath_softc *sc = (struct ath_softc *)data;
17 struct ath_hw *ah = sc->sc_ah;
18 struct ath_common *common = ath9k_hw_common(ah);
19 -
20 u32 status = sc->intrstatus;
21 u32 rxmask;
22
23 - ath9k_ps_wakeup(sc);
24 -
25 if (status & ATH9K_INT_FATAL) {
26 ath_reset(sc, true);
27 - ath9k_ps_restore(sc);
28 return;
29 }
30
31 spin_lock(&sc->sc_pcu_lock);
32 + ath9k_ps_wakeup(sc);
33
34 /*
35 * Only run the baseband hang check if beacons stop working in AP or
36 @@ -980,6 +977,7 @@ int ath_reset(struct ath_softc *sc, bool
37 /* Stop ANI */
38 del_timer_sync(&common->ani.timer);
39
40 + ath9k_ps_wakeup(sc);
41 spin_lock_bh(&sc->sc_pcu_lock);
42
43 ieee80211_stop_queues(hw);
44 @@ -1026,6 +1024,7 @@ int ath_reset(struct ath_softc *sc, bool
45
46 /* Start ANI */
47 ath_start_ani(common);
48 + ath9k_ps_restore(sc);
49
50 return r;
51 }
52 @@ -1748,7 +1747,9 @@ static int ath9k_config(struct ieee80211
53
54 if (changed & IEEE80211_CONF_CHANGE_POWER) {
55 sc->config.txpowlimit = 2 * conf->power_level;
56 + ath9k_ps_wakeup(sc);
57 ath_update_txpow(sc);
58 + ath9k_ps_restore(sc);
59 }
60
61 if (disable_radio) {