ath9k: merge a fix for queue start/stop handling (fixes #18164, #18130)
[oweals/openwrt.git] / package / kernel / mac80211 / patches / 306-ath9k-Unify-reset-API.patch
1 From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2 Date: Fri, 17 Oct 2014 07:40:11 +0530
3 Subject: [PATCH] ath9k: Unify reset API
4
5 Instead of having ath_reset_internal() and ath_reset()
6 as two separate calls to perform a HW reset, have
7 one function. This makes sure that the behavior will
8 be the same at all callsites.
9
10 Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
11 ---
12
13 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
14 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
15 @@ -540,7 +540,6 @@ static inline void ath_chanctx_check_act
16  
17  #endif /* CPTCFG_ATH9K_CHANNEL_CONTEXT */
18  
19 -int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan);
20  void ath_startrecv(struct ath_softc *sc);
21  bool ath_stoprecv(struct ath_softc *sc);
22  u32 ath_calcrxfilter(struct ath_softc *sc);
23 @@ -1069,7 +1068,7 @@ void ath9k_tasklet(unsigned long data);
24  int ath_cabq_update(struct ath_softc *);
25  u8 ath9k_parse_mpdudensity(u8 mpdudensity);
26  irqreturn_t ath_isr(int irq, void *dev);
27 -int ath_reset(struct ath_softc *sc);
28 +int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan);
29  void ath_cancel_work(struct ath_softc *sc);
30  void ath_restart_work(struct ath_softc *sc);
31  int ath9k_init_device(u16 devid, struct ath_softc *sc,
32 --- a/drivers/net/wireless/ath/ath9k/channel.c
33 +++ b/drivers/net/wireless/ath/ath9k/channel.c
34 @@ -66,7 +66,7 @@ static int ath_set_channel(struct ath_so
35         }
36  
37         hchan = &sc->sc_ah->channels[pos];
38 -       r = ath_reset_internal(sc, hchan);
39 +       r = ath_reset(sc, hchan);
40         if (r)
41                 return r;
42  
43 --- a/drivers/net/wireless/ath/ath9k/main.c
44 +++ b/drivers/net/wireless/ath/ath9k/main.c
45 @@ -270,7 +270,7 @@ static bool ath_complete_reset(struct at
46         return true;
47  }
48  
49 -int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan)
50 +static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan)
51  {
52         struct ath_hw *ah = sc->sc_ah;
53         struct ath_common *common = ath9k_hw_common(ah);
54 @@ -598,12 +598,12 @@ chip_reset:
55  #undef SCHED_INTR
56  }
57  
58 -int ath_reset(struct ath_softc *sc)
59 +int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan)
60  {
61         int r;
62  
63         ath9k_ps_wakeup(sc);
64 -       r = ath_reset_internal(sc, NULL);
65 +       r = ath_reset_internal(sc, hchan);
66         ath9k_ps_restore(sc);
67  
68         return r;
69 @@ -623,7 +623,9 @@ void ath_reset_work(struct work_struct *
70  {
71         struct ath_softc *sc = container_of(work, struct ath_softc, hw_reset_work);
72  
73 -       ath_reset(sc);
74 +       ath9k_ps_wakeup(sc);
75 +       ath_reset_internal(sc, NULL);
76 +       ath9k_ps_restore(sc);
77  }
78  
79  /**********************/
80 @@ -2044,7 +2046,7 @@ void __ath9k_flush(struct ieee80211_hw *
81                 spin_unlock_bh(&sc->sc_pcu_lock);
82  
83                 if (!drain_txq)
84 -                       ath_reset(sc);
85 +                       ath_reset(sc, NULL);
86  
87                 ath9k_ps_restore(sc);
88         }
89 --- a/drivers/net/wireless/ath/ath9k/tx99.c
90 +++ b/drivers/net/wireless/ath/ath9k/tx99.c
91 @@ -99,7 +99,7 @@ static struct sk_buff *ath9k_build_tx99_
92  
93  static void ath9k_tx99_deinit(struct ath_softc *sc)
94  {
95 -       ath_reset(sc);
96 +       ath_reset(sc, NULL);
97  
98         ath9k_ps_wakeup(sc);
99         ath9k_tx99_stop(sc);
100 @@ -127,7 +127,7 @@ static int ath9k_tx99_init(struct ath_so
101         memset(&txctl, 0, sizeof(txctl));
102         txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
103  
104 -       ath_reset(sc);
105 +       ath_reset(sc, NULL);
106  
107         ath9k_ps_wakeup(sc);
108