Date: Thu, 18 Aug 2011 13:00:42 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r224966 - user/adrian/if_ath_tx/sys/dev/ath Message-ID: <201108181300.p7ID0gpq058078@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Thu Aug 18 13:00:41 2011 New Revision: 224966 URL: http://svn.freebsd.org/changeset/base/224966 Log: Fix the order of shifting items around the buf lists - it has to be removed from the list first before added to another. Doing it in the reverse order just ends up getting stuck in an infinite loop. Fix some debugging whilst I'm at it. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Thu Aug 18 09:18:39 2011 (r224965) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Thu Aug 18 13:00:41 2011 (r224966) @@ -2458,10 +2458,15 @@ ath_tx_comp_aggr_error(struct ath_softc #endif /* Prepend all frames to the beginning of the queue */ + /* + * XXX for now, these are done in reverse order. + * XXX I'll have to convert this into a TAILQ, so it can + * XXX added to by walking in the reverse order. + */ ATH_TXQ_LOCK(tid); while ((bf = STAILQ_FIRST(&bf_q)) != NULL) { - ATH_TXQ_INSERT_HEAD(tid, bf, bf_list); STAILQ_REMOVE_HEAD(&bf_q, bf_list); + ATH_TXQ_INSERT_HEAD(tid, bf, bf_list); } ATH_TXQ_UNLOCK(tid); } @@ -2555,7 +2560,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * ba[0] = ts->ts_ba_low; ba[1] = ts->ts_ba_high; - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: txa_start=%d, tx_ok=%d, isaggr=%d, seq_st=%d, hasba=%d, ba=%.8x, %.8x\n", __func__, tap->txa_start, tx_ok, isaggr, seq_st, hasba, ba[0], ba[1]); @@ -2621,15 +2626,20 @@ ath_tx_aggr_comp_aggr(struct ath_softc * #endif /* Prepend all frames to the beginning of the queue */ + /* + * XXX for now, these are done in reverse order. + * XXX I'll have to convert this into a TAILQ, so it can + * XXX added to by walking in the reverse order. + */ ATH_TXQ_LOCK(atid); while ((bf = STAILQ_FIRST(&bf_q)) != NULL) { - ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); STAILQ_REMOVE_HEAD(&bf_q, bf_list); + ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); } ATH_TXQ_UNLOCK(atid); - device_printf(sc->sc_dev, "%s: finished; txa_start now %d\n", - __func__, tap->txa_start); + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, + "%s: finished; txa_start now %d\n", __func__, tap->txa_start); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108181300.p7ID0gpq058078>