1: /*
2: * Copyright (c) 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: * @(#)hkreg.h 1.1 (2.10BSD Berkeley) 12/1/86
7: */
8:
9: struct hkdevice
10: {
11: short hkcs1; /* control status reg 1 */
12: short hkwc; /* word count */
13: caddr_t hkba; /* bus address */
14: short hkda; /* disk address */
15: short hkcs2; /* control status reg 2 */
16: short hkds; /* drive status */
17: short hker; /* driver error register */
18: short hkatt; /* attention status/offset register */
19: short hkcyl; /* current cylinder register */
20: short hkxmem; /* extended memory address register */
21: short hkdb; /* data buffer register */
22: short hkmr1; /* maint reg 1 */
23: short hkecps; /* burst error bit position */
24: short hkecpt; /* burst error bit pattern */
25: short hkmr2; /* maint reg 2 */
26: short hkmr3; /* maint reg 3 */
27: };
28:
29: /* hkcs1 */
30: #define HK_CCLR 0100000 /* controller clear (also error) */
31: #define HK_CERR HK_CCLR
32: #define HK_DI 0040000 /* drive interrupt */
33: #define HK_DTCPAR 0020000 /* drive to controller parity */
34: #define HK_CFMT 0010000 /* 18 bit word format */
35: #define HK_CTO 0004000 /* controller timeout */
36: #define HK_CDT 0002000 /* drive type (rk07/rk06) */
37: /* bits 9 and 8 are the extended bus address */
38: #define HK_CRDY 0000200 /* controller ready */
39: #define HK_IE 0000100 /* interrupt enable */
40: /* bit 5 is unused */
41: /* bits 4-1 are the function code */
42: #define HK_GO 0000001
43: #define HK_BITS \
44: "\10\20CCLR\17DI\16DTCPAR\15CFMT\14CTO\13CDT\10CRDY\7IE\1GO"
45:
46: /* commands */
47: #define HK_SELECT 000 /* select drive */
48: #define HK_PACK 002 /* pack acknowledge */
49: #define HK_DCLR 004 /* drive clear */
50: #define HK_UNLOAD 006 /* unload */
51: #define HK_START 010 /* start spindle */
52: #define HK_RECAL 012 /* recalibrate */
53: #define HK_OFFSET 014 /* offset */
54: #define HK_SEEK 016 /* seek */
55: #define HK_READ 020 /* read data */
56: #define HK_WRITE 022 /* write data */
57: #define HK_RHDR 026 /* read header */
58: #define HK_WHDR 030 /* write header */
59:
60: /* hkcs2 */
61: #define HKCS2_DLT 0100000 /* data late */
62: #define HKCS2_WCE 0040000 /* write check */
63: #define HKCS2_UPE 0020000 /* UNIBUS parity */
64: #define HKCS2_NED 0010000 /* non-existent drive */
65: #define HKCS2_NEM 0004000 /* non-existent memory */
66: #define HKCS2_PGE 0002000 /* programming error */
67: #define HKCS2_MDS 0001000 /* multiple drive select */
68: #define HKCS2_UFE 0000400 /* unit field error */
69: #define HKCS2_OR 0000200 /* output ready */
70: #define HKCS2_IR 0000100 /* input ready */
71: #define HKCS2_SCLR 0000040 /* subsystem clear */
72: #define HKCS2_BAI 0000020 /* bus address increment inhibit */
73: #define HKCS2_RLS 0000010 /* release */
74: /* bits 2-0 are drive select */
75:
76: #define HKCS2_BITS \
77: "\10\20DLT\17WCE\16UPE\15NED\14NEM\13PGE\12MDS\11UFE\
78: \10OR\7IR\6SCLR\5BAI\4RLS"
79:
80: #define HKCS2_HARD (HKCS2_NED|HKCS2_PGE)
81:
82: /* hkds */
83: #define HKDS_SVAL 0100000 /* status valid */
84: #define HKDS_CDA 0040000 /* current drive attention */
85: #define HKDS_PIP 0020000 /* positioning in progress */
86: /* bit 12 is unused */
87: #define HKDS_WRL 0004000 /* write lock */
88: /* bits 10-9 are unused */
89: #define HKDS_DDT 0000400 /* disk drive type */
90: #define HKDS_DRDY 0000200 /* drive ready */
91: #define HKDS_VV 0000100 /* volume valid */
92: #define HKDS_DROT 0000040 /* drive off track */
93: #define HKDS_SPLS 0000020 /* speed loss */
94: #define HKDS_ACLO 0000010 /* ac low */
95: #define HKDS_OFF 0000004 /* offset mode */
96: /* bit 1 is unused */
97: #define HKDS_DRA 0000001 /* drive available */
98:
99: #define HKDS_DREADY (HKDS_DRA|HKDS_VV|HKDS_DRDY)
100: #define HKDS_BITS \
101: "\10\20SVAL\17CDA\16PIP\14WRL\11DDT\10DRDY\7VV\6DROT\5SPLS\4ACLO\3OFF\1DRA"
102: #define HKDS_HARD (HKDS_ACLO|HKDS_SPLS)
103:
104: /* hker */
105: #define HKER_DCK 0100000 /* data check */
106: #define HKER_UNS 0040000 /* drive unsafe */
107: #define HKER_OPI 0020000 /* operation incomplete */
108: #define HKER_DTE 0010000 /* drive timing error */
109: #define HKER_WLE 0004000 /* write lock error */
110: #define HKER_IDAE 0002000 /* invalid disk address error */
111: #define HKER_COE 0001000 /* cylinder overflow error */
112: #define HKER_HRVC 0000400 /* header vertical redundancy check */
113: #define HKER_BSE 0000200 /* bad sector error */
114: #define HKER_ECH 0000100 /* hard ecc error */
115: #define HKER_DTYE 0000040 /* drive type error */
116: #define HKER_FMTE 0000020 /* format error */
117: #define HKER_DRPAR 0000010 /* control-to-drive parity error */
118: #define HKER_NXF 0000004 /* non-executable function */
119: #define HKER_SKI 0000002 /* seek incomplete */
120: #define HKER_ILF 0000001 /* illegal function */
121:
122: #define HKER_BITS \
123: "\10\20DCK\17UNS\16OPI\15DTE\14WLE\13IDAE\12COE\11HRVC\
124: \10BSE\7ECH\6DTYE\5FMTE\4DRPAR\3NXF\2SKI\1ILF"
125: #define HKER_HARD \
126: (HKER_WLE|HKER_IDAE|HKER_COE|HKER_DTYE|HKER_FMTE|HKER_ILF)
127:
128: /* offset bits in hkas */
129: #define HKAS_P400 0020 /* +400 RK06, +200 RK07 */
130: #define HKAS_M400 0220 /* -400 RK06, -200 RK07 */
131: #define HKAS_P800 0040 /* +800 RK06, +400 RK07 */
132: #define HKAS_M800 0240 /* -800 RK06, -400 RK07 */
133: #define HKAS_P1200 0060 /* +800 RK06, +400 RK07 */
134: #define HKAS_M1200 0260 /* -1200 RK06, -1200 RK07 */
Defined struct's
Defined macros
HK_DI
defined in line
32;
never used
HK_GO
defined in line
42; used 21 times
- in /usr/src/sys/pdpstand/hk.c line
60,
66,
80,
115
- in /usr/src/sys/pdpuba/hk.c line
140,
385,
402,
435,
500,
511,
534,
614-617(2),
629,
636,
672,
724-728(2),
742,
884,
896
HK_IE
defined in line
39; used 9 times
Usage of this include