summaryrefslogtreecommitdiffstats
path: root/sys/dev/gem/if_gemvar.h
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2003-01-06 22:09:01 +0000
committertmm <tmm@FreeBSD.org>2003-01-06 22:09:01 +0000
commitd110043285c7f70ed63981b7aac6fbea8c664982 (patch)
tree999d08f124d84e9bc3d00bafffacce0ee2f3f076 /sys/dev/gem/if_gemvar.h
parent64ef30fddd206a400119c7364e525bdcd940a3de (diff)
downloadFreeBSD-src-d110043285c7f70ed63981b7aac6fbea8c664982.zip
FreeBSD-src-d110043285c7f70ed63981b7aac6fbea8c664982.tar.gz
- Convert to use bus_dmamap_load_mbuf().
- remove DPRINTF(), there is a CTR*() for any of them, and KTR is far more useful to debug this driver. - some cleanups; remove some unused code and definitions.
Diffstat (limited to 'sys/dev/gem/if_gemvar.h')
-rw-r--r--sys/dev/gem/if_gemvar.h33
1 files changed, 6 insertions, 27 deletions
diff --git a/sys/dev/gem/if_gemvar.h b/sys/dev/gem/if_gemvar.h
index d86e709..5da15fe 100644
--- a/sys/dev/gem/if_gemvar.h
+++ b/sys/dev/gem/if_gemvar.h
@@ -48,6 +48,7 @@
#define GEM_TXQUEUELEN 64
#define GEM_NTXDESC (GEM_TXQUEUELEN * GEM_NTXSEGS)
+#define GEM_MAXTXFREE (GEM_NTXDESC - 1)
#define GEM_NTXDESC_MASK (GEM_NTXDESC - 1)
#define GEM_NEXTTX(x) ((x + 1) & GEM_NTXDESC_MASK)
@@ -104,21 +105,7 @@ STAILQ_HEAD(gem_txsq, gem_txsoft);
/* Argument structure for busdma callback */
struct gem_txdma {
struct gem_softc *txd_sc;
- int txd_nexttx;
- int txd_lasttx;
- int txd_nsegs;
- int txd_flags;
-#define GTXD_FIRST 1
-#define GTXD_LAST 2
- int txd_error;
-};
-
-/* Transmit job descriptor */
-struct gem_txjob {
- int txj_nexttx;
- int txj_lasttx;
- int txj_nsegs;
- STAILQ_HEAD(, gem_txsoft) txj_txsq;
+ struct gem_txsoft *txd_txs;
};
/*
@@ -144,7 +131,8 @@ struct gem_softc {
/* The following bus handles are to be provided by the bus front-end */
bus_space_tag_t sc_bustag; /* bus tag */
bus_dma_tag_t sc_pdmatag; /* parent bus dma tag */
- bus_dma_tag_t sc_dmatag; /* bus dma tag */
+ bus_dma_tag_t sc_rdmatag; /* RX bus dma tag */
+ bus_dma_tag_t sc_tdmatag; /* TX bus dma tag */
bus_dma_tag_t sc_cdmatag; /* control data bus dma tag */
bus_dmamap_t sc_dmamap; /* bus dma handle */
bus_space_handle_t sc_h; /* bus space handle for all regs */
@@ -197,10 +185,6 @@ struct gem_softc {
int sc_inited;
int sc_debug;
int sc_ifflags;
-
- /* Special hardware hooks */
- void (*sc_hwreset)(struct gem_softc *);
- void (*sc_hwinit)(struct gem_softc *);
};
#define GEM_DMA_READ(sc, v) (((sc)->sc_pci) ? le64toh(v) : be64toh(v))
@@ -209,16 +193,11 @@ struct gem_softc {
#define GEM_CDTXADDR(sc, x) ((sc)->sc_cddma + GEM_CDTXOFF((x)))
#define GEM_CDRXADDR(sc, x) ((sc)->sc_cddma + GEM_CDRXOFF((x)))
-#define GEM_CDSPADDR(sc) ((sc)->sc_cddma + GEM_CDSPOFF)
-
#define GEM_CDTXSYNC(sc, x, n, ops) \
- bus_dmamap_sync((sc)->sc_dmatag, (sc)->sc_cddmamap, (ops)); \
+ bus_dmamap_sync((sc)->sc_cdmatag, (sc)->sc_cddmamap, (ops)); \
#define GEM_CDRXSYNC(sc, x, ops) \
- bus_dmamap_sync((sc)->sc_dmatag, (sc)->sc_cddmamap, (ops))
-
-#define GEM_CDSPSYNC(sc, ops) \
- bus_dmamap_sync((sc)->sc_dmatag, (sc)->sc_cddmamap, (ops))
+ bus_dmamap_sync((sc)->sc_cdmatag, (sc)->sc_cddmamap, (ops))
#define GEM_INIT_RXDESC(sc, x) \
do { \
OpenPOWER on IntegriCloud