summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/aac.c8
-rw-r--r--sys/dev/ic/adv.c6
-rw-r--r--sys/dev/ic/adv.h10
-rw-r--r--sys/dev/ic/adw.c6
-rw-r--r--sys/dev/ic/adw.h11
-rw-r--r--sys/dev/ic/aic7xxx.c36
-rw-r--r--sys/dev/ic/ami.c18
-rw-r--r--sys/dev/ic/awi_wep.c3
-rw-r--r--sys/dev/ic/cac.c14
-rw-r--r--sys/dev/ic/dpt.c53
-rw-r--r--sys/dev/ic/fxp.c11
-rw-r--r--sys/dev/ic/fxpvar.h20
-rw-r--r--sys/dev/ic/gdt_common.c8
-rw-r--r--sys/dev/ic/iha.c6
-rw-r--r--sys/dev/ic/iha.h12
-rw-r--r--sys/dev/ic/siop.c16
-rw-r--r--sys/dev/ic/siopvar_common.h12
-rw-r--r--sys/dev/ic/twe.c18
18 files changed, 93 insertions, 175 deletions
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c
index ff88c3e58cc..1b69cbd1821 100644
--- a/sys/dev/ic/aac.c
+++ b/sys/dev/ic/aac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aac.c,v 1.8 2001/09/21 17:55:43 miod Exp $ */
+/* $OpenBSD: aac.c,v 1.9 2001/11/05 17:25:58 art Exp $ */
/*-
* Copyright (c) 2000 Michael Smith
@@ -1640,7 +1640,8 @@ aac_map_command(struct aac_ccb *ccb)
return (error);
}
- bus_dmamap_sync(sc->sc_dmat, ccb->ac_dmamap_xfer,
+ bus_dmamap_sync(sc->sc_dmat, ccb->ac_dmamap_xfer, 0,
+ ccb->ac_dmamap_xfer->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ? BUS_DMASYNC_PREREAD :
BUS_DMASYNC_PREWRITE);
}
@@ -1666,7 +1667,8 @@ aac_unmap_command(struct aac_ccb *ccb)
#endif
if (xs->datalen != 0) {
- bus_dmamap_sync(sc->sc_dmat, ccb->ac_dmamap_xfer,
+ bus_dmamap_sync(sc->sc_dmat, ccb->ac_dmamap_xfer, 0,
+ ccb->ac_dmamap_xfer->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ? BUS_DMASYNC_POSTREAD :
BUS_DMASYNC_POSTWRITE);
diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c
index e6a22226a3d..5200e1d0b78 100644
--- a/sys/dev/ic/adv.c
+++ b/sys/dev/ic/adv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adv.c,v 1.9 2001/08/26 18:03:07 krw Exp $ */
+/* $OpenBSD: adv.c,v 1.10 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */
/*
@@ -778,7 +778,7 @@ adv_scsi_cmd(xs)
adv_free_ccb(sc, ccb);
return (COMPLETE);
}
- adv_bus_dmamap_sync(dmat, ccb->dmamap_xfer,
+ bus_dmamap_sync(dmat, ccb->dmamap_xfer,
0, ccb->dmamap_xfer->dm_mapsize,
((flags & SCSI_DATA_IN) ? BUS_DMASYNC_PREREAD :
BUS_DMASYNC_PREWRITE));
@@ -990,7 +990,7 @@ adv_narrow_isr_callback(sc, qdonep)
* the data buffer.
*/
if (xs->datalen) {
- adv_bus_dmamap_sync(dmat, ccb->dmamap_xfer,
+ bus_dmamap_sync(dmat, ccb->dmamap_xfer,
0, ccb->dmamap_xfer->dm_mapsize,
((xs->flags & SCSI_DATA_IN) ? BUS_DMASYNC_POSTREAD :
BUS_DMASYNC_POSTWRITE));
diff --git a/sys/dev/ic/adv.h b/sys/dev/ic/adv.h
index e3498fb2101..d8e9b31ae2f 100644
--- a/sys/dev/ic/adv.h
+++ b/sys/dev/ic/adv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: adv.h,v 1.3 2001/08/26 18:03:07 krw Exp $ */
+/* $OpenBSD: adv.h,v 1.4 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: adv.h,v 1.3 1998/09/26 16:02:56 dante Exp $ */
/*
@@ -93,12 +93,4 @@ int adv_intr __P((void *arg));
/******************************************************************************/
-#ifdef __HAS_NEW_BUS_DMAMAP_SYNC
-#define adv_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (off), (len), (op))
-#else
-#define adv_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (op))
-#endif
-
#endif /* _ADVANSYS_NARROW_H_ */
diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c
index a71e92f199d..6ab8bb987d4 100644
--- a/sys/dev/ic/adw.c
+++ b/sys/dev/ic/adw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adw.c,v 1.22 2001/09/21 17:55:43 miod Exp $ */
+/* $OpenBSD: adw.c,v 1.23 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */
/*
@@ -854,7 +854,7 @@ adw_build_req(xs, ccb, flags)
adw_free_ccb(sc, ccb);
return (0);
}
- adw_bus_dmamap_sync(dmat, ccb->dmamap_xfer,
+ bus_dmamap_sync(dmat, ccb->dmamap_xfer,
0, ccb->dmamap_xfer->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
@@ -1206,7 +1206,7 @@ adw_isr_callback(sc, scsiq)
*/
dmat = sc->sc_dmat;
if (xs->datalen) {
- adw_bus_dmamap_sync(dmat, ccb->dmamap_xfer,
+ bus_dmamap_sync(dmat, ccb->dmamap_xfer,
0, ccb->dmamap_xfer->dm_mapsize,
((xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE));
diff --git a/sys/dev/ic/adw.h b/sys/dev/ic/adw.h
index 00eccde2028..a2ee9d74e27 100644
--- a/sys/dev/ic/adw.h
+++ b/sys/dev/ic/adw.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: adw.h,v 1.7 2001/08/26 02:39:05 krw Exp $ */
+/* $OpenBSD: adw.h,v 1.8 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: adw.h,v 1.9 2000/05/26 15:13:43 dante Exp $ */
/*
@@ -116,13 +116,4 @@ ADW_CCB *adw_ccb_phys_kv __P((ADW_SOFTC *, u_int32_t));
/******************************************************************************/
-#ifdef __HAS_NEW_BUS_DMAMAP_SYNC
-#define adw_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (off), (len), (op))
-#else
-#define adw_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (op))
-#endif
-
-
#endif /* _ADVANSYS_ADW_H_ */
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 4849d17e887..d1bbca9dd1b 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.40 2000/01/07 23:08:17 gibbs Exp $
- * $OpenBSD: aic7xxx.c,v 1.31 2001/09/20 17:02:31 mpech Exp $
+ * $OpenBSD: aic7xxx.c,v 1.32 2001/11/05 17:25:58 art Exp $
*/
/*
* A few notes on features of the driver.
@@ -255,14 +255,6 @@ typedef enum {
MSGLOOP_TERMINATED
} msg_loop_stat;
-#ifdef __HAS_NEW_BUS_DMAMAP_SYNC
-#define ahc_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (off), (len), (op))
-#else
-#define ahc_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (op))
-#endif
-
STATIC int ahc_parse_msg __P((struct ahc_softc *ahc,
struct scsi_link *sc_link,
struct ahc_devinfo *devinfo));
@@ -531,7 +523,7 @@ ahc_index_busy_tcl(ahc, tcl, unbusy)
scbid = ahc->untagged_scbs[tcl];
if (unbusy) {
ahc->untagged_scbs[tcl] = SCB_LIST_NULL;
- ahc_bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
UNTAGGEDSCB_OFFSET * 256, 256, BUS_DMASYNC_PREWRITE);
}
@@ -544,7 +536,7 @@ ahc_busy_tcl(ahc, scb)
struct scb *scb;
{
ahc->untagged_scbs[scb->hscb->tcl] = scb->hscb->tag;
- ahc_bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
UNTAGGEDSCB_OFFSET * 256, 256, BUS_DMASYNC_PREWRITE);
}
@@ -606,7 +598,7 @@ ahc_run_qoutfifo(ahc)
struct scb *scb;
u_int scb_index;
- ahc_bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
0, 256, BUS_DMASYNC_POSTREAD);
while (ahc->qoutfifo[ahc->qoutfifonext] != SCB_LIST_NULL) {
@@ -3455,13 +3447,13 @@ ahc_done(ahc, scb)
target = sc_link->target;
if (xs->datalen) {
- bus_dmasync_op_t op;
+ int op;
if ((xs->flags & SCSI_DATA_IN) != 0)
op = BUS_DMASYNC_POSTREAD;
else
op = BUS_DMASYNC_POSTWRITE;
- ahc_bus_dmamap_sync(ahc->sc_dmat, scb->dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, scb->dmamap,
0, scb->dmamap->dm_mapsize, op);
bus_dmamap_unload(ahc->sc_dmat, scb->dmamap);
}
@@ -3681,7 +3673,7 @@ ahc_init(ahc)
for (i = 0; i < 256; i++)
ahc->qoutfifo[i] = SCB_LIST_NULL;
- ahc_bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
0, driver_data_size, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
/*
@@ -4297,9 +4289,9 @@ ahc_execute_scb(arg, dm_segs, nsegments)
if (nsegments != 0) {
- struct ahc_dma_seg *sg;
+ struct ahc_dma_seg *sg;
bus_dma_segment_t *end_seg;
- bus_dmasync_op_t op;
+ int op;
end_seg = dm_segs + nsegments;
@@ -4323,7 +4315,7 @@ ahc_execute_scb(arg, dm_segs, nsegments)
op = BUS_DMASYNC_PREREAD;
else
op = BUS_DMASYNC_PREWRITE;
- ahc_bus_dmamap_sync(ahc->sc_dmat, scb->dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, scb->dmamap,
0, scb->dmamap->dm_mapsize, op);
} else {
scb->hscb->SG_pointer = 0;
@@ -4379,7 +4371,7 @@ ahc_execute_scb(arg, dm_segs, nsegments)
ahc->qinfifo[ahc->qinfifonext++] = scb->hscb->tag;
- ahc_bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
QINFIFO_OFFSET * 256, 256, BUS_DMASYNC_PREWRITE);
if ((ahc->features & AHC_QUEUE_REGS) != 0) {
@@ -5080,7 +5072,7 @@ bus_reset:
ahc->qinfifo[ahc->qinfifonext++] =
scb->hscb->tag;
- ahc_bus_dmamap_sync(ahc->sc_dmat,
+ bus_dmamap_sync(ahc->sc_dmat,
ahc->shared_data_dmamap,
QINFIFO_OFFSET * 256, 256,
BUS_DMASYNC_PREWRITE);
@@ -5134,7 +5126,7 @@ ahc_search_qinfifo(ahc, target, channel, lun, tag, role, status, action)
* for removal will be re-added to the queue as we go.
*/
ahc->qinfifonext = qinpos;
- ahc_bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
QINFIFO_OFFSET * 256, 256, BUS_DMASYNC_POSTREAD);
while (qinpos != qintail) {
@@ -5165,7 +5157,7 @@ ahc_search_qinfifo(ahc, target, channel, lun, tag, role, status, action)
}
qinpos++;
}
- ahc_bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
+ bus_dmamap_sync(ahc->sc_dmat, ahc->shared_data_dmamap,
QINFIFO_OFFSET * 256, 256, BUS_DMASYNC_PREWRITE);
if ((ahc->features & AHC_QUEUE_REGS) != 0) {
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index 9d0dc8fc8e5..35a73263a2d 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.11 2001/09/11 20:05:25 miod Exp $ */
+/* $OpenBSD: ami.c,v 1.12 2001/11/05 17:25:58 art Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -536,7 +536,8 @@ ami_quartz_done(sc, mbox)
qdb = bus_space_read_4(sc->iot, sc->ioh, AMI_QODB);
if (qdb == AMI_QODB_READY) {
- bus_dmamap_sync(sc->dmat, sc->sc_cmdmap, BUS_DMASYNC_POSTREAD);
+ bus_dmamap_sync(sc->dmat, sc->sc_cmdmap, 0,
+ sc->sc_cmdmap->dm_mapsize, BUS_DMASYNC_POSTREAD);
*mbox = *sc->sc_mbox;
/* ack interrupt */
@@ -659,9 +660,11 @@ ami_cmd(ccb, flags, wait)
}
AMI_DPRINTF(AMI_D_DMA, ("> "));
- bus_dmamap_sync(sc->dmat, dmap, BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(sc->dmat, dmap, 0, dmap->dm_mapsize,
+ BUS_DMASYNC_PREWRITE);
}
- bus_dmamap_sync(sc->dmat, sc->sc_cmdmap, BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(sc->dmat, sc->sc_cmdmap, 0, sc->sc_cmdmap->dm_mapsize,
+ BUS_DMASYNC_PREWRITE);
if ((error = ami_start(ccb, wait))) {
AMI_DPRINTF(AMI_D_DMA, ("error=%d ", error));
@@ -858,7 +861,8 @@ ami_done(sc, idx)
timeout_del(&xs->stimeout);
if (xs->cmd->opcode != PREVENT_ALLOW &&
xs->cmd->opcode != SYNCHRONIZE_CACHE) {
- bus_dmamap_sync(sc->dmat, ccb->ccb_dmamap,
+ bus_dmamap_sync(sc->dmat, ccb->ccb_dmamap, 0,
+ ccb->ccb_dmamap->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_POSTREAD :
BUS_DMASYNC_POSTWRITE);
@@ -871,8 +875,8 @@ ami_done(sc, idx)
case AMI_INQUIRY:
case AMI_EINQUIRY:
case AMI_EINQUIRY3:
- bus_dmamap_sync(sc->dmat, ccb->ccb_dmamap,
- BUS_DMASYNC_POSTREAD);
+ bus_dmamap_sync(sc->dmat, ccb->ccb_dmamap, 0,
+ ccb->ccb_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);
bus_dmamap_unload(sc->dmat, ccb->ccb_dmamap);
break;
default:
diff --git a/sys/dev/ic/awi_wep.c b/sys/dev/ic/awi_wep.c
index 68d2984632f..d5c920aaa12 100644
--- a/sys/dev/ic/awi_wep.c
+++ b/sys/dev/ic/awi_wep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: awi_wep.c,v 1.5 2001/11/05 16:35:00 mickey Exp $ */
+/* $OpenBSD: awi_wep.c,v 1.6 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: awi_wep.c,v 1.2 2000/07/04 14:47:58 onoe Exp $ */
/*
@@ -90,6 +90,7 @@
#include <dev/ic/am79c930var.h>
#include <dev/ic/awireg.h>
#include <dev/ic/awivar.h>
+#include <dev/rndvar.h>
#endif
#ifdef __OpenBSD__
diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c
index b1b983556b3..0dc2bbaf0bd 100644
--- a/sys/dev/ic/cac.c
+++ b/sys/dev/ic/cac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cac.c,v 1.7 2001/10/18 20:24:10 mickey Exp $ */
+/* $OpenBSD: cac.c,v 1.8 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */
/*
@@ -339,7 +339,8 @@ cac_cmd(struct cac_softc *sc, int command, void *data, int datasize,
bus_dmamap_load(sc->sc_dmat, ccb->ccb_dmamap_xfer,
(void *)data, datasize, NULL, BUS_DMA_NOWAIT);
- bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmamap_xfer,
+ bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmamap_xfer, 0,
+ ccb->ccb_dmamap_xfer->dm_mapsize,
(flags & CAC_CCB_DATA_IN) != 0 ? BUS_DMASYNC_PREREAD :
BUS_DMASYNC_PREWRITE);
@@ -464,7 +465,8 @@ cac_ccb_done(struct cac_softc *sc, struct cac_ccb *ccb)
ccb->ccb_flags &= ~CAC_CCB_ACTIVE;
if ((ccb->ccb_flags & (CAC_CCB_DATA_IN | CAC_CCB_DATA_OUT)) != 0) {
- bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmamap_xfer,
+ bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmamap_xfer, 0,
+ ccb->ccb_dmamap_xfer->dm_mapsize,
ccb->ccb_flags & CAC_CCB_DATA_IN ?
BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->sc_dmat, ccb->ccb_dmamap_xfer);
@@ -795,7 +797,8 @@ cac_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb)
#ifdef CAC_DEBUG
printf("submit-%x ", ccb->ccb_paddr);
#endif
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap,
+ bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, 0,
+ sc->sc_dmamap->dm_mapsize,
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
cac_outl(sc, CAC_REG_CMD_FIFO, ccb->ccb_paddr);
}
@@ -815,7 +818,8 @@ cac_l0_completed(sc)
ccb = (struct cac_ccb *)(sc->sc_ccbs +
((off & ~3) - sc->sc_ccbs_paddr));
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap,
+ bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, 0,
+ sc->sc_dmamap->dm_mapsize,
BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
return (ccb);
diff --git a/sys/dev/ic/dpt.c b/sys/dev/ic/dpt.c
index b5e5b51a52b..7f0cbf6daca 100644
--- a/sys/dev/ic/dpt.c
+++ b/sys/dev/ic/dpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dpt.c,v 1.4 2001/07/13 17:04:28 mickey Exp $ */
+/* $OpenBSD: dpt.c,v 1.5 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: dpt.c,v 1.12 1999/10/23 16:26:33 ad Exp $ */
/*-
@@ -202,14 +202,8 @@ dpt_intr(xxx_sc)
break;
}
-#ifdef __NetBSD__
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, sc->sc_spoff,
sizeof(struct eata_sp), BUS_DMASYNC_POSTREAD);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb,
- BUS_DMASYNC_POSTREAD);
-#endif /* __OpenBSD__ */
if (!sp) {
more = dpt_inb(sc, HA_STATUS) & HA_ST_MORE;
@@ -234,15 +228,9 @@ dpt_intr(xxx_sc)
sc->sc_dv.dv_xname);
#endif
/* Re-sync DMA map */
-#ifdef __NetBSD__
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb,
sc->sc_spoff, sizeof(struct eata_sp),
BUS_DMASYNC_POSTREAD);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb,
- BUS_DMASYNC_POSTREAD);
-#endif /* __OpenBSD__ */
}
/* Make sure CCB ID from status packet is realistic */
@@ -250,15 +238,9 @@ dpt_intr(xxx_sc)
/* Sync up DMA map and cache cmd status */
ccb = sc->sc_ccbs + sp->sp_ccbid;
-#ifdef __NetBSD__
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb,
CCB_OFF(sc, ccb), sizeof(struct dpt_ccb),
BUS_DMASYNC_POSTWRITE);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb,
- BUS_DMASYNC_POSTWRITE);
-#endif /* __OpenBSD__ */
ccb->ccb_hba_status = sp->sp_hba_status & 0x7F;
ccb->ccb_scsi_status = sp->sp_scsi_status;
@@ -824,17 +806,10 @@ dpt_done_ccb(sc, ccb)
* data buffer.
*/
if (xs->datalen) {
-#ifdef __NetBSD__
bus_dmamap_sync(dmat, ccb->ccb_dmamap_xfer, 0,
ccb->ccb_dmamap_xfer->dm_mapsize,
- (xs->xs_control & XS_CTL_DATA_IN) ? BUS_DMASYNC_POSTREAD :
- BUS_DMASYNC_POSTWRITE);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(dmat, ccb->ccb_dmamap_xfer,
(xs->flags & SCSI_DATA_IN) ? BUS_DMASYNC_POSTREAD :
BUS_DMASYNC_POSTWRITE);
-#endif /* __OpenBSD__ */
bus_dmamap_unload(dmat, ccb->ccb_dmamap_xfer);
}
@@ -1195,15 +1170,9 @@ dpt_scsi_cmd(xs)
return (COMPLETE);
}
-#ifdef __NetBSD__
bus_dmamap_sync(dmat, xfer, 0, xfer->dm_mapsize,
- (flags & XS_CTL_DATA_IN) ? BUS_DMASYNC_PREREAD :
+ (flags & SCSI_DATA_IN) ? BUS_DMASYNC_PREREAD :
BUS_DMASYNC_PREWRITE);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(dmat, xfer, (xs->flags & SCSI_DATA_IN) ?
- BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
-#endif /* __OpenBSD__ */
/* Don't bother using scatter/gather for just 1 segment */
if (xfer->dm_nsegs == 1) {
@@ -1235,16 +1204,10 @@ dpt_scsi_cmd(xs)
}
/* Sync up CCB and status packet */
-#ifdef __NetBSD__
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, CCB_OFF(sc, ccb),
sizeof(struct dpt_ccb), BUS_DMASYNC_PREWRITE);
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, sc->sc_spoff,
sizeof(struct eata_sp), BUS_DMASYNC_PREREAD);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, BUS_DMASYNC_PREWRITE);
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, BUS_DMASYNC_PREREAD);
-#endif /* __OpenBSD__ */
/*
* Start the command. If we are polling on completion, mark it
@@ -1405,19 +1368,12 @@ dpt_hba_inquire(sc, ei)
cp->cp_len = sizeof(struct eata_inquiry_data);
/* Sync up CCB, status packet and scratch area */
-#ifdef __NetBSD__
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, CCB_OFF(sc, ccb),
sizeof(struct dpt_ccb), BUS_DMASYNC_PREWRITE);
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, sc->sc_spoff,
sizeof(struct eata_sp), BUS_DMASYNC_PREREAD);
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, sc->sc_scroff,
sizeof(struct eata_inquiry_data), BUS_DMASYNC_PREREAD);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, BUS_DMASYNC_PREWRITE);
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, BUS_DMASYNC_PREREAD);
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, BUS_DMASYNC_PREREAD);
-#endif /* __OpenBSD__ */
/* Start the command and poll on completion */
if (dpt_cmd(sc, &ccb->ccb_eata_cp, ccb->ccb_ccbpa, CP_DMA_CMD, 0))
@@ -1433,12 +1389,7 @@ dpt_hba_inquire(sc, ei)
ccb->ccb_scsi_status);
/* Sync up the DMA map and free CCB, returning */
-#ifdef __NetBSD__
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, sc->sc_scroff,
sizeof(struct eata_inquiry_data), BUS_DMASYNC_POSTREAD);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap_ccb, BUS_DMASYNC_POSTREAD);
-#endif /* __OpenBSD__ */
dpt_free_ccb(sc, ccb);
}
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 716b1a195d8..e107cb76b81 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.28 2001/09/20 17:02:31 mpech Exp $ */
+/* $OpenBSD: fxp.c,v 1.29 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -812,7 +812,7 @@ rcvloop:
m = sc->rfa_headm;
rfap = m->m_ext.ext_buf + RFA_ALIGNMENT_FUDGE;
rxmap = *((bus_dmamap_t *)m->m_ext.ext_buf);
- fxp_bus_dmamap_sync(sc->sc_dmat, rxmap,
+ bus_dmamap_sync(sc->sc_dmat, rxmap,
0, MCLBYTES, BUS_DMASYNC_POSTREAD |
BUS_DMASYNC_POSTWRITE);
@@ -1223,8 +1223,9 @@ fxp_init(xsc)
sc->sc_cbt_cnt = 1;
sc->sc_ctrl->tx_cb[0].cb_command = FXP_CB_COMMAND_NOP |
FXP_CB_COMMAND_S | FXP_CB_COMMAND_I;
- fxp_bus_dmamap_sync(sc->sc_dmat, sc->tx_cb_map, 0,
- sc->tx_cb_map->dm_mapsize, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(sc->sc_dmat, sc->tx_cb_map, 0,
+ sc->tx_cb_map->dm_mapsize,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
fxp_scb_wait(sc);
CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->tx_cb_map->dm_segs->ds_addr +
@@ -1383,7 +1384,7 @@ fxp_add_rfabuf(sc, oldm)
sc->rfa_tailm = m;
- fxp_bus_dmamap_sync(sc->sc_dmat, rxmap, 0, MCLBYTES,
+ bus_dmamap_sync(sc->sc_dmat, rxmap, 0, MCLBYTES,
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
return (m == oldm);
diff --git a/sys/dev/ic/fxpvar.h b/sys/dev/ic/fxpvar.h
index 99c7f172676..5132ef41d5a 100644
--- a/sys/dev/ic/fxpvar.h
+++ b/sys/dev/ic/fxpvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxpvar.h,v 1.9 2001/09/17 16:24:49 jason Exp $ */
+/* $OpenBSD: fxpvar.h,v 1.10 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: if_fxpvar.h,v 1.1 1997/06/05 02:01:58 thorpej Exp $ */
/*
@@ -129,29 +129,21 @@ extern int fxp_detach __P((struct fxp_softc *));
#define FXP_RXMAP_GET(sc) ((sc)->sc_rxmaps[(sc)->sc_rxfree++])
#define FXP_RXMAP_PUT(sc,map) ((sc)->sc_rxmaps[--(sc)->sc_rxfree] = (map))
-#ifdef __HAS_NEW_BUS_DMAMAP_SYNC
-#define fxp_bus_dmamap_sync(t, m, o, l, p) \
- bus_dmamap_sync((t), (m), (o), (l), (p))
-#else
-#define fxp_bus_dmamap_sync(t, m, o, l, p) \
- bus_dmamap_sync((t), (m), (p))
-#endif
-
#define FXP_TXCB_SYNC(sc, txs, p) \
- fxp_bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, (txs)->tx_off, \
+ bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, (txs)->tx_off, \
sizeof(struct fxp_cb_tx), (p))
#define FXP_MCS_SYNC(sc, p) \
- fxp_bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, \
+ bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, \
offsetof(struct fxp_ctrl, u.mcs), sizeof(struct fxp_cb_mcs), (p))
#define FXP_IAS_SYNC(sc, p) \
- fxp_bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, \
+ bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, \
offsetof(struct fxp_ctrl, u.ias), sizeof(struct fxp_cb_ias), (p))
#define FXP_CFG_SYNC(sc, p) \
- fxp_bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, \
+ bus_dmamap_sync((sc)->sc_dmat, (sc)->tx_cb_map, \
offsetof(struct fxp_ctrl, u.cfg), sizeof(struct fxp_cb_config), (p))
#define FXP_MBUF_SYNC(sc, m, p) \
- fxp_bus_dmamap_sync((sc)->sc_dmat, (m), 0, (m)->dm_mapsize, (p))
+ bus_dmamap_sync((sc)->sc_dmat, (m), 0, (m)->dm_mapsize, (p))
diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c
index 7a50216bb66..90e139dac90 100644
--- a/sys/dev/ic/gdt_common.c
+++ b/sys/dev/ic/gdt_common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gdt_common.c,v 1.14 2001/08/12 20:12:12 mickey Exp $ */
+/* $OpenBSD: gdt_common.c,v 1.15 2001/11/05 17:25:58 art Exp $ */
/*
* Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved.
@@ -643,7 +643,8 @@ gdt_scsi_cmd(xs)
scsi_done(xs);
goto ready;
}
- bus_dmamap_sync(gdt->sc_dmat, xfer,
+ bus_dmamap_sync(gdt->sc_dmat, xfer, 0,
+ xfer->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_PREREAD :
BUS_DMASYNC_PREWRITE);
@@ -1062,7 +1063,8 @@ gdt_intr(arg)
prev_cmd = ccb->gc_flags & GDT_GCF_CMD_MASK;
if (xs && xs->cmd->opcode != PREVENT_ALLOW &&
xs->cmd->opcode != SYNCHRONIZE_CACHE) {
- bus_dmamap_sync(gdt->sc_dmat, ccb->gc_dmamap_xfer,
+ bus_dmamap_sync(gdt->sc_dmat, ccb->gc_dmamap_xfer, 0,
+ ccb->gc_dmamap_xfer->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ? BUS_DMASYNC_POSTREAD :
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(gdt->sc_dmat, ccb->gc_dmamap_xfer);
diff --git a/sys/dev/ic/iha.c b/sys/dev/ic/iha.c
index 41027cb49ed..76a108aa76e 100644
--- a/sys/dev/ic/iha.c
+++ b/sys/dev/ic/iha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iha.c,v 1.10 2001/10/14 02:56:34 krw Exp $ */
+/* $OpenBSD: iha.c,v 1.11 2001/11/05 17:25:58 art Exp $ */
/*
* Initio INI-9xxxU/UW SCSI Device Driver
*
@@ -308,7 +308,7 @@ iha_scsi_cmd(xs)
} else
pScb->SCB_BufPAddr = dm->dm_segs[0].ds_addr;
- iha_bus_dmamap_sync(sc->sc_dmat, pScb->SCB_Dmamap,
+ bus_dmamap_sync(sc->sc_dmat, pScb->SCB_Dmamap,
0, pScb->SCB_Dmamap->dm_mapsize,
(pScb->SCB_Flags & SCSI_DATA_IN) ?
BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
@@ -2473,7 +2473,7 @@ iha_done_scb(sc, pScb)
}
if (xs->datalen > 0) {
- iha_bus_dmamap_sync(sc->sc_dmat, pScb->SCB_Dmamap,
+ bus_dmamap_sync(sc->sc_dmat, pScb->SCB_Dmamap,
0, pScb->SCB_Dmamap->dm_mapsize,
((xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE));
diff --git a/sys/dev/ic/iha.h b/sys/dev/ic/iha.h
index 1f1aa3e7592..abe3eb522ed 100644
--- a/sys/dev/ic/iha.h
+++ b/sys/dev/ic/iha.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iha.h,v 1.7 2001/08/26 02:39:05 krw Exp $ */
+/* $OpenBSD: iha.h,v 1.8 2001/11/05 17:25:58 art Exp $ */
/*
* Initio INI-9xxxU/UW SCSI Device Driver
*
@@ -446,14 +446,4 @@ int iha_intr __P((void *));
void iha_minphys __P((struct buf *));
int iha_init_tulip __P((struct iha_softc *));
-#ifdef __HAS_NEW_BUS_DMAMAP_SYNC
-#define iha_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (off), (len), (op))
-#else
-#define iha_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (op))
-#endif
-
-
-
diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c
index 5393b229d2a..e7c167075fb 100644
--- a/sys/dev/ic/siop.c
+++ b/sys/dev/ic/siop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siop.c,v 1.16 2001/10/30 00:02:55 krw Exp $ */
+/* $OpenBSD: siop.c,v 1.17 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: siop.c,v 1.39 2001/02/11 18:04:49 bouyer Exp $ */
/*
@@ -126,7 +126,7 @@ siop_script_sync(sc, ops)
int ops;
{
if ((sc->features & SF_CHIP_RAM) == 0)
- siop_bus_dmamap_sync(sc->sc_dmat, sc->sc_scriptdma,
+ bus_dmamap_sync(sc->sc_dmat, sc->sc_scriptdma,
0, PAGE_SIZE, ops);
}
@@ -1049,7 +1049,7 @@ siop_scsicmd_end(siop_cmd)
}
if (siop_cmd->status != CMDST_SENSE_DONE &&
xs->flags & (SCSI_DATA_IN | SCSI_DATA_OUT)) {
- siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
+ bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
0, siop_cmd->dmamap_data->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
@@ -1086,10 +1086,10 @@ siop_scsicmd_end(siop_cmd)
bus_dmamap_unload(sc->sc_dmat, siop_cmd->dmamap_cmd);
goto out;
}
- siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
+ bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
0, siop_cmd->dmamap_data->dm_mapsize,
BUS_DMASYNC_PREREAD);
- siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_cmd,
+ bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_cmd,
0, siop_cmd->dmamap_data->dm_mapsize,
BUS_DMASYNC_PREWRITE);
@@ -1098,7 +1098,7 @@ siop_scsicmd_end(siop_cmd)
TAILQ_INSERT_HEAD(&sc->urgent_list, siop_cmd, next);
return;
} else if (siop_cmd->status == CMDST_SENSE_DONE) {
- siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
+ bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
0, siop_cmd->dmamap_data->dm_mapsize,
BUS_DMASYNC_POSTREAD);
bus_dmamap_unload(sc->sc_dmat, siop_cmd->dmamap_data);
@@ -1348,12 +1348,12 @@ siop_scsicmd(xs)
splx(s);
return(TRY_AGAIN_LATER);
}
- siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
+ bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_data,
0, siop_cmd->dmamap_data->dm_mapsize,
(xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
}
- siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_cmd,
+ bus_dmamap_sync(sc->sc_dmat, siop_cmd->dmamap_cmd,
0, siop_cmd->dmamap_data->dm_mapsize,
BUS_DMASYNC_PREWRITE);
diff --git a/sys/dev/ic/siopvar_common.h b/sys/dev/ic/siopvar_common.h
index a3cb9f9d86a..8d899781ee6 100644
--- a/sys/dev/ic/siopvar_common.h
+++ b/sys/dev/ic/siopvar_common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: siopvar_common.h,v 1.8 2001/10/30 00:02:55 krw Exp $ */
+/* $OpenBSD: siopvar_common.h,v 1.9 2001/11/05 17:25:58 art Exp $ */
/* $NetBSD: siopvar_common.h,v 1.10 2001/01/26 21:58:56 bouyer Exp $ */
/*
@@ -182,14 +182,6 @@ struct siop_lunsw {
u_int32_t lunsw_size; /* size of this lun sw */
};
-#ifdef __HAS_NEW_BUS_DMAMAP_SYNC
-#define siop_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (off), (len), (op))
-#else
-#define siop_bus_dmamap_sync(tag, map, off, len, op) \
- bus_dmamap_sync((tag), (map), (op))
-#endif
-
static __inline__ void siop_table_sync __P((struct siop_cmd *, int));
static __inline__ void
siop_table_sync(siop_cmd, ops)
@@ -201,7 +193,7 @@ siop_table_sync(siop_cmd, ops)
offset = siop_cmd->dsa -
siop_cmd->siop_cbdp->xferdma->dm_segs[0].ds_addr;
- siop_bus_dmamap_sync(sc->sc_dmat, siop_cmd->siop_cbdp->xferdma, offset,
+ bus_dmamap_sync(sc->sc_dmat, siop_cmd->siop_cbdp->xferdma, offset,
sizeof(struct siop_xfer), ops);
}
diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c
index 2c6e5800706..a9db2c78648 100644
--- a/sys/dev/ic/twe.c
+++ b/sys/dev/ic/twe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: twe.c,v 1.13 2001/09/24 06:52:33 mickey Exp $ */
+/* $OpenBSD: twe.c,v 1.14 2001/11/05 17:25:58 art Exp $ */
/*
* Copyright (c) 2000, 2001 Michael Shalayeff. All rights reserved.
@@ -496,9 +496,11 @@ twe_cmd(ccb, flags, wait)
}
}
TWE_DPRINTF(TWE_D_DMA, ("> "));
- bus_dmamap_sync(sc->dmat, dmap, BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(sc->dmat, dmap, 0, dmap->dm_mapsize,
+ BUS_DMASYNC_PREWRITE);
}
- bus_dmamap_sync(sc->dmat, sc->sc_cmdmap, BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(sc->dmat, sc->sc_cmdmap, 0, sc->sc_cmdmap->dm_mapsize,
+ BUS_DMASYNC_PREWRITE);
if ((error = twe_start(ccb, wait))) {
bus_dmamap_unload(sc->dmat, dmap);
@@ -624,8 +626,8 @@ twe_done(sc, idx)
if (xs) {
if (xs->cmd->opcode != PREVENT_ALLOW &&
xs->cmd->opcode != SYNCHRONIZE_CACHE) {
- bus_dmamap_sync(sc->dmat, dmap,
- (xs->flags & SCSI_DATA_IN) ?
+ bus_dmamap_sync(sc->dmat, dmap, 0,
+ dmap->dm_mapsize, (xs->flags & SCSI_DATA_IN) ?
BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->dmat, dmap);
}
@@ -633,12 +635,14 @@ twe_done(sc, idx)
switch (letoh16(cmd->cmd_op)) {
case TWE_CMD_GPARAM:
case TWE_CMD_READ:
- bus_dmamap_sync(sc->dmat, dmap, BUS_DMASYNC_POSTREAD);
+ bus_dmamap_sync(sc->dmat, dmap, 0,
+ dmap->dm_mapsize, BUS_DMASYNC_POSTREAD);
bus_dmamap_unload(sc->dmat, dmap);
break;
case TWE_CMD_SPARAM:
case TWE_CMD_WRITE:
- bus_dmamap_sync(sc->dmat, dmap, BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_sync(sc->dmat, dmap, 0,
+ dmap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->dmat, dmap);
break;
default: