summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/adv.c17
-rw-r--r--sys/dev/ic/adw.c20
-rw-r--r--sys/dev/ic/bha.c20
-rw-r--r--sys/dev/ic/dpt.c31
-rw-r--r--sys/dev/ic/iha.c18
-rw-r--r--sys/dev/ic/ncr5380sbc.c5
-rw-r--r--sys/dev/ic/osiop.c6
-rw-r--r--sys/dev/ic/uha.c114
8 files changed, 75 insertions, 156 deletions
diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c
index ee5e537abe3..e7468436966 100644
--- a/sys/dev/ic/adv.c
+++ b/sys/dev/ic/adv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adv.c,v 1.19 2008/06/26 05:42:15 ray Exp $ */
+/* $OpenBSD: adv.c,v 1.20 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */
/*
@@ -743,18 +743,9 @@ adv_scsi_cmd(xs)
/*
* Map the DMA transfer.
*/
-#ifdef TFS
- if (flags & SCSI_DATA_UIO) {
- error = bus_dmamap_load_uio(dmat,
- ccb->dmamap_xfer, (struct uio *) xs->data,
- (flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
- } else
-#endif /* TFS */
- {
- error = bus_dmamap_load(dmat,
- ccb->dmamap_xfer, xs->data, xs->datalen, NULL,
- (flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
- }
+ error = bus_dmamap_load(dmat,
+ ccb->dmamap_xfer, xs->data, xs->datalen, NULL,
+ (flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
if (error) {
if (error == EFBIG) {
diff --git a/sys/dev/ic/adw.c b/sys/dev/ic/adw.c
index 7175d024d54..0a4b998e285 100644
--- a/sys/dev/ic/adw.c
+++ b/sys/dev/ic/adw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adw.c,v 1.33 2008/06/26 05:42:15 ray Exp $ */
+/* $OpenBSD: adw.c,v 1.34 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: adw.c,v 1.23 2000/05/27 18:24:50 dante Exp $ */
/*
@@ -816,20 +816,10 @@ adw_build_req(xs, ccb, flags)
/*
* Map the DMA transfer.
*/
-#ifdef TFS
- if (xs->flags & SCSI_DATA_UIO) {
- error = bus_dmamap_load_uio(dmat,
- ccb->dmamap_xfer, (struct uio *) xs->data,
- (flags & SCSI_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
- } else
-#endif /* TFS */
- {
- error = bus_dmamap_load(dmat,
- ccb->dmamap_xfer, xs->data, xs->datalen, NULL,
- (flags & SCSI_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
- }
+ error = bus_dmamap_load(dmat,
+ ccb->dmamap_xfer, xs->data, xs->datalen, NULL,
+ (flags & SCSI_NOSLEEP) ?
+ BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
if (error) {
if (error == EFBIG) {
diff --git a/sys/dev/ic/bha.c b/sys/dev/ic/bha.c
index dda7190a81f..f69e88b38cc 100644
--- a/sys/dev/ic/bha.c
+++ b/sys/dev/ic/bha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bha.c,v 1.12 2008/06/26 05:42:15 ray Exp $ */
+/* $OpenBSD: bha.c,v 1.13 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: bha.c,v 1.27 1998/11/19 21:53:00 thorpej Exp $ */
#undef BHADEBUG
@@ -1430,20 +1430,10 @@ bha_scsi_cmd(xs)
/*
* Map the DMA transfer.
*/
-#ifdef TFS
- if (flags & SCSI_DATA_UIO) {
- error = bus_dmamap_load_uio(dmat,
- ccb->dmamap_xfer, (struct uio *)xs->data,
- (flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT :
- BUS_DMA_WAITOK);
- } else
-#endif /* TFS */
- {
- error = bus_dmamap_load(dmat,
- ccb->dmamap_xfer, xs->data, xs->datalen, NULL,
- (flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT :
- BUS_DMA_WAITOK);
- }
+ error = bus_dmamap_load(dmat,
+ ccb->dmamap_xfer, xs->data, xs->datalen, NULL,
+ (flags & SCSI_NOSLEEP) ? BUS_DMA_NOWAIT :
+ BUS_DMA_WAITOK);
if (error) {
if (error == EFBIG) {
diff --git a/sys/dev/ic/dpt.c b/sys/dev/ic/dpt.c
index c863ca47c57..9ec45f0827c 100644
--- a/sys/dev/ic/dpt.c
+++ b/sys/dev/ic/dpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dpt.c,v 1.16 2008/07/30 18:08:04 miod Exp $ */
+/* $OpenBSD: dpt.c,v 1.17 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: dpt.c,v 1.12 1999/10/23 16:26:33 ad Exp $ */
/*-
@@ -1115,33 +1115,16 @@ dpt_scsi_cmd(xs)
if (xs->datalen) {
xfer = ccb->ccb_dmamap_xfer;
-#ifdef TFS
#ifdef __NetBSD__
- if ((flags & XS_CTL_DATA_UIO) != 0) {
- error = bus_dmamap_load_uio(dmat, xfer,
- (struct uio *)xs->data, (flags & XS_CTL_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
+ error = bus_dmamap_load(dmat, xfer, xs->data,
+ xs->datalen, NULL, (flags & XS_CTL_NOSLEEP) ?
+ BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
#endif /* __NetBSD__ */
#ifdef __OpenBSD__
- if ((xs->flags & SCSI_DATA_UIO) != 0) {
- error = bus_dmamap_load_uio(dmat, xfer,
- (xs->flags & SCSI_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
+ error = bus_dmamap_load(dmat, xfer, xs->data,
+ xs->datalen, NULL, (xs->flags & SCSI_NOSLEEP) ?
+ BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
#endif /* __OpenBSD__ */
- } else
-#endif /*TFS */
- {
-#ifdef __NetBSD__
- error = bus_dmamap_load(dmat, xfer, xs->data,
- xs->datalen, NULL, (flags & XS_CTL_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
-#endif /* __NetBSD__ */
-#ifdef __OpenBSD__
- error = bus_dmamap_load(dmat, xfer, xs->data,
- xs->datalen, NULL, (xs->flags & SCSI_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
-#endif /* __OpenBSD__ */
- }
if (error) {
printf("%s: dpt_scsi_cmd: ", sc->sc_dv.dv_xname);
diff --git a/sys/dev/ic/iha.c b/sys/dev/ic/iha.c
index d4873fd6cb1..4584ffddf14 100644
--- a/sys/dev/ic/iha.c
+++ b/sys/dev/ic/iha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iha.c,v 1.29 2007/12/29 03:04:19 dlg Exp $ */
+/* $OpenBSD: iha.c,v 1.30 2008/09/12 11:14:04 miod Exp $ */
/*-------------------------------------------------------------------------
*
* Device driver for the INI-9XXXU/UW or INIC-940/950 PCI SCSI Controller.
@@ -298,18 +298,10 @@ iha_scsi_cmd(xs)
pScb->SCB_BufCharsLeft = pScb->SCB_BufChars = xs->datalen;
if ((pScb->SCB_Flags & (SCSI_DATA_IN | SCSI_DATA_OUT)) != 0) {
-#ifdef TFS
- if (pScb->SCB_Flags & SCSI_DATA_UIO)
- error = bus_dmamap_load_uio(sc->sc_dmat,
- pScb->SCB_DataDma, (struct uio *)xs->data,
- (pScb->SCB_Flags & SCSI_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
- else
-#endif /* TFS */
- error = bus_dmamap_load(sc->sc_dmat, pScb->SCB_DataDma,
- xs->data, pScb->SCB_BufChars, NULL,
- (pScb->SCB_Flags & SCSI_NOSLEEP) ?
- BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
+ error = bus_dmamap_load(sc->sc_dmat, pScb->SCB_DataDma,
+ xs->data, pScb->SCB_BufChars, NULL,
+ (pScb->SCB_Flags & SCSI_NOSLEEP) ?
+ BUS_DMA_NOWAIT : BUS_DMA_WAITOK);
if (error) {
sc_print_addr(xs->sc_link);
diff --git a/sys/dev/ic/ncr5380sbc.c b/sys/dev/ic/ncr5380sbc.c
index 66ec5b0b6c3..8577d1b42dc 100644
--- a/sys/dev/ic/ncr5380sbc.c
+++ b/sys/dev/ic/ncr5380sbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncr5380sbc.c,v 1.19 2006/12/10 16:15:37 miod Exp $ */
+/* $OpenBSD: ncr5380sbc.c,v 1.20 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: ncr5380sbc.c,v 1.13 1996/10/13 01:37:25 christos Exp $ */
/*
@@ -607,9 +607,6 @@ ncr5380_scsi_cmd(xs)
if (sc->sc_flags & NCR5380_FORCE_POLLING)
flags |= SCSI_POLL;
- if (flags & SCSI_DATA_UIO)
- panic("ncr5380: scsi data uio requested");
-
s = splbio();
if (flags & SCSI_POLL) {
diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c
index a5af4c8e1d0..ce6615d2d27 100644
--- a/sys/dev/ic/osiop.c
+++ b/sys/dev/ic/osiop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osiop.c,v 1.33 2008/05/27 21:08:48 kettenis Exp $ */
+/* $OpenBSD: osiop.c,v 1.34 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */
/*
@@ -378,10 +378,6 @@ osiop_scsicmd(xs)
int err, s;
/* XXXX ?? */
- if (xs->flags & SCSI_DATA_UIO)
- panic("osiop: scsi data uio requested");
-
- /* XXXX ?? */
if (sc->sc_nexus && (xs->flags & SCSI_POLL))
#if 0
panic("osiop_scsicmd: busy");
diff --git a/sys/dev/ic/uha.c b/sys/dev/ic/uha.c
index 600203ee182..84cbda43bc1 100644
--- a/sys/dev/ic/uha.c
+++ b/sys/dev/ic/uha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uha.c,v 1.9 2006/11/28 23:59:45 dlg Exp $ */
+/* $OpenBSD: uha.c,v 1.10 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: uha.c,v 1.3 1996/10/13 01:37:29 christos Exp $ */
#undef UHADEBUG
@@ -405,76 +405,56 @@ uha_scsi_cmd(xs)
if (xs->datalen) {
sg = mscp->uha_dma;
seg = 0;
-#ifdef TFS
- if (flags & SCSI_DATA_UIO) {
- struct iovec *iovp;
- iovp = ((struct uio *) xs->data)->uio_iov;
- datalen = ((struct uio *) xs->data)->uio_iovcnt;
- xs->datalen = 0;
- while (datalen && seg < UHA_NSEG) {
- sg->seg_addr = (physaddr)iovp->iov_base;
- sg->seg_len = iovp->iov_len;
- xs->datalen += iovp->iov_len;
- SC_DEBUGN(sc_link, SDEV_DB4, ("(0x%x@0x%x)",
- iovp->iov_len, iovp->iov_base));
- sg++;
- iovp++;
- seg++;
- datalen--;
- }
- } else
-#endif /*TFS */
- {
- /*
- * Set up the scatter gather block
- */
- SC_DEBUG(sc_link, SDEV_DB4,
- ("%d @0x%x:- ", xs->datalen, xs->data));
- datalen = xs->datalen;
- thiskv = (int) xs->data;
- thisphys = KVTOPHYS(thiskv);
-
- while (datalen && seg < UHA_NSEG) {
- bytes_this_seg = 0;
-
- /* put in the base address */
- sg->seg_addr = thisphys;
-
- SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
-
- /* do it at least once */
- nextphys = thisphys;
- while (datalen && thisphys == nextphys) {
- /*
- * This page is contiguous (physically)
- * with the last, just extend the
- * length
- */
- /* how far to the end of the page */
- nextphys = (thisphys & ~PGOFSET) + NBPG;
- bytes_this_page = nextphys - thisphys;
- /**** or the data ****/
- bytes_this_page = min(bytes_this_page,
- datalen);
- bytes_this_seg += bytes_this_page;
- datalen -= bytes_this_page;
-
- /* get more ready for the next page */
- thiskv = (thiskv & ~PGOFSET) + NBPG;
- if (datalen)
- thisphys = KVTOPHYS(thiskv);
- }
+
+ /*
+ * Set up the scatter gather block
+ */
+ SC_DEBUG(sc_link, SDEV_DB4,
+ ("%d @0x%x:- ", xs->datalen, xs->data));
+ datalen = xs->datalen;
+ thiskv = (int) xs->data;
+ thisphys = KVTOPHYS(thiskv);
+
+ while (datalen && seg < UHA_NSEG) {
+ bytes_this_seg = 0;
+
+ /* put in the base address */
+ sg->seg_addr = thisphys;
+
+ SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+
+ /* do it at least once */
+ nextphys = thisphys;
+ while (datalen && thisphys == nextphys) {
/*
- * next page isn't contiguous, finish the seg
+ * This page is contiguous (physically)
+ * with the last, just extend the
+ * length
*/
- SC_DEBUGN(sc_link, SDEV_DB4,
- ("(0x%x)", bytes_this_seg));
- sg->seg_len = bytes_this_seg;
- sg++;
- seg++;
+ /* how far to the end of the page */
+ nextphys = (thisphys & ~PGOFSET) + NBPG;
+ bytes_this_page = nextphys - thisphys;
+ /**** or the data ****/
+ bytes_this_page = min(bytes_this_page,
+ datalen);
+ bytes_this_seg += bytes_this_page;
+ datalen -= bytes_this_page;
+
+ /* get more ready for the next page */
+ thiskv = (thiskv & ~PGOFSET) + NBPG;
+ if (datalen)
+ thisphys = KVTOPHYS(thiskv);
}
+ /*
+ * next page isn't contiguous, finish the seg
+ */
+ SC_DEBUGN(sc_link, SDEV_DB4,
+ ("(0x%x)", bytes_this_seg));
+ sg->seg_len = bytes_this_seg;
+ sg++;
+ seg++;
}
- /* end of iov/kv decision */
+
SC_DEBUGN(sc_link, SDEV_DB4, ("\n"));
if (datalen) {
/*