svn commit: r227358 - head/sys/dev/ath
Adrian Chadd
adrian at FreeBSD.org
Tue Nov 8 21:06:36 UTC 2011
Author: adrian
Date: Tue Nov 8 21:06:36 2011
New Revision: 227358
URL: http://svn.freebsd.org/changeset/base/227358
Log:
Break out the TX DMA stop code into a separate function.
Sponsored by: Hobnob, Inc.
Modified:
head/sys/dev/ath/if_ath.c
Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c Tue Nov 8 19:25:52 2011 (r227357)
+++ head/sys/dev/ath/if_ath.c Tue Nov 8 21:06:36 2011 (r227358)
@@ -4539,17 +4539,16 @@ ath_tx_stopdma(struct ath_softc *sc, str
(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_R
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]);
More information about the svn-src-head
mailing list