From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:54:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42A60B77; Sat, 3 Nov 2012 22:54:43 +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 119FF8FC12; Sat, 3 Nov 2012 22:54:43 +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 qA3MsgU5061299; Sat, 3 Nov 2012 22:54:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3Msg4v061297; Sat, 3 Nov 2012 22:54:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211032254.qA3Msg4v061297@svn.freebsd.org> From: Adrian Chadd Date: Sat, 3 Nov 2012 22:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242532 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:54:43 -0000 Author: adrian Date: Sat Nov 3 22:54:42 2012 New Revision: 242532 URL: http://svn.freebsd.org/changeset/base/242532 Log: EDMA TX tweaks: * don't poke ath_hal_txstart() if nothing was pushed into the FIFO during the refill process; * shuffle around the TX debugging output a little so it's logged at TX hardware enqueue; * Add logging of the TX status processing. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 3 22:39:07 2012 (r242531) +++ head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 3 22:54:42 2012 (r242532) @@ -134,6 +134,7 @@ static void ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) { struct ath_buf *bf; + int i = 0; ATH_TXQ_LOCK_ASSERT(txq); @@ -143,9 +144,15 @@ ath_edma_tx_fifo_fill(struct ath_softc * if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) break; ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, i, 0); +#endif txq->axq_fifo_depth++; + i++; } - ath_hal_txstart(sc->sc_ah, txq->axq_qnum); + if (i > 0) + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); } /* @@ -208,13 +215,12 @@ ath_edma_xmit_handoff_hw(struct ath_soft /* Push and update frame stats */ ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); -#ifdef ATH_DEBUG - if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) - ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); -#endif /* ATH_DEBUG */ - /* Only schedule to the FIFO if there's space */ if (txq->axq_fifo_depth < HAL_TXFIFO_DEPTH) { +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); +#endif /* ATH_DEBUG */ ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); txq->axq_fifo_depth++; ath_hal_txstart(ah, txq->axq_qnum); @@ -428,17 +434,30 @@ ath_edma_tx_proc(void *arg, int npending struct ath_buf *bf; struct ieee80211_node *ni; int nacked = 0; + int idx; + +#ifdef ATH_DEBUG + /* XXX */ + uint32_t txstatus[32]; +#endif DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); - for (;;) { + for (idx = 0; ; idx++) { bzero(&ts, sizeof(ts)); ATH_TXSTATUS_LOCK(sc); status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); + ath_hal_gettxrawtxdesc(ah, txstatus); ATH_TXSTATUS_UNLOCK(sc); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_TX_PROC) + ath_printtxstatbuf(sc, NULL, txstatus, ts.ts_queue_id, + idx, (status == HAL_OK)); +#endif + if (status == HAL_EINPROGRESS) break; @@ -482,6 +501,8 @@ ath_edma_tx_proc(void *arg, int npending __func__, ts.ts_queue_id, bf); + /* XXX TODO: actually output debugging info about this */ + #if 0 /* XXX assert the buffer/descriptor matches the status descid */ if (ts.ts_desc_id != bf->bf_descid) {