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