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/arch/mvme88k | |
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/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/dev/vs.c | 35 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vsbic.c | 25 |
2 files changed, 36 insertions, 24 deletions
diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c index 38a51672b93..d2d0f12dfb5 100644 --- a/sys/arch/mvme88k/dev/vs.c +++ b/sys/arch/mvme88k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.78 2010/01/09 23:15:06 krw Exp $ */ +/* $OpenBSD: vs.c,v 1.79 2010/03/23 01:57:19 krw Exp $ */ /* * Copyright (c) 2004, 2009, Miodrag Vallat. @@ -65,7 +65,7 @@ int vsmatch(struct device *, void *, void *); void vsattach(struct device *, struct device *, void *); void vs_minphys(struct buf *, struct scsi_link *); -int vs_scsicmd(struct scsi_xfer *); +void vs_scsicmd(struct scsi_xfer *); struct scsi_adapter vs_scsiswitch = { vs_scsicmd, @@ -105,7 +105,7 @@ int vs_load_command(struct vs_softc *, struct vs_cb *, bus_addr_t, bus_addr_t, struct scsi_link *, int, struct scsi_generic *, int, uint8_t *, int); int vs_nintr(void *); -int vs_poll(struct vs_softc *, struct vs_cb *); +void vs_poll(struct vs_softc *, struct vs_cb *); void vs_print_addr(struct vs_softc *, struct scsi_xfer *); struct vs_cb *vs_find_queue(struct scsi_link *, struct vs_softc *); void vs_reset(struct vs_softc *, int); @@ -312,7 +312,7 @@ do_vspoll(struct vs_softc *sc, struct scsi_xfer *xs, int canreset) return 0; } -int +void vs_poll(struct vs_softc *sc, struct vs_cb *cb) { struct scsi_xfer *xs; @@ -340,7 +340,6 @@ vs_poll(struct vs_softc *sc, struct vs_cb *cb) CRB_CLR_DONE; vs_clear_return_info(sc); - return (COMPLETE); } void @@ -403,7 +402,7 @@ vs_scsidone(struct vs_softc *sc, struct vs_cb *cb) scsi_done(xs); } -int +void vs_scsicmd(struct scsi_xfer *xs) { struct scsi_link *slp = xs->sc_link; @@ -432,7 +431,11 @@ vs_scsicmd(struct scsi_xfer *xs) if (cb->cb_xs != NULL) { printf("%s: master command not idle\n", sc->sc_dev.dv_xname); - return (NO_CCB); + xs->error = XS_NO_CCB; + s = splbio(); + scsi_done(xs); + splx(s); + return; } #endif s = splbio(); @@ -445,7 +448,11 @@ vs_scsicmd(struct scsi_xfer *xs) printf("%s: queue for target %d is busy\n", sc->sc_dev.dv_xname, slp->target); #endif - return (NO_CCB); + xs->error = XS_NO_CCB; + s = splbio(); + scsi_done(xs); + splx(s); + return; } if (vs_getcqe(sc, &cqep, &iopb)) { /* XXX shouldn't happen since our queue is ready */ @@ -453,7 +460,11 @@ vs_scsicmd(struct scsi_xfer *xs) #ifdef VS_DEBUG printf("%s: no free CQEs\n", sc->sc_dev.dv_xname); #endif - return (NO_CCB); + xs->error = XS_NO_CCB; + s = splbio(); + scsi_done(xs); + splx(s); + return; } } @@ -469,7 +480,7 @@ vs_scsicmd(struct scsi_xfer *xs) xs->error = XS_DRIVER_STUFFUP; scsi_done(xs); splx(s); - return (COMPLETE); + return; } vs_write(1, cqep + CQE_WORK_QUEUE, cb->cb_q); @@ -486,10 +497,8 @@ vs_scsicmd(struct scsi_xfer *xs) if (flags & SCSI_POLL) { /* poll for the command to complete */ - return vs_poll(sc, cb); + vs_poll(sc, cb); } - - return (SUCCESSFULLY_QUEUED); } int diff --git a/sys/arch/mvme88k/dev/vsbic.c b/sys/arch/mvme88k/dev/vsbic.c index 48d879f4ff2..e65246e4f85 100644 --- a/sys/arch/mvme88k/dev/vsbic.c +++ b/sys/arch/mvme88k/dev/vsbic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsbic.c,v 1.5 2010/01/10 00:10:23 krw Exp $ */ +/* $OpenBSD: vsbic.c,v 1.6 2010/03/23 01:57:19 krw Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -411,7 +411,7 @@ void vsbic_queue_cmd(struct vsbic_softc *, struct bpp_chan *, int vsbic_request_sense(struct vsbic_softc *, struct vsbic_ccb *); void vsbic_reset_command(struct vsbic_softc *, struct vsbic_cmd *, struct scsi_link *); -int vsbic_scsicmd(struct scsi_xfer *); +void vsbic_scsicmd(struct scsi_xfer *); int vsbic_scsireset(struct vsbic_softc *, struct scsi_xfer *); void vsbic_timeout(void *); void vsbic_wrapup(struct vsbic_softc *, struct vsbic_ccb *); @@ -1128,7 +1128,7 @@ vsbic_reset_command(struct vsbic_softc *sc, struct vsbic_cmd *cmd, /* * Try and send a command to the board. */ -int +void vsbic_scsicmd(struct scsi_xfer *xs) { struct scsi_link *sl = xs->sc_link; @@ -1152,7 +1152,7 @@ vsbic_scsicmd(struct scsi_xfer *xs) xs->error = XS_DRIVER_STUFFUP; scsi_done(xs); splx(s); - return COMPLETE; + return; } #endif @@ -1176,7 +1176,7 @@ vsbic_scsicmd(struct scsi_xfer *xs) xs->error = XS_SENSE; scsi_done(xs); splx(s); - return COMPLETE; + return; } /* @@ -1188,8 +1188,9 @@ vsbic_scsicmd(struct scsi_xfer *xs) #ifdef VSBIC_DEBUG printf("%s: no free CCB\n", DEVNAME(sc)); #endif + xs->error = XS_NO_CCB; + scsi_done(xs); splx(s); - return NO_CCB; } env = bpp_get_envelope(bsc); @@ -1198,8 +1199,10 @@ vsbic_scsicmd(struct scsi_xfer *xs) printf("%s: no free envelope\n", DEVNAME(sc)); #endif vsbic_free_ccb(sc, ccb); + xs->error = XS_NO_CCB; + scsi_done(xs); splx(s); - return NO_CCB; + return; } cmd = vsbic_get_cmd(sc); if (cmd == NULL) { @@ -1208,8 +1211,10 @@ vsbic_scsicmd(struct scsi_xfer *xs) #endif bpp_put_envelope(bsc, env); vsbic_free_ccb(sc, ccb); + xs->error = XS_NO_CCB; + scsi_done(xs); splx(s); - return NO_CCB; + return; } ccb->ccb_xs = xs; @@ -1231,7 +1236,7 @@ vsbic_scsicmd(struct scsi_xfer *xs) xs->error = XS_DRIVER_STUFFUP; scsi_done(xs); splx(s); - return (COMPLETE); + return; } /* @@ -1248,11 +1253,9 @@ vsbic_scsicmd(struct scsi_xfer *xs) if (ISSET(xs->flags, SCSI_POLL)) { splx(s); vsbic_poll(sc, ccb); - return (COMPLETE); } else { timeout_add_msec(&xs->stimeout, xs->timeout); splx(s); - return (SUCCESSFULLY_QUEUED); } } |