diff options
Diffstat (limited to 'sys/dev/ath/if_ath_tx_edma.c')
-rw-r--r-- | sys/dev/ath/if_ath_tx_edma.c | 59 |
1 files changed, 52 insertions, 7 deletions
diff --git a/sys/dev/ath/if_ath_tx_edma.c b/sys/dev/ath/if_ath_tx_edma.c index 57e180b..e23c99a 100644 --- a/sys/dev/ath/if_ath_tx_edma.c +++ b/sys/dev/ath/if_ath_tx_edma.c @@ -117,6 +117,10 @@ __FBSDID("$FreeBSD$"); #include <dev/ath/if_ath_tx_edma.h> +#ifdef ATH_DEBUG_ALQ +#include <dev/ath/if_ath_alq.h> +#endif + /* * some general macros */ @@ -132,6 +136,37 @@ MALLOC_DECLARE(M_ATHDEV); static void ath_edma_tx_processq(struct ath_softc *sc, int dosched); +#ifdef ATH_DEBUG_ALQ +static void +ath_edma_tx_alq_post(struct ath_softc *sc, struct ath_buf *bf_first) +{ + struct ath_buf *bf; + int i, n; + const char *ds; + + /* XXX we should skip out early if debugging isn't enabled! */ + bf = bf_first; + + while (bf != NULL) { + /* XXX assume nmaps = 4! */ + /* XXX should ensure bf_nseg > 0! */ + if (bf->bf_nseg == 0) + break; + n = ((bf->bf_nseg - 1) / 4) + 1; + for (i = 0, ds = (const char *) bf->bf_desc; + i < n; + i++, ds += sc->sc_tx_desclen) { + if_ath_alq_post(&sc->sc_alq, + ATH_ALQ_EDMA_TXDESC, + 96, + ds); + } + + bf = bf->bf_next; + } +} +#endif /* ATH_DEBUG_ALQ */ + static void ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) { @@ -149,7 +184,11 @@ ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) ath_printtxbuf(sc, bf, txq->axq_qnum, i, 0); -#endif +#endif/* ATH_DEBUG */ +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXDESC)) + ath_edma_tx_alq_post(sc, bf); +#endif /* ATH_DEBUG_ALQ */ txq->axq_fifo_depth++; i++; } @@ -163,10 +202,6 @@ ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) * * This should only be called as part of the chip reset path, as it * assumes the FIFO is currently empty. - * - * TODO: verify that a cold/warm reset does clear the TX FIFO, so - * writing in a partially-filled FIFO will not cause double-entries - * to appear. */ static void ath_edma_dma_restart(struct ath_softc *sc, struct ath_txq *txq) @@ -222,7 +257,11 @@ ath_edma_xmit_handoff_hw(struct ath_softc *sc, struct ath_txq *txq, #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); -#endif /* ATH_DEBUG */ +#endif /* ATH_DEBUG */ +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXDESC)) + ath_edma_tx_alq_post(sc, bf); +#endif /* ATH_DEBUG_ALQ */ ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); txq->axq_fifo_depth++; ath_hal_txstart(ah, txq->axq_qnum); @@ -368,7 +407,6 @@ ath_edma_dma_txsetup(struct ath_softc *sc) ath_edma_setup_txfifo(sc, i); } - return (0); } @@ -489,6 +527,13 @@ ath_edma_tx_processq(struct ath_softc *sc, int dosched) continue; } +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS)) + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_EDMA_TXSTATUS, + sc->sc_tx_statuslen, + (char *) txstatus); +#endif /* ATH_DEBUG_ALQ */ + /* * At this point we have a valid status descriptor. * The QID and descriptor ID (which currently isn't set) |