diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-03-23 01:57:21 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-03-23 01:57:21 +0000 |
commit | cd948c1fd3a45bb8ee18483b4f8df6ce849f8140 (patch) | |
tree | 2748525ad92550d0ad2b46b5619c24e5bcda0e13 /sys/dev/i2o | |
parent | e88d321d148e115dbbf6fea61f7c0dcb67021421 (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/i2o')
-rw-r--r-- | sys/dev/i2o/ioprbs.c | 18 | ||||
-rw-r--r-- | sys/dev/i2o/iopsp.c | 15 |
2 files changed, 16 insertions, 17 deletions
diff --git a/sys/dev/i2o/ioprbs.c b/sys/dev/i2o/ioprbs.c index 38fca418deb..e2e3d5ca007 100644 --- a/sys/dev/i2o/ioprbs.c +++ b/sys/dev/i2o/ioprbs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioprbs.c,v 1.19 2010/01/09 23:15:06 krw Exp $ */ +/* $OpenBSD: ioprbs.c,v 1.20 2010/03/23 01:57:19 krw Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -105,7 +105,7 @@ void ioprbs_internal_cache_cmd(struct scsi_xfer *); void ioprbs_intr(struct device *, struct iop_msg *, void *); void ioprbs_intr_event(struct device *, struct iop_msg *, void *); int ioprbs_match(struct device *, void *, void *); -int ioprbs_scsi_cmd(struct scsi_xfer *); +void ioprbs_scsi_cmd(struct scsi_xfer *); int ioprbs_start(struct ioprbs_ccb *); void ioprbs_start_ccbs(struct ioprbs_softc *); void ioprbs_timeout(void *); @@ -397,7 +397,7 @@ ioprbs_unconfig(struct ioprbs_softc *sc, int evreg) iop_initiator_unregister(iop, &sc->sc_ii); } -int +void ioprbs_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -408,7 +408,6 @@ ioprbs_scsi_cmd(xs) struct scsi_rw *rw; struct scsi_rw_big *rwb; int s; - int retval = SUCCESSFULLY_QUEUED; s = splbio(); @@ -498,8 +497,10 @@ ioprbs_scsi_cmd(xs) * We are out of commands, try again in a little while. */ if (ccb == NULL) { + xs->error = XS_NO_CCB; + scsi_done(xs); splx(s); - return (NO_CCB); + return; } ccb->ic_blockno = blockno; @@ -516,7 +517,10 @@ ioprbs_scsi_cmd(xs) splx(s); printf("%s: command timed out\n", sc->sc_dv.dv_xname); - return (NO_CCB); + xs->error = XS_NO_CCB; + scsi_done(xs); + splx(s); + return; } scsi_done(xs); #endif @@ -528,13 +532,11 @@ ioprbs_scsi_cmd(xs) * Don't process the queue if we are polling. */ if (xs->flags & SCSI_POLL) { - retval = COMPLETE; break; } } splx(s); - return (retval); } void diff --git a/sys/dev/i2o/iopsp.c b/sys/dev/i2o/iopsp.c index 3cfb91b3a3b..18388d9ce77 100644 --- a/sys/dev/i2o/iopsp.c +++ b/sys/dev/i2o/iopsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iopsp.c,v 1.15 2009/04/02 18:44:49 oga Exp $ */ +/* $OpenBSD: iopsp.c,v 1.16 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD$ */ /*- @@ -71,7 +71,7 @@ struct cfattach iopsp_ca = { sizeof(struct iopsp_softc), iopsp_match, iopsp_attach }; -int iopsp_scsi_cmd(struct scsi_xfer *); +void iopsp_scsi_cmd(struct scsi_xfer *); void iopspminphys(struct buf *bp, struct scsi_link *sl); struct scsi_adapter iopsp_switch = { @@ -404,7 +404,7 @@ iopspminphys(struct buf *bp, struct scsi_link *sl) /* * Start a SCSI command. */ -int +void iopsp_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -422,7 +422,7 @@ iopsp_scsi_cmd(xs) s = splbio(); scsi_done(xs); splx(s); - return (COMPLETE); + return; } SC_DEBUG(xs->sc_link, SDEV_DB2, ("iopsp_scsi_cmd: run_xfer\n")); @@ -442,7 +442,7 @@ iopsp_scsi_cmd(xs) s = splbio(); scsi_done(xs); splx(s); - return (COMPLETE); + return; } #if defined(I2ODEBUG) || defined(SCSIDEBUG) @@ -489,7 +489,7 @@ iopsp_scsi_cmd(xs) s = splbio(); scsi_done(xs); splx(s); - return (COMPLETE); + return; } if ((xs->flags & SCSI_DATA_IN) == 0) mf->flags |= I2O_SCB_FLAG_XFER_TO_DEVICE; @@ -512,10 +512,7 @@ iopsp_scsi_cmd(xs) s = splbio(); scsi_done(xs); splx(s); - return (COMPLETE); } - - return (xs->flags & SCSI_POLL? COMPLETE : SUCCESSFULLY_QUEUED); } #ifdef notyet |