BSD 4_1_snap development
[unix-history] / sys / h / htreg.h
CommitLineData
ed2fb048
C
1/* htreg.h 4.1 81/03/21 */
2
3struct htdevice
4{
5 int htcs1; /* control status register */
6 int htds; /* drive status register */
7 int hter; /* error register */
8 int htmr; /* maintenance register */
9 int htas; /* attention status register */
10 int htfc; /* frame counter */
11 int htdt; /* drive type register */
12 int htck; /* nrzi check (crc) error character */
13 int htsn; /* serial number register */
14 int httc; /* tape controll register */
15};
16
17/* htcs1 */
18#define HT_GO 000001 /* go bit */
19#define HT_SENSE 000000 /* no operations (sense) */
20#define HT_REWOFFL 000002 /* rewind offline */
21#define HT_REW 000006 /* rewind */
22#define HT_DCLR 000010 /* drive clear */
23#define HT_RIP 000020 /* read in preset */
24#define HT_ERASE 000024 /* erase */
25#define HT_WEOF 000026 /* write tape mark */
26#define HT_SFORW 000030 /* space forward */
27#define HT_SREV 000032 /* space reverse */
28#define HT_WCHFWD 000050 /* write check forward */
29#define HT_WCHREV 000056 /* write check reverse */
30#define HT_WCOM 000060 /* write forward */
31#define HT_RCOM 000070 /* read forward */
32#define HT_RREV 000076 /* read reverse */
33
34/* htds */
35#define HTDS_ATA 0100000 /* attention active */
36#define HTDS_ERR 0040000 /* composite error */
37#define HTDS_PIP 0020000 /* positioning in progress */
38#define HTDS_MOL 0010000 /* medium on line */
39#define HTDS_WRL 0004000 /* write lock */
40#define HTDS_EOT 0002000 /* end of tape */
41/* bit 9 is unused */
42#define HTDS_DPR 0000400 /* drive present (always 1) */
43#define HTDS_DRY 0000200 /* drive ready */
44#define HTDS_SSC 0000100 /* slave status change */
45#define HTDS_PES 0000040 /* phase-encoded status */
46#define HTDS_SDWN 0000020 /* settle down */
47#define HTDS_IDB 0000010 /* identification burst */
48#define HTDS_TM 0000004 /* tape mark */
49#define HTDS_BOT 0000002 /* beginning of tape */
50#define HTDS_SLA 0000001 /* slave attention */
51
52#define HTDS_BITS \
53"\10\20ATA\17ERR\16PIP\15MOL\14WRL\13EOT\11DPR\10DRY\
54\7SSC\6PES\5SDWN\4IDB\3TM\2BOT\1SLA"
55
56/* hter */
57#define HTER_CORCRC 0100000 /* correctible data or ecc */
58#define HTER_UNS 0040000 /* unsafe */
59#define HTER_OPI 0020000 /* operation incomplete */
60#define HTER_DTE 0010000 /* drive timing error */
61#define HTER_NEF 0004000 /* non-executable function */
62#define HTER_CSITM 0002000 /* correctable skew/illegal tape mark */
63#define HTER_FCE 0001000 /* frame count error */
64#define HTER_NSG 0000400 /* non-standard gap */
65#define HTER_PEFLRC 0000200 /* format error or lrc error */
66#define HTER_INCVPE 0000100 /* incorrectable data error or vertical
67 parity error */
68#define HTER_DPAR 0000040 /* data parity error */
69#define HTER_FMT 0000020 /* format error */
70#define HTER_CPAR 0000010 /* control bus parity error */
71#define HTER_RMR 0000004 /* register modification refused */
72#define HTER_ILR 0000002 /* illegal register */
73#define HTER_ILF 0000001 /* illegal function */
74
75#define HTER_BITS \
76"\10\20CORCRC\17UNS\16OPI\15DTE\14NEF\13CSITM\12FCE\11NSG\10PEFLRC\
77\7INCVPE\6DPAR\5FMT\4CPAR\3RMR\2ILR\1ILF"
78#define HTER_HARD \
79 (HTER_UNS|HTER_OPI|HTER_NEF|HTER_DPAR|HTER_FMT|HTER_CPAR| \
80 HTER_RMR|HTER_ILR|HTER_ILF)
81
82/* htdt */
83#define HTDT_NSA 0100000 /* not sector addressed; always 1 */
84#define HTDT_TAP 0040000 /* tape; always 1 */
85#define HTDT_MOH 0020000 /* moving head; always 0 */
86#define HTDT_7CH 0010000 /* 7 channel; always 0 */
87#define HTDT_DRQ 0004000 /* drive requested; always 0 */
88#define HTDT_SPR 0002000 /* slave present */
89/* bit 9 is spare */
90/* bits 8-0 are formatter/transport type */
91
92/* httc */
93#define HTTC_ACCL 0100000 /* transport is not reading/writing */
94#define HTTC_FCS 0040000 /* frame count status */
95#define HTTC_SAC 0020000 /* slave address change */
96#define HTTC_EAODTE 0010000 /* enable abort on data xfer errors */
97/* bits 8-10 are density select */
98#define HTTC_800BPI 0001400 /* in bits 8-10, dens=1600 */
99#define HTTC_1600BPI 0002000 /* in bits 8-10, dens=800 */
100/* bits 4-7 are format select */
101#define HTTC_PDP11 0000300 /* in bits 4-7, pdp11 normal format */
102#define HTTC_EVEN 0000010 /* select even parity */
103/* bits 0 - 2 are slave select */
104
105#define b_repcnt b_bcount
106#define b_command b_resid