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/vme Pullup rev. 1.30.
details: https://anonhg.NetBSD.org/src/rev/43d60a48f5f9
branches: netbsd-1-5
changeset: 488661:43d60a48f5f9
user: pk <pk%NetBSD.org@localhost>
date: Sat Jul 22 21:03:22 2000 +0000
description:
Pullup rev. 1.30.
Use vme_dmamap_create().
diffstat:
sys/dev/vme/xd.c | 47 ++++++++++++++++++++++++++++++-----------------
1 files changed, 30 insertions(+), 17 deletions(-)
diffs (113 lines):
diff -r 239e2c615d3d -r 43d60a48f5f9 sys/dev/vme/xd.c
--- a/sys/dev/vme/xd.c Sat Jul 22 15:53:25 2000 +0000
+++ b/sys/dev/vme/xd.c Sat Jul 22 21:03:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xd.c,v 1.27 2000/06/05 15:58:43 chs Exp $ */
+/* $NetBSD: xd.c,v 1.27.2.1 2000/07/22 21:03:22 pk Exp $ */
/*
*
@@ -83,6 +83,7 @@
#include <dev/sun/disklabel.h>
#endif
+#include <dev/vme/vmereg.h>
#include <dev/vme/vmevar.h>
#include <dev/vme/xdreg.h>
@@ -463,10 +464,10 @@
vme_am_t mod;
int error;
- mod = 0x2d; /* VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA */
- if (vme_space_alloc(va->va_vct, va->r[0].offset, sizeof(struct xdc),
- mod))
+ mod = VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA;
+ if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xdc), mod))
return (0);
+
error = vme_probe(ct, va->r[0].offset, sizeof(struct xdc),
mod, VME_D32, xdc_probe, 0);
vme_space_free(va->va_vct, va->r[0].offset, sizeof(struct xdc), mod);
@@ -503,11 +504,11 @@
* into our xdc_softc. */
xdc->dmatag = va->va_bdt;
- mod = 0x2d; /* VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA */
+ mod = VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA;
- if (vme_space_alloc(va->va_vct, va->r[0].offset, sizeof(struct xdc),
- mod))
+ if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xdc), mod))
panic("xdc: vme alloc");
+
if (vme_space_map(ct, va->r[0].offset, sizeof(struct xdc),
mod, VME_D32, 0, &bt, &bh, &resc) != 0)
panic("xdc: vme_map");
@@ -528,28 +529,37 @@
*/
/* Get DMA handle for misc. transfers */
- if ((error = bus_dmamap_create(
- xdc->dmatag,
- MAXPHYS,
+ if ((error = vme_dmamap_create(
+ ct, /* VME chip tag */
+ MAXPHYS, /* size */
+ VME_AM_A24, /* address modifier */
+ VME_D32, /* data size */
+ 0, /* swap */
1, /* nsegments */
- MAXPHYS,
+ MAXPHYS, /* maxsegsz */
0, /* boundary */
BUS_DMA_NOWAIT,
&xdc->auxmap)) != 0) {
+
printf("%s: DMA buffer map create error %d\n",
xdc->sc_dev.dv_xname, error);
return;
}
+
/* Get DMA handle for mapping iorq descriptors */
- if ((error = bus_dmamap_create(
- xdc->dmatag,
+ if ((error = vme_dmamap_create(
+ ct, /* VME chip tag */
XDC_MAXIOPB * sizeof(struct xd_iopb),
+ VME_AM_A24, /* address modifier */
+ VME_D32, /* data size */
+ 0, /* swap */
1, /* nsegments */
XDC_MAXIOPB * sizeof(struct xd_iopb),
0, /* boundary */
BUS_DMA_NOWAIT,
&xdc->iopmap)) != 0) {
+
printf("%s: DMA buffer map create error %d\n",
xdc->sc_dev.dv_xname, error);
return;
@@ -584,15 +594,18 @@
xdc->iopbase[lcv].naddrmod = XDC_ADDRMOD; /* always the same */
xdc->iopbase[lcv].intr_vec = xdc->vector; /* always the same */
- error = bus_dmamap_create(
- xdc->dmatag,
+ if ((error = vme_dmamap_create(
+ ct, /* VME chip tag */
MAXPHYS, /* size */
+ VME_AM_A24, /* address modifier */
+ VME_D32, /* data size */
+ 0, /* swap */
1, /* nsegments */
MAXPHYS, /* maxsegsz */
0, /* boundary */
BUS_DMA_NOWAIT,
- &xdc->reqs[lcv].dmamap);
- if (error) {
+ &xdc->reqs[lcv].dmamap)) != 0) {
+
printf("%s: DMA buffer map create error %d\n",
xdc->sc_dev.dv_xname, error);
return;
Home |
Main Index |
Thread Index |
Old Index