1
2
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 #define AMI_MAX_PDRIVES (75)
31 #define AMI_MAX_LDRIVES 8
32 #define AMI_MAX_SPANDEPTH 4
33 #define AMI_MAX_DEVDEPTH 8
34 #define AMI_MAX_TARGET 16
35
36 #define AMI_BIG_MAX_PDRIVES (256)
37 #define AMI_BIG_MAX_LDRIVES 40
38 #define AMI_BIG_MAX_SPANDEPTH 8
39 #define AMI_BIG_MAX_DEVDEPTH 32
40
41 #define AMI_MAXCMDS 126
42 #define AMI_SECTOR_SIZE 512
43 #define AMI_MAXOFFSETS 26
44 #define AMI_SGEPERCMD 32
45 #define AMI_MAX_BUSYWAIT 10
46 #define AMI_MAX_POLLWAIT 1000000
47 #define AMI_MAXIOCTLCMDS 1
48 #define AMI_MAXPROCS 2
49 #define AMI_MAXRAWCMDS 2
50
51 #define AMI_MAXFER (AMI_MAXOFFSETS * PAGE_SIZE)
52
53 #define AMI_QIDB 0x20
54 #define AMI_QIDB_EXEC 0x01
55 #define AMI_QIDB_ACK 0x02
56 #define AMI_QODB 0x2c
57 #define AMI_QODB_READY 0x10001234
58
59 #define AMI_SCMD 0x10
60 #define AMI_SCMD_EXEC 0x10
61 #define AMI_SCMD_ACK 0x08
62 #define AMI_SMBSTAT 0x10
63 #define AMI_SMBST_BUSY 0x10
64 #define AMI_SIEM 0x11
65 #define AMI_SEIM_ENA 0xc0
66 #define AMI_SMBADDR 0x14
67 #define AMI_SMBENA 0x18
68 #define AMI_ISTAT 0x1a
69 #define AMI_ISTAT_PEND 0x40
70
71
72 #define AMI_READ 0x01
73 #define AMI_WRITE 0x02
74 #define AMI_PASSTHRU 0x03
75 #define AMI_EINQUIRY 0x04
76 #define AMI_INQUIRY 0x05
77 #define AMI_CHSTATE 0x06
78 #define AMI_STATE_ON 3
79 #define AMI_STATE_FAIL 4
80 #define AMI_STATE_SPARE 6
81 #define AMI_RCONFIG 0x07
82 #define AMI_REBUILDPD 0x08
83 #define AMI_CHECK 0x09
84 #define AMI_FLUSH 0x0a
85 #define AMI_ILDRIVE 0x0b
86 #define AMI_EINQUIRY3 0x0c
87 #define AMI_DCHDR 0x14
88 #define AMI_GRBLDPROGR 0x18
89 #define AMI_GCHECKPROGR 0x19
90 #define AMI_GILDRPROGR 0x1b
91 #define AMI_WRCONFIG 0x20
92 #define AMI_RWRCONFIG 0x21
93 #define AMI_RRDCONFIG 0x22
94 #define AMI_GRBLDRATE 0x23
95 #define AMI_SRBLDRATE 0x24
96 #define AMI_UPLDCFGUT 0x25
97 #define AMI_UPLDRVPROP 0x26
98 #define AMI_ABRTREBLD 0x28
99 #define AMI_ABRTCHECK 0x29
100 #define AMI_ABRTILDRV 0x2b
101 #define AMI_WRBLOCK 0x2c
102 #define AMI_PRGFLASH 0x2d
103 #define AMI_SFLUSHINTV 0x2e
104 #define AMI_PCHIPSETVAL 0x2f
105 #define AMI_CS_NEPTUNE 0x61
106 #define AMI_CS_OTHER 0xe1
107 #define AMI_CS_TRITON 0xe2
108 #define AMI_SNEG 0x30
109 #define AMI_SNEG_GET 1
110 #define AMI_SNEG_SET 2
111 #define AMI_QTAG 0x31
112 #define AMI_QTAG_GET 1
113 #define AMI_QTAG_SET 2
114 #define AMI_GSUPARAM 0x32
115 #define AMI_SSUPARAM 0x33
116 #define AMI_GDROAMINFO 0x34
117 #define AMI_GMACHID 0x36
118 #define AMI_BIOSPDATA 0x40
119 #define AMI_I2OCFGDLG 0x41
120 #define AMI_GCACHESTAT 0x50
121 #define AMI_SPEAKER 0x51
122 #define AMI_SPKR_OFF 0
123 #define AMI_SPKR_ON 1
124 #define AMI_SPKR_SHUT 2
125 #define AMI_SPKR_GVAL 3
126 #define AMI_SPKR_TEST 4
127 #define AMI_GDUMP 0x52
128 #define AMI_SENSEDUMPA 0x53
129 #define AMI_STDIAG 0x54
130 #define AMI_FRAID_PF 0x55
131 #define AMI_GFRAIDPF 1
132 #define AMI_SFRAIDPF 2
133 #define AMI_FRAIDVS 0x56
134 #define AMI_GFRAIDVS 1
135 #define AMI_SFRAIDVS 2
136 #define AMI_BBMANAGE 0x57
137 #define AMI_RECONSTRUCT 0x60
138 #define AMI_GRECONSTRUCT 0x61
139 #define AMI_BIOSSTAT 0x62
140 #define AMI_RDCFGDSK 0x63
141 #define AMI_AREBUILD 0x64
142 #define AMI_GUCAP 1
143 #define AMI_SUCAP 2
144 #define AMI_GARBLD 3
145 #define AMI_SARBLD 4
146 #define AMI_GFCC 5
147 #define AMI_SFCC 6
148 #define AMI_GCUCAP 7
149 #define AMI_SCUCAP 8
150 #define AMI_SFD 0x66
151 #define AMI_RDCONFIG8 0x67
152 #define AMI_WRCONFIG8 0x68
153 #define AMI_ESENSEDUMPA 0x69
154 #define AMI_RERRC 0x6a
155 #define AMI_BOOTUP 0x6b
156 #define AMI_ENCLOSURE 0x6c
157 #define AMI_WRCFGD 0x6c
158 #define AMI_HAPIRRLD 0x6e
159 #define AMI_LDRVRIGHTS 0x6f
160 #define AMI_CLUSTERING 0x70
161 #define AMI_GCHPROP 0x71
162 #define AMI_SCHTERM 0x72
163 #define AMI_TERM_DISABLE 0
164 #define AMI_TERM_ENABLE 1
165 #define AMI_TERM_HIGH 2
166 #define AMI_TERM_WIDE 3
167 #define AMI_TERM_DFLT 16
168 #define AMI_QUIETCH 0x73
169 #define AMI_ACTIVATECH 0x74
170 #define AMI_STARTU 0x75
171 #define AMI_STARTU_SYNC 1
172 #define AMI_STARTU_ASYN 2
173 #define AMI_STOPU 0x76
174 #define AMI_GERRC 0x77
175 #define AMI_GBTDS 0x78
176 #define AMI_FMTPROG 0x79
177 #define AMI_RCAPCMD 0x7a
178 #define AMI_WRCRX 0x7b
179 #define AMI_RDCRX 0x7c
180 #define AMI_GINID 0x7d
181 #define AMI_HAPICMD 0x7e
182 #define AMI_SINID 0x7f
183 #define AMI_SMARTMSEL 0x80
184 #define AMI_SPSTARTU 0x85
185 #define AMI_NVFAILHIST 0x90
186 #define AMI_DCMDABRT 0x91
187 #define AMI_GDRIVEHIST 0x92
188 #define AMI_GESENSE 0x93
189 #define AMI_ADAPTER 0x95
190 #define AMI_ADP_SAVE 0
191 #define AMI_ADP_LOAD 1
192 #define AMI_RESET 0x96
193 #define AMI_PRGCLASS 0x97
194 #define AMI_UPHTML 0x98
195 #define AMI_NEWCFG 0x99
196 #define AMI_NEWOP 0xa0
197 #define AMI_FCOP 0xa1
198 #define AMI_FC_PROCEED 0x02
199 #define AMI_FC_DELLDRV 0x03
200 #define AMI_FC_RDCONF 0x04
201 #define AMI_FC_RDFCONF 0x05
202 #define AMI_FC_GCONFDSK 0x06
203 #define AMI_FC_CHLDNO 0x07
204 #define AMI_FC_CMPCTCFG 0x08
205 #define AMI_FC_DRVGRP 0x09
206 #define AMI_FC_GLOOPINF 0x0a
207 #define AMI_FC_CHLOOPID 0x0b
208 #define AMI_FC_GNSCH 0x0c
209 #define AMI_FC_WRCONF 0x0d
210 #define AMI_FC_PRODINF 0x0e
211 #define AMI_FC_EINQ3 0x0f
212 #define AMI_FC_EINQ4 0x1f
213 #define AMI_FC_EINQ3_SOLICITED_NOTIFY 0x01
214 #define AMI_FC_EINQ3_SOLICITED_FULL 0x02
215 #define AMI_FC_EINQ3_UNSOLICITED 0x03
216 #define AMI_MISC 0xa4
217 #define AMI_GET_BGI 0x13
218 #define AMI_GET_IO_CMPL 0x5b
219 #define AMI_SET_IO_CMPL 0x5c
220 #define AMI_CHFUNC 0xa9
221 #define AMI_MANAGE 0xb0
222 #define AMI_MGR_LUN 0x00
223 #define AMI_MGR_THERM 0x01
224 #define AMI_MGR_EEPROM 0x02
225 #define AMI_MGR_LDNAMES 0x03
226 #define AMI_MGR_FCWWN 0x04
227 #define AMI_MGR_CFGACC 0x05
228 #define AMI_HSPDIAG 0xb1
229 #define AMI_GESENSEINFO 0xb2
230 #define AMI_SYSFLUSH 0xfe
231
232
233 struct ami_iocmd {
234 u_int8_t acc_cmd;
235 u_int8_t acc_id;
236 union {
237 #define acc_mbox _._ami_mbox
238 struct {
239 u_int16_t amb_nsect;
240 u_int32_t amb_lba;
241 u_int32_t amb_data;
242 u_int8_t amb_ldn;
243 u_int8_t amb_nsge;
244 u_int8_t amb_reserved;
245 } __packed _ami_mbox;
246
247 #define acc_io _._ami_io
248 struct {
249 u_int8_t aio_channel;
250 u_int8_t aio_param;
251 u_int8_t aio_pad[4];
252 u_int32_t aio_data;
253 u_int8_t aio_pad1[3];
254 } __packed _ami_io;
255
256 #define acc_passthru _._ami_passthru
257 struct {
258 u_int16_t apt_dummy0;
259 u_int32_t apt_dummy1;
260 u_int32_t apt_data;
261 u_int8_t apt_dummy2;
262 u_int8_t apt_dummy3;
263 u_int8_t apt_reserved;
264 } __packed _ami_passthru;
265
266 #define acc_ldrv _._ami_ldrv
267 struct {
268 u_int16_t ald_dummy0;
269 u_int32_t ald_dummy1;
270 u_int32_t ald_data;
271 u_int8_t ald_ldrv;
272 u_int8_t ald_dummy2;
273 u_int8_t ald_reserved;
274 } __packed _ami_ldrv;
275 } __packed _;
276 u_int8_t acc_busy;
277 u_int8_t acc_nstat;
278 u_int8_t acc_status;
279 #define AMI_MAXSTATACK 0x2e
280 u_int8_t acc_cmplidl[AMI_MAXSTATACK];
281 u_int8_t acc_poll;
282 u_int8_t acc_ack;
283 u_int8_t acc_pad[0x3e];
284 } __packed;
285
286 struct ami_sgent {
287 u_int32_t asg_addr;
288 u_int32_t asg_len;
289 } __packed;
290
291 struct ami_iocmd64 {
292 u_int8_t acc_cmd;
293 u_int8_t acc_id;
294 union {
295 struct {
296 u_int16_t amb_nsect;
297 u_int32_t amb_lba;
298 u_int32_t amb_reserved1;
299 u_int8_t amb_ldn;
300 u_int8_t amb_nsge;
301 u_int8_t amb_reserved;
302 } __packed _ami_mbox;
303
304 struct {
305 u_int8_t aio_channel;
306 u_int8_t aio_param;
307 u_int8_t aio_pad[4];
308 u_int32_t aio_data;
309 u_int8_t aio_pad1[3];
310 } __packed _ami_io;
311
312 struct {
313 u_int16_t apt_dummy0;
314 u_int32_t apt_dummy1;
315 u_int32_t apt_data;
316 u_int8_t apt_dummy2;
317 u_int8_t apt_dummy3;
318 u_int8_t apt_reserved;
319 } __packed _ami_passthru;
320
321 struct {
322 u_int16_t ald_dummy0;
323 u_int32_t ald_dummy1;
324 u_int32_t ald_data;
325 u_int8_t ald_ldrv;
326 u_int8_t ald_dummy2;
327 u_int8_t ald_reserved;
328 } __packed _ami_ldrv;
329 } __packed _;
330 u_int8_t acc_busy;
331 u_int32_t acc_data_l;
332 u_int32_t acc_data_h;
333 u_int32_t acc_reserved;
334 u_int8_t acc_nstat;
335 u_int8_t acc_status;
336 u_int8_t acc_cmplidl[AMI_MAXSTATACK];
337 u_int8_t acc_poll;
338 u_int8_t acc_ack;
339 u_int8_t acc_pad[0x32];
340 } __packed;
341
342 struct ami_sgent64 {
343 u_int32_t asg_addr_l;
344 u_int32_t asg_addr_h;
345 u_int32_t asg_len;
346 } __packed;
347
348 struct ami_passthrough {
349 u_int8_t apt_param;
350 #define AMI_PTPARAM(t,a,l) (((l) << 7) | (((a) & 1) << 3) | ((t) & 3))
351 #define AMI_TIMEOUT_6 0
352 #define AMI_TIMEOUT_60 1
353 #define AMI_TIMEOUT_10m 2
354 #define AMI_TIMEOUT_3h 3
355 u_int8_t apt_ldn;
356 u_int8_t apt_channel;
357 u_int8_t apt_target;
358 u_int8_t apt_qtag;
359 u_int8_t apt_qact;
360 #define AMI_MAX_CDB 10
361 u_int8_t apt_cdb[AMI_MAX_CDB];
362 u_int8_t apt_ncdb;
363 u_int8_t apt_nsense;
364 #define AMI_MAX_SENSE 32
365 u_int8_t apt_sense[AMI_MAX_SENSE];
366 u_int8_t apt_nsge;
367 u_int8_t apt_scsistat;
368 u_int32_t apt_data;
369 u_int32_t apt_datalen;
370 } __packed;
371
372 struct ami_inquiry {
373 u_int8_t ain_maxcmd;
374 u_int8_t ain_rbldrate;
375 u_int8_t ain_targets;
376 u_int8_t ain_channels;
377 u_int8_t ain_fwver[4];
378 u_int16_t ain_flashage;
379 u_int8_t ain_chipset;
380 u_int8_t ain_ramsize;
381 u_int8_t ain_flushintv;
382 u_int8_t ain_biosver[4];
383 u_int8_t ain_brdtype;
384 u_int8_t ain_scsisensealert;
385 u_int8_t ain_wrcfgcnt;
386 u_int8_t ain_drvinscnt;
387 u_int8_t ain_insdrv;
388 u_int8_t ain_battery;
389 u_int8_t ain_reserved;
390
391 u_int8_t ain_nlogdrv;
392 u_int8_t ain_reserved1[3];
393 u_int32_t ain_ldsize[AMI_MAX_LDRIVES];
394 u_int8_t ain_ldprop[AMI_MAX_LDRIVES];
395 u_int8_t ain_ldstat[AMI_MAX_LDRIVES];
396
397 u_int8_t ain_pdstat[AMI_MAX_PDRIVES];
398 u_int8_t ain_predictivefailure;
399
400 u_int8_t ain_pdfmtinp[AMI_MAX_PDRIVES];
401 u_int8_t ain_reserved2[AMI_MAX_PDRIVES];
402
403 u_int32_t ain_esize;
404 u_int16_t ain_ssid;
405 u_int16_t ain_ssvid;
406 u_int32_t ain_signature;
407 #define AMI_SIGN431 0xfffe0001
408 #define AMI_SIGN438 0xfffd0002
409 #define AMI_SIGN762 0xfffc0003
410 #define AMI_SIGNT5 0xfffb0004
411 #define AMI_SIGN466 0xfffa0005
412 } __packed;
413
414 #define MAX_NOTIFY_SIZE 0x80
415 #define CUR_NOTIFY_SIZE (sizeof(struct ami_notify))
416 struct ami_notify {
417 u_int32_t ano_eventcounter;
418
419 u_int8_t ano_paramcounter;
420 u_int8_t ano_paramid;
421 #define AMI_PARAM_RBLD_RATE 0x01
422 #define AMI_PARAM_CACHE_FLUSH_INTERVAL 0x02
423 #define AMI_PARAM_SENSE_ALERT 0x03
424 #define AMI_PARAM_DRIVE_INSERTED 0x04
425 #define AMI_PARAM_BATTERY_STATUS 0x05
426 #define AMI_PARAM_NVRAM_EVENT_ALERT 0x06
427 #define AMI_PARAM_PATROL_READ_UPDATE 0x07
428 #define AMI_PARAM_PATROL_READ_STATUS 0x08
429
430
431
432 u_int16_t ano_paramval;
433
434 u_int8_t ano_writeconfcounter;
435 u_int8_t ano_writeconfrsvd[3];
436
437 u_int8_t ano_ldopcounter;
438 u_int8_t ano_ldopid;
439 u_int8_t ano_ldopcmd;
440 #define AMI_LDCMD_CHKCONSISTANCY 0x01
441 #define AMI_LDCMD_INITIALIZE 0x02
442 #define AMI_LDCMD_RECONSTRUCTION 0x03
443 u_int8_t ano_ldopstatus;
444 #define AMI_LDOP_SUCCESS 0x00
445 #define AMI_LDOP_FAILED 0x01
446 #define AMI_LDOP_ABORTED 0x02
447 #define AMI_LDOP_CORRECTED 0x03
448 #define AMI_LDOP_STARTED 0x04
449
450 u_int8_t ano_ldstatecounter;
451 u_int8_t ano_ldstateid;
452 u_int8_t ano_ldstatenew;
453 u_int8_t ano_ldstateold;
454 #define AMI_RDRV_OFFLINE 0
455 #define AMI_RDRV_DEGRADED 1
456 #define AMI_RDRV_OPTIMAL 2
457 #define AMI_RDRV_DELETED 3
458
459 u_int8_t ano_pdstatecounter;
460 u_int8_t ano_pdstateid;
461 u_int8_t ano_pdstatenew;
462 u_int8_t ano_pdstateold;
463 #define AMI_PD_UNCNF 0
464 #define AMI_PD_ONLINE 3
465 #define AMI_PD_FAILED 4
466 #define AMI_PD_RBLD 5
467 #define AMI_PD_HOTSPARE 6
468
469 u_int8_t ano_pdfmtcounter;
470 u_int8_t ano_pdfmtid;
471 u_int8_t ano_pdfmtval;
472 #define AMI_PDFMT_START 0x01
473 #define AMI_PDFMT_OVER 0x02
474 u_int8_t ano_pdfmtrsvd;
475
476 u_int8_t ano_targxfercounter;
477 u_int8_t ano_targxferid;
478 u_int8_t ano_targxferval;
479 u_int8_t ano_targxferrsvd;
480
481 u_int8_t ano_fclidchgcounter;
482 u_int8_t ano_fclidpdid;
483 u_int8_t ano_fclid0;
484 u_int8_t ano_fclid1;
485
486 u_int8_t ano_fclstatecounter;
487 u_int8_t ano_fclstate0;
488 u_int8_t ano_fclstate1;
489 #define AMI_FCLOOP_FAILED 0
490 #define AMI_FCLOOP_ACTIVE 1
491 #define AMI_FCLOOP_TRANSIENT 2
492 u_int8_t ano_fclstatersvd;
493 } __packed;
494
495 struct ami_fc_einquiry {
496 u_int32_t ain_size;
497
498
499 struct ami_notify ain_notify;
500 u_int8_t ain_notifyrsvd[MAX_NOTIFY_SIZE - CUR_NOTIFY_SIZE];
501
502 u_int8_t ain_rbldrate;
503 u_int8_t ain_flushintvl;
504 u_int8_t ain_sensealert;
505 u_int8_t ain_drvinscnt;
506 u_int8_t ain_battery;
507
508 u_int8_t ain_nlogdrv;
509 u_int8_t ain_recon[AMI_BIG_MAX_LDRIVES / 8];
510 u_int16_t ain_stat[AMI_BIG_MAX_LDRIVES / 8];
511
512 u_int32_t ain_ldsize[AMI_BIG_MAX_LDRIVES];
513 u_int8_t ain_ldprop[AMI_BIG_MAX_LDRIVES];
514 u_int8_t ain_ldstat[AMI_BIG_MAX_LDRIVES];
515
516 u_int8_t ain_pdstat[AMI_BIG_MAX_PDRIVES];
517 u_int16_t ain_pdfmtinp[AMI_BIG_MAX_PDRIVES];
518 u_int8_t ain_pdrates [80];
519 u_int8_t ain_pad[263];
520 } __packed;
521
522 struct ami_fc_prodinfo {
523 u_int32_t api_size;
524 u_int32_t api_config;
525 u_int8_t api_fwver[16];
526 u_int8_t api_biosver[16];
527 u_int8_t api_product[80];
528 u_int8_t api_maxcmd;
529 u_int8_t api_channels;
530 u_int8_t api_fcloops;
531 u_int8_t api_memtype;
532 u_int32_t api_signature;
533 u_int16_t api_ramsize;
534 u_int16_t api_ssid;
535 u_int16_t api_ssvid;
536 u_int8_t api_nnotify;
537 } __packed;
538
539 struct ami_diskarray {
540 u_int8_t ada_nld;
541 u_int8_t ada_pad[3];
542 struct {
543 u_int8_t adl_spandepth;
544 u_int8_t adl_raidlvl;
545 u_int8_t adl_rdahead;
546 u_int8_t adl_stripesz;
547 u_int8_t adl_status;
548 u_int8_t adl_wrpolicy;
549 u_int8_t adl_directio;
550 u_int8_t adl_nstripes;
551 struct {
552 u_int32_t ads_start;
553 u_int32_t ads_length;
554 struct {
555 u_int8_t add_channel;
556 u_int8_t add_target;
557 } __packed ads_devs[AMI_MAX_DEVDEPTH];
558 } __packed adl_spans[AMI_MAX_SPANDEPTH];
559 } __packed ada_ldrv[AMI_MAX_LDRIVES];
560 struct {
561 u_int8_t adp_type;
562 u_int8_t adp_ostatus;
563 u_int8_t adp_tagdepth;
564 u_int8_t adp_sneg;
565 u_int32_t adp_size;
566 } __packed ada_pdrv[AMI_MAX_PDRIVES];
567 } __packed;
568
569 struct ami_big_diskarray {
570 u_int8_t ada_nld;
571 u_int8_t ada_pad[3];
572 #define ald ada_ldrv
573 struct {
574 u_int8_t adl_spandepth;
575 u_int8_t adl_raidlvl;
576 u_int8_t adl_rdahead;
577 u_int8_t adl_stripesz;
578 u_int8_t adl_status;
579 u_int8_t adl_wrpolicy;
580 u_int8_t adl_directio;
581 u_int8_t adl_nstripes;
582 #define asp adl_spans
583 struct {
584 u_int32_t ads_start;
585 u_int32_t ads_length;
586 #define adv ads_devs
587 struct {
588 u_int8_t add_channel;
589 u_int8_t add_target;
590 } __packed ads_devs[AMI_BIG_MAX_DEVDEPTH];
591 } __packed adl_spans[AMI_BIG_MAX_SPANDEPTH];
592 } __packed ada_ldrv[AMI_BIG_MAX_LDRIVES];
593 #define apd ada_pdrv
594 struct {
595 u_int8_t adp_type;
596 u_int8_t adp_ostatus;
597 u_int8_t adp_tagdepth;
598 u_int8_t adp_sneg;
599 u_int32_t adp_size;
600 } __packed ada_pdrv[AMI_BIG_MAX_PDRIVES];
601 } __packed;
602
603 struct ami_scsisense {
604 u_int8_t ase_end;
605 struct {
606 u_int8_t asd_channel;
607 u_int8_t asd_target;
608 u_int16_t asd_errcode;
609 u_int16_t asd_sense;
610 u_int16_t asd_addarea1;
611 u_int16_t asd_addarea2;
612 u_int16_t asd_cmdspec0;
613 u_int16_t asd_cmdspec1;
614 u_int16_t asd_asc_ascq;
615 } __packed ase_dump[5];
616 } __packed;
617
618 struct ami_escsisense {
619 u_int8_t ase_end;
620 struct {
621 u_int8_t asd_channel;
622 u_int8_t asd_target;
623 u_int16_t asd_errcode;
624 u_int16_t asd_sense;
625 u_int16_t asd_addarea1;
626 u_int16_t asd_addarea2;
627 u_int16_t asd_cmdspec0;
628 u_int16_t asd_cmdspec1;
629 u_int16_t asd_asc_ascq;
630 u_int16_t asd_extarea;
631 } __packed ase_dump[5];
632 } __packed;
633
634 struct ami_cachestats {
635 u_int32_t acs_total;
636 u_int32_t acs_hits;
637 } __packed;
638
639 struct ami_drivehistory {
640 struct {
641 u_int8_t adh_error;
642 #define AMI_ADHERR_TIMEOUT(e) ((e) & 15)
643 #define AMI_ADHERR_PARITY(e) (((e) >> 4) & 15)
644 u_int8_t adh_throttle;
645 } __packed adh_err[3][16];
646 u_int8_t adh_failidx;
647 struct {
648 u_int8_t adh_tag;
649 #define AMI_ADHTAG_CH(t) ((t) & 7)
650 #define AMI_ADHTAG_TARG(t) (((t) >> 3) & 15)
651 #define AMI_ADHTAG_VALID(t) ((t) & 0x80)
652 u_int8_t reason;
653 #define AMI_ADHERR_MEDIA 1
654 #define AMI_ADHERR_NMEDIA 2
655 #define AMI_ADHERR_CMDTMO 3
656 #define AMI_ADHERR_SELTMO 4
657 #define AMI_ADHERR_HAFAIL 5
658 #define AMI_ADHERR_REASSIGN 6
659 #define AMI_ADHERR_CMDFAIL 7
660 #define AMI_ADHERR_OTHER 8
661
662 #define AMI_FAILHISTORY 10
663 } __packed adh_fail[AMI_FAILHISTORY];
664 } __packed;
665
666 struct ami_inq_data {
667 u_int8_t aid_peri;
668 u_int8_t aid_scsitype;
669 u_int8_t aid_ver;
670 u_int8_t aid_datatrans;
671 u_int8_t aid_addlen;
672 u_int8_t aid_resv[2];
673 u_int8_t aid_scsival;
674 u_int8_t aid_vendor[8];
675 u_int8_t aid_prod[16];
676 u_int8_t aid_prodver[4];
677 u_int8_t aid_mederr;
678 u_int8_t aid_otherr;
679 u_int8_t aid_proctype;
680
681 u_int8_t resv2[20];
682 } __packed;
683
684 struct ami_progress {
685 u_int32_t apr_progress;
686 } __packed;