summaryrefslogtreecommitdiff
path: root/sys/dev/ic/twe.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-03-23 01:57:21 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-03-23 01:57:21 +0000
commitcd948c1fd3a45bb8ee18483b4f8df6ce849f8140 (patch)
tree2748525ad92550d0ad2b46b5619c24e5bcda0e13 /sys/dev/ic/twe.c
parente88d321d148e115dbbf6fea61f7c0dcb67021421 (diff)
Change the scsi_cmd function member of scsi_adapter from int to
void. Use XS_NO_CCB error in the scsi command (xs) to report the NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE confusion and untangles the midlayer from the adapter a bit more. Eyes and some fixes by miod@ There may be some compile issues on little used (i.e. I don't have any) drivers but the change is mechanical and thus easy to remedy. ok dlg@
Diffstat (limited to 'sys/dev/ic/twe.c')
-rw-r--r--sys/dev/ic/twe.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c
index 1c633747cd6..dd0d0c6d21d 100644
--- a/sys/dev/ic/twe.c
+++ b/sys/dev/ic/twe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: twe.c,v 1.33 2010/01/09 23:15:06 krw Exp $ */
+/* $OpenBSD: twe.c,v 1.34 2010/03/23 01:57:20 krw Exp $ */
/*
* Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved.
@@ -64,7 +64,7 @@ struct cfdriver twe_cd = {
NULL, "twe", DV_DULL
};
-int twe_scsi_cmd(struct scsi_xfer *);
+void twe_scsi_cmd(struct scsi_xfer *);
struct scsi_adapter twe_switch = {
twe_scsi_cmd, tweminphys, 0, 0,
@@ -770,7 +770,7 @@ twe_copy_internal_data(xs, v, size)
}
}
-int
+void
twe_scsi_cmd(xs)
struct scsi_xfer *xs;
{
@@ -795,7 +795,7 @@ twe_scsi_cmd(xs)
lock = TWE_LOCK(sc);
scsi_done(xs);
TWE_UNLOCK(sc, lock);
- return (COMPLETE);
+ return;
}
TWE_DPRINTF(TWE_D_CMD, ("twe_scsi_cmd "));
@@ -854,7 +854,7 @@ twe_scsi_cmd(xs)
lock = TWE_LOCK(sc);
scsi_done(xs);
TWE_UNLOCK(sc, lock);
- return (COMPLETE);
+ return;
case READ_COMMAND:
case READ_BIG:
@@ -888,7 +888,7 @@ twe_scsi_cmd(xs)
xs->error = XS_DRIVER_STUFFUP;
scsi_done(xs);
TWE_UNLOCK(sc, lock);
- return (COMPLETE);
+ return;
}
}
@@ -900,8 +900,12 @@ twe_scsi_cmd(xs)
default: op = TWE_CMD_NOP; break;
}
- if ((ccb = twe_get_ccb(sc)) == NULL)
- return (NO_CCB);
+ if ((ccb = twe_get_ccb(sc)) == NULL) {
+ xs->error = XS_NO_CCB;
+ scsi_done(xs);
+ TWE_UNLOCK(sc, lock);
+ return;
+ }
ccb->ccb_xs = xs;
ccb->ccb_data = xs->data;
@@ -923,16 +927,10 @@ twe_scsi_cmd(xs)
TWE_DPRINTF(TWE_D_CMD, ("failed %p ", xs));
xs->error = XS_DRIVER_STUFFUP;
scsi_done(xs);
- TWE_UNLOCK(sc, lock);
- return (COMPLETE);
}
TWE_UNLOCK(sc, lock);
-
- if (wait & SCSI_POLL)
- return (COMPLETE);
- else
- return (SUCCESSFULLY_QUEUED);
+ return;
default:
TWE_DPRINTF(TWE_D_CMD, ("unsupported scsi command %#x tgt %d ",
@@ -943,8 +941,6 @@ twe_scsi_cmd(xs)
lock = TWE_LOCK(sc);
scsi_done(xs);
TWE_UNLOCK(sc, lock);
-
- return (COMPLETE);
}
int