diff options
author | 1996-02-20 01:46:33 +0000 | |
---|---|---|
committer | 1996-02-20 01:46:33 +0000 | |
commit | a48bde132b74c1cad1b1daf4462c2aff367c87d9 (patch) | |
tree | 0f2a80bf8cc6968763be5b3ad785b08445238c61 | |
parent | Sync w/ NetBSD: scsi prototypes. (diff) | |
download | wireguard-openbsd-a48bde132b74c1cad1b1daf4462c2aff367c87d9.tar.xz wireguard-openbsd-a48bde132b74c1cad1b1daf4462c2aff367c87d9.zip |
Sync. w/ NetBSD: scsi prototypes.
-rw-r--r-- | sys/scsi/scsi_base.c | 26 | ||||
-rw-r--r-- | sys/scsi/scsi_ioctl.c | 7 |
2 files changed, 29 insertions, 4 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 192bfa22f34..7eb3c5ecc45 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_base.c,v 1.31 1996/01/12 22:43:29 thorpej Exp $ */ +/* $NetBSD: scsi_base.c,v 1.33 1996/02/14 21:47:14 christos Exp $ */ /* * Copyright (c) 1994, 1995 Charles Hannum. All rights reserved. @@ -42,6 +42,8 @@ #include <sys/malloc.h> #include <sys/errno.h> #include <sys/device.h> +#include <sys/proc.h> +#include <sys/cpu.h> #include <scsi/scsi_all.h> #include <scsi/scsi_disk.h> @@ -51,6 +53,19 @@ void scsi_error __P((struct scsi_xfer *, int)); LIST_HEAD(xs_free_list, scsi_xfer) xs_free_list; +static __inline struct scsi_xfer *scsi_make_xs __P((struct scsi_link *, + struct scsi_generic *, + int cmdlen, + u_char *data_addr, + int datalen, + int retries, + int timeout, + struct buf *, + int flags)); + +int sc_err1 __P((struct scsi_xfer *, int)); +int scsi_interpret_sense __P((struct scsi_xfer *)); + /* * Get a scsi transfer structure for the caller. Charge the structure * to the device that is referenced by the sc_link structure. If the @@ -82,7 +97,7 @@ scsi_get_xs(sc_link, flags) (void) tsleep(sc_link, PRIBIO, "getxs", 0); } sc_link->openings--; - if (xs = xs_free_list.lh_first) { + if ((xs = xs_free_list.lh_first) != NULL) { LIST_REMOVE(xs, free_list); splx(s); } else { @@ -136,7 +151,7 @@ scsi_free_xs(xs, flags) */ static __inline struct scsi_xfer * scsi_make_xs(sc_link, scsi_cmd, cmdlen, data_addr, datalen, - retries, timeout, bp, flags) + retries, timeout, bp, flags) struct scsi_link *sc_link; struct scsi_generic *scsi_cmd; int cmdlen; @@ -439,6 +454,7 @@ retry: #ifdef DIAGNOSTIC panic("scsi_execute_xs: impossible"); #endif + return EINVAL; } /* @@ -667,6 +683,10 @@ scsi_interpret_sense(xs) sc_link->flags &= ~SDEV_MEDIA_LOADED; if ((xs->flags & SCSI_IGNORE_NOT_READY) != 0) return 0; + if (xs->retries && !(sc_link->flags & SDEV_REMOVABLE)) { + delay(1000000); + return ERESTART; + } if ((xs->flags & SCSI_SILENT) != 0) return EIO; error = EIO; diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c index 3bc77130a63..0d77b6620e8 100644 --- a/sys/scsi/scsi_ioctl.c +++ b/sys/scsi/scsi_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_ioctl.c,v 1.19 1995/09/26 19:26:58 thorpej Exp $ */ +/* $NetBSD: scsi_ioctl.c,v 1.20 1996/02/14 21:47:22 christos Exp $ */ /* * Copyright (c) 1994 Charles Hannum. All rights reserved. @@ -60,6 +60,11 @@ struct scsi_ioctl { LIST_HEAD(, scsi_ioctl) si_head; +struct scsi_ioctl *si_get __P((void)); +void si_free __P((struct scsi_ioctl *)); +struct scsi_ioctl *si_find __P((struct buf *)); +void scsistrategy __P((struct buf *)); + struct scsi_ioctl * si_get() { |