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.15 and 1.16 [mrg]:



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

description:
Pullup 1.15 and 1.16 [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.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (47 lines):

diff -r ac6c3028a5e4 -r 18577792213a sys/dev/sbus/if_le.c
--- a/sys/dev/sbus/if_le.c      Wed Oct 25 16:34:14 2000 +0000
+++ b/sys/dev/sbus/if_le.c      Wed Oct 25 16:38:11 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le.c,v 1.13.4.1 2000/07/19 02:53:06 mrg Exp $       */
+/*     $NetBSD: if_le.c,v 1.13.4.2 2000/10/25 16:38:11 tv Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -245,27 +245,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: DMA buffer map error %d\n",
                                self->dv_xname, error);
-                       bus_dmamap_unload(dmatag, lesc->sc_dmamap);
                        bus_dmamem_free(lesc->sc_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;
+               }
+
                sc->sc_addr = lesc->sc_dmamap->dm_segs[0].ds_addr & 0xffffff;
                sc->sc_memsize = MEMSIZE;
                sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON;



Home | Main Index | Thread Index | Old Index