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
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.
10 Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
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
17 #endif /* CPTCFG_ATH9K_CHANNEL_CONTEXT */
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
37 hchan = &sc->sc_ah->channels[pos];
38 - r = ath_reset_internal(sc, hchan);
39 + r = ath_reset(sc, hchan);
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
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)
52 struct ath_hw *ah = sc->sc_ah;
53 struct ath_common *common = ath9k_hw_common(ah);
54 @@ -598,12 +598,12 @@ chip_reset:
58 -int ath_reset(struct ath_softc *sc)
59 +int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan)
64 - r = ath_reset_internal(sc, NULL);
65 + r = ath_reset_internal(sc, hchan);
69 @@ -623,7 +623,9 @@ void ath_reset_work(struct work_struct *
71 struct ath_softc *sc = container_of(work, struct ath_softc, hw_reset_work);
74 + ath9k_ps_wakeup(sc);
75 + ath_reset_internal(sc, NULL);
76 + ath9k_ps_restore(sc);
79 /**********************/
80 @@ -2044,7 +2046,7 @@ void __ath9k_flush(struct ieee80211_hw *
81 spin_unlock_bh(&sc->sc_pcu_lock);
85 + ath_reset(sc, NULL);
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_
93 static void ath9k_tx99_deinit(struct ath_softc *sc)
96 + ath_reset(sc, NULL);
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];
105 + ath_reset(sc, NULL);