Author: adrian
Date: Mon Nov  5 07:08:45 2012
New Revision: 242599
URL: http://svnweb.freebsd.org/changeset/base/242599

Log:
  TX EDMA debugging fixes:
  
  * Do the calculation for each ath_buf, rather than just the first
  * Correct the calculation in the first place.

Modified:
  head/sys/dev/ath/if_ath_debug.c

Modified: head/sys/dev/ath/if_ath_debug.c
==============================================================================
--- head/sys/dev/ath/if_ath_debug.c     Mon Nov  5 05:56:10 2012        
(r242598)
+++ head/sys/dev/ath/if_ath_debug.c     Mon Nov  5 07:08:45 2012        
(r242599)
@@ -143,17 +143,18 @@ ath_printtxbuf_edma(struct ath_softc *sc
        const struct ath_desc_txedma *eds;
        int i, n;
 
-       /*
-        * Assume the TX map size is 4 for now and only walk
-        * the appropriate number of segments.
-        */
-       n = (bf->bf_nseg / 4) + 1;
-
        printf("Q%u[%3u] (nseg=%d)", qnum, ix, bf->bf_nseg);
        while (bf != NULL) {
                /*
                 * XXX For now, assume the txmap size is 4.
                 */
+
+               /*
+                * Assume the TX map size is 4 for now and only walk
+                * the appropriate number of segments.
+                */
+               n = ((bf->bf_nseg - 1) / 4) + 1;
+
                for (i = 0, ds = (const char *) bf->bf_desc;
                    i < n;
                    i ++, ds += sc->sc_tx_desclen) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to