/*

  SCSI definitions.

  By John Wilson <wilson@dbit.com>.

  Copyright (C) 1999-2000 by Digby's Bitpile, Inc.  All rights reserved.
  This program may be freely copied as long as source code is available which
  includes this notice.

  02/13/1999	JMBW	Created.
  04/25/2000	JMBW	Cleaned out E11-related stuff.

*/

typedef unsigned char byte;
typedef unsigned short word;
typedef unsigned long dword;

typedef struct {
	byte	srhst;		/* host adapter # */
	byte	srtrg;		/* target # */
	byte	srlun;		/* LUN # */
	signed char srdir;	/* direction of this command */
				/* -1 => buf to dev, +1 => dev to buf, */
				/* 0 => none */
	byte	sroob;		/* NZ => use out-of-band data buf (SROBB) */
				/* instead */
				/* of regular data buf (pointed to by SRBUF) */
	byte	srcdl;		/* length of SCSI command in SRCDB */
	byte	srcdb[12];	/* SCSI command descriptor block */
	void far *srbuf;	/* 16:16 ptr into I/O buffer */
	word	srsiz;		/* size of I/O transfer in bytes */
#define SRSNSL 18
	byte	srsns[SRSNSL];	/* sense data go here on SC$CHK return */
#define SROBBL 16
	byte	srobb[SROBBL];	/* out-of-band data buf (small buffer for */
				/* doing READ CAPACITY, MODE SENSE/SELECT */
				/* w/o messing up data buffer) */
} scsireq;

/* error codes returned by xscsiw() */
#define	SCNOE	0	/* no error (=0) */
#define	SCIOE	2	/* I/O error (comm problem) */
#define	SCCHK	4	/* check condition */
#define	SCATN	6	/* unit attention (common case of SCCHK) */
#define	SCOFL	8	/* unit not ready (  "     "   "    "   ) */

