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/hp300/dev | |
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/hp300/dev')
-rw-r--r-- | sys/arch/hp300/dev/mb89352.c | 16 |
1 files changed, 9 insertions, 7 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; } /* |