From owner-svn-src-user@FreeBSD.ORG Thu Aug 18 13:00:42 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DF00106566C; Thu, 18 Aug 2011 13:00:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 558BB8FC0C; Thu, 18 Aug 2011 13:00:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7ID0gKR058080; Thu, 18 Aug 2011 13:00:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7ID0gpq058078; Thu, 18 Aug 2011 13:00:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108181300.p7ID0gpq058078@svn.freebsd.org> From: Adrian Chadd Date: Thu, 18 Aug 2011 13:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224966 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2011 13:00:42 -0000 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); } /*