1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -1172,7 +1172,7 @@ void ath_draintxq(struct ath_softc *sc,
7 -void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
8 +bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
10 struct ath_hw *ah = sc->sc_ah;
11 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
12 @@ -1180,7 +1180,7 @@ void ath_drain_all_txq(struct ath_softc
15 if (sc->sc_flags & SC_OP_INVALID)
19 /* Stop beacon queue */
20 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
21 @@ -1194,23 +1194,15 @@ void ath_drain_all_txq(struct ath_softc
28 - ath_print(common, ATH_DBG_FATAL,
29 - "Failed to stop TX DMA. Resetting hardware!\n");
31 - r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
33 - ath_print(common, ATH_DBG_FATAL,
34 - "Unable to reset hardware; reset status %d\n",
38 + ath_print(common, ATH_DBG_FATAL, "Failed to stop TX DMA!\n");
40 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
41 if (ATH_TXQ_SETUP(sc, i))
42 ath_draintxq(sc, &sc->tx.txq[i], retry_tx);
48 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq)
49 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
50 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
51 @@ -311,7 +311,7 @@ void ath_rx_cleanup(struct ath_softc *sc
52 int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp);
53 struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype);
54 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq);
55 -void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx);
56 +bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx);
57 void ath_draintxq(struct ath_softc *sc,
58 struct ath_txq *txq, bool retry_tx);
59 void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an);
60 --- a/drivers/net/wireless/ath/ath9k/main.c
61 +++ b/drivers/net/wireless/ath/ath9k/main.c
62 @@ -246,9 +246,10 @@ int ath_set_channel(struct ath_softc *sc
63 * the relevant bits of the h/w.
65 ath9k_hw_disable_interrupts(ah);
66 - ath_drain_all_txq(sc, false);
67 + stopped = ath_drain_all_txq(sc, false);
69 - stopped = ath_stoprecv(sc);
70 + if (!ath_stoprecv(sc))
73 /* XXX: do not flush receive queue here. We don't want
74 * to flush data frames already in queue because of