diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-05-19 15:27:36 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-05-19 15:27:36 +0000 |
commit | 158d178f03df6b6e0f7f96e4596904b0ab8274bb (patch) | |
tree | 592e86ac7a4fefc86456a1838bc06aab1a0602ed /sys/dev/ic/rt2560.c | |
parent | fa977d1430aef60feb0d5aa71b3610a2ad13ba3e (diff) |
BUS_DMA_ZERO instead of alloc, map, bzero.
ok krw@
Diffstat (limited to 'sys/dev/ic/rt2560.c')
-rw-r--r-- | sys/dev/ic/rt2560.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index ecc79997eb0..634eb1cd45e 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560.c,v 1.47 2010/04/20 22:05:43 tedu Exp $ */ +/* $OpenBSD: rt2560.c,v 1.48 2010/05/19 15:27:35 oga Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -354,7 +354,7 @@ rt2560_alloc_tx_ring(struct rt2560_softc *sc, struct rt2560_tx_ring *ring, } error = bus_dmamem_alloc(sc->sc_dmat, count * RT2560_TX_DESC_SIZE, - PAGE_SIZE, 0, &ring->seg, 1, &nsegs, BUS_DMA_NOWAIT); + PAGE_SIZE, 0, &ring->seg, 1, &nsegs, BUS_DMA_NOWAIT | BUS_DMA_ZERO); if (error != 0) { printf("%s: could not allocate DMA memory\n", sc->sc_dev.dv_xname); @@ -378,7 +378,6 @@ rt2560_alloc_tx_ring(struct rt2560_softc *sc, struct rt2560_tx_ring *ring, goto fail; } - memset(ring->desc, 0, count * RT2560_TX_DESC_SIZE); ring->physaddr = ring->map->dm_segs->ds_addr; ring->data = malloc(count * sizeof (struct rt2560_tx_data), M_DEVBUF, @@ -499,7 +498,7 @@ rt2560_alloc_rx_ring(struct rt2560_softc *sc, struct rt2560_rx_ring *ring, } error = bus_dmamem_alloc(sc->sc_dmat, count * RT2560_RX_DESC_SIZE, - PAGE_SIZE, 0, &ring->seg, 1, &nsegs, BUS_DMA_NOWAIT); + PAGE_SIZE, 0, &ring->seg, 1, &nsegs, BUS_DMA_NOWAIT | BUS_DMA_ZERO); if (error != 0) { printf("%s: could not allocate DMA memory\n", sc->sc_dev.dv_xname); @@ -523,7 +522,6 @@ rt2560_alloc_rx_ring(struct rt2560_softc *sc, struct rt2560_rx_ring *ring, goto fail; } - memset(ring->desc, 0, count * RT2560_RX_DESC_SIZE); ring->physaddr = ring->map->dm_segs->ds_addr; ring->data = malloc(count * sizeof (struct rt2560_rx_data), M_DEVBUF, |