summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-09-12 11:14:05 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-09-12 11:14:05 +0000
commit19df77e4137aaf9261cf8b8f72e6bb66ea8fda77 (patch)
tree30c9d7d025c987d1a7485cbc3f7d7c5178712115 /sys/dev/isa
parent8efa688f67e8149536c1a09aa34320c3bf9cf5cb (diff)
SCSI_DATA_UIO is never used. Code which checks for it is either dead or
commented out, remove it. Unifdef TFS while there. ok marco@ krw@
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/aha.c55
-rw-r--r--sys/dev/isa/wds.c148
2 files changed, 75 insertions, 128 deletions
diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c
index 06ae3f935bf..d4b8cb799cb 100644
--- a/sys/dev/isa/aha.c
+++ b/sys/dev/isa/aha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aha.c,v 1.58 2007/10/09 17:06:18 gilles Exp $ */
+/* $OpenBSD: aha.c,v 1.59 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: aha.c,v 1.11 1996/05/12 23:51:23 mycroft Exp $ */
#undef AHADIAG
@@ -1261,10 +1261,6 @@ aha_scsi_cmd(xs)
struct aha_ccb *ccb;
struct aha_scat_gath *sg;
int seg, flags;
-#ifdef TFS
- struct iovec *iovp;
- int datalen;
-#endif
int s;
SC_DEBUG(sc_link, SDEV_DB2, ("aha_scsi_cmd\n"));
@@ -1297,40 +1293,21 @@ aha_scsi_cmd(xs)
if (xs->datalen) {
sg = ccb->scat_gath;
seg = 0;
-#ifdef TFS
- if (flags & SCSI_DATA_UIO) {
- iovp = ((struct uio *)xs->data)->uio_iov;
- datalen = ((struct uio *)xs->data)->uio_iovcnt;
- xs->datalen = 0;
- while (datalen && seg < AHA_NSEG) {
- ltophys(iovp->iov_base, sg->seg_addr);
- ltophys(iovp->iov_len, sg->seg_len);
- xs->datalen += iovp->iov_len;
- SC_DEBUGN(sc_link, SDEV_DB4, ("UIO(0x%x@0x%x)",
- iovp->iov_len, iovp->iov_base));
- sg++;
- iovp++;
- seg++;
- datalen--;
- }
- } else
-#endif /* TFS */
- {
- /*
- * Set up the scatter-gather block.
- */
- if (bus_dmamap_load(sc->sc_dmat, ccb->dmam, xs->data,
- xs->datalen, NULL, BUS_DMA_NOWAIT) != 0) {
- aha_free_ccb(sc, ccb);
- xs->error = XS_DRIVER_STUFFUP;
- return (TRY_AGAIN_LATER);
- }
- for (seg = 0; seg < ccb->dmam->dm_nsegs; seg++) {
- ltophys(ccb->dmam->dm_segs[seg].ds_addr,
- sg[seg].seg_addr);
- ltophys(ccb->dmam->dm_segs[seg].ds_len,
- sg[seg].seg_len);
- }
+
+ /*
+ * Set up the scatter-gather block.
+ */
+ if (bus_dmamap_load(sc->sc_dmat, ccb->dmam, xs->data,
+ xs->datalen, NULL, BUS_DMA_NOWAIT) != 0) {
+ aha_free_ccb(sc, ccb);
+ xs->error = XS_DRIVER_STUFFUP;
+ return (TRY_AGAIN_LATER);
+ }
+ for (seg = 0; seg < ccb->dmam->dm_nsegs; seg++) {
+ ltophys(ccb->dmam->dm_segs[seg].ds_addr,
+ sg[seg].seg_addr);
+ ltophys(ccb->dmam->dm_segs[seg].ds_len,
+ sg[seg].seg_len);
}
if (flags & SCSI_DATA_OUT)
bus_dmamap_sync(sc->sc_dmat, ccb->dmam, 0,
diff --git a/sys/dev/isa/wds.c b/sys/dev/isa/wds.c
index 1ec6603b487..09c695991f2 100644
--- a/sys/dev/isa/wds.c
+++ b/sys/dev/isa/wds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wds.c,v 1.24 2007/11/05 17:12:41 krw Exp $ */
+/* $OpenBSD: wds.c,v 1.25 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: wds.c,v 1.13 1996/11/03 16:20:31 mycroft Exp $ */
#undef WDSDIAG
@@ -1056,9 +1056,6 @@ wds_scsi_cmd(xs)
int seg;
u_long thiskv, thisphys, nextphys;
int bytes_this_seg, bytes_this_page, datalen, flags;
-#ifdef TFS
- struct iovec *iovp;
-#endif
int s;
#ifdef notyet
int mflags;
@@ -1084,14 +1081,6 @@ wds_scsi_cmd(xs)
scb->xs = xs;
scb->timeout = xs->timeout;
- if (xs->flags & SCSI_DATA_UIO) {
- /* XXX Fix me! */
- /* Let's not worry about UIO. There isn't any code for the *
- * non-SG boards anyway! */
- printf("%s: UIO is untested and disabled!\n", sc->sc_dev.dv_xname);
- goto bad;
- }
-
/* Zero out the command structure. */
bzero(&scb->cmd, sizeof scb->cmd);
bcopy(xs->cmd, &scb->cmd.scb, xs->cmdlen < 12 ? xs->cmdlen : 12);
@@ -1107,94 +1096,75 @@ wds_scsi_cmd(xs)
if (!NEEDBUFFER(sc) && xs->datalen) {
sg = scb->scat_gath;
seg = 0;
-#ifdef TFS
- if (flags & SCSI_DATA_UIO) {
- iovp = ((struct uio *)xs->data)->uio_iov;
- datalen = ((struct uio *)xs->data)->uio_iovcnt;
- xs->datalen = 0;
- while (datalen && seg < WDS_NSEG) {
- ltophys(iovp->iov_base, sg->seg_addr);
- ltophys(iovp->iov_len, sg->seg_len);
- xs->datalen += iovp->iov_len;
- SC_DEBUGN(sc_link, SDEV_DB4, ("UIO(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));
+
+ /*
+ * Set up the scatter-gather block.
+ */
+ SC_DEBUG(sc_link, SDEV_DB4,
+ ("%d @0x%x:- ", xs->datalen, xs->data));
#ifdef notyet
- scb->data_nseg = isadma_map(xs->data, xs->datalen,
- scb->data_phys, mflags);
- for (seg = 0; seg < scb->data_nseg; seg++) {
- ltophys(scb->data_phys[seg].addr,
- sg[seg].seg_addr);
- ltophys(scb->data_phys[seg].length,
- sg[seg].seg_len);
- }
+ scb->data_nseg = isadma_map(xs->data, xs->datalen,
+ scb->data_phys, mflags);
+ for (seg = 0; seg < scb->data_nseg; seg++) {
+ ltophys(scb->data_phys[seg].addr,
+ sg[seg].seg_addr);
+ ltophys(scb->data_phys[seg].length,
+ sg[seg].seg_len);
+ }
#else
- datalen = xs->datalen;
- thiskv = (int)xs->data;
- thisphys = KVTOPHYS(xs->data);
+ datalen = xs->datalen;
+ thiskv = (int)xs->data;
+ thisphys = KVTOPHYS(xs->data);
- while (datalen && seg < WDS_NSEG) {
- bytes_this_seg = 0;
+ while (datalen && seg < WDS_NSEG) {
+ bytes_this_seg = 0;
- /* put in the base address */
- ltophys(thisphys, sg->seg_addr);
+ /* put in the base address */
+ ltophys(thisphys, sg->seg_addr);
- SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", 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
- */
- /* check it fits on the ISA bus */
- if (thisphys > 0xFFFFFF) {
- printf("%s: DMA beyond"
- " end of ISA\n",
- sc->sc_dev.dv_xname);
- goto bad;
- }
- /* 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);
- }
+ /* 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));
- ltophys(bytes_this_seg, sg->seg_len);
- sg++;
- seg++;
-#endif
+ /* check it fits on the ISA bus */
+ if (thisphys > 0xFFFFFF) {
+ printf("%s: DMA beyond"
+ " end of ISA\n",
+ sc->sc_dev.dv_xname);
+ goto bad;
+ }
+ /* 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));
+ ltophys(bytes_this_seg, sg->seg_len);
+ sg++;
+ seg++;
+#endif
}
- /* end of iov/kv decision */
+
SC_DEBUGN(sc_link, SDEV_DB4, ("\n"));
if (datalen) {
/*