From e82d9e7eb567e495596ce0c102acb1c7a61f07c0 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sat, 20 Jan 1996 15:05:55 +0000 Subject: [PATCH] Make the "uk" device usable again. The open() always failed due to an internal driver design problem. --- sys/scsi/scsi_driver.c | 4 ++-- sys/scsi/scsiconf.h | 5 ++++- sys/scsi/uk.c | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/scsi/scsi_driver.c b/sys/scsi/scsi_driver.c index 5db60cab9c2a..45f2ca2f0441 100644 --- a/sys/scsi/scsi_driver.c +++ b/sys/scsi/scsi_driver.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_driver.c,v 1.11 1995/12/05 04:41:20 julian Exp $ + * $Id: scsi_driver.c,v 1.12 1995/12/05 07:14:23 julian Exp $ * */ #include @@ -120,7 +120,7 @@ struct scsi_device *device) /* * Check the unit is legal */ - if (sc_link == 0 || sc_link->sd == 0) + if (sc_link == 0 || (sc_link->sd == 0 && !(sc_link->flags & SDEV_UK))) return ENXIO; /* If it is a "once only" device that is already open return EBUSY. diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index 6f21cec6ffdb..a717ccc1bdb8 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsiconf.h,v 1.36 1995/12/17 21:23:37 phk Exp $ + * $Id: scsiconf.h,v 1.37 1996/01/07 19:27:06 gibbs Exp $ */ #ifndef SCSI_SCSICONF_H #define SCSI_SCSICONF_H 1 @@ -316,6 +316,8 @@ struct scsi_link * open and to make unit attentions errors be logged on the console. * These should be split up; I'm adding SDEV_IS_OPEN to enforce one * open only. + * + * XXX SDEV_UK is used to mark the "uk" device. */ #define SDEV_MEDIA_LOADED 0x0001 /* device figures are still valid */ @@ -328,6 +330,7 @@ struct scsi_link #define SDEV_RESIDS_WORK 0x0400 /* XXX-HA: Residuals work */ #define SDEV_TARGET_OPS 0x0800 /* XXX-HA: Supports target ops */ #define SDEV_IS_OPEN 0x1000 /* at least 1 open session */ +#define SDEV_UK 0x2000 /* this is the "uk" device */ /* * One of these is allocated and filled in for each scsi bus. diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c index f144e4857bfd..03c982293608 100644 --- a/sys/scsi/uk.c +++ b/sys/scsi/uk.c @@ -2,7 +2,7 @@ * Driver for a device we can't identify. * by Julian Elischer (julian@tfs.com) * - * $Id: uk.c,v 1.12 1995/12/08 11:19:03 julian Exp $ + * $Id: uk.c,v 1.13 1995/12/08 23:22:30 phk Exp $ * * If you find that you are adding any code to this file look closely * at putting it in "scsi_driver.c" instead. @@ -40,7 +40,7 @@ struct scsi_device uk_switch = "uk", 0, {0, 0}, - SDEV_ONCE_ONLY, /* Only one open allowed */ + SDEV_ONCE_ONLY|SDEV_UK, /* Only one open allowed */ 0, "Unknown", ukopen,