summaryrefslogtreecommitdiff
path: root/sys/dev/ic/uha.c
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/ic/uha.c
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/ic/uha.c')
-rw-r--r--sys/dev/ic/uha.c114
1 files changed, 47 insertions, 67 deletions
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) {
/*