Author: adrian
Date: Tue Nov  8 22:01:03 2011
New Revision: 227363
URL: http://svn.freebsd.org/changeset/base/227363

Log:
  Add support to the TX descriptor printing code to follow ath_buf
  chains. This allows for debugging of aggregate frames.
  
  Sponsored by: Hobnob, Inc.

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     Tue Nov  8 21:55:40 2011        
(r227362)
+++ head/sys/dev/ath/if_ath_debug.c     Tue Nov  8 22:01:03 2011        
(r227363)
@@ -123,33 +123,44 @@ ath_printrxbuf(struct ath_softc *sc, con
 }
 
 void
-ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *bf,
+ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *first_bf,
        u_int qnum, u_int ix, int done)
 {
-       const struct ath_tx_status *ts = &bf->bf_status.ds_txstat;
+       const struct ath_tx_status *ts = 
&first_bf->bf_last->bf_status.ds_txstat;
+       const struct ath_buf *bf = first_bf;
        struct ath_hal *ah = sc->sc_ah;
        const struct ath_desc *ds;
        int i;
 
        printf("Q%u[%3u]", qnum, ix);
-       for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) {
-               printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:04%x%s\n"
-                      "        %08x %08x %08x %08x %08x %08x\n",
-                   ds, (const struct ath_desc *)bf->bf_daddr + i,
-                   ds->ds_link, ds->ds_data, bf->bf_txflags,
-                   !done ? "" : (ts->ts_status == 0) ? " *" : " !",
-                   ds->ds_ctl0, ds->ds_ctl1,
-                   ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]);
-               if (ah->ah_magic == 0x20065416) {
-                       printf("        %08x %08x %08x %08x %08x %08x %08x 
%08x\n",
-                           ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6],
-                           ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9],
-                           ds->ds_hw[10],ds->ds_hw[11]);
-                       printf("        %08x %08x %08x %08x %08x %08x %08x 
%08x\n",
-                           ds->ds_hw[12],ds->ds_hw[13],ds->ds_hw[14],
-                           ds->ds_hw[15],ds->ds_hw[16],ds->ds_hw[17],
-                           ds->ds_hw[18], ds->ds_hw[19]);
+       while (bf != NULL) {
+               for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) {
+                       printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:%04x%s\n"
+                              "        TXF: %04x Seq: %d swtry: %d ADDBAW?: %d 
DOBAW?: %d\n"
+                              "        %08x %08x %08x %08x %08x %08x\n",
+                           ds, (const struct ath_desc *)bf->bf_daddr + i,
+                           ds->ds_link, ds->ds_data, bf->bf_txflags,
+                           !done ? "" : (ts->ts_status == 0) ? " *" : " !",
+                           bf->bf_state.bfs_flags,
+                           bf->bf_state.bfs_seqno,
+                           bf->bf_state.bfs_retries,
+                           bf->bf_state.bfs_addedbaw,
+                           bf->bf_state.bfs_dobaw,
+                           ds->ds_ctl0, ds->ds_ctl1,
+                           ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], 
ds->ds_hw[3]);
+                       if (ah->ah_magic == 0x20065416) {
+                               printf("        %08x %08x %08x %08x %08x %08x 
%08x %08x\n",
+                                   ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6],
+                                   ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9],
+                                   ds->ds_hw[10],ds->ds_hw[11]);
+                               printf("        %08x %08x %08x %08x %08x %08x 
%08x %08x\n",
+                                   ds->ds_hw[12],ds->ds_hw[13],ds->ds_hw[14],
+                                   ds->ds_hw[15],ds->ds_hw[16],ds->ds_hw[17],
+                                   ds->ds_hw[18], ds->ds_hw[19]);
+                       }
                }
+               printf("  [end]\n");
+               bf = bf->bf_next;
        }
 }
 
_______________________________________________
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