⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stcvar.h

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 H
📖 第 1 页 / 共 2 页
字号:
	struct st_trksel_cm {	    u_char		:5;	/* Reserved			      */	    u_char	lun:3;		/* Logical Unit Number		      */	    u_char		:8;	/* Reserved			      */	    u_char		:8;	/* Reserved			      */	    u_char	trkval;		/* Track Value			      */	    u_char	link:1;		/* Link				      */	    u_char	flag:1;		/* Flag				      */	    u_char		:4;	/* Reserved			      */	    u_char	mbz:2;		/* Must be Zero			      */	    u_char	pad[16];	/* Pad				      */	}trksel;	/*	 * RESERVE UNIT Command	 * RELEASE UNIT Command	 */	 struct st_runit_cm {	    u_char		:1;	/* Reserved			      */	    u_char	thrdpdev:3;	/* Third Party Device		      */	    u_char	thrdp:1;	/* Third Party			      */	    u_char	lun:3;		/* Logical Unit Number		      */	    u_char		:8;	/* Reserved			      */	    u_char		:8;	/* Reserved			      */	    u_char		:8;	/* Reserved			      */	    u_char	link:1;		/* Link				      */	    u_char	flag:1;		/* Flag				      */	    u_char		:4;	/* Reserved			      */	    u_char	mbz:2;		/* Must be Zero			      */	    u_char	pad[16];	/* Pad				      */	}runit;    }cmd;};/* * Data Format Structure */struct st_datfmt {    union {	/*	 * Extended Sense Data Format	 */	struct st_exsns_dt {	    u_char	errcode:4;	/* Error Code			      */	    u_char	errclass:3;	/* Error Class			      */	    u_char	valid:1;	/* Valid			      */	    u_char	segnum;		/* Segment Number		      */	    u_char	snskey:4;	/* Sense Key			      */	    u_char		:1;	/* Reserved			      */	    u_char	ili:1;		/* Illegal Length Indicator	      */	    u_char	eom:1;		/* End of Medium		      */	    u_char	filmrk:1;	/* Filemark			      */	    u_char	infobyte3;	/* Information Byte (MSB)	      */	    u_char	infobyte2;	/* Information Byte 		      */	    u_char	infobyte1;	/* Information Byte 		      */	    u_char	infobyte0;	/* Information Byte (LSB)	      */	    u_char	asl;		/* Additional Sense Length	      */	    u_char	ctlr;		/* Controller internal error code     */	    u_char	drv0;		/* Drive error byte		      */	    u_char	drv1;		/* Drive error byte		      */	    u_char	pad[9]		/* Pad				      */	}exsns;	/*	 * READ BLOCK LIMITS Data	 */	struct st_rd_blklim_dt {	    u_char		:8;	/* Reserved			      */	    u_char	maxreclen2;	/* Maximum Record Length (MSB)	      */	    u_char	maxreclen1;	/* Maximum Record Length 	      */	    u_char	maxreclen0;	/* Maximum Record Length (LSB)	      */	    u_char	minreclen1;	/* Minimum Record Length (MSB)	      */	    u_char	minreclen0;	/* Minimum Record Length (LSB)	      */	    u_char	pad[14]		/* Pad				      */	}rdblim;	/*	 * INQUIRY Data	 */	struct st_inq_dt {	    u_char	perfdt;		/* Peripheral Deice Type	      */	    u_char	devtq:7;	/* Device Type Qualifier	      */	    u_char	rmb:1;		/* Removable Media Bit		      */	    u_char	version;	/* Version			      */	    u_char		:8;	/* Reserved			      */	    u_char	addlen;		/* Additional Length		      */	    u_char	pad[15]		/* Pad				      */	}inq;	/*	 * MODE SENSE Data	 */	struct st_modsns_dt {	/* Parameter List Header	*/	    u_char	sdlen;		/* Sense Data Length		      */	    u_char	mbz1:8;		/* Must be Zero			      */	    u_char	mbz2:4;		/* Must be Zero			      */	    u_char	bufmode:3;	/* Buffered Mode		      */	    u_char	wp:1;		/* Write Protect		      */	    u_char	bdeclen;	/* Block Descriptor Length	      */	/* Parameter List Block Descriptor */	    u_char	mbz3;		/* Must be Zero			      */	    u_char	numofblk2;	/* Number of Blocks (MSB)	      */	    u_char	numofblk1;	/* Number of Blocks 		      */	    u_char	numofblk0;	/* Number of Blocks (LSB)	      */	    u_char		:8;	/* Reserved			      */	    u_char	blklen2;	/* Block Length (MSB)		      */	    u_char	blklen1;	/* Block Length 		      */	    u_char	blklen0;	/* Block Length (LSB)		      */	    u_char	vulen;		/* Vendor Unique Length		      */	    u_char	nof:2;		/* Enable Fillers		      */	    u_char	mbz4:5;		/* Must be Zero			      */	    u_char	vu7:1;		/* Direct Track Access		      */	    u_char	pad[6];		/* Pad				      */	}modsns;	/*	 * RECEIVE DIAGNOSTIC RESULT Data	 */	struct st_recdiag_dt {	    u_char	ctlr_hd_rev;	/* Controller hardware revision level */	    u_char	ctlr_fw_rev;	/* Controller firmware revision level */	    u_char	ctlr_selftest;	/* Controller selftest  0 = Passed    */					/*                      1 = Failed    */	    u_char	drv_hw_rev;	/* Drive hardware revision level      */	    u_char	drv_fw_rev;	/* Drive firmware revision level      */	    u_char	drv_selftest;	/* Drive selftest  0 = Passed	      */					/*		  xx = Failure Code   */	}recdiag;    }dat;};/* * TZK50 Command Opcodes */#define	ST_TUR		0x00		/* TEST UNIT READY Command	      */#define ST_REWIND	0x01		/* REWIND Command		      */#define ST_RQSNS	0x03		/* REQUEST SENSE Command	      */#define ST_RBL		0x05		/* READ BLOCK LIMITS Command	      */#define	ST_READ		0x08		/* READ Command			      */#define ST_WRITE	0x0a		/* WRITE Command		      */#define ST_TRKSEL	0x0b		/* TRACK SELECT Comand		      */#define ST_RESUNIT	0x16		/* RESERVE UNIT Command		      */#define ST_WFM		0x10		/* WRITE FILEMARKS Command	      */#define ST_SPACE	0x11		/* SPACE Command		      */#define ST_INQ		0x12		/* INQUIRY Command		      */#define ST_VFY		0x13		/* VERIFY Command		      */#define ST_RBD		0x14		/* RECOVER BUFFERED DATA Command      */#define ST_MODSEL	0x15		/* MODE SELECT Command		      */#define ST_RELUNIT	0x17		/* RELEASE UNIT Command		      */#define ST_ERASE	0x19		/* ERASE Command		      */#define ST_MODSNS	0x1a		/* MODE SENSE Command		      */#define ST_LOAD		0x1b		/* LOAD Command			      */#define ST_UNLOAD	0x1b		/* UNLOAD Command		      */#define ST_RECDIAG	0x1c		/* RECEIVE DIAGNOSTIC RESULT Command  */#define ST_SNDDIAG	0x1d		/* SEND DIAGNOSTIC Command	      */#define ST_P_FSPACER	0x1e		/* Psuedo opcode for space record     */#define ST_P_FSPACEF	0x1f		/* Psuedo opcode for space file	      */#define ST_P_BSPACER	0x2e		/* Psuedo opcode for backspace record */#define ST_P_BSPACEF	0x2f		/* Psuedo opcode for backspace file   */#define ST_P_CACHE	0x2c		/* Psuedo opcode for buffered mode    */#define ST_P_NOCACHE	0x2d		/* Psuedo opcode for no buffered mode *//* * SCSI Command Data structure names shortened */#define stdt_exsns	st_datfmt.dat.exsns	/* EXTENDED SENSE Data	      */#define stdt_rbl	st_datfmt.dat.rbl	/* READ BLOCK LIMITS Data     */#define	stdt_inq	st_datfmt.dat.inq	/* INQUIRY Data		      */#define stdt_modsel	st_datfmt.dat.modsel	/* MODE SELECT Data	      */#define stdt_modsns	st_datfmt.dat.modsns	/* MODE SENSE Data	      *//* * SCSI STATUS Byte */#define	ST_GOOD		0x00	/* Good					      */#define	ST_CHKCND	0x02	/* Check Condition			      */#define ST_INTRM	0x10	/* Intermediate				      */#define ST_RESCNF	0x18	/* Reservation Conflict			      *//* * SCSI Message Protocols */#define	ST_CMDCPT	0x00	/* Command Complete			      */#define ST_SDP		0x02	/* Save Data Pointers			      */#define ST_DISCON	0x04	/* Disconnect				      */#define ST_ABT		0x06	/* Abort				      */#define ST_MSGREJ	0x07	/* Message Reject			      */#define ST_NOP		0x08	/* No Operation				      */#define ST_MSGPE	0x09	/* Message Parity Error			      */#define ST_DEVRST	0x0c	/* Bus Device Reset			      */#define ST_LNKCMP	0x0a	/* Linked Command Complete		      */#define ST_LNKCMPF	0x0b	/* Linked Command Complete with Flag	      */#define ST_ID_NODIS	0x80	/* IDENTIFY wo/ disconnect capability,	      */#define ST_ID_DIS	0xc0	/* IDENTIFY w/ disconnect capability,	      *//* * Command Data allocation constants */#define	ST_INQ_LEN	 5	/* number of bytes for INQUIRY data	      */#define ST_RECDIAG_LEN	 6	/* number of bytes for RECEIVE DIAG data      */#define ST_RQSNS_LEN	11	/* number of bytes for REQUEST SENSE data     */#define ST_MODSNS_LEN	14	/* number of bytes for MODE SENSE data	      */#define ST_MODSEL_LEN	14	/* number of bytes for MODE SELECT data	      */#define ST_MAX_DT_LEN	20	/* Size of st_datfmt structure		      *//* * Command Packet Length constants */#define ST_MAX_CMD_LEN		22	/* maximum command length in bytes    */#define ST_MODSEL_CMD_LEN	20	/* maximum length of modsel command   */#define ST_CMD_LEN		 6	/* length of commands in bytes	      *//* * Miscellaneous Constants */#define ST_DEFAULT_FILLS	 7	/* Default number of fills that can be					 * written to keep streaming	      */#define	ST_MAX_ARB_TRIES	10	/* Max # of retries for bus arb	      */#define ST_MAX_SEL_DLY	       250	/* Number of msec to wait for BSY     */#define ST_MAX_STACK		 4	/* Maximun size of the state stack    */#define ST_MAX_RETRIES		 5	/* Maximum number of retries	      */#define ST_ONE_SEC	     10000	/* Produces a one second timeout when					   calling STWAIT_XXXX macroes.	      *//* * MACRO for converting a longword to a byte *	args - the longword *	     - which byte in the longword you want */#define	LTOB(a,b)	((a>>(b*8))&0xff)/* MACROS for timing out spin loops. * *	desc:	Waits while expression is true. * *	args:	expr 		- expression to spin on *		spincount 	- amount of time to wait in microseconds *		retval		- return value of this macro */#define	STWAIT_WHILE(expr,spincount,retval) {				\		for (retval = 0; ((retval < 100) && (expr)); retval++);	\		while ((expr) && ( retval < spincount)) {		\			DELAY(100);					\			retval++;					\		}							\	}/* * 	desc: Waits unitl expression is true. */#define STWAIT_UNTIL(expr,spincount,retval) {				\		STWAIT_WHILE((!expr),spincount,retval);			\	}/* * Request Sense Sense Key Codes */#define ST_NOSENSE	0x00	/* Successful cmd or EOT, ILI, FILEMARK	      */#define ST_RECOVERR	0x01	/* Successful cmd with controller recovery    */#define ST_NOTREADY	0x02	/* Device present but not ready		      */#define	ST_MEDIUMERR	0x03	/* Cmd terminated with media flaw	      */#define ST_HARDWARE	0x04	/* Controller or drive hardware error	      */#define ST_ILLEGALREQ	0x05	/* Illegal command or command parameters      */#define ST_UNITATTEN	0x06	/* Unit Attention			      */#define ST_DATAPROTECT	0x07	/* Write attempted to write protected media   */#define ST_BLANKCHK	0x08	/* Read zero length record (EOD)	      */#define ST_ABORTEDCMD	0x0b	/* Cmd aborted that may retry successfully    */#define ST_VOLUMEOVFL	0x0d	/* Buffer data left over after EOM	      */#define ST_MISCOMPARE	0x0e	/* Miscompare on Verify command		      *//* * Top Level State Machine *//* Status/Positioning States */#define	ST_NEXT		 0	/* Process next request from queue	      */#define ST_SP_START	 1	/* Start a Status or Positioning Operation    */#define ST_SP_CONT	 2	/* Continue ST_SP_SETUP:		      *//* Read/Write (DMA) States */#define	ST_RW_START	 3	/* Start a Read or Write Operation	      */#define ST_R_STDMA	 4	/* Start DMA WRITE			      */#define ST_W_STDMA	 5	/* Copy Read data to memory		      */#define ST_R_DMA	 6	/* Read DMA processing			      */#define ST_W_DMA	 7	/* Write DMA processing			      */#define ST_R_COPY	 8	/* Copy READ data to memory		      */#define ST_R_DMACONT	 9	/* Read DMA Completion			      */#define ST_W_DMACONT	10	/* WRITE DMA Completion			      */#define ST_ERR		11	/* DMA Error				      *//* * Bottom Level State Machine */#define ST_SP_ARB	 0	/* Arbitrate for the Bus		      */#define ST_SP_SEL	 1	/* Select the target device		      */#define ST_CMD_PHA	 2	/* Command Phase			      */#define ST_DATAO_PHA	 3	/* Data Out Phase			      */#define ST_DATAI_PHA	 4	/* Data In Phase			      */#define ST_STATUS_PHA	 5	/* Status Phase				      */#define ST_MESSI_PHA	 6	/* Message In Phase			      */#define ST_MESSO_PHA	 7	/* Message Out Phase			      */#define ST_RELBUS	 8	/* Release the Bus			      */#define ST_ABORT	 9	/* Abort the transaction		      */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -