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

📄 mscp_defs.h

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 H
📖 第 1 页 / 共 2 页
字号:
 * * The base major number is different for block and character devices. */#define Ux(Dev) ((major(Dev) >= RA_C_BASE) ?				       \		(((major(Dev) - RA_C_BASE) * RA_MINORS) + (minor(Dev) >> 3)) : \		(((major(Dev) - RA_B_BASE) * RA_MINORS) + (minor(Dev) >> 3)))   /* Px returns the partition index given the device number. */#define Px( Dev ) ( minor( (Dev) ) & 0x7 )/* Dev_to_unitb returns the unit block pointer corresponding to * the given device number. */#define Dev_to_unitb( Dev ) \    (( Ux( (Dev) ) >= NUNIT ) ? ( UNITB * )NULL : mscp_unit_tbl[ Ux( (Dev) ) ] )#define Dev_to_Tunitb( Dev ) \    (( UNIT( (Dev) ) >= NTUNIT ) ? ( UNITB * )NULL : tmscp_unit_tbl[ UNIT( (Dev) ) ] )/* Init_msg clears the message buffer and then fills * in the RSPID and unit number.  If there is no unit * number associated with the command, NULL should be * supplied. */#define Init_msg( Ptr, Rspid, Unit ) { \    ( void )bzero(( caddr_t )(Ptr), sizeof( MSCP_CMDMSG )); \    (Ptr)->mscp_cmd_ref = *( u_long * )&(Rspid); \    (Ptr)->mscp_unit = ( u_short )(Unit); }/* Pad_msg pads out a received end message to the maximum * MSCP message size. */#define Pad_msg( Ptr, Size ) { \    register int temp_size = sizeof( MSCP ) - (Size); \    if( temp_size > 0 ) \	( void )bzero(( ( caddr_t )(Ptr) + (Size) ), temp_size ); }/**//* Double linked list entry and listhead */typedef struct	_qe {			/* General queue entry descriptor    */    struct	_qe	*flink;		/* Forward link			     */    struct	_qe	*blink;		/* Backward link		     */} QE, LISTHD;/* SCA response identifier, a.k.a. command reference number */typedef struct	_rspid {		/* Response ID			    */    u_short		index;		/* RSPID table subscript	    */    u_short		seq_no;		/* Seq No - distinguishes instances */} RSPID;/* Table of Response IDs (RSPIDs) used to manage allocation of RSPIDS * and to correlate a RSPID to a corresponding I/O request block (REQB). */typedef struct _rspid_tbl {    struct _rspid_tbl	*flink;    struct _rspid_tbl	*blink;    RSPID		rspid;    struct _reqb	*reqb;} RSPID_TBL;/* Controller/Unit unique identifier */typedef struct	_uniq_id {		/* Controller/unit identifier	     */    u_char		device_no[6];	/* Device unique identifier	     */    u_char		model;		/* Device model number		     */    u_char		class;		/* Device class			     */} UNIQ_ID;/* Partition size field structure */typedef	struct _part_size {		/* Partition size		    */    daddr_t	    p_nblocks;		/* Number of blocks in partition    */    daddr_t	    p_blkoff;		/* LBN of start of partition	    */} PART_SIZE;/* Disk media ID to name correlation table. */typedef struct _dmscp_media {    char	    *dev_name;		/* Device name string		     */    int		    dev_index;    int		    media_id;		/* MSCP disk medium identifier	     */    PART_SIZE	    *part_sizes;	/* Default partition table pointer   */} DMSCP_MEDIA; /* Tape media ID to name correlation table. */typedef struct _tmscp_media {    char	*dev_name;		/* Device name string		     */    int		dev_index;    int		media_id;		/* MSCP tape medium identifier	     */} TMSCP_MEDIA;/* Controller model to name correlation table structure.  */typedef struct _model {    char	*name;			/* Controller model name string	     */    u_char	model;			/* Controller model number	     */} MODEL;/* State table entry structure. */typedef	struct	_state {    u_long	    new_state;		/* State after event occurence	     */    u_long	    ( *action_rtn )();	/* Action routine address	     */} STATE;/* Per-request data structure * *	This structure has an adb macro associated with it in *	/usr/lib/adb.  Use it during debuggung and please *	update it if any changes are made in this file to this *	structure. * */typedef struct	_reqb {    struct _reqb	*flink;		/* Request block		     */    struct _reqb	*blink;		/*	queue pointers		     */    struct _classb	*classb;	/* Class block back pointer	     */    struct _connb	*connb;		/* Connection block back pointer     */    struct _unitb	*unitb;		/* Unit block back pointer	     */    struct buf		*bufptr;	/* Buf structure pointer	     */    MSCP		*msgptr;	/* Message buffer pointer	     */    u_long		msgsize;	/* Message size			     */    u_long		p1;		/* Function dependent parameter 1    */    u_long		p2;		/* Function dependent parameter 2    */    u_char		*aux;		/* Auxiliary structure pointer	     */    RSPID		rspid;		/* Response ID			     */    u_long		op_seq_num;	/* Operation sequence number	     */    u_short		*rwaitptr;	/* Resource wait counter pointer     */    BHANDLE		lbhandle;	/* Local buffer handle		     */    u_long		state;		/* Request state		     */    STATE		*state_tbl;	/* State table used for request	     */    struct {				/* Request block flags		     */	u_short	perm_reqb 	 :1;	/* Request block is permanent	     */	u_short nocreditw	 :1;	/* Don't wait for send credit	     */	u_short online		 :1;	/* Request represents an online	     */	u_short force		 :1;	/* Request reps a force replacement */	u_short		   	:12;	/* Unused			     */    } flags;} REQB ;/* Per-unit data structure * *	This structure has an adb macro associated with it in *	/usr/lib/adb.  Use it during debuggung and please *	update it if any changes are made in this file to this *	structure. * */typedef struct	_unitb {    struct _unitb	*flink;		/* Unit block			     */    struct _unitb	*blink;		/*	queue pointers		     */    struct _connb	*connb;		/* Connection block back pointer     */    struct uba_device	*ubdev;		/* Unibus device structure pointer   */    struct	{	REQB		*flink;		/* Request block		     */	REQB		*blink;		/*	list head		     */    } request;    u_short		state;		/* Software unit state		     */    struct	{			/* Software unit flags		     */	u_short		alonl	   :1;	/*    Unit was already online	     */	u_short		busy	   :1;	/*    Unit open/close busy flag	     */	u_short		online	   :1;	/*    Unit is online		     */	u_short		online_ip  :1;	/*    Unit online is in progress     */	u_short		close_ip   :1;	/*    Unit close is in progress     */	u_short		rct_pres   :1;	/*    Unit has an RCT		     */	u_short		wrtp	   :1;	/*    Unit is write protected	     */	u_short		force_scan_ip :1; /*  Forced replace/scan in progress*/	u_short		wait_bump  :1;	/*    Reconnect has bumped rwaitct   */	u_short		excl_acc   :1;	/*    Unit is exclusive access 	     */	u_short		mscp_wait  :1;	/*    Waiting for a state to complete*/	u_short			   :5;	/*    Unused			     */    } flags;    u_short		unit;		/* Unit number			     */    u_short		rwaitct;	/* Resource wait reason counter	     */    u_short		part_mask;	/* Open partition mask		     */    dev_t		dev;		/* ?? DO I NEED THIS ??		     */    u_short		mult_unt;	/* Multi-unit code		     */    u_short		unt_flgs;	/* Unit flags			     */    UNIQ_ID		unit_id;	/* Unit identifier		     */    u_long		media_id;	/* Media identifier		     */    u_short		shdw_unt;	/* Shadow unit			     */    u_short		shdw_sts;	/* Shadow status		     */    u_short		track;		/* Track size			     */    u_short		group;		/* Group size			     */    u_short		cylinder;	/* Cylinder size		     */    u_char		unit_svr;	/* Unit software version	     */    u_char		unit_hvr;	/* Unit hardware version	     */    u_short		rct_size;	/* RCT size			     */    u_char		rbns;		/* RBNs per track		     */    u_char		rct_cpys;	/* RCT copies			     */    u_long		unt_size;	/* Unit size (user accessible area)  */    u_long		vol_ser;	/* Volume serial number		     */    u_long		tot_size;	/* Total unit size including RCT     */    u_long		acc_badlbn;     /* First bad lbn found by access     */    u_long		acc_bytecnt;    /* access end packet byte count	     */    u_short		acc_status;     /* access command status	     */    u_short		acc_flags;      /* access end packet flags	     */    u_long		tms_softcnt;	/* Soft error count		     */    u_long		tms_hardcnt;	/* Hard error count		     */    u_long		tms_category_flags; /* Category flags		     */    u_long		tms_position;	/* LBN position on tape		     */    u_long		tms_bcount;	/* Maximum byte count xfer on unit   */    u_short		tms_format;	/* Current format and density	     */    u_short		tms_speed;	/* Speed			     */    u_short		tms_noise;	/* Noise level			     */    u_short		format_menu;	/* Format/density menu		     */    union {	    struct Tflags{				/* Software tape unit flags	     */		u_short		tms_serex   :1;	/* Serious exception		     */		u_short		tms_clserex :1;	/* Set by serex, cleared by nop	     */		u_short		tms_eom     :1;	/* End of media handling state	    */		u_short		tms_eot     :1;	/* End of tape encountered	     */		u_short		tms_tm	    :1;	/* Tape mark encountered	     */		u_short		tms_write   :1; /* Tape was written on after opened  */		u_short		tms_lost    :1; /* Tape position is unknown/lost     */		u_short		tms_bufmark :1; /* Tape mark encountered on buffered i/o*/		u_short		tms_cach    :1; /* Tape unit allows cacheing */		u_short		tms_cach_on :1; /* Tape units caching in use */		u_short		tms_cache_lost    :1; /* Cache data lost exception set */		u_short		tms_inuse   :1; /* Tape unit open and in use */		u_short		tms_wait   :1;  /* Tape unit wait on something*/                u_short         tms_cach_write :1;  /* Cached write pending */	    } Sflags;	    u_short		clearflags;	} state_flags;#define Tflags state_flags.Sflags#define clear_Sflags state_flags.clearflags    int			sel;		/* No/rewind, etc.		     */    u_char		tms_endcode;	/* Last mscp endcode for ioctl	     */    u_short		tms_status;	/* Last mscp status for ioctl	     */    u_char		tms_flags;	/* Last mscp flags for ioctl	     */    u_long		tms_resid;	/* Last mscp resid for ioctl	     */    u_long		cmd_ref;	/* Last mscp cmd_ref for ioctl ABORT */    u_long		tms_recovery_location;	/* current recovery position on tape		     */    char		mscp_device[DEV_SIZE];	/* Media type string 	     */    struct pt		part_info;	/* Embedded partition structure	     */    struct buf		rawbuf;		/* Embedded raw I/O buf structure    */    struct buf		ioctlbuf;	/* Embedded ioctl buf structure	     */} UNITB;/* Per-connection data structure * *	This structure has an adb macro associated with it in *	/usr/lib/adb.  Use it during debuggung and please *	update it if any changes are made in this file to this *	structure. * */typedef struct  _connb {    struct _connb	*flink;		/* Connection block queue	     */    struct _connb	*blink;		/* 	pointers		     */    struct _classb	*classb;	/* Class block back pointer	     */    struct 		{		/* Unit queue list head		     */	UNITB		*flink;		/*    forward link		     */	UNITB		*blink;		/*    backward link		     */    } unit;    struct _bbrb	*bbrb;		/* BBR block address		     */    u_short		state;		/* Driver's connection state	     */    struct {				/* Connection management flags	     */	u_short         restart    :1;	/* Reconnect in progress	     */	u_short		sngl_strm  :1;	/* Single streaming after restart    */	u_short		path_fail  :1;	/* Cleanup entered via path failure  */	u_short		need_upoll :1;	/* Unit polling is needed	     */	u_short		upoll_busy :1;	/* Polling request block is in use   */	u_short		need_cr    :1;	/* Credit reservation is needed	     */	u_short			  :10;	/* Unused			     */    } flags;    struct {	REQB		*flink;		/* Queue of requests		     */	REQB 		*blink;		/*	active in controller	     */    } active;    struct {	REQB		*flink;		/* Queue of requests		     */	REQB		*blink;		/*	in restart queue	     */    } restart;    struct {	REQB		*flink;		/* Queue of requests		     */	REQB		*blink;		/*	in credit wait queue	     */    } credit_wq;    struct {	REQB		*flink;		/* Queue of requests		     */	REQB		*blink;		/*	in buffer wait queue	     */    } buffer_wq;    struct {	REQB		*flink;		/* Queue of requests		     */	REQB		*blink;		/*	in map wait queue	     */    } map_wq;    u_short		cmdtmo_intvl;	/* Command timeout interval (s.)     */	    u_short		rsrctmo_intvl;	/* Resource wait timeout (s.)	     */	    u_short		retry_count;	/* Connection retry count	     */    u_short		cur_unit;	/* Unit number used by poller	     */    u_short		restart_count;	/* Restart command retry count	     */    u_short		hst_tmo;	/* Host timeout period		     */    c_scaaddr		sysid;		/* System ID			     */    c_scaaddr		rport_addr;	/* Remote port address		     */    u_long		lport_name;	/* Local port name		     */    u_short		version;	/* MSCP version			     */    u_short		cnt_flgs;	/* Controller flags		     */    u_short		cnt_tmo;	/* Controller timeout period	     */    u_char		cnt_svr;	/* Controller software version	     */    u_char		cnt_hvr;	/* Controller hardware version	     */    UNIQ_ID		cnt_id;		/* Controller identifier	     */    u_long		max_bcnt;	/* Controller maximum byte count     */    RSPID		old_rspid;	/* RSPID of oldest current command   */    u_long		old_cmd_sts;	/* Status of oldest current command  */    REQB		*restart_reqb;	/* Current request being restarted   */    u_char		*model_name;	/* Controller model name	     */    char		*cnt_name;	/* Config's controller name	     */    short		cnt_number;	/* Config's controller number	     */    u_short		bus_type;	/* I/O bus type			     */    struct uba_ctlr	*ubctlr;	/* Ubminit structure pointer	     */    CONNID		connid;		/* Connection ID		     */    REQB		timeout_reqb;	/* Command timeout permanent REQB    */    REQB		polling_reqb;	/* Polling/DAP permanent REQB	     */} CONNB;/* Driver-wide data structure * *	This structure has an adb macro associated with it in *	/usr/lib/adb.  Use it during debuggung and please *	update it if any changes are made in this file to this *	structure. * */typedef struct  _classb {    CONNB		*flink;		/* Connection block	 	     */    CONNB		*blink;		/* 	list head		     */    struct {	REQB		*flink;		/* Response ID wait queue	     */	REQB		*blink;		/* 	list head		     */    } rspid_wq;    u_long		operation_ct;	/* Request count since boot	     */    UNITB		**unit_tbl;	/* Driver unit table pointer	     */    char		*dev_name;	/* Device name string pointer	     */    STATE		*recov_states;	/* Unit recovery state table pointer */    u_short		system_ct;	/* Count of known systems	     */    struct {        u_short		disk	  :  1;	/* Disk CLASSB if true, else tape    */        u_short		init_done :  1;	/* Driver initialization complete    */        u_short		init_ip   :  1;	/* Driver init. in progress	     */        u_short		need_poll :  1;	/* Need to re-poll for systems	     */        u_short		poll_ip   :  1;	/* System poll in progress	     */        u_short		listen    :  1;	/* SCS listen has been issued	     */        u_short	 		  : 11;	/* Unused			     */    } flags;    CMSB		cmsb;		/* Connection mgmt services block    */    MSB			msb;		/* Maintenance services block	     */} CLASSB;#endif

⌨️ 快捷键说明

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