Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add a new function call to the ISA DMA API: isa_dmamaxsi...
details: https://anonhg.NetBSD.org/src/rev/5c7696b1f5a8
branches: trunk
changeset: 481852:5c7696b1f5a8
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon Feb 07 22:07:27 2000 +0000
description:
Add a new function call to the ISA DMA API: isa_dmamaxsize(), which returns
the maximum transfer size for the specified DMA channel. Make all clients
of ISA DMA use this call to determine their maximum transfer size.
diffstat:
sys/arch/alpha/include/isa_machdep.h | 4 +-
sys/arch/alpha/isa/fd.c | 9 +++-
sys/arch/alpha/isa/fdreg.h | 3 +-
sys/arch/arm32/include/isa_machdep.h | 4 +-
sys/arch/atari/include/isa_machdep.h | 4 +-
sys/arch/bebox/include/isa_machdep.h | 4 +-
sys/arch/bebox/isa/fd.c | 9 +++-
sys/arch/bebox/isa/fdreg.h | 3 +-
sys/arch/i386/include/isa_machdep.h | 4 +-
sys/arch/i386/isa/fd.c | 9 +++-
sys/arch/i386/isa/fdreg.h | 3 +-
sys/dev/ic/interwave.c | 14 +++++++-
sys/dev/ic/interwavevar.h | 4 +-
sys/dev/isa/ad1848_isa.c | 27 ++++++++++++++---
sys/dev/isa/ad1848var.h | 4 +-
sys/dev/isa/cs89x0.c | 10 +++++-
sys/dev/isa/ess.c | 21 ++++++++++---
sys/dev/isa/essvar.h | 5 +-
sys/dev/isa/gus.c | 44 ++++++++++++++++-----------
sys/dev/isa/isadma.c | 42 +++++++++++++++++++-------
sys/dev/isa/isadmareg.h | 56 +++++++++++++++++++++++++++++++++++-
sys/dev/isa/isadmavar.h | 9 +++--
sys/dev/isa/satlink.c | 40 ++++++++++++------------
sys/dev/isa/sbdsp.c | 26 +++++++++++++---
sys/dev/isa/sbdspvar.h | 4 +-
sys/dev/isa/wdc_isa.c | 11 ++++++-
sys/dev/isa/wt.c | 9 +++++-
sys/dev/isapnp/gus_isapnp.c | 10 ++++-
28 files changed, 289 insertions(+), 103 deletions(-)
diffs (truncated from 1062 to 300 lines):
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/alpha/include/isa_machdep.h
--- a/sys/arch/alpha/include/isa_machdep.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/alpha/include/isa_machdep.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.h,v 1.3 1999/03/19 05:04:42 cgd Exp $ */
+/* $NetBSD: isa_machdep.h,v 1.4 2000/02/07 22:07:27 thorpej Exp $ */
/*
* Copyright (c) 1996 Carnegie-Mellon University.
@@ -64,6 +64,8 @@
_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
#define isa_dmacascade(ic, c) \
_isa_dmacascade(&(ic)->ic_dmastate, (c))
+#define isa_dmamaxsize(ic, c) \
+ _isa_dmamaxsize(&(ic)->ic_dmastate, (c))
#define isa_dmamap_create(ic, c, s, f) \
_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
#define isa_dmamap_destroy(ic, c) \
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/alpha/isa/fd.c
--- a/sys/arch/alpha/isa/fd.c Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/alpha/isa/fd.c Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.7 2000/02/07 20:16:47 thorpej Exp $ */
+/* $NetBSD: fd.c,v 1.8 2000/02/07 22:07:28 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -175,6 +175,7 @@
#define sc_fdinioh sc_fdctlioh
int sc_drq;
+ bus_size_t sc_maxiosize;
struct fd_softc *sc_fd[4]; /* pointers to children */
TAILQ_HEAD(drivehead, fd_softc) sc_drives;
@@ -453,7 +454,9 @@
fdc->sc_state = DEVIDLE;
TAILQ_INIT(&fdc->sc_drives);
- if (isa_dmamap_create(fdc->sc_ic, fdc->sc_drq, FDC_MAXIOSIZE,
+ fdc->sc_maxiosize = isa_dmamaxsize(fdc->sc_ic, fdc->sc_drq);
+
+ if (isa_dmamap_create(fdc->sc_ic, fdc->sc_drq, fdc->sc_maxiosize,
BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
printf("%s: can't set up ISA DMA map\n",
fdc->sc_dev.dv_xname);
@@ -1064,7 +1067,7 @@
sec = fd->sc_blkno % type->seccyl;
nblks = type->seccyl - sec;
nblks = min(nblks, fd->sc_bcount / FDC_BSIZE);
- nblks = min(nblks, FDC_MAXIOSIZE / FDC_BSIZE);
+ nblks = min(nblks, fdc->sc_maxiosize / FDC_BSIZE);
fd->sc_nblks = nblks;
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
head = sec / type->sectrac;
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/alpha/isa/fdreg.h
--- a/sys/arch/alpha/isa/fdreg.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/alpha/isa/fdreg.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdreg.h,v 1.1 1999/02/18 20:15:53 thorpej Exp $ */
+/* $NetBSD: fdreg.h,v 1.2 2000/02/07 22:07:28 thorpej Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -63,7 +63,6 @@
#define FDC_BSIZE 512
#define FDC_NPORT 8
-#define FDC_MAXIOSIZE MAXBSIZE
/*
* Copyright (C) 1992-1994 by Joerg Wunsch, Dresden
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/arm32/include/isa_machdep.h
--- a/sys/arch/arm32/include/isa_machdep.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/arm32/include/isa_machdep.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.h,v 1.5 1999/03/19 05:01:52 cgd Exp $ */
+/* $NetBSD: isa_machdep.h,v 1.6 2000/02/07 22:07:29 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -68,6 +68,8 @@
_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
#define isa_dmacascade(ic, c) \
_isa_dmacascade(&(ic)->ic_dmastate, (c))
+#define isa_dmamaxsize(ic, c) \
+ _isa_dmamaxsize(&(ic)->ic_dmastate, (c))
#define isa_dmamap_create(ic, c, s, f) \
_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
#define isa_dmamap_destroy(ic, c) \
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/atari/include/isa_machdep.h
--- a/sys/arch/atari/include/isa_machdep.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/atari/include/isa_machdep.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.h,v 1.6 1999/10/21 15:32:08 leo Exp $ */
+/* $NetBSD: isa_machdep.h,v 1.7 2000/02/07 22:07:29 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -104,6 +104,8 @@
_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
#define isa_dmacascade(ic, c) \
_isa_dmacascade(&(ic)->ic_dmastate, (c))
+#define isa_dmamaxsize(ic, c) \
+ _isa_dmamaxsize(&(ic)->ic_dmastate, (c))
#define isa_dmamap_create(ic, c, s, f) \
_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
#define isa_dmamap_destroy(ic, c) \
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/bebox/include/isa_machdep.h
--- a/sys/arch/bebox/include/isa_machdep.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/bebox/include/isa_machdep.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.h,v 1.8 1999/03/19 05:02:03 cgd Exp $ */
+/* $NetBSD: isa_machdep.h,v 1.9 2000/02/07 22:07:29 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -119,6 +119,8 @@
_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
#define isa_dmacascade(ic, c) \
_isa_dmacascade(&(ic)->ic_dmastate, (c))
+#define isa_dmamaxsize(ic, c) \
+ _isa_dmamaxsize(&(ic)->ic_dmastate, (c))
#define isa_dmamap_create(ic, c, s, f) \
_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
#define isa_dmamap_destroy(ic, c) \
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/bebox/isa/fd.c
--- a/sys/arch/bebox/isa/fd.c Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/bebox/isa/fd.c Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.10 2000/02/07 20:16:50 thorpej Exp $ */
+/* $NetBSD: fd.c,v 1.11 2000/02/07 22:07:29 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -176,6 +176,7 @@
#define sc_fdinioh sc_fdctlioh
int sc_drq;
+ bus_size_t sc_maxiosize;
struct fd_softc *sc_fd[4]; /* pointers to children */
TAILQ_HEAD(drivehead, fd_softc) sc_drives;
@@ -455,7 +456,9 @@
fdc->sc_state = DEVIDLE;
TAILQ_INIT(&fdc->sc_drives);
- if (isa_dmamap_create(fdc->sc_ic, fdc->sc_drq, FDC_MAXIOSIZE,
+ fdc->sc_maxiosize = isa_dmamaxsize(fdc->sc_ic, fdc->sc_drq);
+
+ if (isa_dmamap_create(fdc->sc_ic, fdc->sc_drq, fdc->sc_maxiosize,
BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
printf("%s: can't set up ISA DMA map\n",
fdc->sc_dev.dv_xname);
@@ -1119,7 +1122,7 @@
sec = fd->sc_blkno % type->seccyl;
nblks = type->seccyl - sec;
nblks = min(nblks, fd->sc_bcount / FDC_BSIZE);
- nblks = min(nblks, FDC_MAXIOSIZE / FDC_BSIZE);
+ nblks = min(nblks, fdc->sc_maxiosize / FDC_BSIZE);
fd->sc_nblks = nblks;
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
head = sec / type->sectrac;
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/bebox/isa/fdreg.h
--- a/sys/arch/bebox/isa/fdreg.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/bebox/isa/fdreg.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdreg.h,v 1.2 1999/06/24 01:22:19 sakamoto Exp $ */
+/* $NetBSD: fdreg.h,v 1.3 2000/02/07 22:07:29 thorpej Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -63,7 +63,6 @@
#define FDC_BSIZE 512
#define FDC_NPORT 8
-#define FDC_MAXIOSIZE MAXBSIZE
/*
* Copyright (C) 1992-1994 by Joerg Wunsch, Dresden
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/i386/include/isa_machdep.h
--- a/sys/arch/i386/include/isa_machdep.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/i386/include/isa_machdep.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.h,v 1.13 1999/03/19 05:02:11 cgd Exp $ */
+/* $NetBSD: isa_machdep.h,v 1.14 2000/02/07 22:07:29 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -123,6 +123,8 @@
_isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
#define isa_dmacascade(ic, c) \
_isa_dmacascade(&(ic)->ic_dmastate, (c))
+#define isa_dmamaxsize(ic, c) \
+ _isa_dmamaxsize(&(ic)->ic_dmastate, (c))
#define isa_dmamap_create(ic, c, s, f) \
_isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
#define isa_dmamap_destroy(ic, c) \
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/i386/isa/fd.c
--- a/sys/arch/i386/isa/fd.c Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/i386/isa/fd.c Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.130 2000/02/07 20:16:51 thorpej Exp $ */
+/* $NetBSD: fd.c,v 1.131 2000/02/07 22:07:30 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -176,6 +176,7 @@
#define sc_fdinioh sc_fdctlioh
int sc_drq;
+ bus_size_t sc_maxiosize;
struct fd_softc *sc_fd[4]; /* pointers to children */
TAILQ_HEAD(drivehead, fd_softc) sc_drives;
@@ -455,7 +456,9 @@
fdc->sc_state = DEVIDLE;
TAILQ_INIT(&fdc->sc_drives);
- if (isa_dmamap_create(fdc->sc_ic, fdc->sc_drq, FDC_MAXIOSIZE,
+ fdc->sc_maxiosize = isa_dmamaxsize(fdc->sc_ic, fdc->sc_drq);
+
+ if (isa_dmamap_create(fdc->sc_ic, fdc->sc_drq, fdc->sc_maxiosize,
BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) {
printf("%s: can't set up ISA DMA map\n",
fdc->sc_dev.dv_xname);
@@ -1107,7 +1110,7 @@
sec = fd->sc_blkno % type->seccyl;
nblks = type->seccyl - sec;
nblks = min(nblks, fd->sc_bcount / FDC_BSIZE);
- nblks = min(nblks, FDC_MAXIOSIZE / FDC_BSIZE);
+ nblks = min(nblks, fdc->sc_maxiosize / FDC_BSIZE);
fd->sc_nblks = nblks;
fd->sc_nbytes = finfo ? bp->b_bcount : nblks * FDC_BSIZE;
head = sec / type->sectrac;
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/arch/i386/isa/fdreg.h
--- a/sys/arch/i386/isa/fdreg.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/arch/i386/isa/fdreg.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdreg.h,v 1.10 1997/09/07 13:03:10 mycroft Exp $ */
+/* $NetBSD: fdreg.h,v 1.11 2000/02/07 22:07:30 thorpej Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -63,7 +63,6 @@
#define FDC_BSIZE 512
#define FDC_NPORT 8
-#define FDC_MAXIOSIZE MAXBSIZE
/*
* Copyright (C) 1992-1994 by Joerg Wunsch, Dresden
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/dev/ic/interwave.c
--- a/sys/dev/ic/interwave.c Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/dev/ic/interwave.c Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: interwave.c,v 1.11 1999/02/17 21:44:55 mycroft Exp $ */
+/* $NetBSD: interwave.c,v 1.12 2000/02/07 22:07:30 thorpej Exp $ */
/*
* Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
@@ -1640,8 +1640,16 @@
int direction;
size_t size;
{
- if (size > MAX_ISADMA)
- size = MAX_ISADMA;
+ struct iw_softc *sc = addr;
+ bus_size_t maxsize;
+
+ if (direction == AUMODE_PLAY)
+ maxsize = sc->sc_play_maxsize;
+ else
+ maxsize = sc->sc_rec_maxsize;
+
+ if (size > maxsize)
+ size = maxsize;
return (size);
}
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/dev/ic/interwavevar.h
--- a/sys/dev/ic/interwavevar.h Mon Feb 07 21:40:40 2000 +0000
+++ b/sys/dev/ic/interwavevar.h Mon Feb 07 22:07:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: interwavevar.h,v 1.6 1999/02/17 21:44:55 mycroft Exp $ */
+/* $NetBSD: interwavevar.h,v 1.7 2000/02/07 22:07:30 thorpej Exp $ */
/*
* Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
@@ -107,7 +107,9 @@
void *sc_recarg;
void *sc_recdma_bp;
int sc_playdrq;
+ bus_size_t sc_play_maxsize;
int sc_recdrq;
+ bus_size_t sc_rec_maxsize;
int sc_recdma_cnt;
int sc_playing;
int sc_maxdma;
diff -r 212ebce18f31 -r 5c7696b1f5a8 sys/dev/isa/ad1848_isa.c
Home |
Main Index |
Thread Index |
Old Index