Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/sbus Pullup 1.12 and 1.13 [mrg]:



details:   https://anonhg.NetBSD.org/src/rev/5781b0272f09
branches:  netbsd-1-5
changeset: 489989:5781b0272f09
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Oct 25 16:38:35 2000 +0000

description:
Pullup 1.12 and 1.13 [mrg]:
rework to use bus_dmamem_map() then bus_dmamem_load(), rather than
bus_dmamem_load_raw() then bus_dmamem_map().

ensure DMA mappings are not mapped streamable.  fixes ethernet problems on
ultrasparc sbus class machines.  from eeh.

diffstat:

 sys/dev/sbus/if_le_ledma.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (46 lines):

diff -r 18577792213a -r 5781b0272f09 sys/dev/sbus/if_le_ledma.c
--- a/sys/dev/sbus/if_le_ledma.c        Wed Oct 25 16:38:11 2000 +0000
+++ b/sys/dev/sbus/if_le_ledma.c        Wed Oct 25 16:38:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le_ledma.c,v 1.10.4.1 2000/07/19 02:53:06 mrg Exp $ */
+/*     $NetBSD: if_le_ledma.c,v 1.10.4.2 2000/10/25 16:38:35 tv Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -390,26 +390,26 @@
                return;
        }
 
-       /* Load DMA buffer */
-       if ((error = bus_dmamap_load_raw(dmatag, lesc->sc_dmamap,
-                               &seg, rseg, MEMSIZE, BUS_DMA_NOWAIT)) != 0) {
-               printf("%s: DMA buffer map load error %d\n",
-                       self->dv_xname, error);
-               bus_dmamem_free(dmatag, &seg, rseg);
-               return;
-       }
-
        /* Map DMA buffer into kernel space */
        if ((error = bus_dmamem_map(dmatag, &seg, rseg, MEMSIZE,
                               (caddr_t *)&sc->sc_mem,
                               BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
                printf("%s @ ledma: DMA buffer map error %d\n",
                        self->dv_xname, error);
-               bus_dmamap_unload(dmatag, lesc->sc_dmamap);
                bus_dmamem_free(dmatag, &seg, rseg);
                return;
        }
 
+       /* Load DMA buffer */
+       if ((error = bus_dmamap_load(dmatag, lesc->sc_dmamap, sc->sc_mem,
+                       MEMSIZE, NULL, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
+               printf("%s: DMA buffer map load error %d\n",
+                       self->dv_xname, error);
+               bus_dmamem_free(dmatag, &seg, rseg);
+               bus_dmamem_unmap(dmatag, sc->sc_mem, MEMSIZE);
+               return;
+       }
+
        lesc->sc_laddr = lesc->sc_dmamap->dm_segs[0].ds_addr;
        sc->sc_addr = lesc->sc_laddr & 0xffffff;
        sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON;



Home | Main Index | Thread Index | Old Index