Make the "uk" device usable again. The open() always failed due to an internal driver

design problem.
This commit is contained in:
Joerg Wunsch 1996-01-20 15:05:55 +00:00
parent 49f523939f
commit e82d9e7eb5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13516
3 changed files with 8 additions and 5 deletions

View File

@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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 <sys/types.h> #include <sys/types.h>
@ -120,7 +120,7 @@ struct scsi_device *device)
/* /*
* Check the unit is legal * 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; return ENXIO;
/* If it is a "once only" device that is already open return EBUSY. /* If it is a "once only" device that is already open return EBUSY.

View File

@ -14,7 +14,7 @@
* *
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * 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 #ifndef SCSI_SCSICONF_H
#define SCSI_SCSICONF_H 1 #define SCSI_SCSICONF_H 1
@ -316,6 +316,8 @@ struct scsi_link
* open and to make unit attentions errors be logged on the console. * 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 * These should be split up; I'm adding SDEV_IS_OPEN to enforce one
* open only. * open only.
*
* XXX SDEV_UK is used to mark the "uk" device.
*/ */
#define SDEV_MEDIA_LOADED 0x0001 /* device figures are still valid */ #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_RESIDS_WORK 0x0400 /* XXX-HA: Residuals work */
#define SDEV_TARGET_OPS 0x0800 /* XXX-HA: Supports target ops */ #define SDEV_TARGET_OPS 0x0800 /* XXX-HA: Supports target ops */
#define SDEV_IS_OPEN 0x1000 /* at least 1 open session */ #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. * One of these is allocated and filled in for each scsi bus.

View File

@ -2,7 +2,7 @@
* Driver for a device we can't identify. * Driver for a device we can't identify.
* by Julian Elischer (julian@tfs.com) * 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 * If you find that you are adding any code to this file look closely
* at putting it in "scsi_driver.c" instead. * at putting it in "scsi_driver.c" instead.
@ -40,7 +40,7 @@ struct scsi_device uk_switch =
"uk", "uk",
0, 0,
{0, 0}, {0, 0},
SDEV_ONCE_ONLY, /* Only one open allowed */ SDEV_ONCE_ONLY|SDEV_UK, /* Only one open allowed */
0, 0,
"Unknown", "Unknown",
ukopen, ukopen,