1 #ifndef _QIC117_H
2 #define _QIC117_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 #define QIC_RESET 1
62 #define QIC_REPORT_NEXT_BIT 2
63 #define QIC_PAUSE 3
64 #define QIC_MICRO_STEP_PAUSE 4
65 #define QIC_ALTERNATE_TIMEOUT 5
66 #define QIC_REPORT_DRIVE_STATUS 6
67 #define QIC_REPORT_ERROR_CODE 7
68 #define QIC_REPORT_DRIVE_CONFIGURATION 8
69 #define QIC_REPORT_ROM_VERSION 9
70 #define QIC_LOGICAL_FORWARD 10
71 #define QIC_PHYSICAL_REVERSE 11
72 #define QIC_PHYSICAL_FORWARD 12
73 #define QIC_SEEK_HEAD_TO_TRACK 13
74 #define QIC_SEEK_LOAD_POINT 14
75 #define QIC_ENTER_FORMAT_MODE 15
76 #define QIC_WRITE_REFERENCE_BURST 16
77 #define QIC_ENTER_VERIFY_MODE 17
78 #define QIC_STOP_TAPE 18
79
80 #define QIC_MICRO_STEP_HEAD_UP 21
81 #define QIC_MICRO_STEP_HEAD_DOWN 22
82 #define QIC_SOFT_SELECT 23
83 #define QIC_SOFT_DESELECT 24
84 #define QIC_SKIP_REVERSE 25
85 #define QIC_SKIP_FORWARD 26
86 #define QIC_SELECT_RATE 27
87
88 #define QIC_ENTER_DIAGNOSTIC_1 28
89 #define QIC_ENTER_DIAGNOSTIC_2 29
90 #define QIC_ENTER_PRIMARY_MODE 30
91
92 #define QIC_REPORT_VENDOR_ID 32
93 #define QIC_REPORT_TAPE_STATUS 33
94 #define QIC_SKIP_EXTENDED_REVERSE 34
95 #define QIC_SKIP_EXTENDED_FORWARD 35
96 #define QIC_CALIBRATE_TAPE_LENGTH 36
97 #define QIC_REPORT_FORMAT_SEGMENTS 37
98 #define QIC_SET_FORMAT_SEGMENTS 38
99
100 #define QIC_PHANTOM_SELECT 46
101 #define QIC_PHANTOM_DESELECT 47
102
103 typedef enum {
104 discretional = 0, required, ccs1, ccs2
105 } qic_compatibility;
106
107 typedef enum {
108 unused, mode, motion, report
109 } command_types;
110
111 struct qic117_command_table {
112 char *name;
113 byte mask;
114 byte state;
115 byte cmd_type;
116 byte non_intr;
117 byte level;
118 };
119
120 #define QIC117_COMMANDS {\
121 \
122 \
123 \
124 {NULL, 0x00, 0x00, mode, 0, discretional},\
125 {"soft reset", 0x00, 0x00, motion, 1, required},\
126 {"report next bit", 0x00, 0x00, report, 0, required},\
127 {"pause", 0x36, 0x24, motion, 1, required},\
128 {"micro step pause", 0x36, 0x24, motion, 1, required},\
129 {"alternate command timeout", 0x00, 0x00, mode, 0, required},\
130 {"report drive status", 0x00, 0x00, report, 0, required},\
131 {"report error code", 0x01, 0x01, report, 0, required},\
132 {"report drive configuration",0x00, 0x00, report, 0, required},\
133 {"report rom version", 0x00, 0x00, report, 0, required},\
134 {"logical forward", 0x37, 0x25, motion, 0, required},\
135 {"physical reverse", 0x17, 0x05, motion, 0, required},\
136 {"physical forward", 0x17, 0x05, motion, 0, required},\
137 {"seek head to track", 0x37, 0x25, motion, 0, required},\
138 {"seek load point", 0x17, 0x05, motion, 1, required},\
139 {"enter format mode", 0x1f, 0x05, mode, 0, required},\
140 {"write reference burst", 0x1f, 0x05, motion, 1, required},\
141 {"enter verify mode", 0x37, 0x25, mode, 0, required},\
142 {"stop tape", 0x00, 0x00, motion, 1, required},\
143 {"reserved (19)", 0x00, 0x00, unused, 0, discretional},\
144 {"reserved (20)", 0x00, 0x00, unused, 0, discretional},\
145 {"micro step head up", 0x02, 0x00, motion, 0, required},\
146 {"micro step head down", 0x02, 0x00, motion, 0, required},\
147 {"soft select", 0x00, 0x00, mode, 0, discretional},\
148 {"soft deselect", 0x00, 0x00, mode, 0, discretional},\
149 {"skip segments reverse", 0x36, 0x24, motion, 1, required},\
150 {"skip segments forward", 0x36, 0x24, motion, 1, required},\
151 {"select rate [or format]", 0x03, 0x01, mode, 0, required },\
152 {"enter diag mode 1", 0x00, 0x00, mode, 0, discretional},\
153 {"enter diag mode 2", 0x00, 0x00, mode, 0, discretional},\
154 {"enter primary mode", 0x00, 0x00, mode, 0, required},\
155 {"vendor unique (31)", 0x00, 0x00, unused, 0, discretional},\
156 {"report vendor id", 0x00, 0x00, report, 0, required},\
157 {"report tape status", 0x04, 0x04, report, 0, ccs1},\
158 {"skip extended reverse", 0x36, 0x24, motion, 1, ccs1},\
159 {"skip extended forward", 0x36, 0x24, motion, 1, ccs1},\
160 {"calibrate tape length", 0x17, 0x05, motion, 1, ccs2},\
161 {"report format segments", 0x17, 0x05, report, 0, ccs2},\
162 {"set format segments", 0x17, 0x05, mode, 0, ccs2},\
163 {"reserved (39)", 0x00, 0x00, unused, 0, discretional},\
164 {"vendor unique (40)", 0x00, 0x00, unused, 0, discretional},\
165 {"vendor unique (41)", 0x00, 0x00, unused, 0, discretional},\
166 {"vendor unique (42)", 0x00, 0x00, unused, 0, discretional},\
167 {"vendor unique (43)", 0x00, 0x00, unused, 0, discretional},\
168 {"vendor unique (44)", 0x00, 0x00, unused, 0, discretional},\
169 {"vendor unique (45)", 0x00, 0x00, unused, 0, discretional},\
170 {"phantom select", 0x00, 0x00, mode, 0, discretional},\
171 {"phantom deselect", 0x00, 0x00, mode, 0, discretional},\
172 }
173
174
175
176
177
178 #define QIC_STATUS_READY 0x01
179 #define QIC_STATUS_ERROR 0x02
180
181 #define QIC_STATUS_CARTRIDGE_PRESENT 0x04
182 #define QIC_STATUS_WRITE_PROTECT 0x08
183 #define QIC_STATUS_NEW_CARTRIDGE 0x10
184
185 #define QIC_STATUS_REFERENCED 0x20
186
187 #define QIC_STATUS_AT_BOT 0x40
188
189 #define QIC_STATUS_AT_EOT 0x80
190
191
192
193
194
195 #define QIC_CONFIG_RATE_MASK 0x18
196 #define QIC_CONFIG_RATE_SHIFT 3
197 #define QIC_CONFIG_RATE_250 0
198 #define QIC_CONFIG_RATE_500 2
199 #define QIC_CONFIG_RATE_1000 3
200 #define QIC_CONFIG_RATE_2000 1
201
202 #define QIC_CONFIG_LONG 0x40
203 #define QIC_CONFIG_80 0x80
204
205
206
207
208
209 #define QIC_TAPE_STD_MASK 0x0f
210 #define QIC_TAPE_QIC40 0x01
211 #define QIC_TAPE_QIC80 0x02
212 #define QIC_TAPE_QIC3020 0x03
213 #define QIC_TAPE_QIC3010 0x04
214
215 #define QIC_TAPE_LEN_MASK 0x70
216 #define QIC_TAPE_205FT 0x10
217 #define QIC_TAPE_307FT 0x20
218 #define QIC_TAPE_400FT 0x30
219 #define QIC_TAPE_1100FT 0x40
220 #define QIC_TAPE_FLEX 0x60
221
222 #define QIC_TAPE_WIDE 0x80
223
224
225
226
227
228 typedef struct {
229 char *message;
230 int fatal;
231 } ftape_error;
232
233 #define QIC117_ERRORS {\
234 { "No error", 0, },\
235 { "Command Received while Drive Not Ready", 0, },\
236 { "Cartridge Not Present or Removed", 1, },\
237 { "Motor Speed Error (not within 1%)", 1, },\
238 { "Motor Speed Fault (jammed, or gross speed error", 1, },\
239 { "Cartridge Write Protected", 1, },\
240 { "Undefined or Reserved Command Code", 1, },\
241 { "Illegal Track Address Specified for Seek", 1, },\
242 { "Illegal Command in Report Subcontext", 0, },\
243 { "Illegal Entry into a Diagnostic Mode", 1, },\
244 { "Broken Tape Detected (based on hole sensor)", 1, },\
245 { "Warning--Read Gain Setting Error", 1, },\
246 { "Command Received While Error Status Pending (obs)", 1, },\
247 { "Command Received While New Cartridge Pending", 1, },\
248 { "Command Illegal or Undefined in Primary Mode", 1, },\
249 { "Command Illegal or Undefined in Format Mode", 1, },\
250 { "Command Illegal or Undefined in Verify Mode", 1, },\
251 { "Logical Forward Not a Logical BOT or no Format Segments in Format Mode", 1, },\
252 { "Logical EOT Before All Segments generated", 1, },\
253 { "Command Illegal When Cartridge Not Referenced", 1, },\
254 { "Self-Diagnostic Failed (cannot be cleared)", 1, },\
255 { "Warning EEPROM Not Initialized, Defaults Set", 1, },\
256 { "EEPROM Corrupted or Hardware Failure", 1, },\
257 { "Motion Time-out Error", 1, },\
258 { "Data Segment Too Long -- Logical Forward or Pause", 1, },\
259 { "Transmit Overrun (obs)", 1, },\
260 { "Power On Reset Occurred", 0, },\
261 { "Software Reset Occurred", 0, },\
262 { "Diagnostic Mode 1 Error", 1, },\
263 { "Diagnostic Mode 2 Error", 1, },\
264 { "Command Received During Non-Interruptable Process", 1, },\
265 { "Rate or Format Selection Error", 1, },\
266 { "Illegal Command While in High Speed Mode", 1, },\
267 { "Illegal Seek Segment Value", 1, },\
268 { "Invalid Media", 1, },\
269 { "Head Positioning Failure", 1, },\
270 { "Write Reference Burst Failure", 1, },\
271 { "Prom Code Missing", 1, },\
272 { "Invalid Format", 1, },\
273 { "EOT/BOT System Failure", 1, },\
274 { "Prom A Checksum Error", 1, },\
275 { "Drive Wakeup Reset Occurred", 1, },\
276 { "Prom B Checksum Error", 1, },\
277 { "Illegal Entry into Format Mode", 1, },\
278 }
279
280 #endif