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/usb | |
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/usb')
-rw-r--r-- | sys/dev/usb/umass_scsi.c | 12 | ||||
-rw-r--r-- | sys/dev/usb/usscanner.c | 10 |
2 files changed, 9 insertions, 13 deletions
diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c index 32e19d38629..65827a820fb 100644 --- a/sys/dev/usb/umass_scsi.c +++ b/sys/dev/usb/umass_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass_scsi.c,v 1.27 2010/01/13 11:46:33 krw Exp $ */ +/* $OpenBSD: umass_scsi.c,v 1.28 2010/03/23 01:57:20 krw Exp $ */ /* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ struct umass_scsi_softc { #define UMASS_ATAPI_DRIVE 0 -int umass_scsi_cmd(struct scsi_xfer *); +void umass_scsi_cmd(struct scsi_xfer *); void umass_scsi_minphys(struct buf *, struct scsi_link *); void umass_scsi_cb(struct umass_softc *sc, void *priv, int residue, @@ -166,7 +166,7 @@ umass_scsi_setup(struct umass_softc *sc) return (scbus); } -int +void umass_scsi_cmd(struct scsi_xfer *xs) { struct scsi_link *sc_link = xs->sc_link; @@ -234,7 +234,7 @@ umass_scsi_cmd(struct scsi_xfer *xs) sc->polled_xfer_status)); usbd_set_polling(sc->sc_udev, 0); /* scsi_done() has already been called. */ - return (COMPLETE); + return; } else { DPRINTF(UDMASS_SCSI, ("umass_scsi_cmd: async dir=%d, cmdlen=%d" @@ -244,7 +244,7 @@ umass_scsi_cmd(struct scsi_xfer *xs) xs->data, xs->datalen, dir, xs->timeout, umass_scsi_cb, xs); /* scsi_done() has already been called. */ - return (SUCCESSFULLY_QUEUED); + return; } /* Return if command finishes early. */ @@ -252,8 +252,6 @@ umass_scsi_cmd(struct scsi_xfer *xs) s = splbio(); scsi_done(xs); splx(s); - - return (COMPLETE); } void diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c index 2e1b136ad72..5562951320c 100644 --- a/sys/dev/usb/usscanner.c +++ b/sys/dev/usb/usscanner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usscanner.c,v 1.30 2010/01/09 23:15:07 krw Exp $ */ +/* $OpenBSD: usscanner.c,v 1.31 2010/03/23 01:57:20 krw Exp $ */ /* $NetBSD: usscanner.c,v 1.6 2001/01/23 14:04:14 augustss Exp $ */ /* @@ -150,7 +150,7 @@ struct usscanner_softc { void usscanner_cleanup(struct usscanner_softc *sc); -int usscanner_scsipi_cmd(struct scsipi_xfer *xs); +void usscanner_scsipi_cmd(struct scsipi_xfer *xs); void usscanner_scsipi_minphys(struct buf *bp, struct scsi_link *sl); void usscanner_done(struct usscanner_softc *sc); void usscanner_sense(struct usscanner_softc *sc); @@ -702,7 +702,7 @@ usscanner_cmd_cb(usbd_xfer_handle xfer, usbd_private_handle priv, usscanner_done(sc); } -int +void usscanner_scsipi_cmd(struct scsipi_xfer *xs) { struct scsipi_link *sc_link = xs->sc_link; @@ -759,13 +759,11 @@ usscanner_scsipi_cmd(struct scsipi_xfer *xs) goto done; } - return (SUCCESSFULLY_QUEUED); + return; done: sc->sc_state = UAS_IDLE; s = splbio(); scsipi_done(xs); splx(s); - - return (COMPLETE); } |