Make clarified SCSI transfer direction flag. sc_ispullup == pullup
data from SCSI device == DMA into main memory == datain.
This commit is contained in:
parent
38c3726a7b
commit
b52ffbdbe9
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tcds_dma.c,v 1.28 1999/03/15 05:28:07 nisimura Exp $ */
|
||||
/* $NetBSD: tcds_dma.c,v 1.29 2000/06/02 04:35:06 nisimura Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -68,7 +68,7 @@
|
|||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: tcds_dma.c,v 1.28 1999/03/15 05:28:07 nisimura Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tcds_dma.c,v 1.29 2000/06/02 04:35:06 nisimura Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -162,7 +162,7 @@ tcds_dma_intr(sc)
|
|||
}
|
||||
|
||||
resid = 0;
|
||||
if (!sc->sc_iswrite &&
|
||||
if (!sc->sc_ispullup &&
|
||||
(resid = (NCR_READ_REG(nsc, NCR_FFLAG) & NCRFIFO_FF)) != 0) {
|
||||
NCR_DMA(("dmaintr: empty esp FIFO of %d ", resid));
|
||||
DELAY(1);
|
||||
|
@ -190,12 +190,12 @@ tcds_dma_intr(sc)
|
|||
tcl, tcm, tch, trans, resid));
|
||||
|
||||
bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize,
|
||||
(sc->sc_iswrite ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE));
|
||||
(sc->sc_ispullup ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE));
|
||||
|
||||
/*
|
||||
* Clean up unaligned DMAs into main memory.
|
||||
*/
|
||||
if (sc->sc_iswrite) {
|
||||
if (sc->sc_ispullup) {
|
||||
/* Handle unaligned starting address, length. */
|
||||
dud = bus_space_read_4(sc->sc_bst, sc->sc_bsh, sc->sc_dud0);
|
||||
if ((dud & TCDS_DUD0_VALIDBITS) != 0) {
|
||||
|
@ -257,7 +257,7 @@ tcds_dma_intr(sc)
|
|||
return 0;
|
||||
|
||||
/* and again */
|
||||
dma_start(sc, sc->sc_dmaaddr, sc->sc_dmalen, sc->sc_iswrite);
|
||||
dma_start(sc, sc->sc_dmaaddr, sc->sc_dmalen, sc->sc_ispullup);
|
||||
return 1;
|
||||
#endif
|
||||
return 0;
|
||||
|
@ -281,10 +281,10 @@ tcds_dma_setup(sc, addr, len, datain, dmasize)
|
|||
|
||||
sc->sc_dmaaddr = addr;
|
||||
sc->sc_dmalen = len;
|
||||
sc->sc_iswrite = datain;
|
||||
sc->sc_ispullup = datain;
|
||||
|
||||
NCR_DMA(("tcds_dma %d: start %d@%p,%d\n", sc->sc_slot,
|
||||
(int)*sc->sc_dmalen, *sc->sc_dmaaddr, sc->sc_iswrite));
|
||||
(int)*sc->sc_dmalen, *sc->sc_dmaaddr, sc->sc_ispullup));
|
||||
|
||||
/*
|
||||
* the rules say we cannot transfer more than the limit
|
||||
|
@ -306,7 +306,7 @@ tcds_dma_setup(sc, addr, len, datain, dmasize)
|
|||
}
|
||||
|
||||
bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize,
|
||||
(sc->sc_iswrite ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE));
|
||||
(sc->sc_ispullup ? BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE));
|
||||
|
||||
/* Load address, set/clear unaligned transfer and read/write bits. */
|
||||
bus_space_write_4(sc->sc_bst, sc->sc_bsh, sc->sc_sda,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tcdsvar.h,v 1.11 2000/03/13 23:52:26 soren Exp $ */
|
||||
/* $NetBSD: tcdsvar.h,v 1.12 2000/06/02 04:35:07 nisimura Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
|
||||
|
@ -65,7 +65,7 @@ struct tcds_slotconfig {
|
|||
bus_dma_tag_t sc_dmat;
|
||||
bus_dmamap_t sc_dmamap;
|
||||
int sc_active; /* DMA active ? */
|
||||
int sc_iswrite; /* DMA into main memory? */
|
||||
int sc_ispullup; /* DMA into main memory? */
|
||||
size_t sc_dmasize;
|
||||
caddr_t *sc_dmaaddr;
|
||||
size_t *sc_dmalen;
|
||||
|
|
Loading…
Reference in New Issue