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

📄 scsireg.h

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 H
📖 第 1 页 / 共 4 页
字号:
 * This flags are used in both disk and tape option tables*/#define MSEL_PLL_VAL		0x00000001	/* msel_pll is valid	*/#define MSEL_BLKDL_VAL		0x00000002	/* msel_blkdl is valid	*/#define MSEL_VUL_VAL		0x00000004	/* msel_vul is valid	*/#define MSNS_ALLOCL_VAL		0x00000008	/* msns_allocl is valid	*/#define RSNS_ALLOCL_VAL		0x00000010	/* rsns_allocl is valid	*/#define BUF_MOD			0x00000020	/* Buffered mode */#define PAGE_VAL		0x00000040	/* page_size is valid *//* * what kind of unit are we.......tape type /disk type. * These flags are used in the tape_opt_tab.opt_flags * or  disk_opt_tab*/		/* TAPES */#define SCSI_QIC	0x00010000	/* This is a QIC tape unit	*/#define SCSI_9TRK	0x00020000	/* This is a 9 Track unit	*/#define SCSI_8MM	0x00040000	/* This is an 8 millemeter tape */#define SCSI_RDAT	0x00080000	/* This is an rdat tape		*/		/* DISKS */#define SCSI_REMOVAL	0x00010000	/* This is a removable disk 						Not implemented	*/#define NUM_DENS	0x4	/* Number of densities possible		*/struct tape_opt_tab {	int opt_flags; 		/* Direction flags ie qic 9trk etc... 	*/	char msel_pll;		/* Mode select Parameter list lenght	*/ 	char msel_blkdl;	/* Mode select block descriptor lenght	*/	char msel_vul;		/* Mode select vendor unique lenght	*/	char msns_allocl;	/* mode sense alloc. lenght		*/	char rsns_allocl;	/* request sense alloc. lenght		*/	char page_size;		/* SCSI 2 page size			*/	char rserv1;		/* int boundary and future expansion	*/	char rserv2;	struct tape_info tape_info[NUM_DENS];	/* one for each of the possible						 * densities						*/};struct disk_opt_tab {	int opt_flags; 		/* Direction flags ie etc... 	*/	char msel_pll;		/* Mode select Parameter list lenght	*/ 	char msel_blkdl;	/* Mode select block descriptor lenght	*/	char msel_vul;		/* Mode select vendor unique lenght	*/	char msns_allocl;	/* mode sense alloc. lenght		*/	char rsns_allocl;	/* request sense alloc. lenght		*/	char page_size;		/* SCSI 2 page size			*/	char rserv1;		/* int boundary and future expansion	*/	char rserv2;		/* for further expansion		*/};/* * SCSI device information table data * structure and bit definitions. */struct scsi_devtab {	char *name;		/* Name we match on */	int namelen;		/* Length on which we match */#define tapetype namelen	/* Tapes dont say what they are??? */	char *sysname;		/* What we call it when we see it */	int devtype;		/* Mask for class and type of device */	struct size *disksize;	/* Partition table for disks */	int probedelay;		/* Time (Usec) to wait after all this */	int mspw;		/* Milliseconds per word for iostat */	int flags;		/* Flags to drive probe */	caddr_t *opt_tab;	/* Pointer to our option table (tapes/disks) */};/* * There flags control how the driver handles * the device (mostly in the probe routine). *//* * Send a request sense command to the target after the inquiry. * The command status and the sense data are not checked. */#define SCSI_REQSNS		0x00000001/* * Send a start unit command to the target after the inquiry. * Command status is not checked. Do not wait for the drive to spin up. */#define SCSI_STARTUNIT		0x00000002/* * Operate the target in synchronous data transfer mode if possible. * SII chip only. NCR 5380 does not support synchronous SCSI. */#define SCSI_TRYSYNC		0x00000004/* * Send a test unit ready command to the target after the inquiry. * The command status is not checked. */#define SCSI_TESTUNITREADY	0x00000008/* * Send a read capacity command to the target after the inquiry. * The command status and capacity data are not checked. */#define SCSI_READCAPACITY	0x00000010/* * For tapes only. Do not send the receive diagnostic results * command to the tape during the first open. This flag is for * SCSI tapes which do not support the receive diagnostic results * command. The TZ30 and TZK50 support receive diagnostic results, * so do not set the NODIAG flag for these tapes. */#define SCSI_NODIAG		0x00000020/* * For disks, including cdrom, only. Set the PF (page format) * bit when sending a mode select command to the target. */#define	SCSI_MODSEL_PF		0x00000040/* * For disks, not including cdrom, only. Set if the disk has * removable media, such as the RX23 floppy disk drive. */#define	SCSI_REMOVABLE_DISK	0x00000080/* * See sys/data/scsi_data.c. */#define	SCSI_MODSEL_EXABYTE	0x00000100/* * For hard disks. The driver reassigns the block if an ECC * correctable error occurs. Set this flag if the device does * not support the reassign block command. See sys/data/scsi_data.c * for examples, such as floppy disks and cdrom devices. */#define	SCSI_NODBBR		0x00000200/* DBBR state values and misc defines. */#define BBR_READ	0	/* Read the bad block                        */#define BBR_REASSIGN	1	/* Reassign the bad block                    */#define BBR_WRITE	2	/* Write the bad block                       */#define BBR_COUNT	3	/* number of retries for the BBR states      *//* * SCSI error log data structures and definitions. */#define	SZ_EL_VERS	2	/* SCSI error log packet version number *//* * SCSI error log information flags. * These flags tell the scsi_logerr routine what type * of information to include in the error log packet. * The flags are included in the error log packet in the * info_flags field so UERF knows which fields are valid. */#define	SZ_LOGCMD	0x01	  /* Log SCSI command packet (CDB)	      */#define	SZ_LOGSTAT	0x02	  /* Log SCSI status byte		      */#define	SZ_LOGMSG	0x04	  /* Log SCSI message byte		      */#define	SZ_LOGSNS	0x08	  /* Log SCSI extended sense data	      */#define	SZ_LOGREGS	0x10	  /* Log SCSI controller and DMA registers    */#define	SZ_LOGBUS	0x20	  /* Log SCSI bus data (which IDs on the bus) */#define	SZ_LOGSELST	0x40	  /* LOG SCSI select status for each target   */#define	SZ_HARDERR	0x10000	  /* HARD error				      */#define	SZ_SOFTERR	0x20000	  /* SOFT error				      */#define	SZ_RETRYERR	0x40000	  /* RETRY error			      */#define	SZ_ESMASK	0x70000	  /* Error severity mask		      */#define	SZ_NCR5380	0x100000  /* Port type is NCR 5380 chip		      */#define	SZ_DECSII	0x200000  /* Port type is DEC SII chip		      */#define SZ_NCRASC   	0x400000  /* Port type is NCR 53C94 (ASC)             *//* * SCSI error log error type definitions. */#define	SZ_ET_DEVERR	0	/* Device error reported from szerror()       */#define	SZ_ET_PARITY	1	/* SCSI bus parity error		      */#define	SZ_ET_BUSRST	2	/* SCSI bus reset detected		      */#define	SZ_ET_RSTBUS	3	/* Controller resetting SCSI bus	      */#define	SZ_ET_RSTTARG	4	/* Controller resetting target		      */#define	SZ_ET_CMDABRTD	5	/* Command aborted			      */#define	SZ_ET_RESELERR	6	/* Reselect error			      */#define	SZ_ET_STRYINTR	7	/* Stray interrupt			      */#define	SZ_ET_SELTIMO	8	/* Selection timeout			      */#define	SZ_ET_DISTIMO	9	/* Disk disconnect timeout		      */#define	SZ_ET_CMDTIMO	10	/* Command timeout			      */#define	SZ_ET_ACTSTAT	11	/* Activity status error		      */#define	SZ_ET_BUSERR	12	/* SCSI bus protocol error		      */#define	SZ_ET_DBBR	13	/* Dynamic Bad Block Replacement reporting    *//* * NCR 5380 SCSI chip registers. * * We only log the readable registers. * The select enable register is not readable * so we keep a copy in the sz_softc structure. */struct	reg_5380 {	u_char	ini_cmd;	/* (rw) Initiator command register    */	u_char	mode;		/* (rw) Mode register		      */	u_char	tar_cmd;	/* (rw) Target command register	      */	u_char	cur_stat;	/* (ro) Current bus status register   */	u_char	sel_ena;	/* (wo) Select enable (soft copy)     */	u_char	status;		/* (ro) Bus and status register	      */	u_char	pad[2];		/*      Alignment, not needed, but... */	u_long	adr;		/* (rw) DMA address register	      */	u_long	cnt;		/* (rw) DMA count register	      */	u_long	dir;		/* (rw) DMA direction register	      */};/* * SII chip registers. * * Only the meaningful registers are logged. */struct	reg_sii {	u_short	sii_sdb;	/* SCSI Data Bus and Parity		*/	u_short	sii_sc1;	/* SCSI Control Signals One		*/	u_short	sii_sc2;	/* SCSI Control Signals Two		*/	u_short	sii_csr;	/* Control/Status register		*/	u_short	sii_id;		/* Bus ID register			*/	u_short	sii_slcsr;	/* Select Control and Status Register	*/	u_short	sii_destat;	/* Selection Detector Status Register	*/	u_short	sii_dstmo;	/* DSSI Timeout Register		*/	u_short	sii_data;	/* Data Register			*/	u_short	sii_dmctrl;	/* DMA Control Register			*/	u_short	sii_dmlotc;	/* DMA Length of Transfer Counter	*/	u_short	sii_dmaddrl;	/* DMA Address Register Low		*/	u_short	sii_dmaddrh;	/* DMA Address Register High		*/	u_short	sii_dmabyte;	/* DMA Initial Byte Register		*/	u_short	sii_stlp;	/* DSSI Short Target List Pointer	*/	u_short	sii_ltlp;	/* DSSI Long Target List Pointer	*/	u_short	sii_ilp;	/* DSSI Initiator List Pointer		*/	u_short	sii_dsctrl;	/* DSSI Control Register		*/	u_short	sii_cstat;	/* Connection Status Register		*/	u_short	sii_dstat;	/* Data Transfer Status Register	*/	u_short	sii_comm;	/* Command Register			*/	u_short	sii_dictrl;	/* Diagnostic Control Register		*/	u_short	sii_clock;	/* Diagnostic Clock Register		*/	u_short	sii_bhdiag;	/* Bus Handler Diagnostic Register	*/	u_short	sii_sidiag;	/* SCSI IO Diagnostic Register		*/	u_short	sii_dmdiag;	/* Data Mover Diagnostic Register	*/	u_short	sii_mcdiag;	/* Main Control Diagnostic Register	*/};/* *  ASC Chip registers (read only) */struct  reg_asc {    u_char  tclsb;  /* Transfer Count LSB           */    u_char  tcmsb;  /* Transfer Count MSB           */    u_char  cmd;    /* Command register         */    u_char  stat;   /* Status register          */    u_char  ss;     /* Sequence Step register       */    u_char  intr;   /* Interrupt status register        */    u_char  ffr;    /* FIFO flags register          */    u_char  cnf1;   /* Configuration 1 register     */    u_char  cnf2;   /* Configuration 2 register     */    u_char  cnf3;   /* Configuration 3 register     */};  /* end reg_asc */   /* * Data structure for the SCSI portion of the error log packet. * * TODO: * Goal not to exceed mscp el packet size of 120 bytes * SII reg size may have blown above goal out of the water! */struct	el_scsi {	u_char	scsi_elvers;		/* SCSI error log packet version      */	u_char	error_typ;		/* Error type code		      */	u_char	suberr_typ;		/* Error sub-type code		      */	u_char	scsi_id;		/* SCSI bus ID of target	      */	u_char	bus_data;		/* SCSI bus data (which IDs on bus)   */	u_char	scsi_status;		/* SCSI status byte		      */	u_char	scsi_msgin;		/* SCSI message in byte		      */	u_char	scsi_pad;		/* Place holder			      */	int	info_flags;		/* Info fields valid flags	      */	u_char	scsi_selst[NDPS];	/* Select status for each target      */	u_char	scsi_cmd[12];		/* SCSI command packet (CDB)	      */	struct	sz_exsns_dt scsi_esd;	/* SCSI extended sense data	      */	union {	    struct reg_sii  siiregs;	/* SII port registers		      */	    struct reg_5380 ncrregs;	/* NCR 5380 port registers	      */       	    struct reg_asc  ascregs;    /* NCR 53C94 (ASC) port registers     */	} scsi_regs;	u_long	sect_num;		/* Sector number for disk errors      */};#endif /*	SCSIREG_INCLUDE */

⌨️ 快捷键说明

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