xref: /original-bsd/sys/vax/uba/tmreg.h (revision 21e966f2)
1 /*
2  * Copyright (c) 1982, 1986 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)tmreg.h	7.1 (Berkeley) 06/05/86
7  */
8 
9 /*
10  * TM11 controller registers
11  */
12 struct tmdevice {
13 	u_short	tmer;		/* error register, per drive */
14 	u_short	tmcs;		/* control-status register */
15 	short	tmbc;		/* byte/frame count */
16 	u_short tmba;		/* address */
17 	short	tmdb;		/* data buffer */
18 	short	tmrd;		/* read lines */
19 	short	tmmr;		/* maintenance register */
20 #ifdef	AVIV
21 	short	tmfsr;		/* formatter status reading */
22 #endif
23 };
24 
25 #define	b_repcnt  b_bcount
26 #define	b_command b_resid
27 
28 /* bits in tmcs */
29 #define	TM_GO		0000001
30 #define	TM_OFFL		0000000		/* offline */
31 #define	TM_RCOM		0000002		/* read */
32 #define	TM_WCOM		0000004		/* write */
33 #define	TM_WEOF		0000006		/* write-eof */
34 #define	TM_SFORW	0000010		/* space forward */
35 #define	TM_SREV		0000012		/* space backwards */
36 #define	TM_WIRG		0000014		/* write with xtra interrecord gap */
37 #define	TM_REW		0000016		/* rewind */
38 #define	TM_SENSE	TM_IE		/* sense (internal to driver) */
39 
40 #define	tmreverseop(cmd)		((cmd)==TM_SREV || (cmd)==TM_REW)
41 
42 /* TM_SNS is a pseudo-op used to get tape status */
43 #define	TM_IE		0000100		/* interrupt enable */
44 #define	TM_CUR		0000200		/* control unit is ready */
45 #define	TM_DCLR		0010000		/* drive clear */
46 #define	TM_D800		0060000		/* select 800 bpi density */
47 #define	TM_ERR		0100000		/* drive error summary */
48 
49 /* bits in tmer */
50 #define	TMER_ILC	0100000		/* illegal command */
51 #define	TMER_EOF	0040000		/* end of file */
52 #define	TMER_CRE	0020000		/* cyclic redundancy error */
53 #define	TMER_PAE	0010000		/* parity error */
54 #define	TMER_BGL	0004000		/* bus grant late */
55 #define	TMER_EOT	0002000		/* at end of tape */
56 #define	TMER_RLE	0001000		/* record length error */
57 #define	TMER_BTE	0000400		/* bad tape error */
58 #define	TMER_NXM	0000200		/* non-existant memory */
59 #define	TMER_SELR	0000100		/* tape unit properly selected */
60 #define	TMER_BOT	0000040		/* at beginning of tape */
61 #define	TMER_CH7	0000020		/* 7 channel tape */
62 #define	TMER_SDWN	0000010		/* gap settling down */
63 #define	TMER_WRL	0000004		/* tape unit write protected */
64 #define	TMER_RWS	0000002		/* tape unit rewinding */
65 #define	TMER_TUR	0000001		/* tape unit ready */
66 
67 #define	TMER_BITS	\
68 "\10\20ILC\17EOF\16CRE\15PAE\14BGL\13EOT\12RLE\11BTE\10NXM\
69 \7SELR\6BOT\5CH7\4SDWN\3WRL\2RWS\1TUR"
70 
71 #define	TMER_HARD	(TMER_ILC|TMER_EOT)
72 #define	TMER_SOFT	(TMER_CRE|TMER_PAE|TMER_BGL|TMER_RLE|TMER_BTE|TMER_NXM)
73 
74 #ifdef	AVIV
75 /* bits in tmmr (formatter diagnostic reading) */
76 #define	DTS		000000		/* select dead track status */
77 #   define	DTS_MASK	0xff
78 
79 #define	DAB		010000		/* select diagnostic aid bits */
80 #   define  DAB_MASK		037	/* reject code only */
81 
82 #define	RWERR		020000		/* select read-write errors */
83 #    define RWERR_MASK		01777	/* include bit 9 (MAI) */
84 #    define RWERR_BITS \
85 "\10\12MAI\11CRC ERR\10WTMCHK\7UCE\6PART REC\5MTE\3END DATA CHK\
86 \2VEL ERR\1DIAG MODE"
87 
88 #define	DRSENSE		030000		/* select drive sense */
89 #    define DRSENSE_MASK	0777
90 #    define DRSENSE_BITS \
91 "\10\11WRTS\10EOTS\7BOTS\6WNHB\5PROS\4BWDS\3HDNG\2RDYS\1ON LINE"
92 
93 #define	CRCF		040000		/* CRC-F Generator */
94 
95 #define	FSR_BITS \
96 "\10\20REJ\17TMS\16OVRN\15DATACHK\14SSC\13EOTS\12WRTS\11ROMPS\10CRERR\
97 \7ONLS\6BOTS\5HDENS\4BUPER\3FPTS\2REWS\1RDYS"
98 #endif	AVIV
99