From owner-freebsd-wireless@FreeBSD.ORG Wed Jun 13 05:40:12 2012 Return-Path: Delivered-To: freebsd-wireless@hub.freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 342FD106566B for ; Wed, 13 Jun 2012 05:40:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 140278FC1D for ; Wed, 13 Jun 2012 05:40:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q5D5eBBC006720 for ; Wed, 13 Jun 2012 05:40:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q5D5eBLv006719; Wed, 13 Jun 2012 05:40:11 GMT (envelope-from gnats) Date: Wed, 13 Jun 2012 05:40:11 GMT Message-Id: <201206130540.q5D5eBLv006719@freefall.freebsd.org> To: freebsd-wireless@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/168170: commit references a PR X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 05:40:12 -0000 The following reply was made to PR kern/168170; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/168170: commit references a PR Date: Wed, 13 Jun 2012 05:39:28 +0000 (UTC) Author: adrian Date: Wed Jun 13 05:39:16 2012 New Revision: 236993 URL: http://svn.freebsd.org/changeset/base/236993 Log: 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 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Jun 13 05:02:51 2012 (r236992) +++ head/sys/dev/ath/if_ath.c Wed Jun 13 05:39:16 2012 (r236993) @@ -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 npe 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_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); } Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Wed Jun 13 05:02:51 2012 (r236992) +++ head/sys/dev/ath/if_ath_misc.h Wed Jun 13 05:39:16 2012 (r236993) @@ -55,6 +55,8 @@ extern struct ath_buf * _ath_getbuf_lock extern struct ath_buf * ath_buf_clone(struct ath_softc *sc, const struct ath_buf *bf); extern void ath_freebuf(struct ath_softc *sc, struct ath_buf *bf); +extern void ath_returnbuf_head(struct ath_softc *sc, struct ath_buf *bf); +extern void ath_returnbuf_tail(struct ath_softc *sc, struct ath_buf *bf); extern int ath_reset(struct ifnet *, ATH_RESET_TYPE); extern void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed Jun 13 05:02:51 2012 (r236992) +++ head/sys/dev/ath/if_ath_tx.c Wed Jun 13 05:39:16 2012 (r236993) @@ -184,7 +184,7 @@ ath_txfrag_cleanup(struct ath_softc *sc, TAILQ_FOREACH_SAFE(bf, frags, bf_list, next) { /* NB: bf assumed clean */ TAILQ_REMOVE(frags, bf, bf_list); - TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + ath_returnbuf_head(sc, bf); ieee80211_node_decref(ni); } } @@ -1916,7 +1916,7 @@ ath_raw_xmit(struct ieee80211_node *ni, return 0; bad2: ATH_TXBUF_LOCK(sc); - TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); + ath_returnbuf_head(sc, bf); ATH_TXBUF_UNLOCK(sc); bad: ATH_PCU_LOCK(sc); @@ -3137,7 +3137,7 @@ ath_tx_retry_clone(struct ath_softc *sc, * the list.) */ ATH_TXBUF_LOCK(sc); - TAILQ_INSERT_HEAD(&sc->sc_txbuf, nbf, bf_list); + ath_returnbuf_head(sc, bf); ATH_TXBUF_UNLOCK(sc); return NULL; } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"