mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-04 09:09:56 +00:00
Use the BUS_DMA_ZERO flag.
This commit is contained in:
parent
e41cbeba6d
commit
fa31bfaa13
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118089
@ -1162,13 +1162,11 @@ rl_allocmemcplus(dev, sc)
|
||||
/* Allocate DMA'able memory for the TX ring */
|
||||
|
||||
error = bus_dmamem_alloc(sc->rl_ldata.rl_tx_list_tag,
|
||||
(void **)&sc->rl_ldata.rl_tx_list, BUS_DMA_NOWAIT,
|
||||
(void **)&sc->rl_ldata.rl_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
|
||||
&sc->rl_ldata.rl_tx_list_map);
|
||||
if (error)
|
||||
return (ENOMEM);
|
||||
|
||||
bzero((char *)sc->rl_ldata.rl_tx_list, RL_TX_LIST_SZ);
|
||||
|
||||
/* Load the map for the TX ring. */
|
||||
|
||||
error = bus_dmamap_load(sc->rl_ldata.rl_tx_list_tag,
|
||||
@ -1202,13 +1200,11 @@ rl_allocmemcplus(dev, sc)
|
||||
/* Allocate DMA'able memory for the RX ring */
|
||||
|
||||
error = bus_dmamem_alloc(sc->rl_ldata.rl_rx_list_tag,
|
||||
(void **)&sc->rl_ldata.rl_rx_list, BUS_DMA_NOWAIT,
|
||||
(void **)&sc->rl_ldata.rl_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
|
||||
&sc->rl_ldata.rl_rx_list_map);
|
||||
if (error)
|
||||
return (ENOMEM);
|
||||
|
||||
bzero((char *)sc->rl_ldata.rl_rx_list, RL_RX_LIST_SZ);
|
||||
|
||||
/* Load the map for the RX ring. */
|
||||
|
||||
error = bus_dmamap_load(sc->rl_ldata.rl_rx_list_tag,
|
||||
|
@ -1270,7 +1270,7 @@ sis_attach(dev)
|
||||
goto fail;
|
||||
|
||||
error = bus_dmamem_alloc(sc->sis_ldata.sis_rx_tag,
|
||||
(void **)&sc->sis_ldata.sis_rx_list, BUS_DMA_NOWAIT,
|
||||
(void **)&sc->sis_ldata.sis_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
|
||||
&sc->sis_ldata.sis_rx_dmamap);
|
||||
|
||||
if (error) {
|
||||
@ -1309,7 +1309,7 @@ sis_attach(dev)
|
||||
goto fail;
|
||||
|
||||
error = bus_dmamem_alloc(sc->sis_ldata.sis_tx_tag,
|
||||
(void **)&sc->sis_ldata.sis_tx_list, BUS_DMA_NOWAIT,
|
||||
(void **)&sc->sis_ldata.sis_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
|
||||
&sc->sis_ldata.sis_tx_dmamap);
|
||||
|
||||
if (error) {
|
||||
@ -1347,9 +1347,6 @@ sis_attach(dev)
|
||||
if (error)
|
||||
goto fail;
|
||||
|
||||
bzero(sc->sis_ldata.sis_tx_list, SIS_TX_LIST_SZ);
|
||||
bzero(sc->sis_ldata.sis_rx_list, SIS_RX_LIST_SZ);
|
||||
|
||||
/*
|
||||
* Obtain the physical addresses of the RX and TX
|
||||
* rings which we'll need later in the init routine.
|
||||
@ -1426,7 +1423,7 @@ sis_detach(dev)
|
||||
SIS_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
/* These should only be active if attach succeeded */
|
||||
/* These should only be active if attach succeeded. */
|
||||
if (device_is_attached(dev)) {
|
||||
sis_reset(sc);
|
||||
sis_stop(sc);
|
||||
|
Loading…
Reference in New Issue
Block a user