summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-08-15 06:48:34 +0000
committeradrian <adrian@FreeBSD.org>2012-08-15 06:48:34 +0000
commit2e17c6efe7eeab36ddd1357d7c93c2f6175a297e (patch)
treeeb21934ca7ab90bb3a11fc09a729a5511388047f
parent8ebd91847c4e2a98c80b6f8c8dd615f37ba49ce8 (diff)
downloadFreeBSD-src-2e17c6efe7eeab36ddd1357d7c93c2f6175a297e.zip
FreeBSD-src-2e17c6efe7eeab36ddd1357d7c93c2f6175a297e.tar.gz
Implement a sequential descriptor ID value and stuff it in the ath_buf.
This will be used by the EDMA TX code to assign descriptor IDs in order to provide some debugging.
-rw-r--r--sys/dev/ath/if_ath.c8
-rw-r--r--sys/dev/ath/if_athvar.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 3977c16a..ed4b3c3 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -2344,6 +2344,14 @@ _ath_getbuf_locked(struct ath_softc *sc, ath_buf_type_t btype)
bf->bf_comp = NULL; /* XXX again, just to be sure */
bzero(&bf->bf_state, sizeof(bf->bf_state));
+ /*
+ * Track the descriptor ID only if doing EDMA
+ */
+ if (sc->sc_isedma) {
+ bf->bf_descid = sc->sc_txbuf_descid;
+ sc->sc_txbuf_descid++;
+ }
+
return bf;
}
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index 617ebf8..fa3ca4b 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -191,6 +191,7 @@ struct ath_buf {
int bf_nseg;
HAL_STATUS bf_rxstatus;
uint16_t bf_flags; /* status flags (below) */
+ uint16_t bf_descid; /* 16 bit descriptor ID */
struct ath_desc *bf_desc; /* virtual addr of desc */
struct ath_desc_status bf_status; /* tx/rx status */
bus_addr_t bf_daddr; /* physical addr of desc */
@@ -576,6 +577,7 @@ struct ath_softc {
u_int sc_monpass; /* frames to pass in mon.mode */
struct ath_descdma sc_txdma; /* TX descriptors */
+ uint16_t sc_txbuf_descid;
ath_bufhead sc_txbuf; /* transmit buffer */
int sc_txbuf_cnt; /* how many buffers avail */
struct ath_descdma sc_txdma_mgmt; /* mgmt TX descriptors */
OpenPOWER on IntegriCloud