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) {
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to