Fix a sight open flags buglet pointed out by Matthias Scheler.

This commit is contained in:
thorpej 1998-10-20 22:26:04 +00:00
parent a2386d4325
commit c0ba12768e
2 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsiconf.c,v 1.113 1998/10/10 03:33:01 thorpej Exp $ */
/* $NetBSD: scsiconf.c,v 1.114 1998/10/20 22:26:04 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -731,19 +731,16 @@ scsibusopen(dev, flag, fmt, p)
struct proc *p;
{
struct scsibus_softc *sc;
struct scsipi_link *sc_link;
int unit = minor(dev);
if (unit >= scsibus_cd.cd_ndevs ||
(sc = scsibus_cd.cd_devs[unit]) == NULL)
return (ENXIO);
sc_link = sc->adapter_link;
if (sc_link->flags & SDEV_OPEN)
if (sc->sc_flags & SCSIBUSF_OPEN)
return (EBUSY);
sc_link->flags |= SDEV_OPEN;
sc->sc_flags |= SCSIBUSF_OPEN;
return (0);
}
@ -755,9 +752,8 @@ scsibusclose(dev, flag, fmt, p)
struct proc *p;
{
struct scsibus_softc *sc = scsibus_cd.cd_devs[minor(dev)];
struct scsipi_link *sc_link = sc->adapter_link;
sc_link->flags &= ~SDEV_OPEN;
sc->sc_flags &= ~SCSIBUSF_OPEN;
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsiconf.h,v 1.44 1998/08/17 00:49:02 mycroft Exp $ */
/* $NetBSD: scsiconf.h,v 1.45 1998/10/20 22:26:05 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -74,10 +74,14 @@ struct scsibus_softc {
struct device sc_dev;
struct scsipi_link *adapter_link; /* prototype supplied by adapter */
struct scsipi_link ***sc_link; /* dynamically allocated */
int sc_flags;
int sc_maxtarget;
u_int8_t moreluns;
};
/* sc_flags */
#define SCSIBUSF_OPEN 0x00000001 /* bus is open */
#define SCSI_OP_TARGET 0x0001
#define SCSI_OP_RESET 0x0002
#define SCSI_OP_BDINFO 0x0003