From owner-svn-src-all@FreeBSD.ORG Sun Aug 12 00:46:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C025106566B; Sun, 12 Aug 2012 00:46:16 +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 2C6678FC08; Sun, 12 Aug 2012 00:46:16 +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 q7C0kGF8017936; Sun, 12 Aug 2012 00:46:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7C0kF3R017929; Sun, 12 Aug 2012 00:46:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208120046.q7C0kF3R017929@svn.freebsd.org> From: Adrian Chadd Date: Sun, 12 Aug 2012 00:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239205 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Aug 2012 00:46:16 -0000 Author: adrian Date: Sun Aug 12 00:46:15 2012 New Revision: 239205 URL: http://svn.freebsd.org/changeset/base/239205 Log: Revert the ath_tx_draintxq() method, and instead teach it the minimum necessary to "do" EDMA. It was just using the TX completion status for logging information about the descriptor completion. Since with EDMA we don't know this without checking the TX completion FIFO, we can't provide this information. So don't. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Aug 12 00:37:29 2012 (r239204) +++ head/sys/dev/ath/if_ath.c Sun Aug 12 00:46:15 2012 (r239205) @@ -3987,7 +3987,7 @@ ath_tx_freebuf(struct ath_softc *sc, str } void -ath_legacy_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) +ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) { #ifdef ATH_DEBUG struct ath_hal *ah = sc->sc_ah; @@ -4013,6 +4013,17 @@ ath_legacy_tx_draintxq(struct ath_softc bf = TAILQ_FIRST(&txq->axq_q); if (bf == NULL) { txq->axq_link = NULL; + /* + * There's currently no flag that indicates + * a buffer is on the FIFO. So until that + * occurs, just clear the FIFO counter here. + * + * Yes, this means that if something in parallel + * is pushing things onto this TXQ and pushing + * _that_ into the hardware, things will get + * very fruity very quickly. + */ + txq->axq_fifo_depth = 0; ATH_TXQ_UNLOCK(txq); break; } @@ -4022,10 +4033,20 @@ ath_legacy_tx_draintxq(struct ath_softc #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) { struct ieee80211com *ic = sc->sc_ifp->if_l2com; + int status = 0; - ath_printtxbuf(sc, bf, txq->axq_qnum, ix, - ath_hal_txprocdesc(ah, bf->bf_lastds, + /* + * EDMA operation has a TX completion FIFO + * separate from the TX descriptor, so this + * method of checking the "completion" status + * is wrong. + */ + if (! sc->sc_isedma) { + status = (ath_hal_txprocdesc(ah, + bf->bf_lastds, &bf->bf_status.ds_txstat) == HAL_OK); + } + ath_printtxbuf(sc, bf, txq->axq_qnum, ix, status); ieee80211_dump_pkt(ic, mtod(bf->bf_m, const uint8_t *), bf->bf_m->m_len, 0, -1); } Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sun Aug 12 00:37:29 2012 (r239204) +++ head/sys/dev/ath/if_ath_misc.h Sun Aug 12 00:46:15 2012 (r239205) @@ -97,7 +97,8 @@ extern void ath_descdma_cleanup(struct a extern void ath_legacy_attach_comp_func(struct ath_softc *sc); -extern void ath_legacy_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq); +extern void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq); + extern void ath_legacy_tx_drain(struct ath_softc *sc, ATH_RESET_TYPE reset_type); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Aug 12 00:37:29 2012 (r239204) +++ head/sys/dev/ath/if_ath_tx.c Sun Aug 12 00:46:15 2012 (r239205) @@ -4572,6 +4572,5 @@ ath_xmit_setup_legacy(struct ath_softc * sc->sc_tx.xmit_dma_restart = ath_legacy_tx_dma_restart; sc->sc_tx.xmit_handoff = ath_legacy_xmit_handoff; - sc->sc_tx.xmit_drainq = ath_legacy_tx_draintxq; sc->sc_tx.xmit_drain = ath_legacy_tx_drain; } Modified: head/sys/dev/ath/if_ath_tx.h ============================================================================== --- head/sys/dev/ath/if_ath_tx.h Sun Aug 12 00:37:29 2012 (r239204) +++ head/sys/dev/ath/if_ath_tx.h Sun Aug 12 00:46:15 2012 (r239205) @@ -134,9 +134,6 @@ extern void ath_addba_response_timeout(s (_sc)->sc_tx.xmit_dma_restart((_sc), (_txq)) #define ath_tx_handoff(_sc, _txq, _bf) \ (_sc)->sc_tx.xmit_handoff((_sc), (_txq), (_bf)) - -#define ath_tx_draintxq(_sc, _txq) \ - (_sc)->sc_tx.xmit_drainq((_sc), (_txq)) #define ath_draintxq(_sc, _rtype) \ (_sc)->sc_tx.xmit_drain((_sc), (_rtype)) Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sun Aug 12 00:37:29 2012 (r239204) +++ head/sys/dev/ath/if_ath_tx_edma.c Sun Aug 12 00:46:15 2012 (r239205) @@ -360,19 +360,6 @@ ath_edma_tx_drain(struct ath_softc *sc, } /* - * Completely drain the TXQ, completing frames that were completed. - * - * This is only called to _explictly_ drain the frames from a queue - * without caring if they were completed or not. - */ -static void -ath_edma_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) -{ - - device_printf(sc->sc_dev, "%s: called\n", __func__); -} - -/* * Process the TX status queue. */ static void @@ -441,6 +428,5 @@ ath_xmit_setup_edma(struct ath_softc *sc sc->sc_tx.xmit_dma_restart = ath_edma_dma_restart; sc->sc_tx.xmit_handoff = ath_edma_xmit_handoff; - sc->sc_tx.xmit_drainq = ath_edma_tx_draintxq; sc->sc_tx.xmit_drain = ath_edma_tx_drain; } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Aug 12 00:37:29 2012 (r239204) +++ head/sys/dev/ath/if_athvar.h Sun Aug 12 00:46:15 2012 (r239205) @@ -416,14 +416,6 @@ struct ath_tx_methods { struct ath_txq *txq); void (*xmit_handoff)(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf); - - /* - * This is only required by the CABQ code as well as - * xmit_drain(). - */ - void (*xmit_drainq)(struct ath_softc *sc, - struct ath_txq *txq); - void (*xmit_drain)(struct ath_softc *sc, ATH_RESET_TYPE reset_type); };