Fix various types. Remove some outdated flags.
This commit is contained in:
parent
c01cb5c454
commit
58dfc9dffc
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cd.c,v 1.24 1994/04/11 02:23:41 mycroft Exp $
|
||||
* $Id: cd.c,v 1.25 1994/04/11 03:53:58 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -86,15 +86,13 @@ struct cd_data {
|
||||
struct device sc_dev;
|
||||
struct dkdevice sc_dk;
|
||||
|
||||
u_int32 flags;
|
||||
#define CDINIT 0x04 /* device has been init'd */
|
||||
struct scsi_link *sc_link; /* address of scsi low level switch */
|
||||
u_int32 cmdscount; /* cmds allowed outstanding by board */
|
||||
struct cd_parms {
|
||||
u_int32 blksize;
|
||||
u_long disksize; /* total number sectors */
|
||||
} params;
|
||||
u_int32 partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
int partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
#define CDOPEN 0x01
|
||||
u_int32 openparts; /* one bit for each open partition */
|
||||
u_int32 xfer_block_wait;
|
||||
@ -167,7 +165,6 @@ cdattach(parent, self, aux)
|
||||
cd->params.disksize, cd->params.blksize);
|
||||
else
|
||||
printf(": drive empty\n");
|
||||
cd->flags |= CDINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -188,10 +185,7 @@ cdopen(dev)
|
||||
if (unit >= cdcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
cd = cdcd.cd_devs[unit];
|
||||
/*
|
||||
* Make sure the device has been initialised
|
||||
*/
|
||||
if (!cd || !(cd->flags & CDINIT))
|
||||
if (!cd)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = cd->sc_link;
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ch.c,v 1.6 1994/03/29 04:29:25 mycroft Exp $
|
||||
* $Id: ch.c,v 1.7 1994/04/11 03:54:02 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -57,10 +57,8 @@
|
||||
struct ch_data {
|
||||
struct device sc_dev;
|
||||
|
||||
u_int32 flags;
|
||||
#define CHINIT 0x01
|
||||
#define CHOPEN 0x02
|
||||
#define CHKNOWN 0x04
|
||||
int flags;
|
||||
#define CHOPEN 0x01
|
||||
struct scsi_link *sc_link; /* all the inter level info */
|
||||
u_int16 chmo; /* Offset of first CHM */
|
||||
u_int16 chms; /* No. of CHM */
|
||||
@ -121,16 +119,11 @@ chattach(parent, self, aux)
|
||||
* the drive. We cannot use interrupts yet, so the
|
||||
* request must specify this.
|
||||
*/
|
||||
if ((ch_mode_sense(ch, SCSI_NOSLEEP | SCSI_NOMASK))) {
|
||||
if ((ch_mode_sense(ch, SCSI_NOSLEEP | SCSI_NOMASK)))
|
||||
printf(": offline\n");
|
||||
/*stat = CHOPEN;*/
|
||||
} else {
|
||||
else
|
||||
printf(": %d slot(s), %d drive(s), %d arm(s), %d i/e-slot(s)\n",
|
||||
ch->slots, ch->drives, ch->chms, ch->imexs);
|
||||
/*stat = CHKNOWN;*/
|
||||
}
|
||||
|
||||
ch->flags |= CHINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -151,7 +144,7 @@ chopen(dev)
|
||||
if (unit >= chcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
ch = chcd.cd_devs[unit];
|
||||
if (!ch || !(ch->flags & CHINIT))
|
||||
if (!ch)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = ch->sc_link;
|
||||
@ -226,7 +219,7 @@ chioctl(dev, cmd, arg, mode)
|
||||
struct ch_data *ch = chcd.cd_devs[CHUNIT(dev)];
|
||||
struct scsi_link *sc_link = ch->sc_link;
|
||||
int number;
|
||||
u_int flags;
|
||||
int flags;
|
||||
|
||||
/*
|
||||
* Find the device that the user is talking about
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scsiconf.c,v 1.12 1994/03/29 04:29:37 mycroft Exp $
|
||||
* $Id: scsiconf.c,v 1.13 1994/04/11 03:54:05 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -82,18 +82,17 @@
|
||||
* The structure of known drivers for autoconfiguration
|
||||
*/
|
||||
struct scsidevs {
|
||||
char *devname;
|
||||
char *devname;
|
||||
u_int32 type;
|
||||
boolean removable;
|
||||
char flags; /* 1 show my comparisons during boot(debug) */
|
||||
char *manufacturer;
|
||||
char *model;
|
||||
char *version;
|
||||
};
|
||||
|
||||
int flags; /* 1 show my comparisons during boot(debug) */
|
||||
#define SC_SHOWME 0x01
|
||||
#define SC_ONE_LU 0x00
|
||||
#define SC_MORE_LUS 0x02
|
||||
char *manufacturer;
|
||||
char *model;
|
||||
char *version;
|
||||
};
|
||||
|
||||
#if NUK > 0
|
||||
static struct scsidevs unknowndev = {
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scsiconf.h,v 1.7 1994/04/11 02:23:45 mycroft Exp $
|
||||
* $Id: scsiconf.h,v 1.8 1994/04/11 03:54:07 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -94,8 +94,7 @@ typedef unsigned char u_int8;
|
||||
* whatever low-end drivers they are attached to each adapter type has one of
|
||||
* these statically allocated.
|
||||
*/
|
||||
struct scsi_adapter
|
||||
{
|
||||
struct scsi_adapter {
|
||||
/* 4*/ int (*scsi_cmd)();
|
||||
/* 8*/ void (*scsi_minphys)();
|
||||
/*12*/ int32 (*open_target_lu)();
|
||||
@ -126,14 +125,13 @@ struct scsi_adapter
|
||||
* whatever high-end drivers they are attached to. Each device type has one
|
||||
* of these statically allocated.
|
||||
*/
|
||||
struct scsi_device
|
||||
{
|
||||
struct scsi_device {
|
||||
/* 4*/ int (*err_handler)(); /* returns -1 to say err processing complete */
|
||||
/* 8*/ void (*start)();
|
||||
/* 12*/ int32 (*async)();
|
||||
/* 16*/ int32 (*done)(); /* returns -1 to say done processing complete */
|
||||
/* 20*/ char *name; /* name of device type */
|
||||
/* 24*/ u_int32 flags; /* device type dependent flags */
|
||||
/* 24*/ int flags; /* device type dependent flags */
|
||||
/* 32*/ int32 spare[2];
|
||||
};
|
||||
|
||||
@ -143,8 +141,7 @@ struct scsi_device
|
||||
* the other, and to allow generic scsi glue code to call these services
|
||||
* as well.
|
||||
*/
|
||||
struct scsi_link
|
||||
{
|
||||
struct scsi_link {
|
||||
/* 1*/ u_int8 scsibus; /* the Nth scsibus */
|
||||
/* 2*/ u_int8 target; /* targ of this dev */
|
||||
/* 3*/ u_int8 lun; /* lun of this dev */
|
||||
@ -153,7 +150,7 @@ struct scsi_link
|
||||
/* 6*/ u_int8 opennings; /* available operations */
|
||||
/* 7*/ u_int8 active; /* operations in progress */
|
||||
/* 8*/ u_int8 sparea[1];
|
||||
/* 10*/ u_int16 flags; /* flags that all devices have */
|
||||
/* 10*/ int flags; /* flags that all devices have */
|
||||
/* 12*/ u_int8 spareb[2];
|
||||
/* 16*/ struct scsi_adapter *adapter; /* adapter entry points etc. */
|
||||
/* 20*/ struct scsi_device *device; /* device entry points etc. */
|
||||
@ -186,20 +183,18 @@ struct scsibus_data {
|
||||
* device and adapter for which the command is destined.
|
||||
* (via the scsi_link structure)
|
||||
*/
|
||||
struct scsi_xfer
|
||||
{
|
||||
struct scsi_xfer {
|
||||
/* 4*/ struct scsi_xfer *next; /* when free */
|
||||
/* 8*/ u_int32 flags;
|
||||
/* 8*/ int flags;
|
||||
/*12*/ struct scsi_link *sc_link; /* all about our device and adapter */
|
||||
/*13*/ u_int8 retries; /* the number of times to retry */
|
||||
/*16*/ u_int8 spare[3];
|
||||
/*20*/ int32 timeout; /* in milliseconds */
|
||||
/*16*/ int retries; /* the number of times to retry */
|
||||
/*20*/ int timeout; /* in milliseconds */
|
||||
/*24*/ struct scsi_generic *cmd; /* The scsi command to execute */
|
||||
/*28*/ int32 cmdlen; /* how long it is */
|
||||
/*32*/ u_char *data; /* dma address OR a uio address */
|
||||
/*36*/ int32 datalen; /* data len (blank if uio) */
|
||||
/*40*/ int32 resid; /* how much buffer was not touched */
|
||||
/*44*/ int32 error; /* an error value */
|
||||
/*44*/ int error; /* an error value */
|
||||
/*48*/ struct buf *bp; /* If we need to associate with a buf */
|
||||
/*80*/ struct scsi_sense_data sense; /* 32 bytes*/
|
||||
/*
|
||||
@ -254,20 +249,20 @@ int scsi_targmatch __P((struct device *, struct cfdata *, void *));
|
||||
int scsi_targmatch();
|
||||
#endif
|
||||
|
||||
struct scsi_xfer *get_xs __P((struct scsi_link *, u_int32));
|
||||
void free_xs __P((struct scsi_xfer *, struct scsi_link *, u_int32));
|
||||
u_int32 scsi_size __P((struct scsi_link *, u_int32));
|
||||
int scsi_test_unit_ready __P((struct scsi_link *, u_int32));
|
||||
int scsi_change_def __P((struct scsi_link *, u_int32));
|
||||
int scsi_inquire __P((struct scsi_link *, struct scsi_inquiry_data *, u_int32));
|
||||
int scsi_prevent __P((struct scsi_link *, u_int32, u_int32));
|
||||
int scsi_start __P((struct scsi_link *, u_int32, u_int32));
|
||||
struct scsi_xfer *get_xs __P((struct scsi_link *, int));
|
||||
void free_xs __P((struct scsi_xfer *, struct scsi_link *, int));
|
||||
u_int32 scsi_size __P((struct scsi_link *, int));
|
||||
int scsi_test_unit_ready __P((struct scsi_link *, int));
|
||||
int scsi_change_def __P((struct scsi_link *, int));
|
||||
int scsi_inquire __P((struct scsi_link *, struct scsi_inquiry_data *, int));
|
||||
int scsi_prevent __P((struct scsi_link *, int, int));
|
||||
int scsi_start __P((struct scsi_link *, int, int));
|
||||
void scsi_done __P((struct scsi_xfer *));
|
||||
int scsi_scsi_cmd __P((struct scsi_link *, struct scsi_generic *,
|
||||
u_int32 cmdlen, u_char *data_addr,
|
||||
u_int32 datalen, u_int32 retries,
|
||||
u_int32 timeout, struct buf *bp,
|
||||
u_int32 flags));
|
||||
u_int32 datalen, int retries,
|
||||
int timeout, struct buf *bp,
|
||||
int flags));
|
||||
int scsi_do_ioctl __P((struct scsi_link *, int, caddr_t, int));
|
||||
|
||||
void show_scsi_xs __P((struct scsi_xfer *));
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scsipi_ioctl.c,v 1.4 1994/03/29 04:29:35 mycroft Exp $
|
||||
* $Id: scsipi_ioctl.c,v 1.5 1994/04/11 03:54:04 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -211,7 +211,7 @@ scsistrategy(bp)
|
||||
struct scsi_ioctl *si;
|
||||
scsireq_t *screq;
|
||||
struct scsi_link *sc_link;
|
||||
u_int32 flags = 0;
|
||||
int flags = 0;
|
||||
int s;
|
||||
|
||||
si = si_find(bp);
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sd.c,v 1.28 1994/04/11 02:23:48 mycroft Exp $
|
||||
* $Id: sd.c,v 1.29 1994/04/11 03:54:10 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -84,11 +84,10 @@ struct sd_data {
|
||||
struct device sc_dev;
|
||||
struct dkdevice sc_dk;
|
||||
|
||||
u_int32 flags;
|
||||
#define SDINIT 0x04 /* device has been init'd */
|
||||
#define SDHAVELABEL 0x10 /* have read the label */
|
||||
#define SDDOSPART 0x20 /* Have read the DOS partition table */
|
||||
#define SDWRITEPROT 0x40 /* Device in readonly mode (S/W) */
|
||||
int flags;
|
||||
#define SDHAVELABEL 0x01 /* have read the label */
|
||||
#define SDDOSPART 0x02 /* Have read the DOS partition table */
|
||||
#define SDWRITEPROT 0x04 /* Device in readonly mode (S/W) */
|
||||
struct scsi_link *sc_link; /* contains our targ, lun etc. */
|
||||
u_int32 ad_info; /* info about the adapter */
|
||||
u_int32 cmdscount; /* cmds allowed outstanding by board */
|
||||
@ -100,7 +99,7 @@ struct sd_data {
|
||||
u_int32 blksize; /* Number of bytes/sector */
|
||||
u_long disksize; /* total number sectors */
|
||||
} params;
|
||||
u_int32 partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
int partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
#define SDOPEN 0x01
|
||||
u_int32 openparts; /* one bit for each open partition */
|
||||
u_int32 xfer_block_wait;
|
||||
@ -176,7 +175,6 @@ sdattach(parent, self, aux)
|
||||
printf(": %dMB, %d cyl, %d head, %d sec, %d bytes/sec\n",
|
||||
dp->disksize / ((1024L * 1024L) / dp->blksize), dp->cyls,
|
||||
dp->heads, dp->sectors, dp->blksize);
|
||||
sd->flags |= SDINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -197,12 +195,7 @@ sdopen(dev)
|
||||
if (unit >= sdcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
sd = sdcd.cd_devs[unit];
|
||||
/*
|
||||
* Make sure the disk has been initialised
|
||||
* At some point in the future, get the scsi driver
|
||||
* to look for a new device if we are not initted
|
||||
*/
|
||||
if (!sd || !(sd->flags & SDINIT))
|
||||
if (!sd)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = sd->sc_link;
|
||||
@ -841,7 +834,7 @@ sdsize(dev_t dev)
|
||||
if (unit >= sdcd.cd_ndevs)
|
||||
return -1;
|
||||
sd = sdcd.cd_devs[unit];
|
||||
if (!sd || !(sd->flags & SDINIT))
|
||||
if (!sd)
|
||||
return -1;
|
||||
|
||||
if ((sd->flags & SDHAVELABEL) == 0) {
|
||||
@ -904,9 +897,6 @@ sddump(dev_t dev)
|
||||
sd = sd_data[unit];
|
||||
if (!sd)
|
||||
return ENXIO;
|
||||
/* was it ever initialized etc. ? */
|
||||
if (!(sd->flags & SDINIT))
|
||||
return ENXIO;
|
||||
if (sd->sc_link->flags & SDEV_MEDIA_LOADED != SDEV_MEDIA_LOADED)
|
||||
return ENXIO;
|
||||
if (sd->flags & SDWRITEPROT)
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: st.c,v 1.26 1994/04/10 00:07:02 mycroft Exp $
|
||||
* $Id: st.c,v 1.27 1994/04/11 03:54:12 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -191,7 +191,7 @@ static struct rogues gallery[] = /* ends with an all-null entry */
|
||||
struct st_data {
|
||||
struct device sc_dev;
|
||||
/*--------------------present operating parameters, flags etc.----------------*/
|
||||
u_int flags; /* see below */
|
||||
int flags; /* see below */
|
||||
u_int blksiz; /* blksiz we are using */
|
||||
u_int density; /* present density */
|
||||
u_int quirks; /* quirks for the open mode */
|
||||
@ -231,15 +231,15 @@ struct cfdriver stcd = {
|
||||
NULL, "st", scsi_targmatch, stattach, DV_TAPE, sizeof(struct st_data)
|
||||
};
|
||||
|
||||
int st_space __P((struct st_data *, int number, u_int what, u_int flags));
|
||||
int st_rewind __P((struct st_data *, boolean immed, u_int flags));
|
||||
int st_mode_sense __P((struct st_data *, u_int flags));
|
||||
int st_space __P((struct st_data *, int number, u_int what, int flags));
|
||||
int st_rewind __P((struct st_data *, boolean immed, int flags));
|
||||
int st_mode_sense __P((struct st_data *, int flags));
|
||||
int st_decide_mode __P((struct st_data *, boolean first_read));
|
||||
int st_rd_blk_lim __P((struct st_data *, u_int flags));
|
||||
int st_rd_blk_lim __P((struct st_data *, int flags));
|
||||
int st_touch_tape __P((struct st_data *));
|
||||
int st_write_filemarks __P((struct st_data *, int number, u_int flags));
|
||||
int st_load __P((struct st_data *, u_int type, u_int flags));
|
||||
int st_mode_select __P((struct st_data *, u_int flags));
|
||||
int st_write_filemarks __P((struct st_data *, int number, int flags));
|
||||
int st_load __P((struct st_data *, u_int type, int flags));
|
||||
int st_mode_select __P((struct st_data *, int flags));
|
||||
void ststrategy();
|
||||
void stminphys();
|
||||
int st_chkeod();
|
||||
@ -259,7 +259,6 @@ struct scsi_device st_switch = {
|
||||
0
|
||||
};
|
||||
|
||||
#define ST_INITIALIZED 0x01
|
||||
#define ST_INFO_VALID 0x02
|
||||
#define ST_OPEN 0x04
|
||||
#define ST_BLOCK_SET 0x08 /* block size, mode set by ioctl */
|
||||
@ -338,7 +337,6 @@ stattach(parent, self, aux)
|
||||
st->buf_queue.b_active = 0;
|
||||
st->buf_queue.b_actf = 0;
|
||||
st->buf_queue.b_actb = &st->buf_queue.b_actf;
|
||||
st->flags |= ST_INITIALIZED;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -460,7 +458,7 @@ st_loadquirks(st)
|
||||
int
|
||||
stopen(dev, flags)
|
||||
dev_t dev;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
int unit;
|
||||
u_int mode, dsty;
|
||||
@ -475,7 +473,7 @@ stopen(dev, flags)
|
||||
if (unit >= stcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
st = stcd.cd_devs[unit];
|
||||
if (!st || !(st->flags & ST_INITIALIZED))
|
||||
if (!st)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = st->sc_link;
|
||||
@ -589,7 +587,7 @@ stclose(dev)
|
||||
int
|
||||
st_mount_tape(dev, flags)
|
||||
dev_t dev;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
int unit;
|
||||
u_int mode, dsty;
|
||||
@ -955,7 +953,7 @@ ststart(unit)
|
||||
struct scsi_link *sc_link = st->sc_link;
|
||||
register struct buf *bp, *dp;
|
||||
struct scsi_rw_tape cmd;
|
||||
u_int flags;
|
||||
int flags;
|
||||
|
||||
SC_DEBUG(sc_link, SDEV_DB2, ("ststart "));
|
||||
/*
|
||||
@ -1081,7 +1079,7 @@ stioctl(dev, cmd, arg, flag)
|
||||
int error = 0;
|
||||
int unit;
|
||||
int number, nmarks, dsty;
|
||||
u_int flags;
|
||||
int flags;
|
||||
struct st_data *st;
|
||||
u_int hold_blksiz;
|
||||
u_int hold_density;
|
||||
@ -1256,7 +1254,7 @@ int
|
||||
st_read(st, buf, size, flags)
|
||||
struct st_data *st;
|
||||
u_int size;
|
||||
u_int flags;
|
||||
int flags;
|
||||
char *buf;
|
||||
{
|
||||
struct scsi_rw_tape scsi_cmd;
|
||||
@ -1291,7 +1289,7 @@ st_read(st, buf, size, flags)
|
||||
int
|
||||
st_rd_blk_lim(st, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
struct scsi_blk_limits scsi_cmd;
|
||||
struct scsi_blk_limits_data scsi_blkl;
|
||||
@ -1339,7 +1337,7 @@ st_rd_blk_lim(st, flags)
|
||||
int
|
||||
st_mode_sense(st, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
u_int scsi_sense_len;
|
||||
int error;
|
||||
@ -1421,7 +1419,7 @@ st_mode_sense(st, flags)
|
||||
int
|
||||
st_mode_select(st, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
u_int dat_len;
|
||||
char *dat_ptr;
|
||||
@ -1480,7 +1478,7 @@ int
|
||||
st_space(st, number, what, flags)
|
||||
struct st_data *st;
|
||||
u_int what;
|
||||
u_int flags;
|
||||
int flags;
|
||||
int number;
|
||||
{
|
||||
int error;
|
||||
@ -1559,7 +1557,7 @@ st_space(st, number, what, flags)
|
||||
int
|
||||
st_write_filemarks(st, number, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
int number;
|
||||
{
|
||||
struct scsi_write_filemarks scsi_cmd;
|
||||
@ -1603,7 +1601,7 @@ st_chkeod(st, position, nmarks, flags)
|
||||
struct st_data *st;
|
||||
boolean position;
|
||||
int *nmarks;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -1631,7 +1629,7 @@ int
|
||||
st_load(st, type, flags)
|
||||
struct st_data *st;
|
||||
u_int type;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
struct scsi_load scsi_cmd;
|
||||
struct scsi_link *sc_link = st->sc_link;
|
||||
@ -1659,7 +1657,7 @@ st_load(st, type, flags)
|
||||
int
|
||||
st_rewind(st, immed, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
boolean immed;
|
||||
{
|
||||
struct scsi_rewind scsi_cmd;
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: uk.c,v 1.5 1994/03/29 04:29:45 mycroft Exp $
|
||||
* $Id: uk.c,v 1.6 1994/04/11 03:54:21 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -48,8 +48,6 @@
|
||||
struct uk_data {
|
||||
struct device sc_dev;
|
||||
|
||||
u_int32 flags;
|
||||
#define UKINIT 0x01
|
||||
struct scsi_link *sc_link; /* all the inter level info */
|
||||
};
|
||||
|
||||
@ -93,7 +91,6 @@ ukattach(parent, self, aux)
|
||||
sc_link->dev_unit = uk->sc_dev.dv_unit;
|
||||
|
||||
printf(": unknown device\n");
|
||||
uk->flags |= UKINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -112,10 +109,7 @@ ukopen(dev)
|
||||
if (unit >= ukcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
uk = ukcd.cd_devs[unit];
|
||||
/*
|
||||
* Make sure the device has been initialised
|
||||
*/
|
||||
if (!uk || !(uk->cflags & UKINIT))
|
||||
if (!uk)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = uk->sc_link;
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cd.c,v 1.24 1994/04/11 02:23:41 mycroft Exp $
|
||||
* $Id: cd.c,v 1.25 1994/04/11 03:53:58 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -86,15 +86,13 @@ struct cd_data {
|
||||
struct device sc_dev;
|
||||
struct dkdevice sc_dk;
|
||||
|
||||
u_int32 flags;
|
||||
#define CDINIT 0x04 /* device has been init'd */
|
||||
struct scsi_link *sc_link; /* address of scsi low level switch */
|
||||
u_int32 cmdscount; /* cmds allowed outstanding by board */
|
||||
struct cd_parms {
|
||||
u_int32 blksize;
|
||||
u_long disksize; /* total number sectors */
|
||||
} params;
|
||||
u_int32 partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
int partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
#define CDOPEN 0x01
|
||||
u_int32 openparts; /* one bit for each open partition */
|
||||
u_int32 xfer_block_wait;
|
||||
@ -167,7 +165,6 @@ cdattach(parent, self, aux)
|
||||
cd->params.disksize, cd->params.blksize);
|
||||
else
|
||||
printf(": drive empty\n");
|
||||
cd->flags |= CDINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -188,10 +185,7 @@ cdopen(dev)
|
||||
if (unit >= cdcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
cd = cdcd.cd_devs[unit];
|
||||
/*
|
||||
* Make sure the device has been initialised
|
||||
*/
|
||||
if (!cd || !(cd->flags & CDINIT))
|
||||
if (!cd)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = cd->sc_link;
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ch.c,v 1.6 1994/03/29 04:29:25 mycroft Exp $
|
||||
* $Id: ch.c,v 1.7 1994/04/11 03:54:02 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -57,10 +57,8 @@
|
||||
struct ch_data {
|
||||
struct device sc_dev;
|
||||
|
||||
u_int32 flags;
|
||||
#define CHINIT 0x01
|
||||
#define CHOPEN 0x02
|
||||
#define CHKNOWN 0x04
|
||||
int flags;
|
||||
#define CHOPEN 0x01
|
||||
struct scsi_link *sc_link; /* all the inter level info */
|
||||
u_int16 chmo; /* Offset of first CHM */
|
||||
u_int16 chms; /* No. of CHM */
|
||||
@ -121,16 +119,11 @@ chattach(parent, self, aux)
|
||||
* the drive. We cannot use interrupts yet, so the
|
||||
* request must specify this.
|
||||
*/
|
||||
if ((ch_mode_sense(ch, SCSI_NOSLEEP | SCSI_NOMASK))) {
|
||||
if ((ch_mode_sense(ch, SCSI_NOSLEEP | SCSI_NOMASK)))
|
||||
printf(": offline\n");
|
||||
/*stat = CHOPEN;*/
|
||||
} else {
|
||||
else
|
||||
printf(": %d slot(s), %d drive(s), %d arm(s), %d i/e-slot(s)\n",
|
||||
ch->slots, ch->drives, ch->chms, ch->imexs);
|
||||
/*stat = CHKNOWN;*/
|
||||
}
|
||||
|
||||
ch->flags |= CHINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -151,7 +144,7 @@ chopen(dev)
|
||||
if (unit >= chcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
ch = chcd.cd_devs[unit];
|
||||
if (!ch || !(ch->flags & CHINIT))
|
||||
if (!ch)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = ch->sc_link;
|
||||
@ -226,7 +219,7 @@ chioctl(dev, cmd, arg, mode)
|
||||
struct ch_data *ch = chcd.cd_devs[CHUNIT(dev)];
|
||||
struct scsi_link *sc_link = ch->sc_link;
|
||||
int number;
|
||||
u_int flags;
|
||||
int flags;
|
||||
|
||||
/*
|
||||
* Find the device that the user is talking about
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scsi_ioctl.c,v 1.4 1994/03/29 04:29:35 mycroft Exp $
|
||||
* $Id: scsi_ioctl.c,v 1.5 1994/04/11 03:54:04 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -211,7 +211,7 @@ scsistrategy(bp)
|
||||
struct scsi_ioctl *si;
|
||||
scsireq_t *screq;
|
||||
struct scsi_link *sc_link;
|
||||
u_int32 flags = 0;
|
||||
int flags = 0;
|
||||
int s;
|
||||
|
||||
si = si_find(bp);
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scsiconf.c,v 1.12 1994/03/29 04:29:37 mycroft Exp $
|
||||
* $Id: scsiconf.c,v 1.13 1994/04/11 03:54:05 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -82,18 +82,17 @@
|
||||
* The structure of known drivers for autoconfiguration
|
||||
*/
|
||||
struct scsidevs {
|
||||
char *devname;
|
||||
char *devname;
|
||||
u_int32 type;
|
||||
boolean removable;
|
||||
char flags; /* 1 show my comparisons during boot(debug) */
|
||||
char *manufacturer;
|
||||
char *model;
|
||||
char *version;
|
||||
};
|
||||
|
||||
int flags; /* 1 show my comparisons during boot(debug) */
|
||||
#define SC_SHOWME 0x01
|
||||
#define SC_ONE_LU 0x00
|
||||
#define SC_MORE_LUS 0x02
|
||||
char *manufacturer;
|
||||
char *model;
|
||||
char *version;
|
||||
};
|
||||
|
||||
#if NUK > 0
|
||||
static struct scsidevs unknowndev = {
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: scsiconf.h,v 1.7 1994/04/11 02:23:45 mycroft Exp $
|
||||
* $Id: scsiconf.h,v 1.8 1994/04/11 03:54:07 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -94,8 +94,7 @@ typedef unsigned char u_int8;
|
||||
* whatever low-end drivers they are attached to each adapter type has one of
|
||||
* these statically allocated.
|
||||
*/
|
||||
struct scsi_adapter
|
||||
{
|
||||
struct scsi_adapter {
|
||||
/* 4*/ int (*scsi_cmd)();
|
||||
/* 8*/ void (*scsi_minphys)();
|
||||
/*12*/ int32 (*open_target_lu)();
|
||||
@ -126,14 +125,13 @@ struct scsi_adapter
|
||||
* whatever high-end drivers they are attached to. Each device type has one
|
||||
* of these statically allocated.
|
||||
*/
|
||||
struct scsi_device
|
||||
{
|
||||
struct scsi_device {
|
||||
/* 4*/ int (*err_handler)(); /* returns -1 to say err processing complete */
|
||||
/* 8*/ void (*start)();
|
||||
/* 12*/ int32 (*async)();
|
||||
/* 16*/ int32 (*done)(); /* returns -1 to say done processing complete */
|
||||
/* 20*/ char *name; /* name of device type */
|
||||
/* 24*/ u_int32 flags; /* device type dependent flags */
|
||||
/* 24*/ int flags; /* device type dependent flags */
|
||||
/* 32*/ int32 spare[2];
|
||||
};
|
||||
|
||||
@ -143,8 +141,7 @@ struct scsi_device
|
||||
* the other, and to allow generic scsi glue code to call these services
|
||||
* as well.
|
||||
*/
|
||||
struct scsi_link
|
||||
{
|
||||
struct scsi_link {
|
||||
/* 1*/ u_int8 scsibus; /* the Nth scsibus */
|
||||
/* 2*/ u_int8 target; /* targ of this dev */
|
||||
/* 3*/ u_int8 lun; /* lun of this dev */
|
||||
@ -153,7 +150,7 @@ struct scsi_link
|
||||
/* 6*/ u_int8 opennings; /* available operations */
|
||||
/* 7*/ u_int8 active; /* operations in progress */
|
||||
/* 8*/ u_int8 sparea[1];
|
||||
/* 10*/ u_int16 flags; /* flags that all devices have */
|
||||
/* 10*/ int flags; /* flags that all devices have */
|
||||
/* 12*/ u_int8 spareb[2];
|
||||
/* 16*/ struct scsi_adapter *adapter; /* adapter entry points etc. */
|
||||
/* 20*/ struct scsi_device *device; /* device entry points etc. */
|
||||
@ -186,20 +183,18 @@ struct scsibus_data {
|
||||
* device and adapter for which the command is destined.
|
||||
* (via the scsi_link structure)
|
||||
*/
|
||||
struct scsi_xfer
|
||||
{
|
||||
struct scsi_xfer {
|
||||
/* 4*/ struct scsi_xfer *next; /* when free */
|
||||
/* 8*/ u_int32 flags;
|
||||
/* 8*/ int flags;
|
||||
/*12*/ struct scsi_link *sc_link; /* all about our device and adapter */
|
||||
/*13*/ u_int8 retries; /* the number of times to retry */
|
||||
/*16*/ u_int8 spare[3];
|
||||
/*20*/ int32 timeout; /* in milliseconds */
|
||||
/*16*/ int retries; /* the number of times to retry */
|
||||
/*20*/ int timeout; /* in milliseconds */
|
||||
/*24*/ struct scsi_generic *cmd; /* The scsi command to execute */
|
||||
/*28*/ int32 cmdlen; /* how long it is */
|
||||
/*32*/ u_char *data; /* dma address OR a uio address */
|
||||
/*36*/ int32 datalen; /* data len (blank if uio) */
|
||||
/*40*/ int32 resid; /* how much buffer was not touched */
|
||||
/*44*/ int32 error; /* an error value */
|
||||
/*44*/ int error; /* an error value */
|
||||
/*48*/ struct buf *bp; /* If we need to associate with a buf */
|
||||
/*80*/ struct scsi_sense_data sense; /* 32 bytes*/
|
||||
/*
|
||||
@ -254,20 +249,20 @@ int scsi_targmatch __P((struct device *, struct cfdata *, void *));
|
||||
int scsi_targmatch();
|
||||
#endif
|
||||
|
||||
struct scsi_xfer *get_xs __P((struct scsi_link *, u_int32));
|
||||
void free_xs __P((struct scsi_xfer *, struct scsi_link *, u_int32));
|
||||
u_int32 scsi_size __P((struct scsi_link *, u_int32));
|
||||
int scsi_test_unit_ready __P((struct scsi_link *, u_int32));
|
||||
int scsi_change_def __P((struct scsi_link *, u_int32));
|
||||
int scsi_inquire __P((struct scsi_link *, struct scsi_inquiry_data *, u_int32));
|
||||
int scsi_prevent __P((struct scsi_link *, u_int32, u_int32));
|
||||
int scsi_start __P((struct scsi_link *, u_int32, u_int32));
|
||||
struct scsi_xfer *get_xs __P((struct scsi_link *, int));
|
||||
void free_xs __P((struct scsi_xfer *, struct scsi_link *, int));
|
||||
u_int32 scsi_size __P((struct scsi_link *, int));
|
||||
int scsi_test_unit_ready __P((struct scsi_link *, int));
|
||||
int scsi_change_def __P((struct scsi_link *, int));
|
||||
int scsi_inquire __P((struct scsi_link *, struct scsi_inquiry_data *, int));
|
||||
int scsi_prevent __P((struct scsi_link *, int, int));
|
||||
int scsi_start __P((struct scsi_link *, int, int));
|
||||
void scsi_done __P((struct scsi_xfer *));
|
||||
int scsi_scsi_cmd __P((struct scsi_link *, struct scsi_generic *,
|
||||
u_int32 cmdlen, u_char *data_addr,
|
||||
u_int32 datalen, u_int32 retries,
|
||||
u_int32 timeout, struct buf *bp,
|
||||
u_int32 flags));
|
||||
u_int32 datalen, int retries,
|
||||
int timeout, struct buf *bp,
|
||||
int flags));
|
||||
int scsi_do_ioctl __P((struct scsi_link *, int, caddr_t, int));
|
||||
|
||||
void show_scsi_xs __P((struct scsi_xfer *));
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sd.c,v 1.28 1994/04/11 02:23:48 mycroft Exp $
|
||||
* $Id: sd.c,v 1.29 1994/04/11 03:54:10 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -84,11 +84,10 @@ struct sd_data {
|
||||
struct device sc_dev;
|
||||
struct dkdevice sc_dk;
|
||||
|
||||
u_int32 flags;
|
||||
#define SDINIT 0x04 /* device has been init'd */
|
||||
#define SDHAVELABEL 0x10 /* have read the label */
|
||||
#define SDDOSPART 0x20 /* Have read the DOS partition table */
|
||||
#define SDWRITEPROT 0x40 /* Device in readonly mode (S/W) */
|
||||
int flags;
|
||||
#define SDHAVELABEL 0x01 /* have read the label */
|
||||
#define SDDOSPART 0x02 /* Have read the DOS partition table */
|
||||
#define SDWRITEPROT 0x04 /* Device in readonly mode (S/W) */
|
||||
struct scsi_link *sc_link; /* contains our targ, lun etc. */
|
||||
u_int32 ad_info; /* info about the adapter */
|
||||
u_int32 cmdscount; /* cmds allowed outstanding by board */
|
||||
@ -100,7 +99,7 @@ struct sd_data {
|
||||
u_int32 blksize; /* Number of bytes/sector */
|
||||
u_long disksize; /* total number sectors */
|
||||
} params;
|
||||
u_int32 partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
int partflags[MAXPARTITIONS]; /* per partition flags */
|
||||
#define SDOPEN 0x01
|
||||
u_int32 openparts; /* one bit for each open partition */
|
||||
u_int32 xfer_block_wait;
|
||||
@ -176,7 +175,6 @@ sdattach(parent, self, aux)
|
||||
printf(": %dMB, %d cyl, %d head, %d sec, %d bytes/sec\n",
|
||||
dp->disksize / ((1024L * 1024L) / dp->blksize), dp->cyls,
|
||||
dp->heads, dp->sectors, dp->blksize);
|
||||
sd->flags |= SDINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -197,12 +195,7 @@ sdopen(dev)
|
||||
if (unit >= sdcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
sd = sdcd.cd_devs[unit];
|
||||
/*
|
||||
* Make sure the disk has been initialised
|
||||
* At some point in the future, get the scsi driver
|
||||
* to look for a new device if we are not initted
|
||||
*/
|
||||
if (!sd || !(sd->flags & SDINIT))
|
||||
if (!sd)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = sd->sc_link;
|
||||
@ -841,7 +834,7 @@ sdsize(dev_t dev)
|
||||
if (unit >= sdcd.cd_ndevs)
|
||||
return -1;
|
||||
sd = sdcd.cd_devs[unit];
|
||||
if (!sd || !(sd->flags & SDINIT))
|
||||
if (!sd)
|
||||
return -1;
|
||||
|
||||
if ((sd->flags & SDHAVELABEL) == 0) {
|
||||
@ -904,9 +897,6 @@ sddump(dev_t dev)
|
||||
sd = sd_data[unit];
|
||||
if (!sd)
|
||||
return ENXIO;
|
||||
/* was it ever initialized etc. ? */
|
||||
if (!(sd->flags & SDINIT))
|
||||
return ENXIO;
|
||||
if (sd->sc_link->flags & SDEV_MEDIA_LOADED != SDEV_MEDIA_LOADED)
|
||||
return ENXIO;
|
||||
if (sd->flags & SDWRITEPROT)
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: st.c,v 1.26 1994/04/10 00:07:02 mycroft Exp $
|
||||
* $Id: st.c,v 1.27 1994/04/11 03:54:12 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -191,7 +191,7 @@ static struct rogues gallery[] = /* ends with an all-null entry */
|
||||
struct st_data {
|
||||
struct device sc_dev;
|
||||
/*--------------------present operating parameters, flags etc.----------------*/
|
||||
u_int flags; /* see below */
|
||||
int flags; /* see below */
|
||||
u_int blksiz; /* blksiz we are using */
|
||||
u_int density; /* present density */
|
||||
u_int quirks; /* quirks for the open mode */
|
||||
@ -231,15 +231,15 @@ struct cfdriver stcd = {
|
||||
NULL, "st", scsi_targmatch, stattach, DV_TAPE, sizeof(struct st_data)
|
||||
};
|
||||
|
||||
int st_space __P((struct st_data *, int number, u_int what, u_int flags));
|
||||
int st_rewind __P((struct st_data *, boolean immed, u_int flags));
|
||||
int st_mode_sense __P((struct st_data *, u_int flags));
|
||||
int st_space __P((struct st_data *, int number, u_int what, int flags));
|
||||
int st_rewind __P((struct st_data *, boolean immed, int flags));
|
||||
int st_mode_sense __P((struct st_data *, int flags));
|
||||
int st_decide_mode __P((struct st_data *, boolean first_read));
|
||||
int st_rd_blk_lim __P((struct st_data *, u_int flags));
|
||||
int st_rd_blk_lim __P((struct st_data *, int flags));
|
||||
int st_touch_tape __P((struct st_data *));
|
||||
int st_write_filemarks __P((struct st_data *, int number, u_int flags));
|
||||
int st_load __P((struct st_data *, u_int type, u_int flags));
|
||||
int st_mode_select __P((struct st_data *, u_int flags));
|
||||
int st_write_filemarks __P((struct st_data *, int number, int flags));
|
||||
int st_load __P((struct st_data *, u_int type, int flags));
|
||||
int st_mode_select __P((struct st_data *, int flags));
|
||||
void ststrategy();
|
||||
void stminphys();
|
||||
int st_chkeod();
|
||||
@ -259,7 +259,6 @@ struct scsi_device st_switch = {
|
||||
0
|
||||
};
|
||||
|
||||
#define ST_INITIALIZED 0x01
|
||||
#define ST_INFO_VALID 0x02
|
||||
#define ST_OPEN 0x04
|
||||
#define ST_BLOCK_SET 0x08 /* block size, mode set by ioctl */
|
||||
@ -338,7 +337,6 @@ stattach(parent, self, aux)
|
||||
st->buf_queue.b_active = 0;
|
||||
st->buf_queue.b_actf = 0;
|
||||
st->buf_queue.b_actb = &st->buf_queue.b_actf;
|
||||
st->flags |= ST_INITIALIZED;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -460,7 +458,7 @@ st_loadquirks(st)
|
||||
int
|
||||
stopen(dev, flags)
|
||||
dev_t dev;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
int unit;
|
||||
u_int mode, dsty;
|
||||
@ -475,7 +473,7 @@ stopen(dev, flags)
|
||||
if (unit >= stcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
st = stcd.cd_devs[unit];
|
||||
if (!st || !(st->flags & ST_INITIALIZED))
|
||||
if (!st)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = st->sc_link;
|
||||
@ -589,7 +587,7 @@ stclose(dev)
|
||||
int
|
||||
st_mount_tape(dev, flags)
|
||||
dev_t dev;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
int unit;
|
||||
u_int mode, dsty;
|
||||
@ -955,7 +953,7 @@ ststart(unit)
|
||||
struct scsi_link *sc_link = st->sc_link;
|
||||
register struct buf *bp, *dp;
|
||||
struct scsi_rw_tape cmd;
|
||||
u_int flags;
|
||||
int flags;
|
||||
|
||||
SC_DEBUG(sc_link, SDEV_DB2, ("ststart "));
|
||||
/*
|
||||
@ -1081,7 +1079,7 @@ stioctl(dev, cmd, arg, flag)
|
||||
int error = 0;
|
||||
int unit;
|
||||
int number, nmarks, dsty;
|
||||
u_int flags;
|
||||
int flags;
|
||||
struct st_data *st;
|
||||
u_int hold_blksiz;
|
||||
u_int hold_density;
|
||||
@ -1256,7 +1254,7 @@ int
|
||||
st_read(st, buf, size, flags)
|
||||
struct st_data *st;
|
||||
u_int size;
|
||||
u_int flags;
|
||||
int flags;
|
||||
char *buf;
|
||||
{
|
||||
struct scsi_rw_tape scsi_cmd;
|
||||
@ -1291,7 +1289,7 @@ st_read(st, buf, size, flags)
|
||||
int
|
||||
st_rd_blk_lim(st, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
struct scsi_blk_limits scsi_cmd;
|
||||
struct scsi_blk_limits_data scsi_blkl;
|
||||
@ -1339,7 +1337,7 @@ st_rd_blk_lim(st, flags)
|
||||
int
|
||||
st_mode_sense(st, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
u_int scsi_sense_len;
|
||||
int error;
|
||||
@ -1421,7 +1419,7 @@ st_mode_sense(st, flags)
|
||||
int
|
||||
st_mode_select(st, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
u_int dat_len;
|
||||
char *dat_ptr;
|
||||
@ -1480,7 +1478,7 @@ int
|
||||
st_space(st, number, what, flags)
|
||||
struct st_data *st;
|
||||
u_int what;
|
||||
u_int flags;
|
||||
int flags;
|
||||
int number;
|
||||
{
|
||||
int error;
|
||||
@ -1559,7 +1557,7 @@ st_space(st, number, what, flags)
|
||||
int
|
||||
st_write_filemarks(st, number, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
int number;
|
||||
{
|
||||
struct scsi_write_filemarks scsi_cmd;
|
||||
@ -1603,7 +1601,7 @@ st_chkeod(st, position, nmarks, flags)
|
||||
struct st_data *st;
|
||||
boolean position;
|
||||
int *nmarks;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -1631,7 +1629,7 @@ int
|
||||
st_load(st, type, flags)
|
||||
struct st_data *st;
|
||||
u_int type;
|
||||
u_int flags;
|
||||
int flags;
|
||||
{
|
||||
struct scsi_load scsi_cmd;
|
||||
struct scsi_link *sc_link = st->sc_link;
|
||||
@ -1659,7 +1657,7 @@ st_load(st, type, flags)
|
||||
int
|
||||
st_rewind(st, immed, flags)
|
||||
struct st_data *st;
|
||||
u_int flags;
|
||||
int flags;
|
||||
boolean immed;
|
||||
{
|
||||
struct scsi_rewind scsi_cmd;
|
||||
|
@ -26,7 +26,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: uk.c,v 1.5 1994/03/29 04:29:45 mycroft Exp $
|
||||
* $Id: uk.c,v 1.6 1994/04/11 03:54:21 mycroft Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -48,8 +48,6 @@
|
||||
struct uk_data {
|
||||
struct device sc_dev;
|
||||
|
||||
u_int32 flags;
|
||||
#define UKINIT 0x01
|
||||
struct scsi_link *sc_link; /* all the inter level info */
|
||||
};
|
||||
|
||||
@ -93,7 +91,6 @@ ukattach(parent, self, aux)
|
||||
sc_link->dev_unit = uk->sc_dev.dv_unit;
|
||||
|
||||
printf(": unknown device\n");
|
||||
uk->flags |= UKINIT;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -112,10 +109,7 @@ ukopen(dev)
|
||||
if (unit >= ukcd.cd_ndevs)
|
||||
return ENXIO;
|
||||
uk = ukcd.cd_devs[unit];
|
||||
/*
|
||||
* Make sure the device has been initialised
|
||||
*/
|
||||
if (!uk || !(uk->cflags & UKINIT))
|
||||
if (!uk)
|
||||
return ENXIO;
|
||||
|
||||
sc_link = uk->sc_link;
|
||||
|
Loading…
Reference in New Issue
Block a user