VirtualBox

source: vbox/trunk/src/VBox/Devices/Storage/Debug.cpp@ 13303

Last change on this file since 13303 was 12927, checked in by vboxsync, 16 years ago

warnings

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 46.3 KB
Line 
1/* $Id: Debug.cpp 12927 2008-10-02 11:34:15Z vboxsync $ */
2/** @file
3 * VBox storage devices: debug helpers
4 */
5
6/*
7 * Copyright (C) 2008 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22
23#include <iprt/assert.h>
24#include <iprt/types.h>
25#include <VBox/scsi.h>
26#include "ide.h"
27
28/**
29 * ATA command codes
30 */
31static const char * const g_apszATACmdNames[256] =
32{
33 "NOP", /* 0x00 */
34 "", /* 0x01 */
35 "", /* 0x02 */
36 "CFA REQUEST EXTENDED ERROR CODE", /* 0x03 */
37 "", /* 0x04 */
38 "", /* 0x05 */
39 "", /* 0x06 */
40 "", /* 0x07 */
41 "DEVICE RESET", /* 0x08 */
42 "", /* 0x09 */
43 "", /* 0x0a */
44 "", /* 0x0b */
45 "", /* 0x0c */
46 "", /* 0x0d */
47 "", /* 0x0e */
48 "", /* 0x0f */
49 "RECALIBRATE", /* 0x10 */
50 "", /* 0x11 */
51 "", /* 0x12 */
52 "", /* 0x13 */
53 "", /* 0x14 */
54 "", /* 0x15 */
55 "", /* 0x16 */
56 "", /* 0x17 */
57 "", /* 0x18 */
58 "", /* 0x19 */
59 "", /* 0x1a */
60 "", /* 0x1b */
61 "", /* 0x1c */
62 "", /* 0x1d */
63 "", /* 0x1e */
64 "", /* 0x1f */
65 "READ SECTORS", /* 0x20 */
66 "READ SECTORS WITHOUT RETRIES", /* 0x21 */
67 "READ LONG", /* 0x22 */
68 "READ LONG WITHOUT RETRIES", /* 0x23 */
69 "READ SECTORS EXT", /* 0x24 */
70 "READ DMA EXT", /* 0x25 */
71 "READ DMA QUEUED EXT", /* 0x26 */
72 "READ NATIVE MAX ADDRESS EXT", /* 0x27 */
73 "", /* 0x28 */
74 "READ MULTIPLE EXT", /* 0x29 */
75 "READ STREAM DMA EXT", /* 0x2a */
76 "READ STREAM EXT", /* 0x2b */
77 "", /* 0x2c */
78 "", /* 0x2d */
79 "", /* 0x2e */
80 "READ LOG EXT", /* 0x2f */
81 "WRITE SECTORS", /* 0x30 */
82 "WRITE SECTORS WITHOUT RETRIES", /* 0x31 */
83 "WRITE LONG", /* 0x32 */
84 "WRITE LONG WITHOUT RETRIES", /* 0x33 */
85 "WRITE SECTORS EXT", /* 0x34 */
86 "WRITE DMA EXT", /* 0x35 */
87 "WRITE DMA QUEUED EXT", /* 0x36 */
88 "SET MAX ADDRESS EXT", /* 0x37 */
89 "CFA WRITE SECTORS WITHOUT ERASE", /* 0x38 */
90 "WRITE MULTIPLE EXT", /* 0x39 */
91 "WRITE STREAM DMA EXT", /* 0x3a */
92 "WRITE STREAM EXT", /* 0x3b */
93 "WRITE VERIFY", /* 0x3c */
94 "WRITE DMA FUA EXT", /* 0x3d */
95 "WRITE DMA QUEUED FUA EXT", /* 0x3e */
96 "WRITE LOG EXT", /* 0x3f */
97 "READ VERIFY SECTORS", /* 0x40 */
98 "READ VERIFY SECTORS WITHOUT RETRIES", /* 0x41 */
99 "READ VERIFY SECTORS EXT", /* 0x42 */
100 "", /* 0x43 */
101 "", /* 0x44 */
102 "WRITE UNCORRECTABLE EXT", /* 0x45 */
103 "", /* 0x46 */
104 "READ LOG DMA EXT", /* 0x47 */
105 "", /* 0x48 */
106 "", /* 0x49 */
107 "", /* 0x4a */
108 "", /* 0x4b */
109 "", /* 0x4c */
110 "", /* 0x4d */
111 "", /* 0x4e */
112 "", /* 0x4f */
113 "FORMAT TRACK", /* 0x50 */
114 "CONFIGURE STREAM", /* 0x51 */
115 "", /* 0x52 */
116 "", /* 0x53 */
117 "", /* 0x54 */
118 "", /* 0x55 */
119 "", /* 0x56 */
120 "WRITE LOG DMA EXT", /* 0x57 */
121 "", /* 0x58 */
122 "", /* 0x59 */
123 "", /* 0x5a */
124 "", /* 0x5b */
125 "TRUSTED RECEIVE", /* 0x5c */
126 "TRUSTED RECEIVE DMA", /* 0x5d */
127 "TRUSTED SEND", /* 0x5e */
128 "TRUSTED SEND DMA", /* 0x5f */
129 "READ FPDMA QUEUED", /* 0x60 */
130 "WRITE FPDMA QUEUED", /* 0x61 */
131 "", /* 0x62 */
132 "", /* 0x63 */
133 "", /* 0x64 */
134 "", /* 0x65 */
135 "", /* 0x66 */
136 "", /* 0x67 */
137 "", /* 0x68 */
138 "", /* 0x69 */
139 "", /* 0x6a */
140 "", /* 0x6b */
141 "", /* 0x6c */
142 "", /* 0x6d */
143 "", /* 0x6e */
144 "", /* 0x6f */
145 "SEEK", /* 0x70 */
146 "", /* 0x71 */
147 "", /* 0x72 */
148 "", /* 0x73 */
149 "", /* 0x74 */
150 "", /* 0x75 */
151 "", /* 0x76 */
152 "", /* 0x77 */
153 "", /* 0x78 */
154 "", /* 0x79 */
155 "", /* 0x7a */
156 "", /* 0x7b */
157 "", /* 0x7c */
158 "", /* 0x7d */
159 "", /* 0x7e */
160 "", /* 0x7f */
161 "", /* 0x80 */
162 "", /* 0x81 */
163 "", /* 0x82 */
164 "", /* 0x83 */
165 "", /* 0x84 */
166 "", /* 0x85 */
167 "", /* 0x86 */
168 "CFA TRANSLATE SECTOR", /* 0x87 */
169 "", /* 0x88 */
170 "", /* 0x89 */
171 "", /* 0x8a */
172 "", /* 0x8b */
173 "", /* 0x8c */
174 "", /* 0x8d */
175 "", /* 0x8e */
176 "", /* 0x8f */
177 "EXECUTE DEVICE DIAGNOSTIC", /* 0x90 */
178 "INITIALIZE DEVICE PARAMETERS", /* 0x91 */
179 "DOWNLOAD MICROCODE", /* 0x92 */
180 "", /* 0x93 */
181 "STANDBY IMMEDIATE ALT", /* 0x94 */
182 "IDLE IMMEDIATE ALT", /* 0x95 */
183 "STANDBY ALT", /* 0x96 */
184 "IDLE ALT", /* 0x97 */
185 "CHECK POWER MODE ALT", /* 0x98 */
186 "SLEEP ALT", /* 0x99 */
187 "", /* 0x9a */
188 "", /* 0x9b */
189 "", /* 0x9c */
190 "", /* 0x9d */
191 "", /* 0x9e */
192 "", /* 0x9f */
193 "PACKET", /* 0xa0 */
194 "IDENTIFY PACKET DEVICE", /* 0xa1 */
195 "SERVICE", /* 0xa2 */
196 "", /* 0xa3 */
197 "", /* 0xa4 */
198 "", /* 0xa5 */
199 "", /* 0xa6 */
200 "", /* 0xa7 */
201 "", /* 0xa8 */
202 "", /* 0xa9 */
203 "", /* 0xaa */
204 "", /* 0xab */
205 "", /* 0xac */
206 "", /* 0xad */
207 "", /* 0xae */
208 "", /* 0xaf */
209 "SMART", /* 0xb0 */
210 "DEVICE CONFIGURATION OVERLAY", /* 0xb1 */
211 "", /* 0xb2 */
212 "", /* 0xb3 */
213 "", /* 0xb4 */
214 "", /* 0xb5 */
215 "NV CACHE", /* 0xb6 */
216 "", /* 0xb7 */
217 "", /* 0xb8 */
218 "", /* 0xb9 */
219 "", /* 0xba */
220 "", /* 0xbb */
221 "", /* 0xbc */
222 "", /* 0xbd */
223 "", /* 0xbe */
224 "", /* 0xbf */
225 "CFA ERASE SECTORS", /* 0xc0 */
226 "", /* 0xc1 */
227 "", /* 0xc2 */
228 "", /* 0xc3 */
229 "READ MULTIPLE", /* 0xc4 */
230 "WRITE MULTIPLE", /* 0xc5 */
231 "SET MULTIPLE MODE", /* 0xc6 */
232 "READ DMA QUEUED", /* 0xc7 */
233 "READ DMA", /* 0xc8 */
234 "READ DMA WITHOUT RETRIES", /* 0xc9 */
235 "WRITE DMA", /* 0xca */
236 "WRITE DMA WITHOUT RETRIES", /* 0xcb */
237 "WRITE DMA QUEUED", /* 0xcc */
238 "CFA WRITE MULTIPLE WITHOUT ERASE", /* 0xcd */
239 "WRITE MULTIPLE FUA EXT", /* 0xce */
240 "", /* 0xcf */
241 "", /* 0xd0 */
242 "CHECK MEDIA CARD TYPE", /* 0xd1 */
243 "", /* 0xd2 */
244 "", /* 0xd3 */
245 "", /* 0xd4 */
246 "", /* 0xd5 */
247 "", /* 0xd6 */
248 "", /* 0xd7 */
249 "", /* 0xd8 */
250 "", /* 0xd9 */
251 "GET MEDIA STATUS", /* 0xda */
252 "ACKNOWLEDGE MEDIA CHANGE", /* 0xdb */
253 "BOOT POST BOOT", /* 0xdc */
254 "BOOT PRE BOOT", /* 0xdd */
255 "MEDIA LOCK", /* 0xde */
256 "MEDIA UNLOCK", /* 0xdf */
257 "STANDBY IMMEDIATE", /* 0xe0 */
258 "IDLE IMMEDIATE", /* 0xe1 */
259 "STANDBY", /* 0xe2 */
260 "IDLE", /* 0xe3 */
261 "READ BUFFER", /* 0xe4 */
262 "CHECK POWER MODE", /* 0xe5 */
263 "SLEEP", /* 0xe6 */
264 "FLUSH CACHE", /* 0xe7 */
265 "WRITE BUFFER", /* 0xe8 */
266 "WRITE SAME", /* 0xe9 */
267 "FLUSH CACHE EXT", /* 0xea */
268 "", /* 0xeb */
269 "IDENTIFY DEVICE", /* 0xec */
270 "MEDIA EJECT", /* 0xed */
271 "IDENTIFY DMA", /* 0xee */
272 "SET FEATURES", /* 0xef */
273 "", /* 0xf0 */
274 "SECURITY SET PASSWORD", /* 0xf1 */
275 "SECURITY UNLOCK", /* 0xf2 */
276 "SECURITY ERASE PREPARE", /* 0xf3 */
277 "SECURITY ERASE UNIT", /* 0xf4 */
278 "SECURITY FREEZE LOCK", /* 0xf5 */
279 "SECURITY DISABLE PASSWORD", /* 0xf6 */
280 "", /* 0xf7 */
281 "READ NATIVE MAX ADDRESS", /* 0xf8 */
282 "SET MAX", /* 0xf9 */
283 "", /* 0xfa */
284 "", /* 0xfb */
285 "", /* 0xfc */
286 "", /* 0xfd */
287 "", /* 0xfe */
288 "" /* 0xff */
289};
290
291/**
292 * SCSI command codes.
293 */
294static const char * const g_apszSCSICmdNames[256] =
295{
296 "TEST UNIT READY", /* 0x00 */
297 "REZERO UNIT", /* 0x01 */
298 "", /* 0x02 */
299 "REQUEST SENSE", /* 0x03 */
300 "FORMAT UNIT", /* 0x04 */
301 "READ BLOCK LIMITS", /* 0x05 */
302 "", /* 0x06 */
303 "REASSIGN BLOCKS", /* 0x07 */
304 "READ (6)", /* 0x08 */
305 "", /* 0x09 */
306 "WRITE (6)", /* 0x0a */
307 "SEEK (6)", /* 0x0b */
308 "", /* 0x0c */
309 "", /* 0x0d */
310 "", /* 0x0e */
311 "READ REVERSE (6)", /* 0x0f */
312 "READ FILEMARKS (6)", /* 0x10 */
313 "SPACE (6)", /* 0x11 */
314 "INQUIRY", /* 0x12 */
315 "VERIFY (6)", /* 0x13 */
316 "RECOVER BUFFERED DATA", /* 0x14 */
317 "MODE SELECT (6)", /* 0x15 */
318 "RESERVE (6)", /* 0x16 */
319 "RELEASE (6)", /* 0x17 */
320 "COPY", /* 0x18 */
321 "ERASE (6)", /* 0x19 */
322 "MODE SENSE (6)", /* 0x1a */
323 "START STOP UNIT", /* 0x1b */
324 "RECEIVE DIAGNOSTIC RESULTS", /* 0x1c */
325 "SEND DIAGNOSTIC", /* 0x1d */
326 "PREVENT ALLOW MEDIUM REMOVAL", /* 0x1e */
327 "", /* 0x1f */
328 "", /* 0x20 */
329 "", /* 0x21 */
330 "", /* 0x22 */
331 "READ FORMAT CAPACITIES", /* 0x23 */
332 "SET WINDOW", /* 0x24 */
333 "READ CAPACITY", /* 0x25 */
334 "", /* 0x26 */
335 "", /* 0x27 */
336 "READ (10)", /* 0x28 */
337 "READ GENERATION", /* 0x29 */
338 "WRITE (10)", /* 0x2a */
339 "SEEK (10)", /* 0x2b */
340 "ERASE (10)", /* 0x2c */
341 "READ UPDATED BLOCK", /* 0x2d */
342 "WRITE AND VERIFY (10)", /* 0x2e */
343 "VERIFY (10)", /* 0x2f */
344 "SEARCH DATA HIGH (10)", /* 0x30 */
345 "SEARCH DATA EQUAL (10)", /* 0x31 */
346 "SEARCH DATA LOW (10)", /* 0x32 */
347 "SET LIMITS (10)", /* 0x33 */
348 "PRE-FETCH (10)", /* 0x34 */
349 "SYNCHRONIZE CACHE (10)", /* 0x35 */
350 "LOCK UNLOCK CACHE (10)", /* 0x36 */
351 "READ DEFECT DATA (10)", /* 0x37 */
352 "MEDIUM SCAN", /* 0x38 */
353 "COMPARE", /* 0x39 */
354 "COPY AND VERIFY", /* 0x3a */
355 "WRITE BUFFER", /* 0x3b */
356 "READ BUFFER", /* 0x3c */
357 "UPDATE BLOCK", /* 0x3d */
358 "READ LONG (10)", /* 0x3e */
359 "WRITE LONG (10)", /* 0x3f */
360 "CHANGE DEFINITION", /* 0x40 */
361 "WRITE SAME (10)", /* 0x41 */
362 "READ SUBCHANNEL", /* 0x42 */
363 "READ TOC/PMA/ATIP", /* 0x43 */
364 "REPORT DENSITY SUPPORT", /* 0x44 */
365 "PLAY AUDIO (10)", /* 0x45 */
366 "GET CONFIGURATION", /* 0x46 */
367 "PLAY AUDIO MSF", /* 0x47 */
368 "", /* 0x48 */
369 "", /* 0x49 */
370 "GET EVENT STATUS NOTIFICATION", /* 0x4a */
371 "PAUSE/RESUME", /* 0x4b */
372 "LOG SELECT", /* 0x4c */
373 "LOG SENSE", /* 0x4d */
374 "STOP PLAY/SCAN", /* 0x4e */
375 "", /* 0x4f */
376 "XDWRITE (10)", /* 0x50 */
377 "READ DISC INFORMATION", /* 0x51 */
378 "READ TRACK INFORMATION", /* 0x52 */
379 "RESERVE TRACK", /* 0x53 */
380 "SEND OPC INFORMATION", /* 0x54 */
381 "MODE SELECT (10)", /* 0x55 */
382 "RESERVE (10)", /* 0x56 */
383 "RELEASE (10)", /* 0x57 */
384 "REPAIR TRACK", /* 0x58 */
385 "", /* 0x59 */
386 "MODE SENSE (10)", /* 0x5a */
387 "CLOSE TRACK/SESSION", /* 0x5b */
388 "READ BUFFER CAPACITY", /* 0x5c */
389 "SEND CUE SHEET", /* 0x5d */
390 "PERSISTENT RESERVE IN", /* 0x5e */
391 "PERSISTENT RESERVE OUT", /* 0x5f */
392 "", /* 0x60 */
393 "", /* 0x61 */
394 "", /* 0x62 */
395 "", /* 0x63 */
396 "", /* 0x64 */
397 "", /* 0x65 */
398 "", /* 0x66 */
399 "", /* 0x67 */
400 "", /* 0x68 */
401 "", /* 0x69 */
402 "", /* 0x6a */
403 "", /* 0x6b */
404 "", /* 0x6c */
405 "", /* 0x6d */
406 "", /* 0x6e */
407 "", /* 0x6f */
408 "", /* 0x70 */
409 "", /* 0x71 */
410 "", /* 0x72 */
411 "", /* 0x73 */
412 "", /* 0x74 */
413 "", /* 0x75 */
414 "", /* 0x76 */
415 "", /* 0x77 */
416 "", /* 0x78 */
417 "", /* 0x79 */
418 "", /* 0x7a */
419 "", /* 0x7b */
420 "", /* 0x7c */
421 "", /* 0x7d */
422 "", /* 0x7e */
423 "", /* 0x7f */
424 "WRITE FILEMARKS (16)", /* 0x80 */
425 "READ REVERSE (16)", /* 0x81 */
426 "REGENERATE (16)", /* 0x82 */
427 "EXTENDED COPY", /* 0x83 */
428 "RECEIVE COPY RESULTS", /* 0x84 */
429 "ATA COMMAND PASS THROUGH (16)", /* 0x85 */
430 "ACCESS CONTROL IN", /* 0x86 */
431 "ACCESS CONTROL OUT", /* 0x87 */
432 "READ (16)", /* 0x88 */
433 "", /* 0x89 */
434 "WRITE(16)", /* 0x8a */
435 "", /* 0x8b */
436 "READ ATTRIBUTE", /* 0x8c */
437 "WRITE ATTRIBUTE", /* 0x8d */
438 "WRITE AND VERIFY (16)", /* 0x8e */
439 "VERIFY (16)", /* 0x8f */
440 "PRE-FETCH (16)", /* 0x90 */
441 "SYNCHRONIZE CACHE (16)", /* 0x91 */
442 "LOCK UNLOCK CACHE (16)", /* 0x92 */
443 "WRITE SAME (16)", /* 0x93 */
444 "", /* 0x94 */
445 "", /* 0x95 */
446 "", /* 0x96 */
447 "", /* 0x97 */
448 "", /* 0x98 */
449 "", /* 0x99 */
450 "", /* 0x9a */
451 "", /* 0x9b */
452 "", /* 0x9c */
453 "", /* 0x9d */
454 "SERVICE ACTION IN (16)", /* 0x9e */
455 "SERVICE ACTION OUT (16)", /* 0x9f */
456 "REPORT LUNS", /* 0xa0 */
457 "BLANK", /* 0xa1 */
458 "SEND EVENT", /* 0xa2 */
459 "SEND KEY", /* 0xa3 */
460 "REPORT KEY", /* 0xa4 */
461 "PLAY AUDIO (12)", /* 0xa5 */
462 "LOAD/UNLOAD MEDIUM", /* 0xa6 */
463 "SET READ AHEAD", /* 0xa7 */
464 "READ (12)", /* 0xa8 */
465 "SERVICE ACTION OUT (12)", /* 0xa9 */
466 "WRITE (12)", /* 0xaa */
467 "SERVICE ACTION IN (12)", /* 0xab */
468 "GET PERFORMANCE", /* 0xac */
469 "READ DVD STRUCTURE", /* 0xad */
470 "WRITE AND VERIFY (12)", /* 0xae */
471 "VERIFY (12)", /* 0xaf */
472 "SEARCH DATA HIGH (12)", /* 0xb0 */
473 "SEARCH DATA EQUAL (12)", /* 0xb1 */
474 "SEARCH DATA LOW (12)", /* 0xb2 */
475 "SET LIMITS (12)", /* 0xb3 */
476 "READ ELEMENT STATUS ATTACHED", /* 0xb4 */
477 "REQUEST VOLUME ELEMENT ADDRESS", /* 0xb5 */
478 "SET STREAMING", /* 0xb6 */
479 "READ DEFECT DATA (12)", /* 0xb7 */
480 "READ ELEMENT STATUS", /* 0xb8 */
481 "READ CD MSF", /* 0xb9 */
482 "SCAN", /* 0xba */
483 "SET CD SPEED", /* 0xbb */
484 "SPARE (IN)", /* 0xbc */
485 "MECHANISM STATUS", /* 0xbd */
486 "READ CD", /* 0xbe */
487 "SEND DVD STRUCTURE", /* 0xbf */
488 "", /* 0xc0 */
489 "", /* 0xc1 */
490 "", /* 0xc2 */
491 "", /* 0xc3 */
492 "", /* 0xc4 */
493 "", /* 0xc5 */
494 "", /* 0xc6 */
495 "", /* 0xc7 */
496 "", /* 0xc8 */
497 "", /* 0xc9 */
498 "", /* 0xca */
499 "", /* 0xcb */
500 "", /* 0xcc */
501 "", /* 0xcd */
502 "", /* 0xce */
503 "", /* 0xcf */
504 "", /* 0xd0 */
505 "", /* 0xd1 */
506 "", /* 0xd2 */
507 "", /* 0xd3 */
508 "", /* 0xd4 */
509 "", /* 0xd5 */
510 "", /* 0xd6 */
511 "", /* 0xd7 */
512 "", /* 0xd8 */
513 "", /* 0xd9 */
514 "", /* 0xda */
515 "", /* 0xdb */
516 "", /* 0xdc */
517 "", /* 0xdd */
518 "", /* 0xde */
519 "", /* 0xdf */
520 "", /* 0xe0 */
521 "", /* 0xe1 */
522 "", /* 0xe2 */
523 "", /* 0xe3 */
524 "", /* 0xe4 */
525 "", /* 0xe5 */
526 "", /* 0xe6 */
527 "", /* 0xe7 */
528 "", /* 0xe8 */
529 "", /* 0xe9 */
530 "", /* 0xea */
531 "", /* 0xeb */
532 "", /* 0xec */
533 "", /* 0xed */
534 "", /* 0xee */
535 "", /* 0xef */
536 "", /* 0xf0 */
537 "", /* 0xf1 */
538 "", /* 0xf2 */
539 "", /* 0xf3 */
540 "", /* 0xf4 */
541 "", /* 0xf5 */
542 "", /* 0xf6 */
543 "", /* 0xf7 */
544 "", /* 0xf8 */
545 "", /* 0xf9 */
546 "", /* 0xfa */
547 "", /* 0xfb */
548 "", /* 0xfc */
549 "", /* 0xfd */
550 "", /* 0xfe */
551 "" /* 0xff */
552};
553
554static const char * const g_apszSCSISenseNames[] =
555{
556 "NO SENSE",
557 "RECOVERED ERROR",
558 "NOT READY",
559 "MEDIUM ERROR",
560 "HARDWARE ERROR",
561 "ILLEGAL REQUEST",
562 "UNIT ATTENTION",
563 "DATA PROTECT",
564 "BLANK CHECK",
565 "VENDOR-SPECIFIC",
566 "COPY ABORTED",
567 "ABORTED COMMAND",
568 "(obsolete)",
569 "VOLUME OVERFLOW",
570 "MISCOMPARE",
571 "(reserved)"
572};
573
574/**
575 * SCSI Sense text
576 */
577static struct
578{
579 uint8_t uASC;
580 uint8_t uASCQ;
581 const char * const pszSenseText;
582} g_aSCSISenseText[]
583=
584{
585 { 0x67, 0x02, "A ADD LOGICAL UNIT FAILED" },
586 { 0x13, 0x00, "ADDRESS MARK NOT FOUND FOR DATA FIELD" },
587 { 0x12, 0x00, "ADDRESS MARK NOT FOUND FOR ID FIELD" },
588 { 0x27, 0x03, "ASSOCIATED WRITE PROTECT" },
589 { 0x67, 0x06, "ATTACHMENT OF LOGICAL UNIT FAILED" },
590 { 0x00, 0x11, "AUDIO PLAY OPERATION IN PROGRESS" },
591 { 0x00, 0x12, "AUDIO PLAY OPERATION PAUSED" },
592 { 0x00, 0x14, "AUDIO PLAY OPERATION STOPPED DUE TO ERROR" },
593 { 0x00, 0x13, "AUDIO PLAY OPERATION SUCCESSFULLY COMPLETED" },
594 { 0x66, 0x00, "AUTOMATIC DOCUMENT FEEDER COVER UP" },
595 { 0x66, 0x01, "AUTOMATIC DOCUMENT FEEDER LIFT UP" },
596 { 0x00, 0x04, "BEGINNING-OF-PARTITION/MEDIUM DETECTED" },
597 { 0x0C, 0x06, "BLOCK NOT COMPRESSIBLE" },
598 { 0x14, 0x04, "BLOCK SEQUENCE ERROR" },
599 { 0x29, 0x03, "BUS DEVICE RESET FUNCTION OCCURRED" },
600 { 0x11, 0x0E, "CANNOT DECOMPRESS USING DECLARED ALGORITHM" },
601 { 0x30, 0x06, "CANNOT FORMAT MEDIUM - INCOMPATIBLE MEDIUM" },
602 { 0x30, 0x02, "CANNOT READ MEDIUM - INCOMPATIBLE FORMAT" },
603 { 0x30, 0x01, "CANNOT READ MEDIUM - UNKNOWN FORMAT" },
604 { 0x30, 0x08, "CANNOT WRITE - APPLICATION CODE MISMATCH" },
605 { 0x30, 0x05, "CANNOT WRITE MEDIUM - INCOMPATIBLE FORMAT" },
606 { 0x30, 0x04, "CANNOT WRITE MEDIUM - UNKNOWN FORMAT" },
607 { 0x52, 0x00, "CARTRIDGE FAULT" },
608 { 0x73, 0x00, "CD CONTROL ERROR" },
609 { 0x3F, 0x02, "CHANGED OPERATING DEFINITION" },
610 { 0x11, 0x06, "CIRC UNRECOVERED ERROR" },
611 { 0x30, 0x03, "CLEANING CARTRIDGE INSTALLED" },
612 { 0x30, 0x07, "CLEANING FAILURE" },
613 { 0x00, 0x17, "CLEANING REQUESTED" },
614 { 0x4A, 0x00, "COMMAND PHASE ERROR" },
615 { 0x2C, 0x00, "COMMAND SEQUENCE ERROR" },
616 { 0x6E, 0x00, "COMMAND TO LOGICAL UNIT FAILED" },
617 { 0x2F, 0x00, "COMMANDS CLEARED BY ANOTHER INITIATOR" },
618 { 0x0C, 0x04, "COMPRESSION CHECK MISCOMPARE ERROR" },
619 { 0x67, 0x00, "CONFIGURATION FAILURE" },
620 { 0x67, 0x01, "CONFIGURATION OF INCAPABLE LOGICAL UNITS FAILED" },
621 { 0x2B, 0x00, "COPY CANNOT EXECUTE SINCE HOST CANNOT DISCONNECT" },
622 { 0x67, 0x07, "CREATION OF LOGICAL UNIT FAILED" },
623 { 0x2C, 0x04, "CURRENT PROGRAM AREA IS EMPTY" },
624 { 0x2C, 0x03, "CURRENT PROGRAM AREA IS NOT EMPTY" },
625 { 0x30, 0x09, "CURRENT SESSION NOT FIXATED FOR APPEND" },
626 { 0x0C, 0x05, "DATA EXPANSION OCCURRED DURING COMPRESSION" },
627 { 0x69, 0x00, "DATA LOSS ON LOGICAL UNIT" },
628 { 0x41, 0x00, "DATA PATH FAILURE (SHOULD USE 40 NN)" },
629 { 0x4B, 0x00, "DATA PHASE ERROR" },
630 { 0x11, 0x07, "DATA RE-SYNCHRONIZATION ERROR" },
631 { 0x16, 0x03, "DATA SYNC ERROR - DATA AUTO-REALLOCATED" },
632 { 0x16, 0x01, "DATA SYNC ERROR - DATA REWRITTEN" },
633 { 0x16, 0x04, "DATA SYNC ERROR - RECOMMEND REASSIGNMENT" },
634 { 0x16, 0x02, "DATA SYNC ERROR - RECOMMEND REWRITE" },
635 { 0x16, 0x00, "DATA SYNCHRONIZATION MARK ERROR" },
636 { 0x11, 0x0D, "DE-COMPRESSION CRC ERROR" },
637 { 0x71, 0x00, "DECOMPRESSION EXCEPTION LONG ALGORITHM ID" },
638 { 0x70, 0xFF, "DECOMPRESSION EXCEPTION SHORT ALGORITHM ID OF NN" },
639 { 0x19, 0x00, "DEFECT LIST ERROR" },
640 { 0x19, 0x03, "DEFECT LIST ERROR IN GROWN LIST" },
641 { 0x19, 0x02, "DEFECT LIST ERROR IN PRIMARY LIST" },
642 { 0x19, 0x01, "DEFECT LIST NOT AVAILABLE" },
643 { 0x1C, 0x00, "DEFECT LIST NOT FOUND" },
644 { 0x32, 0x01, "DEFECT LIST UPDATE FAILURE" },
645 { 0x29, 0x04, "DEVICE INTERNAL RESET" },
646 { 0x40, 0xFF, "DIAGNOSTIC FAILURE ON COMPONENT NN (80H-FFH)" },
647 { 0x66, 0x02, "DOCUMENT JAM IN AUTOMATIC DOCUMENT FEEDER" },
648 { 0x66, 0x03, "DOCUMENT MISS FEED AUTOMATIC IN DOCUMENT FEEDER" },
649 { 0x72, 0x04, "EMPTY OR PARTIALLY WRITTEN RESERVED TRACK" },
650 { 0x34, 0x00, "ENCLOSURE FAILURE" },
651 { 0x35, 0x00, "ENCLOSURE SERVICES FAILURE" },
652 { 0x35, 0x03, "ENCLOSURE SERVICES TRANSFER FAILURE" },
653 { 0x35, 0x04, "ENCLOSURE SERVICES TRANSFER REFUSED" },
654 { 0x35, 0x02, "ENCLOSURE SERVICES UNAVAILABLE" },
655 { 0x3B, 0x0F, "END OF MEDIUM REACHED" },
656 { 0x63, 0x00, "END OF USER AREA ENCOUNTERED ON THIS TRACK" },
657 { 0x00, 0x05, "END-OF-DATA DETECTED" },
658 { 0x14, 0x03, "END-OF-DATA NOT FOUND" },
659 { 0x00, 0x02, "END-OF-PARTITION/MEDIUM DETECTED" },
660 { 0x51, 0x00, "ERASE FAILURE" },
661 { 0x0A, 0x00, "ERROR LOG OVERFLOW" },
662 { 0x11, 0x10, "ERROR READING ISRC NUMBER" },
663 { 0x11, 0x0F, "ERROR READING UPC/EAN NUMBER" },
664 { 0x11, 0x02, "ERROR TOO LONG TO CORRECT" },
665 { 0x03, 0x02, "EXCESSIVE WRITE ERRORS" },
666 { 0x67, 0x04, "EXCHANGE OF LOGICAL UNIT FAILED" },
667 { 0x3B, 0x07, "FAILED TO SENSE BOTTOM-OF-FORM" },
668 { 0x3B, 0x06, "FAILED TO SENSE TOP-OF-FORM" },
669 { 0x5D, 0x00, "FAILURE PREDICTION THRESHOLD EXCEEDED" },
670 { 0x5D, 0xFF, "FAILURE PREDICTION THRESHOLD EXCEEDED (FALSE)" },
671 { 0x00, 0x01, "FILEMARK DETECTED" },
672 { 0x14, 0x02, "FILEMARK OR SETMARK NOT FOUND" },
673 { 0x09, 0x02, "FOCUS SERVO FAILURE" },
674 { 0x31, 0x01, "FORMAT COMMAND FAILED" },
675 { 0x58, 0x00, "GENERATION DOES NOT EXIST" },
676 { 0x1C, 0x02, "GROWN DEFECT LIST NOT FOUND" },
677 { 0x27, 0x01, "HARDWARE WRITE PROTECTED" },
678 { 0x09, 0x04, "HEAD SELECT FAULT" },
679 { 0x00, 0x06, "I/O PROCESS TERMINATED" },
680 { 0x10, 0x00, "ID CRC OR ECC ERROR" },
681 { 0x5E, 0x03, "IDLE CONDITION ACTIVATED BY COMMAND" },
682 { 0x5E, 0x01, "IDLE CONDITION ACTIVATED BY TIMER" },
683 { 0x22, 0x00, "ILLEGAL FUNCTION (USE 20 00, 24 00, OR 26 00)" },
684 { 0x64, 0x00, "ILLEGAL MODE FOR THIS TRACK" },
685 { 0x28, 0x01, "IMPORT OR EXPORT ELEMENT ACCESSED" },
686 { 0x30, 0x00, "INCOMPATIBLE MEDIUM INSTALLED" },
687 { 0x11, 0x08, "INCOMPLETE BLOCK READ" },
688 { 0x6A, 0x00, "INFORMATIONAL, REFER TO LOG" },
689 { 0x48, 0x00, "INITIATOR DETECTED ERROR MESSAGE RECEIVED" },
690 { 0x3F, 0x03, "INQUIRY DATA HAS CHANGED" },
691 { 0x44, 0x00, "INTERNAL TARGET FAILURE" },
692 { 0x3D, 0x00, "INVALID BITS IN IDENTIFY MESSAGE" },
693 { 0x2C, 0x02, "INVALID COMBINATION OF WINDOWS SPECIFIED" },
694 { 0x20, 0x00, "INVALID COMMAND OPERATION CODE" },
695 { 0x21, 0x01, "INVALID ELEMENT ADDRESS" },
696 { 0x24, 0x00, "INVALID FIELD IN CDB" },
697 { 0x26, 0x00, "INVALID FIELD IN PARAMETER LIST" },
698 { 0x49, 0x00, "INVALID MESSAGE ERROR" },
699 { 0x64, 0x01, "INVALID PACKET SIZE" },
700 { 0x26, 0x04, "INVALID RELEASE OF ACTIVE PERSISTENT RESERVATION" },
701 { 0x11, 0x05, "L-EC UNCORRECTABLE ERROR" },
702 { 0x60, 0x00, "LAMP FAILURE" },
703 { 0x5B, 0x02, "LOG COUNTER AT MAXIMUM" },
704 { 0x5B, 0x00, "LOG EXCEPTION" },
705 { 0x5B, 0x03, "LOG LIST CODES EXHAUSTED" },
706 { 0x2A, 0x02, "LOG PARAMETERS CHANGED" },
707 { 0x21, 0x00, "LOGICAL BLOCK ADDRESS OUT OF RANGE" },
708 { 0x08, 0x03, "LOGICAL UNIT COMMUNICATION CRC ERROR (ULTRA-DMA/32)" },
709 { 0x08, 0x00, "LOGICAL UNIT COMMUNICATION FAILURE" },
710 { 0x08, 0x02, "LOGICAL UNIT COMMUNICATION PARITY ERROR" },
711 { 0x08, 0x01, "LOGICAL UNIT COMMUNICATION TIME-OUT" },
712 { 0x05, 0x00, "LOGICAL UNIT DOES NOT RESPOND TO SELECTION" },
713 { 0x4C, 0x00, "LOGICAL UNIT FAILED SELF-CONFIGURATION" },
714 { 0x3E, 0x01, "LOGICAL UNIT FAILURE" },
715 { 0x3E, 0x00, "LOGICAL UNIT HAS NOT SELF-CONFIGURED YET" },
716 { 0x04, 0x01, "LOGICAL UNIT IS IN PROCESS OF BECOMING READY" },
717 { 0x68, 0x00, "LOGICAL UNIT NOT CONFIGURED" },
718 { 0x04, 0x00, "LOGICAL UNIT NOT READY, CAUSE NOT REPORTABLE" },
719 { 0x04, 0x04, "LOGICAL UNIT NOT READY, FORMAT IN PROGRESS" },
720 { 0x04, 0x02, "LOGICAL UNIT NOT READY, INITIALIZING CMD. REQUIRED" },
721 { 0x04, 0x08, "LOGICAL UNIT NOT READY, LONG WRITE IN PROGRESS" },
722 { 0x04, 0x03, "LOGICAL UNIT NOT READY, MANUAL INTERVENTION REQUIRED" },
723 { 0x04, 0x07, "LOGICAL UNIT NOT READY, OPERATION IN PROGRESS" },
724 { 0x04, 0x05, "LOGICAL UNIT NOT READY, REBUILD IN PROGRESS" },
725 { 0x04, 0x06, "LOGICAL UNIT NOT READY, RECALCULATION IN PROGRESS" },
726 { 0x25, 0x00, "LOGICAL UNIT NOT SUPPORTED" },
727 { 0x27, 0x02, "LOGICAL UNIT SOFTWARE WRITE PROTECTED" },
728 { 0x5E, 0x00, "LOW POWER CONDITION ON" },
729 { 0x15, 0x01, "MECHANICAL POSITIONING ERROR" },
730 { 0x53, 0x00, "MEDIA LOAD OR EJECT FAILED" },
731 { 0x3B, 0x0D, "MEDIUM DESTINATION ELEMENT FULL" },
732 { 0x31, 0x00, "MEDIUM FORMAT CORRUPTED" },
733 { 0x3B, 0x13, "MEDIUM MAGAZINE INSERTED" },
734 { 0x3B, 0x14, "MEDIUM MAGAZINE LOCKED" },
735 { 0x3B, 0x11, "MEDIUM MAGAZINE NOT ACCESSIBLE" },
736 { 0x3B, 0x12, "MEDIUM MAGAZINE REMOVED" },
737 { 0x3B, 0x15, "MEDIUM MAGAZINE UNLOCKED" },
738 { 0x3A, 0x00, "MEDIUM NOT PRESENT" },
739 { 0x3A, 0x01, "MEDIUM NOT PRESENT - TRAY CLOSED" },
740 { 0x3A, 0x02, "MEDIUM NOT PRESENT - TRAY OPEN" },
741 { 0x53, 0x02, "MEDIUM REMOVAL PREVENTED" },
742 { 0x3B, 0x0E, "MEDIUM SOURCE ELEMENT EMPTY" },
743 { 0x43, 0x00, "MESSAGE ERROR" },
744 { 0x3F, 0x01, "MICROCODE HAS BEEN CHANGED" },
745 { 0x1D, 0x00, "MISCOMPARE DURING VERIFY OPERATION" },
746 { 0x11, 0x0A, "MISCORRECTED ERROR" },
747 { 0x2A, 0x01, "MODE PARAMETERS CHANGED" },
748 { 0x67, 0x03, "MODIFICATION OF LOGICAL UNIT FAILED" },
749 { 0x69, 0x01, "MULTIPLE LOGICAL UNIT FAILURES" },
750 { 0x07, 0x00, "MULTIPLE PERIPHERAL DEVICES SELECTED" },
751 { 0x11, 0x03, "MULTIPLE READ ERRORS" },
752 { 0x00, 0x00, "NO ADDITIONAL SENSE INFORMATION" },
753 { 0x00, 0x15, "NO CURRENT AUDIO STATUS TO RETURN" },
754 { 0x32, 0x00, "NO DEFECT SPARE LOCATION AVAILABLE" },
755 { 0x11, 0x09, "NO GAP FOUND" },
756 { 0x01, 0x00, "NO INDEX/SECTOR SIGNAL" },
757 { 0x06, 0x00, "NO REFERENCE POSITION FOUND" },
758 { 0x02, 0x00, "NO SEEK COMPLETE" },
759 { 0x03, 0x01, "NO WRITE CURRENT" },
760 { 0x28, 0x00, "NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED" },
761 { 0x00, 0x16, "OPERATION IN PROGRESS" },
762 { 0x5A, 0x01, "OPERATOR MEDIUM REMOVAL REQUEST" },
763 { 0x5A, 0x00, "OPERATOR REQUEST OR STATE CHANGE INPUT" },
764 { 0x5A, 0x03, "OPERATOR SELECTED WRITE PERMIT" },
765 { 0x5A, 0x02, "OPERATOR SELECTED WRITE PROTECT" },
766 { 0x61, 0x02, "OUT OF FOCUS" },
767 { 0x4E, 0x00, "OVERLAPPED COMMANDS ATTEMPTED" },
768 { 0x2D, 0x00, "OVERWRITE ERROR ON UPDATE IN PLACE" },
769 { 0x63, 0x01, "PACKET DOES NOT FIT IN AVAILABLE SPACE" },
770 { 0x3B, 0x05, "PAPER JAM" },
771 { 0x1A, 0x00, "PARAMETER LIST LENGTH ERROR" },
772 { 0x26, 0x01, "PARAMETER NOT SUPPORTED" },
773 { 0x26, 0x02, "PARAMETER VALUE INVALID" },
774 { 0x2A, 0x00, "PARAMETERS CHANGED" },
775 { 0x69, 0x02, "PARITY/DATA MISMATCH" },
776 { 0x1F, 0x00, "PARTIAL DEFECT LIST TRANSFER" },
777 { 0x03, 0x00, "PERIPHERAL DEVICE WRITE FAULT" },
778 { 0x27, 0x05, "PERMANENT WRITE PROTECT" },
779 { 0x27, 0x04, "PERSISTENT WRITE PROTECT" },
780 { 0x50, 0x02, "POSITION ERROR RELATED TO TIMING" },
781 { 0x3B, 0x0C, "POSITION PAST BEGINNING OF MEDIUM" },
782 { 0x3B, 0x0B, "POSITION PAST END OF MEDIUM" },
783 { 0x15, 0x02, "POSITIONING ERROR DETECTED BY READ OF MEDIUM" },
784 { 0x73, 0x01, "POWER CALIBRATION AREA ALMOST FULL" },
785 { 0x73, 0x03, "POWER CALIBRATION AREA ERROR" },
786 { 0x73, 0x02, "POWER CALIBRATION AREA IS FULL" },
787 { 0x29, 0x01, "POWER ON OCCURRED" },
788 { 0x29, 0x00, "POWER ON, RESET, OR BUS DEVICE RESET OCCURRED" },
789 { 0x42, 0x00, "POWER-ON OR SELF-TEST FAILURE (SHOULD USE 40 NN)" },
790 { 0x1C, 0x01, "PRIMARY DEFECT LIST NOT FOUND" },
791 { 0x73, 0x05, "PROGRAM MEMORY AREA IS FULL" },
792 { 0x73, 0x04, "PROGRAM MEMORY AREA UPDATE FAILURE" },
793 { 0x40, 0x00, "RAM FAILURE (SHOULD USE 40 NN)" },
794 { 0x15, 0x00, "RANDOM POSITIONING ERROR" },
795 { 0x11, 0x11, "READ ERROR - LOSS OF STREAMING" },
796 { 0x3B, 0x0A, "READ PAST BEGINNING OF MEDIUM" },
797 { 0x3B, 0x09, "READ PAST END OF MEDIUM" },
798 { 0x11, 0x01, "READ RETRIES EXHAUSTED" },
799 { 0x6C, 0x00, "REBUILD FAILURE OCCURRED" },
800 { 0x6D, 0x00, "RECALCULATE FAILURE OCCURRED" },
801 { 0x14, 0x01, "RECORD NOT FOUND" },
802 { 0x14, 0x06, "RECORD NOT FOUND - DATA AUTO-REALLOCATED" },
803 { 0x14, 0x05, "RECORD NOT FOUND - RECOMMEND REASSIGNMENT" },
804 { 0x14, 0x00, "RECORDED ENTITY NOT FOUND" },
805 { 0x18, 0x02, "RECOVERED DATA - DATA AUTO-REALLOCATED" },
806 { 0x18, 0x05, "RECOVERED DATA - RECOMMEND REASSIGNMENT" },
807 { 0x18, 0x06, "RECOVERED DATA - RECOMMEND REWRITE" },
808 { 0x17, 0x05, "RECOVERED DATA USING PREVIOUS SECTOR ID" },
809 { 0x18, 0x03, "RECOVERED DATA WITH CIRC" },
810 { 0x18, 0x07, "RECOVERED DATA WITH ECC - DATA REWRITTEN" },
811 { 0x18, 0x01, "RECOVERED DATA WITH ERROR CORR. & RETRIES APPLIED" },
812 { 0x18, 0x00, "RECOVERED DATA WITH ERROR CORRECTION APPLIED" },
813 { 0x18, 0x04, "RECOVERED DATA WITH L-EC" },
814 { 0x17, 0x03, "RECOVERED DATA WITH NEGATIVE HEAD OFFSET" },
815 { 0x17, 0x00, "RECOVERED DATA WITH NO ERROR CORRECTION APPLIED" },
816 { 0x17, 0x02, "RECOVERED DATA WITH POSITIVE HEAD OFFSET" },
817 { 0x17, 0x01, "RECOVERED DATA WITH RETRIES" },
818 { 0x17, 0x04, "RECOVERED DATA WITH RETRIES AND/OR CIRC APPLIED" },
819 { 0x17, 0x06, "RECOVERED DATA WITHOUT ECC - DATA AUTO-REALLOCATED" },
820 { 0x17, 0x09, "RECOVERED DATA WITHOUT ECC - DATA REWRITTEN" },
821 { 0x17, 0x07, "RECOVERED DATA WITHOUT ECC - RECOMMEND REASSIGNMENT" },
822 { 0x17, 0x08, "RECOVERED DATA WITHOUT ECC - RECOMMEND REWRITE" },
823 { 0x1E, 0x00, "RECOVERED ID WITH ECC CORRECTION" },
824 { 0x6B, 0x01, "REDUNDANCY LEVEL GOT BETTER" },
825 { 0x6B, 0x02, "REDUNDANCY LEVEL GOT WORSE" },
826 { 0x67, 0x05, "REMOVE OF LOGICAL UNIT FAILED" },
827 { 0x3B, 0x08, "REPOSITION ERROR" },
828 { 0x2A, 0x03, "RESERVATIONS PREEMPTED" },
829 { 0x36, 0x00, "RIBBON, INK, OR TONER FAILURE" },
830 { 0x37, 0x00, "ROUNDED PARAMETER" },
831 { 0x5C, 0x00, "RPL STATUS CHANGE" },
832 { 0x39, 0x00, "SAVING PARAMETERS NOT SUPPORTED" },
833 { 0x62, 0x00, "SCAN HEAD POSITIONING ERROR" },
834 { 0x29, 0x02, "SCSI BUS RESET OCCURRED" },
835 { 0x47, 0x00, "SCSI PARITY ERROR" },
836 { 0x54, 0x00, "SCSI TO HOST SYSTEM INTERFACE FAILURE" },
837 { 0x45, 0x00, "SELECT OR RESELECT FAILURE" },
838 { 0x3B, 0x00, "SEQUENTIAL POSITIONING ERROR" },
839 { 0x72, 0x00, "SESSION FIXATION ERROR" },
840 { 0x72, 0x03, "SESSION FIXATION ERROR - INCOMPLETE TRACK IN SESSION" },
841 { 0x72, 0x01, "SESSION FIXATION ERROR WRITING LEAD-IN" },
842 { 0x72, 0x02, "SESSION FIXATION ERROR WRITING LEAD-OUT" },
843 { 0x00, 0x03, "SETMARK DETECTED" },
844 { 0x3B, 0x04, "SLEW FAILURE" },
845 { 0x09, 0x03, "SPINDLE SERVO FAILURE" },
846 { 0x5C, 0x02, "SPINDLES NOT SYNCHRONIZED" },
847 { 0x5C, 0x01, "SPINDLES SYNCHRONIZED" },
848 { 0x5E, 0x04, "STANDBY CONDITION ACTIVATED BY COMMAND" },
849 { 0x5E, 0x02, "STANDBY CONDITION ACTIVATED BY TIMER" },
850 { 0x6B, 0x00, "STATE CHANGE HAS OCCURRED" },
851 { 0x1B, 0x00, "SYNCHRONOUS DATA TRANSFER ERROR" },
852 { 0x55, 0x01, "SYSTEM BUFFER FULL" },
853 { 0x55, 0x00, "SYSTEM RESOURCE FAILURE" },
854 { 0x4D, 0xFF, "TAGGED OVERLAPPED COMMANDS (NN = QUEUE TAG)" },
855 { 0x33, 0x00, "TAPE LENGTH ERROR" },
856 { 0x3B, 0x03, "TAPE OR ELECTRONIC VERTICAL FORMS UNIT NOT READY" },
857 { 0x3B, 0x01, "TAPE POSITION ERROR AT BEGINNING-OF-MEDIUM" },
858 { 0x3B, 0x02, "TAPE POSITION ERROR AT END-OF-MEDIUM" },
859 { 0x3F, 0x00, "TARGET OPERATING CONDITIONS HAVE CHANGED" },
860 { 0x5B, 0x01, "THRESHOLD CONDITION MET" },
861 { 0x26, 0x03, "THRESHOLD PARAMETERS NOT SUPPORTED" },
862 { 0x3E, 0x02, "TIMEOUT ON LOGICAL UNIT" },
863 { 0x2C, 0x01, "TOO MANY WINDOWS SPECIFIED" },
864 { 0x09, 0x00, "TRACK FOLLOWING ERROR" },
865 { 0x09, 0x01, "TRACKING SERVO FAILURE" },
866 { 0x61, 0x01, "UNABLE TO ACQUIRE VIDEO" },
867 { 0x57, 0x00, "UNABLE TO RECOVER TABLE-OF-CONTENTS" },
868 { 0x53, 0x01, "UNLOAD TAPE FAILURE" },
869 { 0x11, 0x00, "UNRECOVERED READ ERROR" },
870 { 0x11, 0x04, "UNRECOVERED READ ERROR - AUTO REALLOCATE FAILED" },
871 { 0x11, 0x0B, "UNRECOVERED READ ERROR - RECOMMEND REASSIGNMENT" },
872 { 0x11, 0x0C, "UNRECOVERED READ ERROR - RECOMMEND REWRITE THE DATA" },
873 { 0x46, 0x00, "UNSUCCESSFUL SOFT RESET" },
874 { 0x35, 0x01, "UNSUPPORTED ENCLOSURE FUNCTION" },
875 { 0x59, 0x00, "UPDATED BLOCK READ" },
876 { 0x61, 0x00, "VIDEO ACQUISITION ERROR" },
877 { 0x65, 0x00, "VOLTAGE FAULT" },
878 { 0x0B, 0x00, "WARNING" },
879 { 0x0B, 0x02, "WARNING - ENCLOSURE DEGRADED" },
880 { 0x0B, 0x01, "WARNING - SPECIFIED TEMPERATURE EXCEEDED" },
881 { 0x50, 0x00, "WRITE APPEND ERROR" },
882 { 0x50, 0x01, "WRITE APPEND POSITION ERROR" },
883 { 0x0C, 0x00, "WRITE ERROR" },
884 { 0x0C, 0x02, "WRITE ERROR - AUTO REALLOCATION FAILED" },
885 { 0x0C, 0x09, "WRITE ERROR - LOSS OF STREAMING" },
886 { 0x0C, 0x0A, "WRITE ERROR - PADDING BLOCKS ADDED" },
887 { 0x0C, 0x03, "WRITE ERROR - RECOMMEND REASSIGNMENT" },
888 { 0x0C, 0x01, "WRITE ERROR - RECOVERED WITH AUTO REALLOCATION" },
889 { 0x0C, 0x08, "WRITE ERROR - RECOVERY FAILED" },
890 { 0x0C, 0x07, "WRITE ERROR - RECOVERY NEEDED" },
891 { 0x27, 0x00, "WRITE PROTECTED" },
892};
893
894/**
895 * Return the plain text of an ATA command for debugging purposes.
896 * Don't allocate the string as we use this function in Log() statements.
897 */
898const char * ATACmdText(uint8_t uCmd)
899{
900 AssertCompile(RT_ELEMENTS(g_apszATACmdNames) == (1 << (8*sizeof(uCmd))));
901 return g_apszATACmdNames[uCmd];
902}
903
904/**
905 * Return the plain text of a SCSI command for debugging purposes.
906 * Don't allocate the string as we use this function in Log() statements.
907 */
908const char * SCSICmdText(uint8_t uCmd)
909{
910 AssertCompile(RT_ELEMENTS(g_apszSCSICmdNames) == (1 << (8*sizeof(uCmd))));
911 return g_apszSCSICmdNames[uCmd];
912}
913
914/**
915 * Return the plain text of a SCSI sense code.
916 * Don't allocate the string as we use this function in Log() statements.
917 */
918const char * SCSISenseText(uint8_t uSense)
919{
920 if (uSense < RT_ELEMENTS(g_apszSCSISenseNames))
921 return g_apszSCSISenseNames[uSense];
922
923 return "(SCSI sense out of range)";
924}
925
926/**
927 * Return the plain text of an extended SCSI sense key.
928 * Don't allocate the string as we use this function in Log() statements.
929 */
930const char * SCSISenseExtText(uint8_t uASC, uint8_t uASCQ)
931{
932 unsigned iIdx;
933
934 /* Linear search. Doesn't hurt as we don't call this function very frequently */
935 for (iIdx = 0; iIdx < RT_ELEMENTS(g_aSCSISenseText); iIdx++)
936 {
937 if ( g_aSCSISenseText[iIdx].uASC == uASC
938 && ( g_aSCSISenseText[iIdx].uASCQ == uASCQ
939 || g_aSCSISenseText[iIdx].uASCQ == 0xff))
940 return g_aSCSISenseText[iIdx].pszSenseText;
941 }
942 return "(Unknown extended sense code)";
943}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette