Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic rearrange the order of bus_dma operations to be m...
details: https://anonhg.NetBSD.org/src/rev/8ad0f8088a24
branches: trunk
changeset: 486312:8ad0f8088a24
user: mrg <mrg%NetBSD.org@localhost>
date: Thu May 18 14:00:46 2000 +0000
description:
rearrange the order of bus_dma operations to be more like many other
drivers, at the suggestion of fvdl. also, use bus_dmamap_load() not
load_raw().
diffstat:
sys/dev/ic/hme.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diffs (64 lines):
diff -r 678438b4e23a -r 8ad0f8088a24 sys/dev/ic/hme.c
--- a/sys/dev/ic/hme.c Thu May 18 13:23:43 2000 +0000
+++ b/sys/dev/ic/hme.c Thu May 18 14:00:46 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hme.c,v 1.12 2000/05/18 12:49:09 mrg Exp $ */
+/* $NetBSD: hme.c,v 1.13 2000/05/18 14:00:46 mrg Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -202,13 +202,6 @@
sc->sc_rb.rb_ntbuf * _HME_BUFSZ + /* TX buffers */
sc->sc_rb.rb_nrbuf * _HME_BUFSZ; /* TX buffers */
- if ((error = bus_dmamap_create(dmatag, size, 1, size, 0,
- BUS_DMA_NOWAIT, &sc->sc_dmamap)) != 0) {
- printf("%s: DMA map create error %d\n",
- sc->sc_dev.dv_xname, error);
- return;
- }
-
/* Allocate DMA buffer */
if ((error = bus_dmamem_alloc(dmatag, size,
2048, 0,
@@ -218,16 +211,6 @@
return;
}
- /* Load the buffer */
- if ((error = bus_dmamap_load_raw(dmatag, sc->sc_dmamap,
- &seg, rseg, size, BUS_DMA_NOWAIT)) != 0) {
- printf("%s: DMA buffer map load error %d\n",
- sc->sc_dev.dv_xname, error);
- bus_dmamem_free(dmatag, &seg, rseg);
- return;
- }
- sc->sc_rb.rb_dmabase = sc->sc_dmamap->dm_segs[0].ds_addr;
-
/* Map DMA memory in CPU addressable space */
if ((error = bus_dmamem_map(dmatag, &seg, rseg, size,
&sc->sc_rb.rb_membase,
@@ -239,6 +222,23 @@
return;
}
+ if ((error = bus_dmamap_create(dmatag, size, 1, size, 0,
+ BUS_DMA_NOWAIT, &sc->sc_dmamap)) != 0) {
+ printf("%s: DMA map create error %d\n",
+ sc->sc_dev.dv_xname, error);
+ return;
+ }
+
+ /* Load the buffer */
+ if ((error = bus_dmamap_load(dmatag, sc->sc_dmamap,
+ sc->sc_rb.rb_membase, size, NULL, BUS_DMA_NOWAIT)) != 0) {
+ printf("%s: DMA buffer map load error %d\n",
+ sc->sc_dev.dv_xname, error);
+ bus_dmamem_free(dmatag, &seg, rseg);
+ return;
+ }
+ sc->sc_rb.rb_dmabase = sc->sc_dmamap->dm_segs[0].ds_addr;
+
printf(": address %s\n", ether_sprintf(sc->sc_enaddr));
/* Initialize ifnet structure. */
Home |
Main Index |
Thread Index |
Old Index