summaryrefslogtreecommitdiffstats
path: root/sys/dev/tx
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2003-08-12 14:55:12 +0000
committermux <mux@FreeBSD.org>2003-08-12 14:55:12 +0000
commit31088bfee5bd60f1348f938b7ef9c491ae7f1dcd (patch)
tree4f30055079efe7af7111ba382f6d9c9ab741734f /sys/dev/tx
parent78ac3dc812906e38350a8cc85455423166fe18f7 (diff)
downloadFreeBSD-src-31088bfee5bd60f1348f938b7ef9c491ae7f1dcd.zip
FreeBSD-src-31088bfee5bd60f1348f938b7ef9c491ae7f1dcd.tar.gz
- No need to bzero() the softc structure.
- Use BUS_DMA_ZERO where appropriate.
Diffstat (limited to 'sys/dev/tx')
-rw-r--r--sys/dev/tx/if_tx.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c
index cdd5844..9b1b3e6 100644
--- a/sys/dev/tx/if_tx.c
+++ b/sys/dev/tx/if_tx.c
@@ -234,7 +234,6 @@ epic_attach(dev)
unit = device_get_unit(dev);
/* Preinitialize softc structure. */
- bzero(sc, sizeof(epic_softc_t));
sc->unit = unit;
sc->dev = dev;
@@ -318,12 +317,11 @@ epic_attach(dev)
/* Allocate DMA safe memory and get the DMA addresses. */
error = bus_dmamem_alloc(sc->ftag, (void **)&sc->tx_flist,
- BUS_DMA_NOWAIT, &sc->fmap);
+ BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->fmap);
if (error) {
device_printf(dev, "couldn't allocate dma memory\n");
goto fail;
}
- bzero(sc->tx_flist, sizeof(struct epic_frag_list) * TX_RING_SIZE);
error = bus_dmamap_load(sc->ftag, sc->fmap, sc->tx_flist,
sizeof(struct epic_frag_list) * TX_RING_SIZE, epic_dma_map_addr,
&sc->frag_addr, 0);
@@ -332,12 +330,11 @@ epic_attach(dev)
goto fail;
}
error = bus_dmamem_alloc(sc->ttag, (void **)&sc->tx_desc,
- BUS_DMA_NOWAIT, &sc->tmap);
+ BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->tmap);
if (error) {
device_printf(dev, "couldn't allocate dma memory\n");
goto fail;
}
- bzero(sc->tx_desc, sizeof(struct epic_tx_desc) * TX_RING_SIZE);
error = bus_dmamap_load(sc->ttag, sc->tmap, sc->tx_desc,
sizeof(struct epic_tx_desc) * TX_RING_SIZE, epic_dma_map_addr,
&sc->tx_addr, 0);
@@ -346,12 +343,11 @@ epic_attach(dev)
goto fail;
}
error = bus_dmamem_alloc(sc->rtag, (void **)&sc->rx_desc,
- BUS_DMA_NOWAIT, &sc->rmap);
+ BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->rmap);
if (error) {
device_printf(dev, "couldn't allocate dma memory\n");
goto fail;
}
- bzero(sc->rx_desc, sizeof(struct epic_rx_desc) * RX_RING_SIZE);
error = bus_dmamap_load(sc->rtag, sc->rmap, sc->rx_desc,
sizeof(struct epic_rx_desc) * RX_RING_SIZE, epic_dma_map_addr,
&sc->rx_addr, 0);
OpenPOWER on IntegriCloud