summaryrefslogtreecommitdiffstats
path: root/sys/dev/en
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-07-15 15:45:41 +0000
committerharti <harti@FreeBSD.org>2003-07-15 15:45:41 +0000
commit9eb1765de539d648c26db8a73a120dbd0f6fae8b (patch)
treefb6f4af000beea884ed514b79fcf01426919546d /sys/dev/en
parent86b084f883185e7476c6e7ba2d60e627ada31ab1 (diff)
downloadFreeBSD-src-9eb1765de539d648c26db8a73a120dbd0f6fae8b.zip
FreeBSD-src-9eb1765de539d648c26db8a73a120dbd0f6fae8b.tar.gz
Be careful to call bus_dmamap_load with BUS_DMA_NOWAIT so that the
callback will never be deferred. ATM needs to prevent cell and packet ordering. Also use the default mutex and lock functions (those that panic) for the tag creation.
Diffstat (limited to 'sys/dev/en')
-rw-r--r--sys/dev/en/midway.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index d70d236..1d2a385 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -750,7 +750,7 @@ en_txdma(struct en_softc *sc, struct en_txslot *slot)
* Try to load that map
*/
error = bus_dmamap_load_mbuf(sc->txtag, map->map, tx.m,
- en_txdma_load, &tx, 0);
+ en_txdma_load, &tx, BUS_DMA_NOWAIT);
if (lastm != NULL)
lastm->m_next = NULL;
@@ -2311,7 +2311,7 @@ en_service(struct en_softc *sc)
}
rx.m = m;
error = bus_dmamap_load_mbuf(sc->txtag, map->map, m,
- en_rxdma_load, &rx, 0);
+ en_rxdma_load, &rx, BUS_DMA_NOWAIT);
if (error != 0) {
if_printf(&sc->ifatm.ifnet, "loading RX map failed "
@@ -2706,8 +2706,8 @@ en_dmaprobe(struct en_softc *sc)
*/
err = bus_dma_tag_create(NULL, MIDDMA_MAXBURST, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
- 3 * MIDDMA_MAXBURST, 1, 3 * MIDDMA_MAXBURST, 0, busdma_lock_mutex,
- &Giant, &tag);
+ 3 * MIDDMA_MAXBURST, 1, 3 * MIDDMA_MAXBURST, 0,
+ NULL, NULL, &tag);
if (err)
panic("%s: cannot create test DMA tag %d", __func__, err);
@@ -2716,7 +2716,7 @@ en_dmaprobe(struct en_softc *sc)
panic("%s: cannot allocate test DMA memory %d", __func__, err);
err = bus_dmamap_load(tag, map, buffer, 3 * MIDDMA_MAXBURST,
- en_dmaprobe_load, &phys, 0);
+ en_dmaprobe_load, &phys, BUS_DMA_NOWAIT);
if (err)
panic("%s: cannot load test DMA map %d", __func__, err);
addr = buffer;
@@ -2919,8 +2919,8 @@ en_attach(struct en_softc *sc)
if (bus_dma_tag_create(NULL, 1, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
- EN_TXSZ * 1024, EN_MAX_DMASEG, EN_TXSZ * 1024, 0, busdma_lock_mutex,
- &Giant, &sc->txtag))
+ EN_TXSZ * 1024, EN_MAX_DMASEG, EN_TXSZ * 1024, 0,
+ NULL, NULL, &sc->txtag))
goto fail;
sc->map_zone = uma_zcreate("en dma maps", sizeof(struct en_map),
OpenPOWER on IntegriCloud