summaryrefslogtreecommitdiff
path: root/sys/dev/eisa
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/eisa
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/eisa')
-rw-r--r--sys/dev/eisa/aha1742.c117
1 files changed, 47 insertions, 70 deletions
diff --git a/sys/dev/eisa/aha1742.c b/sys/dev/eisa/aha1742.c
index b0b1a690b6d..c9775e042a7 100644
--- a/sys/dev/eisa/aha1742.c
+++ b/sys/dev/eisa/aha1742.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aha1742.c,v 1.26 2007/11/05 17:12:41 krw Exp $ */
+/* $OpenBSD: aha1742.c,v 1.27 2008/09/12 11:14:04 miod Exp $ */
/* $NetBSD: aha1742.c,v 1.61 1996/05/12 23:40:01 mycroft Exp $ */
/*
@@ -953,9 +953,6 @@ ahb_scsi_cmd(xs)
int seg; /* scatter gather seg being worked on */
u_long thiskv, thisphys, nextphys;
int bytes_this_seg, bytes_this_page, datalen, flags;
-#ifdef TFS
- struct iovec *iovp;
-#endif
int s;
SC_DEBUG(sc_link, SDEV_DB2, ("ahb_scsi_cmd\n"));
@@ -1026,76 +1023,56 @@ ahb_scsi_cmd(xs)
ecb->data_addr = KVTOPHYS(ecb->ahb_dma);
sg = ecb->ahb_dma;
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 < AHB_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 = (long) xs->data;
- thisphys = KVTOPHYS(thiskv);
-
- while (datalen && seg < AHB_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 = (long) xs->data;
+ thisphys = KVTOPHYS(thiskv);
+
+ while (datalen && seg < AHB_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 */
+
ecb->data_length = seg * sizeof(struct ahb_dma_seg);
SC_DEBUGN(sc_link, SDEV_DB4, ("\n"));
if (datalen) {