diff options
author | adrian <adrian@FreeBSD.org> | 2012-06-13 05:39:16 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-06-13 05:39:16 +0000 |
commit | 0e5e2a4303aa3eb0817d005f2bff36cf9530cdcf (patch) | |
tree | cb25c1825aa03739664b6c8e3c4e57c55e4c40bb /sys/dev/ath/if_ath.c | |
parent | e9a3ea52432e88e05b37d79a2d76aaf8afaefa7f (diff) | |
download | FreeBSD-src-0e5e2a4303aa3eb0817d005f2bff36cf9530cdcf.zip FreeBSD-src-0e5e2a4303aa3eb0817d005f2bff36cf9530cdcf.tar.gz |
Replace the direct sc_txbuf manipulation with a pair of functions.
This is preparation work for having a separate ath_buf queue for
management traffic.
PR: kern/168170
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r-- | sys/dev/ath/if_ath.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 248acdb..b925668 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -2358,7 +2358,7 @@ ath_start(struct ifnet *ifp) IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) { ATH_TXBUF_LOCK(sc); - TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + ath_returnbuf_head(sc, bf); ATH_TXBUF_UNLOCK(sc); break; } @@ -2401,7 +2401,7 @@ ath_start(struct ifnet *ifp) bf->bf_m = NULL; bf->bf_node = NULL; ATH_TXBUF_LOCK(sc); - TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + ath_returnbuf_head(sc, bf); ath_txfrag_cleanup(sc, &frags, ni); ATH_TXBUF_UNLOCK(sc); if (ni != NULL) @@ -3631,6 +3631,24 @@ ath_txq_sched_tasklet(void *arg, int npending) ATH_PCU_UNLOCK(sc); } +void +ath_returnbuf_tail(struct ath_softc *sc, struct ath_buf *bf) +{ + + ATH_TXBUF_LOCK_ASSERT(sc); + + TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); +} + +void +ath_returnbuf_head(struct ath_softc *sc, struct ath_buf *bf) +{ + + ATH_TXBUF_LOCK_ASSERT(sc); + + TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); +} + /* * Return a buffer to the pool and update the 'busy' flag on the * previous 'tail' entry. @@ -3653,7 +3671,7 @@ ath_freebuf(struct ath_softc *sc, struct ath_buf *bf) ATH_TXBUF_LOCK(sc); ath_tx_update_busy(sc); - TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); + ath_returnbuf_tail(sc, bf); ATH_TXBUF_UNLOCK(sc); } |