summaryrefslogtreecommitdiff
path: root/sys/dev/pci/isp_pci.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-08-25 14:52:58 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-08-25 14:52:58 +0000
commit37829d2f9d3a06ea914a93398cda232b3250c495 (patch)
treea19112ff3f096a93490b9a2afb7c4b11085860be /sys/dev/pci/isp_pci.c
parentec48ce018c8728f707a54f5fbac6bb3ddb5460ff (diff)
deal with 5 arg for of bus_dmamap_sync() if available
Diffstat (limited to 'sys/dev/pci/isp_pci.c')
-rw-r--r--sys/dev/pci/isp_pci.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/pci/isp_pci.c b/sys/dev/pci/isp_pci.c
index e4aaa8277f5..45306e85e0d 100644
--- a/sys/dev/pci/isp_pci.c
+++ b/sys/dev/pci/isp_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_pci.c,v 1.20 2001/08/25 10:13:29 art Exp $ */
+/* $OpenBSD: isp_pci.c,v 1.21 2001/08/25 14:52:57 jason Exp $ */
/*
* PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
*
@@ -242,6 +242,13 @@ static struct ispmdvec mdvec_2200 = {
#define BUS_DMA_COHERENT BUS_DMAMEM_NOSYNC
#endif
+#ifdef __HAS_NEW_BUS_DMAMAP_SYNC
+#define isp_bus_dmamap_sync(t, m, o, l, f) \
+ bus_dmamap_sync((t), (m), (o), (l), (f))
+#else
+#define isp_bus_dmamap_sync(t, m, o, l, f) \
+ bus_dmamap_sync((t), (m), (f))
+#endif
static int isp_pci_probe (struct device *, void *, void *);
static void isp_pci_attach (struct device *, struct device *, void *);
@@ -908,13 +915,14 @@ isp_pci_dmasetup(struct ispsoftc *isp, XS_T *xs, ispreq_t *rq, u_int16_t *iptrp,
} while (seg < segcnt);
dmasync:
- bus_dmamap_sync(pci->pci_dmat, dmap, (xs->flags & SCSI_DATA_IN) ?
+ isp_bus_dmamap_sync(pci->pci_dmat, dmap, 0, dmap->dm_mapsize,
+ (xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
mbxsync:
ISP_SWIZZLE_REQUEST(isp, rq);
- bus_dmamap_sync(pci->pci_dmat, pci->pci_rquest_dmap,
- BUS_DMASYNC_PREWRITE);
+ isp_bus_dmamap_sync(pci->pci_dmat, pci->pci_rquest_dmap, 0,
+ pci->pci_request_dmap->dm_mapsize, BUS_DMASYNC_PREWRITE);
return (CMD_QUEUED);
}
@@ -925,7 +933,8 @@ isp_pci_intr(void *arg)
struct ispsoftc *isp = (struct ispsoftc *)arg;
struct isp_pcisoftc *p = (struct isp_pcisoftc *)isp;
- bus_dmamap_sync(p->pci_dmat, p->pci_result_dmap, BUS_DMASYNC_POSTREAD);
+ isp_bus_dmamap_sync(p->pci_dmat, p->pci_result_dmap, 0,
+ pcs->pci_result_dmap->dm_mapsize, BUS_DMASYNC_POSTREAD);
isp->isp_osinfo.onintstack = 1;
r = isp_intr(arg);
@@ -938,7 +947,8 @@ isp_pci_dmateardown(struct ispsoftc *isp, XS_T *xs, u_int16_t handle)
{
struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp;
bus_dmamap_t dmap = pci->pci_xfer_dmap[isp_handle_index(handle)];
- bus_dmamap_sync(pci->pci_dmat, dmap, xs->flags & SCSI_DATA_IN ?
+ isp_bus_dmamap_sync(pci->pci_dmat, dmap, 0, dmap->dm_mapsize,
+ xs->flags & SCSI_DATA_IN ?
BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(pci->pci_dmat, dmap);
}