xref: /csrg-svn/sys/vax/uba/utreg.h (revision 34505)
123358Smckusick /*
229256Smckusick  * Copyright (c) 1982, 1986 Regents of the University of California.
323358Smckusick  * All rights reserved.  The Berkeley software License Agreement
423358Smckusick  * specifies the terms and conditions for redistribution.
523358Smckusick  *
6*34505Skarels  *	@(#)utreg.h	7.2 (Berkeley) 05/26/88
723358Smckusick  */
84742Swnj 
94742Swnj /*
104742Swnj  * System Industries Model 9700 Tape Drive
114742Swnj  *   emulates TU45 on the UNIBUS
124742Swnj  */
134742Swnj 
144764Swnj struct utdevice {
154742Swnj 	u_short	utcs1;		/* control status register 1 */
164742Swnj 	short	utwc;		/* word count register */
174742Swnj 	u_short	utba;		/* low 16-bits of bus address */
184747Sroot 	short	utfc;		/* frame counter */
194742Swnj 	u_short	utcs2;		/* control status register 2 */
204742Swnj 	u_short	utds;		/* drive status register */
214742Swnj 	u_short	uter;		/* error register */
224742Swnj 	u_short	utas;		/* attention status register */
234742Swnj 	u_short	utcc;		/* NRZI CRC character for validation */
244742Swnj 	u_short	utdb;		/* data buffer reg (not emulated) */
254742Swnj 	u_short	utmr;		/* maintenance reg (not emulated) */
264742Swnj 	u_short	utdt;		/* drive type register (not emulated) */
274742Swnj 	u_short	utsn;		/* serial number reg (not emulated) */
284742Swnj 	u_short	uttc;		/* tape control register */
294742Swnj 	u_short	utbae;		/* buffer address extension register */
304742Swnj 	u_short	utcs3;		/* control and status register 3 */
314742Swnj };
324742Swnj 
334742Swnj /*
344742Swnj  * utcs1 --
354742Swnj  *   cmds, interrupt enable, extended address bits, and status
364742Swnj  */
374764Swnj #define	UT_GO		0x0001		/* go bit */
384742Swnj /* function codes reside in bits 5-1 */
394764Swnj #define	UT_NOP		0x0000		/* no operation */
404764Swnj #define	UT_REWOFFL	0x0002		/* rewind offline */
414764Swnj #define	UT_LOOP		0x0004		/* loop read/write */
424764Swnj #define	UT_REW		0x0006		/* rewind */
434764Swnj #define	UT_CLEAR	0x0008		/* drive clear */
444764Swnj #define	UT_SENSE	0x000a		/* drive sense */
454764Swnj #define	UT_PRESET	0x0010		/* read in preset */
464764Swnj #define	UT_DIAGN	0x0012		/* diagnostic mode set */
474764Swnj #define	UT_ERASE	0x0014		/* erase */
484764Swnj #define	UT_WEOF		0x0016		/* write tape mark */
494764Swnj #define	UT_SFORW	0x0018		/* forward space block */
504764Swnj #define	UT_SREV		0x001a		/* reverse space block */
514764Swnj #define	UT_SFORWF	0x001c		/* forward space file */
524764Swnj #define	UT_SREVF	0x001e		/* reverse space file */
534764Swnj #define	UT_WCHFORW	0x0028		/* write check forward */
544764Swnj #define	UT_WCHREV	0x002e		/* write check reverse */
554764Swnj #define	UT_WCOM		0x0030		/* write forward */
564764Swnj #define	UT_RCOM		0x0038		/* read forward */
574764Swnj #define	UT_RREV		0x003e		/* read reverse */
584742Swnj /* the remainder are control and status bits */
594764Swnj #define	UT_IE		0x0040		/* interrupt-enable */
604764Swnj #define	UT_RDY		0x0080		/* controller ready */
614764Swnj #define	UT_EADDR	0x0300		/* extended address bits */
624742Swnj /* bit 10 unused */
634764Swnj #define	UT_DVA		0x0800		/* drive available */
644742Swnj /* bit 12 unused */
654742Swnj /* bit 13 - massbus control parity error not emulated */
664764Swnj #define	UT_TRE		0x4000		/* transfer error */
674764Swnj #define	UT_SC		0x8000		/* special condition */
684742Swnj 
694742Swnj #define	UT_BITS \
704742Swnj "\10\20SC\17TRE\14DVA\10RDY\7IE\1GO"
714742Swnj 
724742Swnj /*
734742Swnj  * utcs2 --
744764Swnj  *   controller clear, error flags, and unit select
754742Swnj  */
764764Swnj /* bits 0-2 are unit select */
774764Swnj #define	UTCS2_BAI	0x0008		/* UNIBUS address increment inhibit */
784764Swnj #define	UTCS2_PAT	0x0010		/* parity test */
794764Swnj #define	UTCS2_CLR	0x0020		/* controller clear */
804764Swnj #define	UTCS2_IR	0x0040		/* input ready (not emulated) */
814764Swnj #define	UTCS2_OR	0x0080		/* output ready (not emulated) */
824764Swnj #define	UTCS2_RPE	0x0100		/* rom parity error */
834764Swnj #define	UTCS2_MXF	0x0200		/* missed transfer */
844764Swnj #define	UTCS2_NEM	0x0400		/* non existant memory */
854764Swnj #define	UTCS2_PGE	0x0800		/* program error */
864764Swnj #define	UTCS2_NED	0x1000		/* non existent drive */
874764Swnj #define	UTCS2_PE	0x2000		/* parity error */
884764Swnj #define	UTCS2_WCE	0x4000		/* write check error */
894764Swnj #define	UTCS2_DLT	0x8000		/* data late */
904742Swnj 
914764Swnj #define	UTCS2_BITS \
92*34505Skarels "\10\20DLT\17WCE\16PE\15NED\14NEM\13PGE\12MXF\11RPE\10OR\7IR\6CLR\5PAT\4BAI"
934742Swnj 
944742Swnj /*
954742Swnj  * utds --
964764Swnj  *   beginning of tape, end of tape, error summary bit, plus lots more
974742Swnj  */
984764Swnj #define	UTDS_SLA	0x0001		/* slave attention */
994764Swnj #define	UTDS_BOT	0x0002		/* beginning of tape */
1004764Swnj #define	UTDS_TM		0x0004		/* tape mark */
1014764Swnj #define	UTDS_IDB	0x0008		/* identification burst */
1024764Swnj #define	UTDS_SDWN	0x0010		/* slowing down */
1034764Swnj #define	UTDS_PES	0x0020		/* phase encode status */
1044764Swnj #define	UTDS_SSC	0x0040		/* slave status change */
1054764Swnj #define	UTDS_DRY	0x0080		/* drive ready */
1064764Swnj #define	UTDS_DPR	0x0100		/* drive present (always 1) */
1074764Swnj #define	UTDS_GCR	0x0200		/* GCR status */
1084764Swnj #define	UTDS_EOT	0x0400		/* end of tape */
1094764Swnj #define	UTDS_WRL	0x0800		/* write lock */
1104764Swnj #define	UTDS_MOL	0x1000		/* medium on line */
1114764Swnj #define	UTDS_PIP	0x2000		/* positioning in progress */
1124764Swnj #define	UTDS_ERR	0x4000		/* composite error */
1134764Swnj #define	UTDS_ATA	0x8000		/* attention active */
1144742Swnj 
1154742Swnj #define	UTDS_BITS \
116*34505Skarels "\10\20ATA\17ERR\16PIP\15MOL\14WRL\13EOT\12GCR\11DPR\10DRY\7SSC\6PES\5SDWN\4IDB\3TM\2BOT\1SLA"
1174742Swnj 
1184742Swnj /*
1194742Swnj  * uter --
1204764Swnj  *   detailed breakdown of error summary bit from cs2
1214742Swnj  */
1224764Swnj #define	UTER_ILF	0x0001		/* illegal function */
1234764Swnj #define	UTER_ILR	0x0002		/* illegal register (always 0) */
1244764Swnj #define	UTER_RMR	0x0004		/* register modification refused */
1254764Swnj #define	UTER_RPE	0x0008		/* read data parity error */
1264764Swnj #define	UTER_FMT	0x0010		/* format error */
1274764Swnj #define	UTER_DPAR	0x0020		/* data bus parity error */
1284764Swnj #define	UTER_INC	0x0040		/* incorrectable data */
1294764Swnj #define	UTER_PEF	0x0080		/* PE format error */
1304764Swnj #define	UTER_NSG	0x0100		/* non standard gap */
1314764Swnj #define	UTER_FCE	0x0200		/* frame count error */
1324764Swnj #define	UTER_CS		0x0400		/* correctable skew */
1334764Swnj #define	UTER_NEF	0x0800		/* non executable function */
1344764Swnj #define	UTER_DTE	0x1000		/* drive timing error */
1354764Swnj #define	UTER_OPI	0x2000		/* operation incomplete */
1364764Swnj #define	UTER_UNS	0x4000		/* unsafe */
1374764Swnj #define	UTER_COR	0x8000		/* correctible data error */
1384742Swnj 
1394747Sroot /*
1404747Sroot  * These errors we consider "hard"; UTER_OPI and UTER_RPE
1414747Sroot  * are considered "soft", at least for the moment.
1424747Sroot  */
1434747Sroot #define	UTER_HARD	(UTER_UNS|UTER_NEF|UTER_DPAR|UTER_FMT|UTER_RMR|\
1444747Sroot 			 UTER_ILR|UTER_ILF)
1454742Swnj 
1464742Swnj #define	UTER_BITS \
147*34505Skarels "\10\20COR\17UNS\16OPI\15DTE\14NEF\13CS\12FCE\11NSG\10PEF\7INC\6DPAR\5FMT\4RPE\3RMR\2ILR\1ILF"
1484742Swnj 
1494742Swnj /*
1504742Swnj  * uttc --
1514764Swnj  *   tape format and density
1524742Swnj  */
1534764Swnj /* bits 0-2 are slave select */
1544764Swnj #define	UTTC_EVPAR	0x0008		/* even parity */
1554764Swnj #define	UTTC_FMT	0x00f0		/* format select (see below) */
1564764Swnj #define	UTTC_DEN	0x0700		/* density select (see below) */
1574742Swnj /* bit 11 not used */
1584764Swnj #define	UTTC_EAODTE	0x1000		/* (not emulated) */
1594764Swnj #define	UTTC_TCW	0x2000		/* tape control write */
1604764Swnj #define	UTTC_FCS	0x4000		/* frame count status */
1614764Swnj #define	UTTC_ACCL	0x8000		/* acceleration */
1624742Swnj 
1634742Swnj /* the bits to stuff in UTTC_DEN */
1644764Swnj #define	UT_NRZI		0x0000		/* 800 bpi code */
1654764Swnj #define	UT_PE		0x0400		/* 1600 bpi code */
1664764Swnj #define	UT_GCR		0x0500		/* 6250 bpi code */
1674742Swnj 
1684742Swnj /* tape formats - only PDP-11 standard is supported */
1694764Swnj #define	PDP11FMT	0x00c0		/* PDP-11 standard */
1704742Swnj 
1714742Swnj #define	b_repcnt  b_bcount
1724742Swnj #define	b_command b_resid
1734747Sroot #define	b_state	  b_active
174