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