diff options
author | 2010-03-23 01:57:19 +0000 | |
---|---|---|
committer | 2010-03-23 01:57:19 +0000 | |
commit | bae03be695661916786746dd9a15ef9b4291286c (patch) | |
tree | b0dd41b1f70d41fdf54b594d2df5b2a70b37201e /sys/dev/softraid.c | |
parent | dont maintain a list of vether devices inside the driver if they are never (diff) | |
download | wireguard-openbsd-bae03be695661916786746dd9a15ef9b4291286c.tar.xz wireguard-openbsd-bae03be695661916786746dd9a15ef9b4291286c.zip |
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/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 48504172bce..e0a57d5e918 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.194 2010/02/13 22:10:01 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.195 2010/03/23 01:57:19 krw Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -87,7 +87,7 @@ struct cfdriver softraid_cd = { }; /* scsi & discipline */ -int sr_scsi_cmd(struct scsi_xfer *); +void sr_scsi_cmd(struct scsi_xfer *); void sr_minphys(struct buf *bp, struct scsi_link *sl); void sr_copy_internal_data(struct scsi_xfer *, void *, size_t); @@ -1829,7 +1829,7 @@ sr_scsi_done(struct sr_discipline *sd, struct scsi_xfer *xs) splx(s); } -int +void sr_scsi_cmd(struct scsi_xfer *xs) { int s; @@ -1868,7 +1868,10 @@ sr_scsi_cmd(struct scsi_xfer *xs) */ if ((wu = sr_wu_get(sd, 0)) == NULL) { DNPRINTF(SR_D_CMD, "%s: sr_scsi_cmd no wu\n", DEVNAME(sc)); - return (NO_CCB); + xs->error = XS_NO_CCB; + s = splbio(); + scsi_done(xs); + return; } xs->error = XS_NOERROR; @@ -1950,7 +1953,7 @@ sr_scsi_cmd(struct scsi_xfer *xs) goto stuffup; } - return (SUCCESSFULLY_QUEUED); + return; stuffup: if (sd && sd->sd_scsi_sense.error_code) { xs->error = XS_SENSE; @@ -1963,7 +1966,6 @@ complete: if (wu) sr_wu_put(wu); sr_scsi_done(sd, xs); - return (COMPLETE); } int sr_scsi_ioctl(struct scsi_link *link, u_long cmd, caddr_t addr, int flag, |