File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / pits / vddc.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:30:31 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21


/*
 *	Definitions for VDDC CONTROLLER operations
 *
*/

#define RETRY		200
#define DELAY(n)	{ register N = 3*(n); while (--N > 0 ); }
 
/*	*****************
	Device parameters
	*****************
*/

#define UDC_BLKLEN	256	/* Block length on UDC */
#define SECTSIZ 	256	/* sector size */
#define BLKSIZ		1024	/* Logical block size */

struct DEVPAR {
	long nocyl;		/* No of cylinders */
	long nohead;		/* No of heads */
	long notraks;		/* No of data surfaces/cyl */
	long secs_trak;		/* No of sectors/track */
	long sector_siz;	/* Sector size */
	char alive;
	char name[3];
};

struct DA {
	long devaddr;		/* device address of controller */
	long intvect;		/* interrupt vector */
	char online;		/* online flag */
};


/*	**********************
	VDDC packet structures
	**********************
*/

struct MDCB {		/* Master DCB : 4 longwords */
	long fdcb_adr;	/* 1st DCB address */
	long dcb_active;/* address of DCB in progress */
	long dcb_int;	/* address of DCB causing interrupt */
	long ctlr_stat;	/* Controller status */
};

struct DCB {		/* DCB structure */
	long nxt_dcb;			/* Address of next DCB */
	unsigned short int_flags;	/* Interrupt,chain flags */
	unsigned short opcode;		/* opcode */
	long dcb_stat;			/* operation status */
	unsigned short unused;
	char dev_sel;			/* Device select */
	char trail_wcnt;		/* Trailer word count */

	long err_memadr;		/* These following fields are not */
	unsigned short unused1;		/* defined in the Manual. */
	unsigned short err_wcount;
	unsigned short err_track;
	unsigned short err_cyl;		/* Up to here !! */

	long trailer[255];		/* Trailer 0-256 longwords */
};
 

/*
**	DCB Command Codes
*/

#define	R_DATA	0x80		/* Read Data */
#define	FTR	0xc0		/* Full Track Read */
#define	RAS	0x90		/* Read and Scatter */
#define	C	0xa0		/* Compare */
#define	FTC	0xe0		/* Full Track Compare */
#define	RHDE	0x180		/* Read Header, Data & ECC (not used) */
#define	W_DATA	0x00		/* Write Data */
#define	FTW	0x40		/* Full Track Write */
#define	WR_COMP	0x20		/* Write Then Compare */
#define	FTWTC	0x60		/* Full Track Write Then Compare */
#define	GAW	0x10		/* Gather and Write */
#define	WDE	0x100		/* Write Data & ECC (not used) */
#define	FORMAT	0x900		/* Format Sector */
#define	GWC	0x30		/* Gather Write & Compare */
#define	START_DR 0x800		/* Start drives */
#define	STOP_DR 0xa00		/* Stop drives */
#define	SEEK	0xb00		/* Seek */
#define	INITIALIZE	0xc00		/* Initialize VDDC */
#define	DIAGNOSE	0xd00		/* Diagnose (self-test) VDDC */
#define	CONFIG	0xe00		/* Reset/Configure VDDC/DDI/Drive(s) */
#define	STATUS   0xf00		/* VDDC Status */
/*
	*************************
	VDDC CONTROLLER PARAMETERS
	*************************
*/
#define IOBASE		0xff000000
/*	DCB longword no. 1 	*/

#define	NO_CHAIN	0

/*	DCB longword no. 2	*/

#define	NOOP		0		/* No-op */
#define	NO_MODIFIER	0x0		/* No modifier */
#define	SGATHER		0x100		/* Scatter gather */
#define	COMPARE		0x200		/* Compare */
#define	NO_INT		0		/* No interrupt */
#define	INT_DONE	1		/* Interrupt when done */
#define	INT_ERROR  	2		/* Interrupt on error */
#define INT_SUCCESS	3		/* Interrupt on success */

/*	DCB longword no. 3 	*/

#define	HARDERR_MASK	0xffffffff	/* Hard error mask */
#define	SOFTERR_MASK	0xffffffff	/* Soft error mask */
#define	DATA_CORRECT	0x100000	/* Controller performed data correct */
#define HARD_ERROR	0x200000	/* Hard error */
#define SOFT_ERROR	0x400000	/* Soft error (retry successful) */
#define	ANY_ERROR	0x800000	/* Any error : bits 20,21,22 set */
#define DCB_ABORT 	0x10000000	/* DCB aborted */
#define	UNSUCCESS	0x20000000	/* Unsuccessful completion */
#define	DCB_DONE	0x40000000	/* DCB completed */
#define	DCB_STARTED	0x80000000
#define	INVL_CMD	writes("\ninvalid command\n")

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.