summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-11-08 21:06:36 +0000
committeradrian <adrian@FreeBSD.org>2011-11-08 21:06:36 +0000
commit8c46d06cce6d90088488e9be65cb0ae8f345e794 (patch)
tree21e9740e5d8e1ef66a5ed1889521c206afa602da /sys/dev/ath/if_ath.c
parent227a997065ce535f302d1760083cb123c5241787 (diff)
downloadFreeBSD-src-8c46d06cce6d90088488e9be65cb0ae8f345e794.zip
FreeBSD-src-8c46d06cce6d90088488e9be65cb0ae8f345e794.tar.gz
Break out the TX DMA stop code into a separate function.
Sponsored by: Hobnob, Inc.
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 10bb512..dcf624f 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -4539,17 +4539,16 @@ ath_tx_stopdma(struct ath_softc *sc, struct ath_txq *txq)
(void) ath_hal_stoptxdma(ah, txq->axq_qnum);
}
-/*
- * Drain the transmit queues and reclaim resources.
- */
-static void
-ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type)
+static int
+ath_stoptxdma(struct ath_softc *sc)
{
struct ath_hal *ah = sc->sc_ah;
- struct ifnet *ifp = sc->sc_ifp;
int i;
/* XXX return value */
+ if (sc->sc_invalid)
+ return 0;
+
if (!sc->sc_invalid) {
/* don't touch the hardware if marked invalid */
DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] %p, link %p\n",
@@ -4561,6 +4560,24 @@ ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type)
if (ATH_TXQ_SETUP(sc, i))
ath_tx_stopdma(sc, &sc->sc_txq[i]);
}
+
+ return 1;
+}
+
+/*
+ * Drain the transmit queues and reclaim resources.
+ */
+static void
+ath_draintxq(struct ath_softc *sc, ATH_RESET_TYPE reset_type)
+{
+#ifdef ATH_DEBUG
+ struct ath_hal *ah = sc->sc_ah;
+#endif
+ struct ifnet *ifp = sc->sc_ifp;
+ int i;
+
+ (void) ath_stoptxdma(sc);
+
for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
if (ATH_TXQ_SETUP(sc, i))
ath_tx_draintxq(sc, &sc->sc_txq[i]);
OpenPOWER on IntegriCloud