From owner-svn-src-user@FreeBSD.ORG Mon Oct 24 14:37:26 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 9AF921065677; Mon, 24 Oct 2011 14:37:26 +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 71EC98FC1A; Mon, 24 Oct 2011 14:37:26 +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 p9OEbQfL048145; Mon, 24 Oct 2011 14:37:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9OEbQQG048142; Mon, 24 Oct 2011 14:37:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201110241437.p9OEbQQG048142@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Oct 2011 14:37:26 +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: r226691 - 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: Mon, 24 Oct 2011 14:37:26 -0000 Author: adrian Date: Mon Oct 24 14:37:26 2011 New Revision: 226691 URL: http://svn.freebsd.org/changeset/base/226691 Log: Add a function to restart TX DMA after it's been stopped - ath_txq_restart_dma(). This restarts DMA for a queue with frames in it. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h 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 Mon Oct 24 14:35:31 2011 (r226690) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Mon Oct 24 14:37:26 2011 (r226691) @@ -582,6 +582,31 @@ ath_tx_handoff_hw(struct ath_softc *sc, } /* + * Restart TX DMA for the given TXQ. + * + * This must be called whether the queue is empty or not. + */ +void +ath_txq_restart_dma(struct ath_softc *sc, struct ath_txq *txq) +{ + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf; + + ATH_TXQ_LOCK_ASSERT(txq); + + /* This is always going to be cleared, empty or not */ + txq->axq_flags &= ~ATH_TXQ_PUTPENDING; + + bf = TAILQ_FIRST(&txq->axq_q); + if (bf == NULL) + return; + + ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + txq->axq_link = &bf->bf_lastds->ds_link; + ath_hal_txstart(ah, txq->axq_qnum); +} + +/* * Hand off a packet to the hardware (or mcast queue.) * * The relevant hardware txq should be locked. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Mon Oct 24 14:35:31 2011 (r226690) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Mon Oct 24 14:37:26 2011 (r226691) @@ -79,6 +79,7 @@ #define BAW_WITHIN(_start, _bawsz, _seqno) \ ((((_seqno) - (_start)) & 4095) < (_bawsz)) +extern void ath_txq_restart_dma(struct ath_softc *sc, struct ath_txq *txq); extern void ath_freetx(struct mbuf *m); extern void ath_tx_node_flush(struct ath_softc *sc, struct ath_node *an); extern void ath_tx_txq_drain(struct ath_softc *sc, struct ath_txq *txq);