Date: Mon, 24 Oct 2011 14:37:26 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r226691 - user/adrian/if_ath_tx/sys/dev/ath Message-ID: <201110241437.p9OEbQQG048142@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110241437.p9OEbQQG048142>