diff options
Diffstat (limited to 'sys/dev/ic/malo.c')
-rw-r--r-- | sys/dev/ic/malo.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/ic/malo.c b/sys/dev/ic/malo.c index d9a2243e3de..c87afadadcc 100644 --- a/sys/dev/ic/malo.c +++ b/sys/dev/ic/malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malo.c,v 1.89 2009/07/12 18:24:23 mglocker Exp $ */ +/* $OpenBSD: malo.c,v 1.90 2010/05/19 15:27:35 oga Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -552,7 +552,8 @@ malo_alloc_rx_ring(struct malo_softc *sc, struct malo_rx_ring *ring, int count) error = bus_dmamem_alloc(sc->sc_dmat, count * sizeof(struct malo_rx_desc), - 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); @@ -576,7 +577,6 @@ malo_alloc_rx_ring(struct malo_softc *sc, struct malo_rx_ring *ring, int count) goto fail; } - bzero(ring->desc, count * sizeof(struct malo_rx_desc)); ring->physaddr = ring->map->dm_segs->ds_addr; ring->data = malloc(count * sizeof (struct malo_rx_data), M_DEVBUF, @@ -711,8 +711,8 @@ malo_alloc_tx_ring(struct malo_softc *sc, struct malo_tx_ring *ring, } error = bus_dmamem_alloc(sc->sc_dmat, - count * sizeof(struct malo_tx_desc), - PAGE_SIZE, 0, &ring->seg, 1, &nsegs, BUS_DMA_NOWAIT); + count * sizeof(struct malo_tx_desc), 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); @@ -736,7 +736,6 @@ malo_alloc_tx_ring(struct malo_softc *sc, struct malo_tx_ring *ring, goto fail; } - memset(ring->desc, 0, count * sizeof(struct malo_tx_desc)); ring->physaddr = ring->map->dm_segs->ds_addr; ring->data = malloc(count * sizeof(struct malo_tx_data), M_DEVBUF, |