]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/wireless/ath/ath9k/xmit.c
ath9k: move the PCU lock to the sc structure
[net-next-2.6.git] / drivers / net / wireless / ath / ath9k / xmit.c
index 30ef2dfc1ed2037ee63c54ec0a16223732194ac4..d97b7a336b5b3c69c5883f0871238dcf67a57ec6 100644 (file)
@@ -1089,15 +1089,6 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
        txq->axq_tx_inprogress = false;
        spin_unlock_bh(&txq->axq_lock);
 
-       /* flush any pending frames if aggregation is enabled */
-       if (sc->sc_flags & SC_OP_TXAGGR) {
-               if (!retry_tx) {
-                       spin_lock_bh(&txq->axq_lock);
-                       ath_txq_drain_pending_buffers(sc, txq);
-                       spin_unlock_bh(&txq->axq_lock);
-               }
-       }
-
        if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
                spin_lock_bh(&txq->axq_lock);
                while (!list_empty(&txq->txq_fifo_pending)) {
@@ -1118,6 +1109,15 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
                }
                spin_unlock_bh(&txq->axq_lock);
        }
+
+       /* flush any pending frames if aggregation is enabled */
+       if (sc->sc_flags & SC_OP_TXAGGR) {
+               if (!retry_tx) {
+                       spin_lock_bh(&txq->axq_lock);
+                       ath_txq_drain_pending_buffers(sc, txq);
+                       spin_unlock_bh(&txq->axq_lock);
+               }
+       }
 }
 
 void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
@@ -1148,13 +1148,13 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
                ath_print(common, ATH_DBG_FATAL,
                          "Failed to stop TX DMA. Resetting hardware!\n");
 
-               spin_lock_bh(&sc->sc_resetlock);
+               spin_lock_bh(&sc->sc_pcu_lock);
                r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
                if (r)
                        ath_print(common, ATH_DBG_FATAL,
                                  "Unable to reset hardware; reset status %d\n",
                                  r);
-               spin_unlock_bh(&sc->sc_resetlock);
+               spin_unlock_bh(&sc->sc_pcu_lock);
        }
 
        for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {