More meth updates.
[linux-2.6/linux-mips.git] / drivers / ide / ide-cd.h
blob6a08e3e210a9838c37c240dbbb2f22d51625e66d
1 /*
2 * linux/drivers/ide/ide_cd.h
4 * Copyright (C) 1996-98 Erik Andersen
5 * Copyright (C) 1998-2000 Jens Axboe
6 */
7 #ifndef _IDE_CD_H
8 #define _IDE_CD_H
10 #include <linux/cdrom.h>
11 #include <asm/byteorder.h>
13 /* Turn this on to have the driver print out the meanings of the
14 ATAPI error codes. This will use up additional kernel-space
15 memory, though. */
17 #ifndef VERBOSE_IDE_CD_ERRORS
18 #define VERBOSE_IDE_CD_ERRORS 1
19 #endif
22 /* Turning this on will remove code to work around various nonstandard
23 ATAPI implementations. If you know your drive follows the standard,
24 this will give you a slightly smaller kernel. */
26 #ifndef STANDARD_ATAPI
27 #define STANDARD_ATAPI 0
28 #endif
31 /* Turning this on will disable the door-locking functionality.
32 This is apparently needed for supermount. */
34 #ifndef NO_DOOR_LOCKING
35 #define NO_DOOR_LOCKING 0
36 #endif
38 /************************************************************************/
40 #define SECTOR_BITS 9
41 #ifndef SECTOR_SIZE
42 #define SECTOR_SIZE (1 << SECTOR_BITS)
43 #endif
44 #define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS)
45 #define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)
46 #define SECTORS_BUFFER (SECTOR_BUFFER_SIZE >> SECTOR_BITS)
47 #define SECTORS_MAX (131072 >> SECTOR_BITS)
49 #define BLOCKS_PER_FRAME (CD_FRAMESIZE / BLOCK_SIZE)
51 #define MIN(a,b) ((a) < (b) ? (a) : (b))
53 /* special command codes for strategy routine. */
54 #define PACKET_COMMAND 4315
55 #define REQUEST_SENSE_COMMAND 4316
56 #define RESET_DRIVE_COMMAND 4317
59 /* Configuration flags. These describe the capabilities of the drive.
60 They generally do not change after initialization, unless we learn
61 more about the drive from stuff failing. */
62 struct ide_cd_config_flags {
63 __u8 drq_interrupt : 1; /* Device sends an interrupt when ready
64 for a packet command. */
65 __u8 no_doorlock : 1; /* Drive cannot lock the door. */
66 __u8 no_eject : 1; /* Drive cannot eject the disc. */
67 __u8 nec260 : 1; /* Drive is a pre-1.2 NEC 260 drive. */
68 __u8 playmsf_as_bcd : 1; /* PLAYMSF command takes BCD args. */
69 __u8 tocaddr_as_bcd : 1; /* TOC addresses are in BCD. */
70 __u8 toctracks_as_bcd : 1; /* TOC track numbers are in BCD. */
71 __u8 subchan_as_bcd : 1; /* Subchannel info is in BCD. */
72 __u8 is_changer : 1; /* Drive is a changer. */
73 __u8 cd_r : 1; /* Drive can write to CD-R media . */
74 __u8 cd_rw : 1; /* Drive can write to CD-R/W media . */
75 __u8 dvd : 1; /* Drive is a DVD-ROM */
76 __u8 dvd_r : 1; /* Drive can write DVD-R */
77 __u8 dvd_ram : 1; /* Drive can write DVD-RAM */
78 __u8 test_write : 1; /* Drive can fake writes */
79 __u8 supp_disc_present : 1; /* Changer can report exact contents
80 of slots. */
81 __u8 limit_nframes : 1; /* Drive does not provide data in
82 multiples of SECTOR_SIZE when more
83 than one interrupt is needed. */
84 __u8 seeking : 1; /* Seeking in progress */
85 __u8 audio_play : 1; /* can do audio related commands */
86 __u8 close_tray : 1; /* can close the tray */
87 __u8 writing : 1; /* pseudo write in progress */
88 __u8 reserved : 3;
89 byte max_speed; /* Max speed of the drive */
91 #define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags))
94 /* State flags. These give information about the current state of the
95 drive, and will change during normal operation. */
96 struct ide_cd_state_flags {
97 __u8 media_changed : 1; /* Driver has noticed a media change. */
98 __u8 toc_valid : 1; /* Saved TOC information is current. */
99 __u8 door_locked : 1; /* We think that the drive door is locked. */
100 __u8 writing : 1; /* the drive is currently writing */
101 __u8 reserved : 4;
102 byte current_speed; /* Current speed of the drive */
105 #define CDROM_STATE_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->state_flags))
107 /* Structure of a MSF cdrom address. */
108 struct atapi_msf {
109 byte reserved;
110 byte minute;
111 byte second;
112 byte frame;
115 /* Space to hold the disk TOC. */
116 #define MAX_TRACKS 99
117 struct atapi_toc_header {
118 unsigned short toc_length;
119 byte first_track;
120 byte last_track;
123 struct atapi_toc_entry {
124 byte reserved1;
125 #if defined(__BIG_ENDIAN_BITFIELD)
126 __u8 adr : 4;
127 __u8 control : 4;
128 #elif defined(__LITTLE_ENDIAN_BITFIELD)
129 __u8 control : 4;
130 __u8 adr : 4;
131 #else
132 #error "Please fix <asm/byteorder.h>"
133 #endif
134 byte track;
135 byte reserved2;
136 union {
137 unsigned lba;
138 struct atapi_msf msf;
139 } addr;
142 struct atapi_toc {
143 int last_session_lba;
144 int xa_flag;
145 unsigned long capacity;
146 struct atapi_toc_header hdr;
147 struct atapi_toc_entry ent[MAX_TRACKS+1];
148 /* One extra for the leadout. */
152 /* This structure is annoyingly close to, but not identical with,
153 the cdrom_subchnl structure from cdrom.h. */
154 struct atapi_cdrom_subchnl {
155 u_char acdsc_reserved;
156 u_char acdsc_audiostatus;
157 u_short acdsc_length;
158 u_char acdsc_format;
160 #if defined(__BIG_ENDIAN_BITFIELD)
161 u_char acdsc_ctrl: 4;
162 u_char acdsc_adr: 4;
163 #elif defined(__LITTLE_ENDIAN_BITFIELD)
164 u_char acdsc_adr: 4;
165 u_char acdsc_ctrl: 4;
166 #else
167 #error "Please fix <asm/byteorder.h>"
168 #endif
169 u_char acdsc_trk;
170 u_char acdsc_ind;
171 union {
172 struct atapi_msf msf;
173 int lba;
174 } acdsc_absaddr;
175 union {
176 struct atapi_msf msf;
177 int lba;
178 } acdsc_reladdr;
183 /* This should probably go into cdrom.h along with the other
184 * generic stuff now in the Mt. Fuji spec.
186 struct atapi_capabilities_page {
187 struct mode_page_header header;
188 #if defined(__BIG_ENDIAN_BITFIELD)
189 __u8 parameters_saveable : 1;
190 __u8 reserved1 : 1;
191 __u8 page_code : 6;
192 #elif defined(__LITTLE_ENDIAN_BITFIELD)
193 __u8 page_code : 6;
194 __u8 reserved1 : 1;
195 __u8 parameters_saveable : 1;
196 #else
197 #error "Please fix <asm/byteorder.h>"
198 #endif
200 byte page_length;
202 #if defined(__BIG_ENDIAN_BITFIELD)
203 __u8 reserved2 : 2;
204 /* Drive supports reading of DVD-RAM discs */
205 __u8 dvd_ram_read : 1;
206 /* Drive supports reading of DVD-R discs */
207 __u8 dvd_r_read : 1;
208 /* Drive supports reading of DVD-ROM discs */
209 __u8 dvd_rom : 1;
210 /* Drive supports reading CD-R discs with addressing method 2 */
211 __u8 method2 : 1; /* reserved in 1.2 */
212 /* Drive can read from CD-R/W (CD-E) discs (orange book, part III) */
213 __u8 cd_rw_read : 1; /* reserved in 1.2 */
214 /* Drive supports read from CD-R discs (orange book, part II) */
215 __u8 cd_r_read : 1; /* reserved in 1.2 */
216 #elif defined(__LITTLE_ENDIAN_BITFIELD)
217 /* Drive supports read from CD-R discs (orange book, part II) */
218 __u8 cd_r_read : 1; /* reserved in 1.2 */
219 /* Drive can read from CD-R/W (CD-E) discs (orange book, part III) */
220 __u8 cd_rw_read : 1; /* reserved in 1.2 */
221 /* Drive supports reading CD-R discs with addressing method 2 */
222 __u8 method2 : 1;
223 /* Drive supports reading of DVD-ROM discs */
224 __u8 dvd_rom : 1;
225 /* Drive supports reading of DVD-R discs */
226 __u8 dvd_r_read : 1;
227 /* Drive supports reading of DVD-RAM discs */
228 __u8 dvd_ram_read : 1;
229 __u8 reserved2 : 2;
230 #else
231 #error "Please fix <asm/byteorder.h>"
232 #endif
234 #if defined(__BIG_ENDIAN_BITFIELD)
235 __u8 reserved3 : 2;
236 /* Drive can write DVD-RAM discs */
237 __u8 dvd_ram_write : 1;
238 /* Drive can write DVD-R discs */
239 __u8 dvd_r_write : 1;
240 __u8 reserved3a : 1;
241 /* Drive can fake writes */
242 __u8 test_write : 1;
243 /* Drive can write to CD-R/W (CD-E) discs (orange book, part III) */
244 __u8 cd_rw_write : 1; /* reserved in 1.2 */
245 /* Drive supports write to CD-R discs (orange book, part II) */
246 __u8 cd_r_write : 1; /* reserved in 1.2 */
247 #elif defined(__LITTLE_ENDIAN_BITFIELD)
248 /* Drive can write to CD-R discs (orange book, part II) */
249 __u8 cd_r_write : 1; /* reserved in 1.2 */
250 /* Drive can write to CD-R/W (CD-E) discs (orange book, part III) */
251 __u8 cd_rw_write : 1; /* reserved in 1.2 */
252 /* Drive can fake writes */
253 __u8 test_write : 1;
254 __u8 reserved3a : 1;
255 /* Drive can write DVD-R discs */
256 __u8 dvd_r_write : 1;
257 /* Drive can write DVD-RAM discs */
258 __u8 dvd_ram_write : 1;
259 __u8 reserved3 : 2;
260 #else
261 #error "Please fix <asm/byteorder.h>"
262 #endif
264 #if defined(__BIG_ENDIAN_BITFIELD)
265 __u8 reserved4 : 1;
266 /* Drive can read multisession discs. */
267 __u8 multisession : 1;
268 /* Drive can read mode 2, form 2 data. */
269 __u8 mode2_form2 : 1;
270 /* Drive can read mode 2, form 1 (XA) data. */
271 __u8 mode2_form1 : 1;
272 /* Drive supports digital output on port 2. */
273 __u8 digport2 : 1;
274 /* Drive supports digital output on port 1. */
275 __u8 digport1 : 1;
276 /* Drive can deliver a composite audio/video data stream. */
277 __u8 composite : 1;
278 /* Drive supports audio play operations. */
279 __u8 audio_play : 1;
280 #elif defined(__LITTLE_ENDIAN_BITFIELD)
281 /* Drive supports audio play operations. */
282 __u8 audio_play : 1;
283 /* Drive can deliver a composite audio/video data stream. */
284 __u8 composite : 1;
285 /* Drive supports digital output on port 1. */
286 __u8 digport1 : 1;
287 /* Drive supports digital output on port 2. */
288 __u8 digport2 : 1;
289 /* Drive can read mode 2, form 1 (XA) data. */
290 __u8 mode2_form1 : 1;
291 /* Drive can read mode 2, form 2 data. */
292 __u8 mode2_form2 : 1;
293 /* Drive can read multisession discs. */
294 __u8 multisession : 1;
295 __u8 reserved4 : 1;
296 #else
297 #error "Please fix <asm/byteorder.h>"
298 #endif
300 #if defined(__BIG_ENDIAN_BITFIELD)
301 __u8 reserved5 : 1;
302 /* Drive can return Media Catalog Number (UPC) info. */
303 __u8 upc : 1;
304 /* Drive can return International Standard Recording Code info. */
305 __u8 isrc : 1;
306 /* Drive supports C2 error pointers. */
307 __u8 c2_pointers : 1;
308 /* R-W data will be returned deinterleaved and error corrected. */
309 __u8 rw_corr : 1;
310 /* Subchannel reads can return combined R-W information. */
311 __u8 rw_supported : 1;
312 /* Drive can continue a read cdda operation from a loss of streaming.*/
313 __u8 cdda_accurate : 1;
314 /* Drive can read Red Book audio data. */
315 __u8 cdda : 1;
316 #elif defined(__LITTLE_ENDIAN_BITFIELD)
317 /* Drive can read Red Book audio data. */
318 __u8 cdda : 1;
319 /* Drive can continue a read cdda operation from a loss of streaming.*/
320 __u8 cdda_accurate : 1;
321 /* Subchannel reads can return combined R-W information. */
322 __u8 rw_supported : 1;
323 /* R-W data will be returned deinterleaved and error corrected. */
324 __u8 rw_corr : 1;
325 /* Drive supports C2 error pointers. */
326 __u8 c2_pointers : 1;
327 /* Drive can return International Standard Recording Code info. */
328 __u8 isrc : 1;
329 /* Drive can return Media Catalog Number (UPC) info. */
330 __u8 upc : 1;
331 __u8 reserved5 : 1;
332 #else
333 #error "Please fix <asm/byteorder.h>"
334 #endif
336 #if defined(__BIG_ENDIAN_BITFIELD)
337 /* Drive mechanism types. */
338 mechtype_t mechtype : 3;
339 __u8 reserved6 : 1;
340 /* Drive can eject a disc or changer cartridge. */
341 __u8 eject : 1;
342 /* State of prevent/allow jumper. */
343 __u8 prevent_jumper : 1;
344 /* Present state of door lock. */
345 __u8 lock_state : 1;
346 /* Drive can lock the door. */
347 __u8 lock : 1;
348 #elif defined(__LITTLE_ENDIAN_BITFIELD)
350 /* Drive can lock the door. */
351 __u8 lock : 1;
352 /* Present state of door lock. */
353 __u8 lock_state : 1;
354 /* State of prevent/allow jumper. */
355 __u8 prevent_jumper : 1;
356 /* Drive can eject a disc or changer cartridge. */
357 __u8 eject : 1;
358 __u8 reserved6 : 1;
359 /* Drive mechanism types. */
360 mechtype_t mechtype : 3;
361 #else
362 #error "Please fix <asm/byteorder.h>"
363 #endif
365 #if defined(__BIG_ENDIAN_BITFIELD)
366 __u8 reserved7 : 4;
367 /* Drive supports software slot selection. */
368 __u8 sss : 1; /* reserved in 1.2 */
369 /* Changer can report exact contents of slots. */
370 __u8 disc_present : 1; /* reserved in 1.2 */
371 /* Audio for each channel can be muted independently. */
372 __u8 separate_mute : 1;
373 /* Audio level for each channel can be controlled independently. */
374 __u8 separate_volume : 1;
375 #elif defined(__LITTLE_ENDIAN_BITFIELD)
377 /* Audio level for each channel can be controlled independently. */
378 __u8 separate_volume : 1;
379 /* Audio for each channel can be muted independently. */
380 __u8 separate_mute : 1;
381 /* Changer can report exact contents of slots. */
382 __u8 disc_present : 1; /* reserved in 1.2 */
383 /* Drive supports software slot selection. */
384 __u8 sss : 1; /* reserved in 1.2 */
385 __u8 reserved7 : 4;
386 #else
387 #error "Please fix <asm/byteorder.h>"
388 #endif
390 /* Note: the following four fields are returned in big-endian form. */
391 /* Maximum speed (in kB/s). */
392 unsigned short maxspeed;
393 /* Number of discrete volume levels. */
394 unsigned short n_vol_levels;
395 /* Size of cache in drive, in kB. */
396 unsigned short buffer_size;
397 /* Current speed (in kB/s). */
398 unsigned short curspeed;
399 char pad[4];
403 struct atapi_mechstat_header {
404 #if defined(__BIG_ENDIAN_BITFIELD)
405 __u8 fault : 1;
406 __u8 changer_state : 2;
407 __u8 curslot : 5;
408 #elif defined(__LITTLE_ENDIAN_BITFIELD)
409 __u8 curslot : 5;
410 __u8 changer_state : 2;
411 __u8 fault : 1;
412 #else
413 #error "Please fix <asm/byteorder.h>"
414 #endif
416 #if defined(__BIG_ENDIAN_BITFIELD)
417 __u8 mech_state : 3;
418 __u8 door_open : 1;
419 __u8 reserved1 : 4;
420 #elif defined(__LITTLE_ENDIAN_BITFIELD)
421 __u8 reserved1 : 4;
422 __u8 door_open : 1;
423 __u8 mech_state : 3;
424 #else
425 #error "Please fix <asm/byteorder.h>"
426 #endif
428 byte curlba[3];
429 byte nslots;
430 __u16 slot_tablelen;
434 struct atapi_slot {
435 #if defined(__BIG_ENDIAN_BITFIELD)
436 __u8 disc_present : 1;
437 __u8 reserved1 : 6;
438 __u8 change : 1;
439 #elif defined(__LITTLE_ENDIAN_BITFIELD)
440 __u8 change : 1;
441 __u8 reserved1 : 6;
442 __u8 disc_present : 1;
443 #else
444 #error "Please fix <asm/byteorder.h>"
445 #endif
447 byte reserved2[3];
450 struct atapi_changer_info {
451 struct atapi_mechstat_header hdr;
452 struct atapi_slot slots[0];
455 /* Extra per-device info for cdrom drives. */
456 struct cdrom_info {
458 /* Buffer for table of contents. NULL if we haven't allocated
459 a TOC buffer for this device yet. */
461 struct atapi_toc *toc;
463 unsigned long sector_buffered;
464 unsigned long nsectors_buffered;
465 unsigned char *buffer;
467 /* The result of the last successful request sense command
468 on this device. */
469 struct request_sense sense_data;
471 struct request request_sense_request;
472 int dma;
473 int cmd;
474 unsigned long last_block;
475 unsigned long start_seek;
476 /* Buffer to hold mechanism status and changer slot table. */
477 struct atapi_changer_info *changer_info;
479 struct ide_cd_config_flags config_flags;
480 struct ide_cd_state_flags state_flags;
482 /* Per-device info needed by cdrom.c generic driver. */
483 struct cdrom_device_info devinfo;
486 /****************************************************************************
487 * Descriptions of ATAPI error codes.
490 #define ARY_LEN(a) ((sizeof(a) / sizeof(a[0])))
492 /* This stuff should be in cdrom.h, since it is now generic... */
494 /* ATAPI sense keys (from table 140 of ATAPI 2.6) */
495 #define NO_SENSE 0x00
496 #define RECOVERED_ERROR 0x01
497 #define NOT_READY 0x02
498 #define MEDIUM_ERROR 0x03
499 #define HARDWARE_ERROR 0x04
500 #define ILLEGAL_REQUEST 0x05
501 #define UNIT_ATTENTION 0x06
502 #define DATA_PROTECT 0x07
503 #define ABORTED_COMMAND 0x0b
504 #define MISCOMPARE 0x0e
508 /* This stuff should be in cdrom.h, since it is now generic... */
509 #if VERBOSE_IDE_CD_ERRORS
511 /* The generic packet command opcodes for CD/DVD Logical Units,
512 * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
513 const struct {
514 unsigned short packet_command;
515 const char * const text;
516 } packet_command_texts[] = {
517 { GPCMD_TEST_UNIT_READY, "Test Unit Ready" },
518 { GPCMD_REQUEST_SENSE, "Request Sense" },
519 { GPCMD_FORMAT_UNIT, "Format Unit" },
520 { GPCMD_INQUIRY, "Inquiry" },
521 { GPCMD_START_STOP_UNIT, "Start/Stop Unit" },
522 { GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL, "Prevent/Allow Medium Removal" },
523 { GPCMD_READ_FORMAT_CAPACITIES, "Read Format Capacities" },
524 { GPCMD_READ_CDVD_CAPACITY, "Read Cd/Dvd Capacity" },
525 { GPCMD_READ_10, "Read 10" },
526 { GPCMD_WRITE_10, "Write 10" },
527 { GPCMD_SEEK, "Seek" },
528 { GPCMD_WRITE_AND_VERIFY_10, "Write and Verify 10" },
529 { GPCMD_VERIFY_10, "Verify 10" },
530 { GPCMD_FLUSH_CACHE, "Flush Cache" },
531 { GPCMD_READ_SUBCHANNEL, "Read Subchannel" },
532 { GPCMD_READ_TOC_PMA_ATIP, "Read Table of Contents" },
533 { GPCMD_READ_HEADER, "Read Header" },
534 { GPCMD_PLAY_AUDIO_10, "Play Audio 10" },
535 { GPCMD_GET_CONFIGURATION, "Get Configuration" },
536 { GPCMD_PLAY_AUDIO_MSF, "Play Audio MSF" },
537 { GPCMD_PLAYAUDIO_TI, "Play Audio TrackIndex" },
538 { GPCMD_GET_EVENT_STATUS_NOTIFICATION, "Get Event Status Notification" },
539 { GPCMD_PAUSE_RESUME, "Pause/Resume" },
540 { GPCMD_STOP_PLAY_SCAN, "Stop Play/Scan" },
541 { GPCMD_READ_DISC_INFO, "Read Disc Info" },
542 { GPCMD_READ_TRACK_RZONE_INFO, "Read Track Rzone Info" },
543 { GPCMD_RESERVE_RZONE_TRACK, "Reserve Rzone Track" },
544 { GPCMD_SEND_OPC, "Send OPC" },
545 { GPCMD_MODE_SELECT_10, "Mode Select 10" },
546 { GPCMD_REPAIR_RZONE_TRACK, "Repair Rzone Track" },
547 { GPCMD_MODE_SENSE_10, "Mode Sense 10" },
548 { GPCMD_CLOSE_TRACK, "Close Track" },
549 { GPCMD_BLANK, "Blank" },
550 { GPCMD_SEND_EVENT, "Send Event" },
551 { GPCMD_SEND_KEY, "Send Key" },
552 { GPCMD_REPORT_KEY, "Report Key" },
553 { GPCMD_LOAD_UNLOAD, "Load/Unload" },
554 { GPCMD_SET_READ_AHEAD, "Set Read-ahead" },
555 { GPCMD_READ_12, "Read 12" },
556 { GPCMD_GET_PERFORMANCE, "Get Performance" },
557 { GPCMD_SEND_DVD_STRUCTURE, "Send DVD Structure" },
558 { GPCMD_READ_DVD_STRUCTURE, "Read DVD Structure" },
559 { GPCMD_SET_STREAMING, "Set Streaming" },
560 { GPCMD_READ_CD_MSF, "Read CD MSF" },
561 { GPCMD_SCAN, "Scan" },
562 { GPCMD_SET_SPEED, "Set Speed" },
563 { GPCMD_PLAY_CD, "Play CD" },
564 { GPCMD_MECHANISM_STATUS, "Mechanism Status" },
565 { GPCMD_READ_CD, "Read CD" },
570 /* From Table 303 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
571 const char * const sense_key_texts[16] = {
572 "No sense data",
573 "Recovered error",
574 "Not ready",
575 "Medium error",
576 "Hardware error",
577 "Illegal request",
578 "Unit attention",
579 "Data protect",
580 "(reserved)",
581 "(reserved)",
582 "(reserved)",
583 "Aborted command",
584 "(reserved)",
585 "(reserved)",
586 "Miscompare",
587 "(reserved)",
590 /* From Table 304 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
591 const struct {
592 unsigned long asc_ascq;
593 const char * const text;
594 } sense_data_texts[] = {
595 { 0x000000, "No additional sense information" },
596 { 0x000011, "Play operation in progress" },
597 { 0x000012, "Play operation paused" },
598 { 0x000013, "Play operation successfully completed" },
599 { 0x000014, "Play operation stopped due to error" },
600 { 0x000015, "No current audio status to return" },
601 { 0x010c0a, "Write error - padding blocks added" },
602 { 0x011700, "Recovered data with no error correction applied" },
603 { 0x011701, "Recovered data with retries" },
604 { 0x011702, "Recovered data with positive head offset" },
605 { 0x011703, "Recovered data with negative head offset" },
606 { 0x011704, "Recovered data with retries and/or CIRC applied" },
607 { 0x011705, "Recovered data using previous sector ID" },
608 { 0x011800, "Recovered data with error correction applied" },
609 { 0x011801, "Recovered data with error correction and retries applied"},
610 { 0x011802, "Recovered data - the data was auto-reallocated" },
611 { 0x011803, "Recovered data with CIRC" },
612 { 0x011804, "Recovered data with L-EC" },
613 { 0x015d00,
614 "Failure prediction threshold exceeded - Predicted logical unit failure" },
615 { 0x015d01,
616 "Failure prediction threshold exceeded - Predicted media failure" },
617 { 0x015dff, "Failure prediction threshold exceeded - False" },
618 { 0x017301, "Power calibration area almost full" },
619 { 0x020400, "Logical unit not ready - cause not reportable" },
620 /* Following is misspelled in ATAPI 2.6, _and_ in Mt. Fuji */
621 { 0x020401,
622 "Logical unit not ready - in progress [sic] of becoming ready" },
623 { 0x020402, "Logical unit not ready - initializing command required" },
624 { 0x020403, "Logical unit not ready - manual intervention required" },
625 { 0x020404, "Logical unit not ready - format in progress" },
626 { 0x020407, "Logical unit not ready - operation in progress" },
627 { 0x020408, "Logical unit not ready - long write in progress" },
628 { 0x020600, "No reference position found (media may be upside down)" },
629 { 0x023000, "Incompatible medium installed" },
630 { 0x023a00, "Medium not present" },
631 { 0x025300, "Media load or eject failed" },
632 { 0x025700, "Unable to recover table of contents" },
633 { 0x030300, "Peripheral device write fault" },
634 { 0x030301, "No write current" },
635 { 0x030302, "Excessive write errors" },
636 { 0x030c00, "Write error" },
637 { 0x030c01, "Write error - Recovered with auto reallocation" },
638 { 0x030c02, "Write error - auto reallocation failed" },
639 { 0x030c03, "Write error - recommend reassignment" },
640 { 0x030c04, "Compression check miscompare error" },
641 { 0x030c05, "Data expansion occurred during compress" },
642 { 0x030c06, "Block not compressible" },
643 { 0x030c07, "Write error - recovery needed" },
644 { 0x030c08, "Write error - recovery failed" },
645 { 0x030c09, "Write error - loss of streaming" },
646 { 0x031100, "Unrecovered read error" },
647 { 0x031106, "CIRC unrecovered error" },
648 { 0x033101, "Format command failed" },
649 { 0x033200, "No defect spare location available" },
650 { 0x033201, "Defect list update failure" },
651 { 0x035100, "Erase failure" },
652 { 0x037200, "Session fixation error" },
653 { 0x037201, "Session fixation error writin lead-in" },
654 { 0x037202, "Session fixation error writin lead-out" },
655 { 0x037300, "CD control error" },
656 { 0x037302, "Power calibration area is full" },
657 { 0x037303, "Power calibration area error" },
658 { 0x037304, "Program memory area / RMA update failure" },
659 { 0x037305, "Program memory area / RMA is full" },
660 { 0x037306, "Program memory area / RMA is (almost) full" },
662 { 0x040200, "No seek complete" },
663 { 0x040300, "Write fault" },
664 { 0x040900, "Track following error" },
665 { 0x040901, "Tracking servo failure" },
666 { 0x040902, "Focus servo failure" },
667 { 0x040903, "Spindle servo failure" },
668 { 0x041500, "Random positioning error" },
669 { 0x041501, "Mechanical positioning or changer error" },
670 { 0x041502, "Positioning error detected by read of medium" },
671 { 0x043c00, "Mechanical positioning or changer error" },
672 { 0x044000, "Diagnostic failure on component (ASCQ)" },
673 { 0x044400, "Internal CD/DVD logical unit failure" },
674 { 0x04b600, "Media load mechanism failed" },
675 { 0x051a00, "Parameter list length error" },
676 { 0x052000, "Invalid command operation code" },
677 { 0x052100, "Logical block address out of range" },
678 { 0x052102, "Invalid address for write" },
679 { 0x052400, "Invalid field in command packet" },
680 { 0x052600, "Invalid field in parameter list" },
681 { 0x052601, "Parameter not supported" },
682 { 0x052602, "Parameter value invalid" },
683 { 0x052700, "Write protected media" },
684 { 0x052c00, "Command sequence error" },
685 { 0x052c03, "Current program area is not empty" },
686 { 0x052c04, "Current program area is empty" },
687 { 0x053001, "Cannot read medium - unknown format" },
688 { 0x053002, "Cannot read medium - incompatible format" },
689 { 0x053900, "Saving parameters not supported" },
690 { 0x054e00, "Overlapped commands attempted" },
691 { 0x055302, "Medium removal prevented" },
692 { 0x055500, "System resource failure" },
693 { 0x056300, "End of user area encountered on this track" },
694 { 0x056400, "Illegal mode for this track or incompatible medium" },
695 { 0x056f00, "Copy protection key exchange failure - Authentication failure" },
696 { 0x056f01, "Copy protection key exchange failure - Key not present" },
697 { 0x056f02, "Copy protection key exchange failure - Key not established" },
698 { 0x056f03, "Read of scrambled sector without authentication" },
699 { 0x056f04, "Media region code is mismatched to logical unit" },
700 { 0x056f05, "Drive region must be permanent / region reset count error" },
701 { 0x057203, "Session fixation error - incomplete track in session" },
702 { 0x057204, "Empty or partially written reserved track" },
703 { 0x057205, "No more RZONE reservations are allowed" },
704 { 0x05bf00, "Loss of streaming" },
705 { 0x062800, "Not ready to ready transition, medium may have changed" },
706 { 0x062900, "Power on, reset or hardware reset occurred" },
707 { 0x062a00, "Parameters changed" },
708 { 0x062a01, "Mode parameters changed" },
709 { 0x062e00, "Insufficient time for operation" },
710 { 0x063f00, "Logical unit operating conditions have changed" },
711 { 0x063f01, "Microcode has been changed" },
712 { 0x065a00, "Operator request or state change input (unspecified)" },
713 { 0x065a01, "Operator medium removal request" },
714 { 0x0bb900, "Play operation aborted" },
716 /* Here we use 0xff for the key (not a valid key) to signify
717 * that these can have _any_ key value associated with them... */
718 { 0xff0401, "Logical unit is in process of becoming ready" },
719 { 0xff0400, "Logical unit not ready, cause not reportable" },
720 { 0xff0402, "Logical unit not ready, initializing command required" },
721 { 0xff0403, "Logical unit not ready, manual intervention required" },
722 { 0xff0500, "Logical unit does not respond to selection" },
723 { 0xff0800, "Logical unit communication failure" },
724 { 0xff0802, "Logical unit communication parity error" },
725 { 0xff0801, "Logical unit communication time-out" },
726 { 0xff2500, "Logical unit not supported" },
727 { 0xff4c00, "Logical unit failed self-configuration" },
728 { 0xff3e00, "Logical unit has not self-configured yet" },
730 #endif
733 #endif /* _IDE_CD_H */