diff options
author | adrian <adrian@FreeBSD.org> | 2012-02-17 03:23:01 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-02-17 03:23:01 +0000 |
commit | 1871433d24cdad603cdfa06743a355efd04d9928 (patch) | |
tree | f486d71a6b95b9a0a0cda9b9be111edd244afc47 /sys/dev/ath/if_ath.c | |
parent | dcdb23291fec1365e927195511d5dfb273901a5d (diff) | |
download | FreeBSD-src-1871433d24cdad603cdfa06743a355efd04d9928.zip FreeBSD-src-1871433d24cdad603cdfa06743a355efd04d9928.tar.gz |
Begin breaking out the txrx stop code into a locked and unlocked variant.
PR: kern/165220
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r-- | sys/dev/ath/if_ath.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 51318ef..1ea1548 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1903,15 +1903,16 @@ ath_stop_locked(struct ifnet *ifp) #define MAX_TXRX_ITERATIONS 1000 static void -ath_txrx_stop(struct ath_softc *sc) +ath_txrx_stop_locked(struct ath_softc *sc) { int i = MAX_TXRX_ITERATIONS; ATH_UNLOCK_ASSERT(sc); + ATH_PCU_LOCK_ASSERT(sc); + /* Stop any new TX/RX from occuring */ taskqueue_block(sc->sc_tq); - ATH_PCU_LOCK(sc); /* * Sleep until all the pending operations have completed. * @@ -1925,7 +1926,6 @@ ath_txrx_stop(struct ath_softc *sc) msleep(sc, &sc->sc_pcu_mtx, 0, "ath_txrx_stop", 1); i--; } - ATH_PCU_UNLOCK(sc); if (i <= 0) device_printf(sc->sc_dev, @@ -1935,6 +1935,17 @@ ath_txrx_stop(struct ath_softc *sc) #undef MAX_TXRX_ITERATIONS static void +ath_txrx_stop(struct ath_softc *sc) +{ + ATH_UNLOCK_ASSERT(sc); + ATH_PCU_UNLOCK_ASSERT(sc); + + ATH_PCU_LOCK(sc); + ath_txrx_stop_locked(sc); + ATH_PCU_UNLOCK(sc); +} + +static void ath_txrx_start(struct ath_softc *sc) { |