fixes SCSI.
authorpefo <pefo@openbsd.org>
Mon, 17 Feb 1997 19:08:25 +0000 (19:08 +0000)
committerpefo <pefo@openbsd.org>
Mon, 17 Feb 1997 19:08:25 +0000 (19:08 +0000)
sys/arch/wgrisc/dev/asc.c
sys/arch/wgrisc/dev/dma.h

index c4cdae7..4ccba23 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: asc.c,v 1.1.1.1 1997/02/06 16:02:42 pefo Exp $        */
+/*     $OpenBSD: asc.c,v 1.2 1997/02/17 19:08:25 pefo Exp $    */
 /*     $NetBSD: asc.c,v 1.10 1994/12/05 19:11:12 dean Exp $    */
 
 /*-
@@ -1075,6 +1075,7 @@ printf("asc_intr: fifo flush %d len %d fifo %x\n", fifo, len, regs->asc_fifo);
                                        len = state->dmalen - len;
                                        goto do_in;
                                }
+                               DMA_END(&asc->dma);
                                state->script =
                                        &asc_scripts[SCRIPT_RESUME_DMA_IN];
                        } else if (state->flags & DMA_OUT)
index 3011b06..0eb2e30 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dma.h,v 1.2 1997/02/16 22:31:22 pefo Exp $ */
+/*     $OpenBSD: dma.h,v 1.3 1997/02/17 19:08:28 pefo Exp $ */
 
 /*
  * Copyright (c) 1996 Per Fogelstrom
@@ -140,17 +140,17 @@ typedef struct dma_softc {
            if((c)->dma_ch == DMA_CH0) {                                \
                out32(R3715_IO_TIMING, in32(R3715_IO_TIMING) & ~0x10);  \
                resudial = in32(R3715_DMA_CNT0);                        \
-if(resudial)                                                           \
-printf("res: %d\n", resudial);                                         \
            }                                                           \
            else {                                                      \
                out32(R3715_IO_TIMING, in32(R3715_IO_TIMING) & ~0x400); \
                resudial = in32(R3715_DMA_CNT1);                        \
            }                                                           \
+           if(resudial)                                                \
+               resudial++;                                             \
            if((c)->mode == DMA_FROM_DEV) {                             \
                int *_v = (int *)(c)->req_va;                           \
                int *_p = (int *)PHYS_TO_UNCACHED(CACHED_TO_PHYS(dma_buffer)); \
-               int _n = (c)->req_size;                                 \
+               int _n = (c)->req_size - resudial;                      \
                while(_n > 0) {                                         \
                        *_v = htonl(*_p);                               \
                        _p++; _v++; _n -= 4;                            \