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 | |
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')
-rw-r--r-- | sys/arch/hp300/dev/mb89352.c | 16 | ||||
-rw-r--r-- | sys/arch/luna88k/dev/mb89352.c | 16 | ||||
-rw-r--r-- | sys/arch/luna88k/dev/mb89352var.h | 4 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/ncr5380.c | 16 | ||||
-rw-r--r-- | sys/arch/macppc/dev/mesh.c | 17 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/sbic.c | 12 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vs.c | 33 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vsbic.c | 26 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vs.c | 35 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vsbic.c | 25 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vdsk.c | 14 | ||||
-rw-r--r-- | sys/arch/vax/dec/sii.c | 20 |
12 files changed, 132 insertions, 102 deletions
diff --git a/sys/arch/hp300/dev/mb89352.c b/sys/arch/hp300/dev/mb89352.c index b0f4af988cb..fcdd214e10a 100644 --- a/sys/arch/hp300/dev/mb89352.c +++ b/sys/arch/hp300/dev/mb89352.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mb89352.c,v 1.21 2010/01/13 06:09:44 krw Exp $ */ +/* $OpenBSD: mb89352.c,v 1.22 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD: mb89352.c,v 1.5 2000/03/23 07:01:31 thorpej Exp $ */ /* NecBSD: mb89352.c,v 1.4 1998/03/14 07:31:20 kmatsuda Exp */ @@ -137,7 +137,7 @@ int spc_debug = 0x00; /* SPC_SHOWSTART|SPC_SHOWMISC|SPC_SHOWTRACE; */ void spc_done (struct spc_softc *, struct spc_acb *); void spc_dequeue (struct spc_softc *, struct spc_acb *); -int spc_scsi_cmd (struct scsi_xfer *); +void spc_scsi_cmd (struct scsi_xfer *); int spc_poll (struct spc_softc *, struct scsi_xfer *, int); void spc_sched_msgout(struct spc_softc *, u_char); void spc_setsync(struct spc_softc *, struct spc_tinfo *); @@ -398,7 +398,7 @@ spc_get_acb(struct spc_softc *sc, int flags) * This function is called by the higher level SCSI-driver to queue/run * SCSI-commands. */ -int +void spc_scsi_cmd(struct scsi_xfer *xs) { struct scsi_link *sc_link = xs->sc_link; @@ -412,7 +412,11 @@ spc_scsi_cmd(struct scsi_xfer *xs) flags = xs->flags; if ((acb = spc_get_acb(sc, flags)) == NULL) { - return (NO_CCB); + xs->error = XS_NO_CCB; + s= splbio(); + scsi_done(xs); + splx(s); + return; } /* Initialize acb */ @@ -442,13 +446,12 @@ spc_scsi_cmd(struct scsi_xfer *xs) spc_sched(sc); /* * After successful sending, check if we should return just now. - * If so, return SUCCESSFULLY_QUEUED. */ splx(s); if ((flags & SCSI_POLL) == 0) - return SUCCESSFULLY_QUEUED; + return; /* Not allowed to use interrupts, use polling instead */ s = splbio(); @@ -458,7 +461,6 @@ spc_scsi_cmd(struct scsi_xfer *xs) spc_timeout(acb); } splx(s); - return COMPLETE; } /* diff --git a/sys/arch/luna88k/dev/mb89352.c b/sys/arch/luna88k/dev/mb89352.c index 1ea542c8b82..42b18f50ccd 100644 --- a/sys/arch/luna88k/dev/mb89352.c +++ b/sys/arch/luna88k/dev/mb89352.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mb89352.c,v 1.11 2010/01/13 06:09:44 krw Exp $ */ +/* $OpenBSD: mb89352.c,v 1.12 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD: mb89352.c,v 1.5 2000/03/23 07:01:31 thorpej Exp $ */ /* NecBSD: mb89352.c,v 1.4 1998/03/14 07:31:20 kmatsuda Exp */ @@ -150,7 +150,7 @@ int spc_debug = 0x00; /* SPC_SHOWSTART|SPC_SHOWMISC|SPC_SHOWTRACE; */ void spc_done (struct spc_softc *, struct spc_acb *); void spc_dequeue (struct spc_softc *, struct spc_acb *); -int spc_scsi_cmd (struct scsi_xfer *); +void spc_scsi_cmd (struct scsi_xfer *); int spc_poll (struct spc_softc *, struct scsi_xfer *, int); integrate void spc_sched_msgout(struct spc_softc *, u_char); integrate void spc_setsync(struct spc_softc *, struct spc_tinfo *); @@ -427,7 +427,7 @@ spc_get_acb(sc, flags) * This function is called by the higher level SCSI-driver to queue/run * SCSI-commands. */ -int +void spc_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -442,7 +442,11 @@ spc_scsi_cmd(xs) flags = xs->flags; if ((acb = spc_get_acb(sc, flags)) == NULL) { - return (NO_CCB); + xs->error = XS_NO_CCB; + s = splbio(); + scsi_done(xs); + splx(s); + return; } /* Initialize acb */ @@ -472,13 +476,12 @@ spc_scsi_cmd(xs) spc_sched(sc); /* * After successful sending, check if we should return just now. - * If so, return SUCCESSFULLY_QUEUED. */ splx(s); if ((flags & SCSI_POLL) == 0) - return SUCCESSFULLY_QUEUED; + return; /* Not allowed to use interrupts, use polling instead */ s = splbio(); @@ -488,7 +491,6 @@ spc_scsi_cmd(xs) spc_timeout(acb); } splx(s); - return COMPLETE; } /* diff --git a/sys/arch/luna88k/dev/mb89352var.h b/sys/arch/luna88k/dev/mb89352var.h index e77f0649a05..e94a5011d75 100644 --- a/sys/arch/luna88k/dev/mb89352var.h +++ b/sys/arch/luna88k/dev/mb89352var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mb89352var.h,v 1.1 2004/04/21 15:23:55 aoyama Exp $ */ +/* $OpenBSD: mb89352var.h,v 1.2 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD: mb89352var.h,v 1.6 2003/08/02 12:48:09 tsutsui Exp $ */ /* NecBSD: mb89352var.h,v 1.4 1998/03/14 07:31:22 kmatsuda Exp */ @@ -209,6 +209,6 @@ int spc_intr(void *); int spc_find(bus_space_tag_t, bus_space_handle_t, int); void spc_init(struct spc_softc *); void spc_sched(struct spc_softc *); -int spc_scsi_cmd(struct scsi_xfer *); +void spc_scsi_cmd(struct scsi_xfer *); void spc_minphys(struct buf *); #endif /* _MB89352VAR_H_ */ diff --git a/sys/arch/mac68k/dev/ncr5380.c b/sys/arch/mac68k/dev/ncr5380.c index 9324557d98b..201cab11ff6 100644 --- a/sys/arch/mac68k/dev/ncr5380.c +++ b/sys/arch/mac68k/dev/ncr5380.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr5380.c,v 1.37 2010/01/13 06:09:44 krw Exp $ */ +/* $OpenBSD: ncr5380.c,v 1.38 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD: ncr5380.c,v 1.38 1996/12/19 21:48:18 scottr Exp $ */ /* @@ -74,7 +74,7 @@ static volatile int main_running = 0; static u_char busy; static void ncr5380_minphys(struct buf *bp, struct scsi_link *sl); -static int mac68k_ncr5380_scsi_cmd(struct scsi_xfer *xs); +static void mac68k_ncr5380_scsi_cmd(struct scsi_xfer *xs); static void ncr5380_show_scsi_cmd(struct scsi_xfer *xs); struct scsi_adapter ncr5380_switch = { @@ -287,7 +287,7 @@ void *auxp; /* * Carry out a request from the high level driver. */ -static int +static void mac68k_ncr5380_scsi_cmd(struct scsi_xfer *xs) { int sps; @@ -300,7 +300,7 @@ mac68k_ncr5380_scsi_cmd(struct scsi_xfer *xs) if (flags & SCSI_RESET) { scsi_reset_verbose(xs->sc_link->adapter_softc, "Got reset-command"); - return (COMPLETE); + return; } /* @@ -308,8 +308,10 @@ mac68k_ncr5380_scsi_cmd(struct scsi_xfer *xs) */ sps = splbio(); if ((reqp = free_head) == 0) { + xs->error = XS_NO_CCB; + scsi_done(xs); splx(sps); - return (NO_CCB); + return; } free_head = reqp->next; reqp->next = NULL; @@ -380,10 +382,6 @@ mac68k_ncr5380_scsi_cmd(struct scsi_xfer *xs) #endif run_main(xs->sc_link->adapter_softc); - - if (xs->flags & (SCSI_POLL|ITSDONE)) - return (COMPLETE); /* We're booting or run_main has completed */ - return (SUCCESSFULLY_QUEUED); } static void diff --git a/sys/arch/macppc/dev/mesh.c b/sys/arch/macppc/dev/mesh.c index 57ef3f965de..d3e8b2308dd 100644 --- a/sys/arch/macppc/dev/mesh.c +++ b/sys/arch/macppc/dev/mesh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mesh.c,v 1.24 2010/01/13 06:09:44 krw Exp $ */ +/* $OpenBSD: mesh.c,v 1.25 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD: mesh.c,v 1.1 1999/02/19 13:06:03 tsubai Exp $ */ /*- @@ -236,7 +236,7 @@ int mesh_stp(struct mesh_softc *, int); void mesh_setsync(struct mesh_softc *, struct mesh_tinfo *); struct mesh_scb *mesh_get_scb(struct mesh_softc *); void mesh_free_scb(struct mesh_softc *, struct mesh_scb *); -int mesh_scsi_cmd(struct scsi_xfer *); +void mesh_scsi_cmd(struct scsi_xfer *); void mesh_sched(struct mesh_softc *); int mesh_poll(struct scsi_xfer *); void mesh_done(struct mesh_softc *, struct mesh_scb *); @@ -1030,7 +1030,7 @@ mesh_free_scb(struct mesh_softc *sc, struct mesh_scb *scb) TAILQ_INSERT_TAIL(&sc->free_scb, scb, chain); } -int +void mesh_scsi_cmd(struct scsi_xfer *xs) { struct scsi_link *sc_link = xs->sc_link;; @@ -1042,9 +1042,13 @@ mesh_scsi_cmd(struct scsi_xfer *xs) flags = xs->flags; s = splbio(); scb = mesh_get_scb(sc); + if (scb == NULL) { + xs->error = XS_NO_CCB; + scsi_done(xs); + splx(s); + return; + } splx(s); - if (scb == NULL) - return (NO_CCB); DPRINTF("cmdlen: %d\n", xs->cmdlen); scb->xs = xs; scb->flags = 0; @@ -1075,10 +1079,7 @@ mesh_scsi_cmd(struct scsi_xfer *xs) sc->sc_dev.dv_xname); } - return COMPLETE; } - - return SUCCESSFULLY_QUEUED; } void diff --git a/sys/arch/mvme68k/dev/sbic.c b/sys/arch/mvme68k/dev/sbic.c index a51033aff25..e15b2e1349b 100644 --- a/sys/arch/mvme68k/dev/sbic.c +++ b/sys/arch/mvme68k/dev/sbic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbic.c,v 1.24 2010/01/09 23:15:06 krw Exp $ */ +/* $OpenBSD: sbic.c,v 1.25 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD: sbic.c,v 1.2 1996/04/23 16:32:54 chuck Exp $ */ /* @@ -367,7 +367,11 @@ sbic_scsicmd(xs) Debugger(); #endif #endif - return (NO_CCB); + xs->error = XS_NO_CCB; + s = splbio(); + scsi_done(xs); + splx(s); + return; } if ( flags & SCSI_DATA_IN ) @@ -419,7 +423,7 @@ sbic_scsicmd(xs) splx(s); - return(COMPLETE); + return; } s = splbio(); @@ -432,8 +436,6 @@ sbic_scsicmd(xs) sbic_sched(dev); splx(s); - - return(SUCCESSFULLY_QUEUED); } /* diff --git a/sys/arch/mvme68k/dev/vs.c b/sys/arch/mvme68k/dev/vs.c index 5c77815059d..7f16bf3e2b8 100644 --- a/sys/arch/mvme68k/dev/vs.c +++ b/sys/arch/mvme68k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.30 2010/01/09 23:15:06 krw Exp $ */ +/* $OpenBSD: vs.c,v 1.31 2010/03/23 01:57:19 krw Exp $ */ /* * Copyright (c) 2004, 2009, Miodrag Vallat. @@ -64,7 +64,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, @@ -104,7 +104,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); @@ -327,7 +327,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; @@ -355,7 +355,6 @@ vs_poll(struct vs_softc *sc, struct vs_cb *cb) CRB_CLR_DONE; vs_clear_return_info(sc); - return (COMPLETE); } void @@ -418,7 +417,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; @@ -447,7 +446,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(); @@ -460,7 +463,10 @@ 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); } if (vs_getcqe(sc, &cqep, &iopb)) { /* XXX shouldn't happen since our queue is ready */ @@ -468,7 +474,10 @@ 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); } } @@ -484,7 +493,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); @@ -501,10 +510,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/mvme68k/dev/vsbic.c b/sys/arch/mvme68k/dev/vsbic.c index 1841138c7f6..8d10bec56a1 100644 --- a/sys/arch/mvme68k/dev/vsbic.c +++ b/sys/arch/mvme68k/dev/vsbic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsbic.c,v 1.4 2010/01/10 00:10:23 krw Exp $ */ +/* $OpenBSD: vsbic.c,v 1.5 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,10 @@ 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; + return; } env = bpp_get_envelope(bsc); @@ -1198,8 +1200,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 +1212,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 +1237,7 @@ vsbic_scsicmd(struct scsi_xfer *xs) xs->error = XS_DRIVER_STUFFUP; scsi_done(xs); splx(s); - return (COMPLETE); + return; } /* @@ -1248,11 +1254,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); } } 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); } } diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index 9d4a48a6344..5a9def7238f 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.17 2010/01/09 23:15:06 krw Exp $ */ +/* $OpenBSD: vdsk.c,v 1.18 2010/03/23 01:57:19 krw Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -200,7 +200,7 @@ void vdsk_send_attr_info(struct vdsk_softc *); void vdsk_send_dring_reg(struct vdsk_softc *); void vdsk_send_rdx(struct vdsk_softc *); -int vdsk_scsi_cmd(struct scsi_xfer *); +void vdsk_scsi_cmd(struct scsi_xfer *); int vdsk_dev_probe(struct scsi_link *); void vdsk_dev_free(struct scsi_link *); int vdsk_ioctl(struct scsi_link *, u_long, caddr_t, int, struct proc *); @@ -914,7 +914,7 @@ vdsk_dring_free(bus_dma_tag_t t, struct vdsk_dring *vd) free(vd, M_DEVBUF); } -int +void vdsk_scsi_cmd(struct scsi_xfer *xs) { struct scsi_rw *rw; @@ -978,8 +978,10 @@ vdsk_scsi_cmd(struct scsi_xfer *xs) s = splbio(); if (sc->sc_vio_state != VIO_ESTABLISHED || sc->sc_tx_cnt >= sc->sc_vd->vd_nentries) { + xs->error = XS_NO_CCB; + scsi_done(xs); splx(s); - return (NO_CCB); + return; } desc = sc->sc_tx_prod; @@ -1038,7 +1040,7 @@ vdsk_scsi_cmd(struct scsi_xfer *xs) if (!ISSET(xs->flags, SCSI_POLL)) { splx(s); - return (SUCCESSFULLY_QUEUED); + return; } timeout = 1000; @@ -1050,8 +1052,6 @@ vdsk_scsi_cmd(struct scsi_xfer *xs) delay(1000); } while(--timeout > 0); splx(s); - - return (COMPLETE); } } diff --git a/sys/arch/vax/dec/sii.c b/sys/arch/vax/dec/sii.c index b48348bf190..15b0e8e0886 100644 --- a/sys/arch/vax/dec/sii.c +++ b/sys/arch/vax/dec/sii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sii.c,v 1.7 2010/01/10 00:40:25 krw Exp $ */ +/* $OpenBSD: sii.c,v 1.8 2010/03/23 01:57:19 krw Exp $ */ /* $NetBSD: sii.c,v 1.42 2000/06/02 20:20:29 mhitch Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -156,7 +156,7 @@ int sii_GetByte(SIIRegs *regs, int phase, int ack); void sii_DoSync(struct sii_softc *, State *); void sii_StartDMA(SIIRegs *regs, int phase, u_int dmaAddr, int size); u_int sii_msgout(SIIRegs *, u_int, u_int8_t); -int sii_scsi_cmd(struct scsi_xfer *); +void sii_scsi_cmd(struct scsi_xfer *); void sii_schedule(struct sii_softc *); #ifdef DEBUG void sii_DumpLog(void); @@ -225,7 +225,7 @@ sii_attach(sc) * connect/disconnect during an operation. */ -int +void sii_scsi_cmd(xs) struct scsi_xfer *xs; { @@ -236,11 +236,13 @@ sii_scsi_cmd(xs) s = splbio(); if (sc->sc_xs[target] != NULL) { - splx(s); #ifdef DEBUG printf("[busy at start]\n"); #endif - return (NO_CCB); + xs->error = XS_NO_CCB; + scsi_done(xs); + splx(s); + return; } /* * Build a ScsiCmd for this command and start it. @@ -250,9 +252,9 @@ sii_scsi_cmd(xs) splx(s); if ((xs->flags & ITSDONE) != 0) - return (COMPLETE); + return; if ((xs->flags & SCSI_POLL) == 0) - return (SUCCESSFULLY_QUEUED); + return; count = xs->timeout; while (count) { s = splbio(); @@ -265,12 +267,12 @@ sii_scsi_cmd(xs) --count; } if ((xs->flags & ITSDONE) != 0) - return (COMPLETE); + return; xs->error = XS_TIMEOUT; s = splbio(); scsi_done(xs); splx(s); - return (COMPLETE); + return; } /* |