diff options
| author | Pyun YongHyeon <yongari@FreeBSD.org> | 2009-09-24 17:53:00 +0000 |
|---|---|---|
| committer | Pyun YongHyeon <yongari@FreeBSD.org> | 2009-09-24 17:53:00 +0000 |
| commit | 42bd4150905c17931eafaf62cc81d0ccbca5b2e7 (patch) | |
| tree | 546fa747c5abe9ca0515721d115a721fa7abaa91 /sys/dev/de | |
| parent | f0ca78112031e736ad55dbf591b310620ab505f0 (diff) | |
Notes
Diffstat (limited to 'sys/dev/de')
| -rw-r--r-- | sys/dev/de/if_de.c | 16 | ||||
| -rw-r--r-- | sys/dev/de/if_devar.h | 1 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index e63e4f22c7b7..c3d283988aeb 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -4491,7 +4491,7 @@ tulip_busdma_freering(tulip_ringinfo_t *ri) /* Allocate memory for a single descriptor ring. */ static int tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count, - bus_size_t maxsize, int nsegs, tulip_ringinfo_t *ri, const char *name) + bus_size_t align, int nsegs, tulip_ringinfo_t *ri, const char *name) { size_t size; int error, i; @@ -4499,7 +4499,7 @@ tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count, /* First, setup a tag. */ ri->ri_max = count; size = count * sizeof(tulip_desc_t); - error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ri->ri_ring_tag); if (error) { @@ -4527,9 +4527,9 @@ tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count, } /* Allocate a tag for the data buffers. */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, align, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - maxsize, nsegs, TULIP_DATA_PER_DESC, 0, NULL, NULL, &ri->ri_data_tag); + MCLBYTES * nsegs, nsegs, MCLBYTES, 0, NULL, NULL, &ri->ri_data_tag); if (error) { device_printf(dev, "failed to allocate %s buffer dma tag\n", name); return (error); @@ -4587,8 +4587,8 @@ tulip_busdma_init(device_t dev, tulip_softc_t * const sc) /* * Allocate space and dmamap for transmit ring. */ - error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, TULIP_DATA_PER_DESC, - TULIP_MAX_TXSEG, &sc->tulip_txinfo, "transmit"); + error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, 1, TULIP_MAX_TXSEG, + &sc->tulip_txinfo, "transmit"); if (error) return (error); @@ -4599,7 +4599,7 @@ tulip_busdma_init(device_t dev, tulip_softc_t * const sc) * a waste in practice though as an ethernet frame can easily fit * in TULIP_RX_BUFLEN bytes. */ - error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, MCLBYTES, 1, + error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, 4, 1, &sc->tulip_rxinfo, "receive"); if (error) return (error); @@ -4607,7 +4607,7 @@ tulip_busdma_init(device_t dev, tulip_softc_t * const sc) /* * Allocate a DMA tag, memory, and map for setup descriptor */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0, NULL, NULL, &sc->tulip_setup_tag); diff --git a/sys/dev/de/if_devar.h b/sys/dev/de/if_devar.h index a494dd893b30..b4feebc12aaa 100644 --- a/sys/dev/de/if_devar.h +++ b/sys/dev/de/if_devar.h @@ -135,7 +135,6 @@ typedef struct { * 100Mb/s cards the copying is just too much of a hit. */ -#define TULIP_DATA_PER_DESC 2032 #define TULIP_TXTIMER 4 #define TULIP_RXDESCS 48 #define TULIP_TXDESCS 128 |
