Import 2.3.9pre5
[davej-history.git] / drivers / block / ide-cd.h
blob553013b9df0c9e371cba28ce56c7e110bce4fa3a
1 #ifndef _IDE_CD_H
2 #define _IDE_CD_H
3 /*
4 * linux/drivers/block/ide_modes.h
6 * Copyright (C) 1996 Erik Andersen
7 * Copyright (C) 1998, 1999 Jens Axboe
8 */
10 #include <asm/byteorder.h>
12 /* Turn this on to have the driver print out the meanings of the
13 ATAPI error codes. This will use up additional kernel-space
14 memory, though. */
16 #ifndef VERBOSE_IDE_CD_ERRORS
17 #define VERBOSE_IDE_CD_ERRORS 1
18 #endif
21 /* Turning this on will remove code to work around various nonstandard
22 ATAPI implementations. If you know your drive follows the standard,
23 this will give you a slightly smaller kernel. */
25 #ifndef STANDARD_ATAPI
26 #define STANDARD_ATAPI 0
27 #endif
30 /* Turning this on will disable the door-locking functionality.
31 This is apparently needed for supermount. */
33 #ifndef NO_DOOR_LOCKING
34 #define NO_DOOR_LOCKING 0
35 #endif
38 /* Size of buffer to allocate, in blocks, for audio reads. */
40 #ifndef CDROM_NBLOCKS_BUFFER
41 #define CDROM_NBLOCKS_BUFFER 8
42 #endif
45 /************************************************************************/
47 #define SECTOR_SIZE 512
48 #define SECTOR_BITS 9
49 #define SECTORS_PER_FRAME (CD_FRAMESIZE / SECTOR_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 * For controlling drive spindown time.
61 #define CDROMGETSPINDOWN 0x531d
62 #define CDROMSETSPINDOWN 0x531e
65 /* Some ATAPI command opcodes (just like SCSI).
66 (Some other cdrom-specific codes are in cdrom.h.) */
67 #define TEST_UNIT_READY 0x00
68 #define REQUEST_SENSE 0x03
69 #define INQUIRY 0x12
70 #define START_STOP 0x1b
71 #define ALLOW_MEDIUM_REMOVAL 0x1e
72 #define READ_CAPACITY 0x25
73 #define READ_10 0x28
74 #define SEEK 0x2b
75 #define READ_HEADER 0x44
76 #define STOP_PLAY_SCAN 0x4e
77 #define MODE_SELECT_10 0x55
78 #define MODE_SENSE_10 0x5a
79 #define LOAD_UNLOAD 0xa6
80 #define READ_12 0xa8
81 #define READ_CD_MSF 0xb9
82 #define SCAN 0xba
83 #define SET_CD_SPEED 0xbb
84 #define PLAY_CD 0xbc
85 #define MECHANISM_STATUS 0xbd
86 #define READ_CD 0xbe
88 /* DVD Opcodes */
89 #define DVD_GET_PERFORMANCE 0xac
92 /* Page codes for mode sense/set */
94 #define PAGE_READERR 0x01
95 #define PAGE_CDROM 0x0d
96 #define PAGE_AUDIO 0x0e
97 #define PAGE_CAPABILITIES 0x2a
98 #define PAGE_ALL 0x3f
101 /* ATAPI sense keys (from table 140 of ATAPI 2.6) */
103 #define NO_SENSE 0x00
104 #define RECOVERED_ERROR 0x01
105 #define NOT_READY 0x02
106 #define MEDIUM_ERROR 0x03
107 #define HARDWARE_ERROR 0x04
108 #define ILLEGAL_REQUEST 0x05
109 #define UNIT_ATTENTION 0x06
110 #define DATA_PROTECT 0x07
111 #define ABORTED_COMMAND 0x0b
112 #define MISCOMPARE 0x0e
114 /* We want some additional flags for CDROM drives.
115 To save space in the ide_drive_t struct, use some fields which
116 doesn't make sense for CDROMs -- `bios_cyl' and `bios_head'. */
118 /* Configuration flags. These describe the capabilities of the drive.
119 They generally do not change after initialization, unless we learn
120 more about the drive from stuff failing. */
121 struct ide_cd_config_flags {
122 __u8 drq_interrupt : 1; /* Device sends an interrupt when ready
123 for a packet command. */
124 __u8 no_doorlock : 1; /* Drive cannot lock the door. */
125 __u8 no_eject : 1; /* Drive cannot eject the disc. */
126 __u8 nec260 : 1; /* Drive is a pre-1.2 NEC 260 drive. */
127 __u8 playmsf_as_bcd : 1; /* PLAYMSF command takes BCD args. */
128 __u8 tocaddr_as_bcd : 1; /* TOC addresses are in BCD. */
129 __u8 toctracks_as_bcd : 1; /* TOC track numbers are in BCD. */
130 __u8 subchan_as_bcd : 1; /* Subchannel info is in BCD. */
131 __u8 is_changer : 1; /* Drive is a changer. */
132 __u8 cd_r : 1; /* Drive can write to CD-R media . */
133 __u8 cd_rw : 1; /* Drive can write to CD-R/W media . */
134 __u8 dvd : 1; /* Drive is a DVD-ROM */
135 __u8 dvd_r : 1; /* Drive can write DVD-RAM */
136 __u8 dvd_rw : 1; /* Drive can write DVD-R/W */
137 __u8 test_write : 1; /* Drive can fake writes */
138 __u8 supp_disc_present: 1; /* Changer can report exact contents
139 of slots. */
140 __u8 limit_nframes : 1; /* Drive does not provide data in
141 multiples of SECTOR_SIZE when more
142 than one interrupt is needed. */
143 __u8 seeking : 1; /* Seeking in progress */
144 __u8 reserved : 6;
145 byte max_speed; /* Max speed of the drive */
147 #define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags))
150 /* State flags. These give information about the current state of the
151 drive, and will change during normal operation. */
152 struct ide_cd_state_flags {
153 __u8 media_changed : 1; /* Driver has noticed a media change. */
154 __u8 toc_valid : 1; /* Saved TOC information is current. */
155 __u8 door_locked : 1; /* We think that the drive door is locked. */
156 __u8 sanyo_slot : 2; /* Sanyo 3 CD changer support */
157 __u8 reserved : 3;
158 byte current_speed; /* Current speed of the drive */
160 #define CDROM_STATE_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->state_flags))
163 struct atapi_request_sense {
164 #if defined(__BIG_ENDIAN_BITFIELD)
165 unsigned char valid : 1;
166 unsigned char error_code : 7;
167 #elif defined(__LITTLE_ENDIAN_BITFIELD)
168 unsigned char error_code : 7;
169 unsigned char valid : 1;
170 #else
171 #error "Please fix <asm/byteorder.h>"
172 #endif
173 byte reserved1;
174 #if defined(__BIG_ENDIAN_BITFIELD)
175 unsigned char reserved3 : 2;
176 unsigned char ili : 1;
177 unsigned char reserved2 : 1;
178 unsigned char sense_key : 4;
179 #elif defined(__LITTLE_ENDIAN_BITFIELD)
180 unsigned char sense_key : 4;
181 unsigned char reserved2 : 1;
182 unsigned char ili : 1;
183 unsigned char reserved3 : 2;
184 #else
185 #error "Please fix <asm/byteorder.h>"
186 #endif
187 byte info[4];
188 byte sense_len;
189 byte command_info[4];
190 byte asc;
191 byte ascq;
192 byte fru;
193 byte sense_key_specific[3];
196 struct packet_command {
197 char *buffer;
198 int buflen;
199 int stat;
200 struct atapi_request_sense *sense_data;
201 unsigned char c[12];
204 /* Structure of a MSF cdrom address. */
205 struct atapi_msf {
206 byte reserved;
207 byte minute;
208 byte second;
209 byte frame;
212 /* Space to hold the disk TOC. */
213 #define MAX_TRACKS 99
214 struct atapi_toc_header {
215 unsigned short toc_length;
216 byte first_track;
217 byte last_track;
220 struct atapi_toc_entry {
221 byte reserved1;
222 #if defined(__BIG_ENDIAN_BITFIELD)
223 __u8 adr : 4;
224 __u8 control : 4;
225 #elif defined(__LITTLE_ENDIAN_BITFIELD)
226 __u8 control : 4;
227 __u8 adr : 4;
228 #else
229 #error "Please fix <asm/byteorder.h>"
230 #endif
231 byte track;
232 byte reserved2;
233 union {
234 unsigned lba;
235 struct atapi_msf msf;
236 } addr;
239 struct atapi_toc {
240 int last_session_lba;
241 int xa_flag;
242 unsigned capacity;
243 struct atapi_toc_header hdr;
244 struct atapi_toc_entry ent[MAX_TRACKS+1];
245 /* One extra for the leadout. */
249 /* This structure is annoyingly close to, but not identical with,
250 the cdrom_subchnl structure from cdrom.h. */
251 struct atapi_cdrom_subchnl {
252 u_char acdsc_reserved;
253 u_char acdsc_audiostatus;
254 u_short acdsc_length;
255 u_char acdsc_format;
257 #if defined(__BIG_ENDIAN_BITFIELD)
258 u_char acdsc_ctrl: 4;
259 u_char acdsc_adr: 4;
260 #elif defined(__LITTLE_ENDIAN_BITFIELD)
261 u_char acdsc_adr: 4;
262 u_char acdsc_ctrl: 4;
263 #else
264 #error "Please fix <asm/byteorder.h>"
265 #endif
266 u_char acdsc_trk;
267 u_char acdsc_ind;
268 union {
269 struct atapi_msf msf;
270 int lba;
271 } acdsc_absaddr;
272 union {
273 struct atapi_msf msf;
274 int lba;
275 } acdsc_reladdr;
279 typedef enum {
280 mechtype_caddy = 0,
281 mechtype_tray = 1,
282 mechtype_popup = 2,
283 mechtype_individual_changer = 4,
284 mechtype_cartridge_changer = 5
285 } mechtype_t;
288 struct atapi_capabilities_page {
289 #if defined(__BIG_ENDIAN_BITFIELD)
290 __u8 parameters_saveable : 1;
291 __u8 reserved1 : 1;
292 __u8 page_code : 6;
293 #elif defined(__LITTLE_ENDIAN_BITFIELD)
294 __u8 page_code : 6;
295 __u8 reserved1 : 1;
296 __u8 parameters_saveable : 1;
297 #else
298 #error "Please fix <asm/byteorder.h>"
299 #endif
301 byte page_length;
303 #if defined(__BIG_ENDIAN_BITFIELD)
304 __u8 reserved2 : 2;
305 /* Drive supports reading of DVD-RAM discs */
306 __u8 dvd_ram_read : 1;
307 /* Drive supports reading of DVD-R discs */
308 __u8 dvd_r_read : 1;
309 /* Drive supports reading of DVD-ROM discs */
310 __u8 dvd_rom : 1;
311 /* Drive supports reading CD-R discs with addressing method 2 */
312 __u8 method2 : 1; /* reserved in 1.2 */
313 /* Drive can read from CD-R/W (CD-E) discs (orange book, part III) */
314 __u8 cd_rw_read : 1; /* reserved in 1.2 */
315 /* Drive supports read from CD-R discs (orange book, part II) */
316 __u8 cd_r_read : 1; /* reserved in 1.2 */
317 #elif defined(__LITTLE_ENDIAN_BITFIELD)
318 /* Drive supports read from CD-R discs (orange book, part II) */
319 __u8 cd_r_read : 1; /* reserved in 1.2 */
320 /* Drive can read from CD-R/W (CD-E) discs (orange book, part III) */
321 __u8 cd_rw_read : 1; /* reserved in 1.2 */
322 /* Drive supports reading CD-R discs with addressing method 2 */
323 __u8 method2 : 1;
324 /* Drive supports reading of DVD-ROM discs */
325 __u8 dvd_rom : 1;
326 /* Drive supports reading of DVD-R discs */
327 __u8 dvd_r_read : 1;
328 /* Drive supports reading of DVD-RAM discs */
329 __u8 dvd_ram_read : 1;
330 __u8 reserved2 : 2;
331 #else
332 #error "Please fix <asm/byteorder.h>"
333 #endif
335 #if defined(__BIG_ENDIAN_BITFIELD)
336 __u8 reserved3 : 2;
337 /* Drive can write DVD-RAM discs */
338 __u8 dvd_ram_write : 1;
339 /* Drive can write DVD-R discs */
340 __u8 dvd_r_write : 1;
341 __u8 reserved3a : 1;
342 /* Drive can fake writes */
343 __u8 test_write : 1;
344 /* Drive can write to CD-R/W (CD-E) discs (orange book, part III) */
345 __u8 cd_rw_write : 1; /* reserved in 1.2 */
346 /* Drive supports write to CD-R discs (orange book, part II) */
347 __u8 cd_r_write : 1; /* reserved in 1.2 */
348 #elif defined(__LITTLE_ENDIAN_BITFIELD)
349 /* Drive can write to CD-R discs (orange book, part II) */
350 __u8 cd_r_write : 1; /* reserved in 1.2 */
351 /* Drive can write to CD-R/W (CD-E) discs (orange book, part III) */
352 __u8 cd_rw_write : 1; /* reserved in 1.2 */
353 /* Drive can fake writes */
354 __u8 test_write : 1;
355 __u8 reserved3a : 1;
356 /* Drive can write DVD-R discs */
357 __u8 dvd_r_write : 1;
358 /* Drive can write DVD-RAM discs */
359 __u8 dvd_ram_write : 1;
360 __u8 reserved3 : 2;
361 #else
362 #error "Please fix <asm/byteorder.h>"
363 #endif
365 #if defined(__BIG_ENDIAN_BITFIELD)
366 __u8 reserved4 : 1;
367 /* Drive can read multisession discs. */
368 __u8 multisession : 1;
369 /* Drive can read mode 2, form 2 data. */
370 __u8 mode2_form2 : 1;
371 /* Drive can read mode 2, form 1 (XA) data. */
372 __u8 mode2_form1 : 1;
373 /* Drive supports digital output on port 2. */
374 __u8 digport2 : 1;
375 /* Drive supports digital output on port 1. */
376 __u8 digport1 : 1;
377 /* Drive can deliver a composite audio/video data stream. */
378 __u8 composite : 1;
379 /* Drive supports audio play operations. */
380 __u8 audio_play : 1;
381 #elif defined(__LITTLE_ENDIAN_BITFIELD)
382 /* Drive supports audio play operations. */
383 __u8 audio_play : 1;
384 /* Drive can deliver a composite audio/video data stream. */
385 __u8 composite : 1;
386 /* Drive supports digital output on port 1. */
387 __u8 digport1 : 1;
388 /* Drive supports digital output on port 2. */
389 __u8 digport2 : 1;
390 /* Drive can read mode 2, form 1 (XA) data. */
391 __u8 mode2_form1 : 1;
392 /* Drive can read mode 2, form 2 data. */
393 __u8 mode2_form2 : 1;
394 /* Drive can read multisession discs. */
395 __u8 multisession : 1;
396 __u8 reserved4 : 1;
397 #else
398 #error "Please fix <asm/byteorder.h>"
399 #endif
401 #if defined(__BIG_ENDIAN_BITFIELD)
402 __u8 reserved5 : 1;
403 /* Drive can return Media Catalog Number (UPC) info. */
404 __u8 upc : 1;
405 /* Drive can return International Standard Recording Code info. */
406 __u8 isrc : 1;
407 /* Drive supports C2 error pointers. */
408 __u8 c2_pointers : 1;
409 /* R-W data will be returned deinterleaved and error corrected. */
410 __u8 rw_corr : 1;
411 /* Subchannel reads can return combined R-W information. */
412 __u8 rw_supported : 1;
413 /* Drive can continue a read cdda operation from a loss of streaming.*/
414 __u8 cdda_accurate : 1;
415 /* Drive can read Red Book audio data. */
416 __u8 cdda : 1;
417 #elif defined(__LITTLE_ENDIAN_BITFIELD)
418 /* Drive can read Red Book audio data. */
419 __u8 cdda : 1;
420 /* Drive can continue a read cdda operation from a loss of streaming.*/
421 __u8 cdda_accurate : 1;
422 /* Subchannel reads can return combined R-W information. */
423 __u8 rw_supported : 1;
424 /* R-W data will be returned deinterleaved and error corrected. */
425 __u8 rw_corr : 1;
426 /* Drive supports C2 error pointers. */
427 __u8 c2_pointers : 1;
428 /* Drive can return International Standard Recording Code info. */
429 __u8 isrc : 1;
430 /* Drive can return Media Catalog Number (UPC) info. */
431 __u8 upc : 1;
432 __u8 reserved5 : 1;
433 #else
434 #error "Please fix <asm/byteorder.h>"
435 #endif
437 #if defined(__BIG_ENDIAN_BITFIELD)
438 /* Drive mechanism types. */
439 mechtype_t mechtype : 3;
440 __u8 reserved6 : 1;
441 /* Drive can eject a disc or changer cartridge. */
442 __u8 eject : 1;
443 /* State of prevent/allow jumper. */
444 __u8 prevent_jumper : 1;
445 /* Present state of door lock. */
446 __u8 lock_state : 1;
447 /* Drive can lock the door. */
448 __u8 lock : 1;
449 #elif defined(__LITTLE_ENDIAN_BITFIELD)
451 /* Drive can lock the door. */
452 __u8 lock : 1;
453 /* Present state of door lock. */
454 __u8 lock_state : 1;
455 /* State of prevent/allow jumper. */
456 __u8 prevent_jumper : 1;
457 /* Drive can eject a disc or changer cartridge. */
458 __u8 eject : 1;
459 __u8 reserved6 : 1;
460 /* Drive mechanism types. */
461 mechtype_t mechtype : 3;
462 #else
463 #error "Please fix <asm/byteorder.h>"
464 #endif
466 #if defined(__BIG_ENDIAN_BITFIELD)
467 __u8 reserved7 : 4;
468 /* Drive supports software slot selection. */
469 __u8 sss : 1; /* reserved in 1.2 */
470 /* Changer can report exact contents of slots. */
471 __u8 disc_present : 1; /* reserved in 1.2 */
472 /* Audio for each channel can be muted independently. */
473 __u8 separate_mute : 1;
474 /* Audio level for each channel can be controlled independently. */
475 __u8 separate_volume : 1;
476 #elif defined(__LITTLE_ENDIAN_BITFIELD)
478 /* Audio level for each channel can be controlled independently. */
479 __u8 separate_volume : 1;
480 /* Audio for each channel can be muted independently. */
481 __u8 separate_mute : 1;
482 /* Changer can report exact contents of slots. */
483 __u8 disc_present : 1; /* reserved in 1.2 */
484 /* Drive supports software slot selection. */
485 __u8 sss : 1; /* reserved in 1.2 */
486 __u8 reserved7 : 4;
487 #else
488 #error "Please fix <asm/byteorder.h>"
489 #endif
491 /* Note: the following four fields are returned in big-endian form. */
492 /* Maximum speed (in kB/s). */
493 unsigned short maxspeed;
494 /* Number of discrete volume levels. */
495 unsigned short n_vol_levels;
496 /* Size of cache in drive, in kB. */
497 unsigned short buffer_size;
498 /* Current speed (in kB/s). */
499 unsigned short curspeed;
501 /* Truncate the structure here, so we don't have headaches reading
502 from older drives. */
506 struct atapi_mechstat_header {
507 #if defined(__BIG_ENDIAN_BITFIELD)
508 __u8 fault : 1;
509 __u8 changer_state : 2;
510 __u8 curslot : 5;
511 #elif defined(__LITTLE_ENDIAN_BITFIELD)
512 __u8 curslot : 5;
513 __u8 changer_state : 2;
514 __u8 fault : 1;
515 #else
516 #error "Please fix <asm/byteorder.h>"
517 #endif
519 #if defined(__BIG_ENDIAN_BITFIELD)
520 __u8 mech_state : 3;
521 __u8 reserved1 : 5;
522 #elif defined(__LITTLE_ENDIAN_BITFIELD)
523 __u8 reserved1 : 5;
524 __u8 mech_state : 3;
525 #else
526 #error "Please fix <asm/byteorder.h>"
527 #endif
529 byte curlba[3];
530 byte nslots;
531 __u8 short slot_tablelen;
535 struct atapi_slot {
536 #if defined(__BIG_ENDIAN_BITFIELD)
537 __u8 disc_present : 1;
538 __u8 reserved1 : 6;
539 __u8 change : 1;
540 #elif defined(__LITTLE_ENDIAN_BITFIELD)
541 __u8 change : 1;
542 __u8 reserved1 : 6;
543 __u8 disc_present : 1;
544 #else
545 #error "Please fix <asm/byteorder.h>"
546 #endif
548 byte reserved2[3];
552 struct atapi_changer_info {
553 struct atapi_mechstat_header hdr;
554 struct atapi_slot slots[0];
558 /* Extra per-device info for cdrom drives. */
559 struct cdrom_info {
561 /* Buffer for table of contents. NULL if we haven't allocated
562 a TOC buffer for this device yet. */
564 struct atapi_toc *toc;
566 /* Sector buffer. If a read request wants only the first part
567 of a cdrom block, we cache the rest of the block here,
568 in the expectation that the data is going to be wanted soon.
569 SECTOR_BUFFERED is the number of the first buffered sector,
570 and NSECTORS_BUFFERED is the number of sectors in the buffer.
571 Before the buffer is allocated, we should have
572 SECTOR_BUFFER == NULL and NSECTORS_BUFFERED == 0. */
574 unsigned long sector_buffered;
575 unsigned long nsectors_buffered;
576 char *sector_buffer;
578 /* The result of the last successful request sense command
579 on this device. */
580 struct atapi_request_sense sense_data;
582 struct request request_sense_request;
583 struct packet_command request_sense_pc;
584 int dma;
585 unsigned long last_block;
586 unsigned long start_seek;
587 /* Buffer to hold mechanism status and changer slot table. */
588 struct atapi_changer_info *changer_info;
590 struct ide_cd_config_flags config_flags;
591 struct ide_cd_state_flags state_flags;
593 /* Per-device info needed by cdrom.c generic driver. */
594 struct cdrom_device_info devinfo;
598 #define SECTOR_BUFFER_SIZE CD_FRAMESIZE
601 /****************************************************************************
602 * Descriptions of ATAPI error codes.
605 #define ARY_LEN(a) ((sizeof(a) / sizeof(a[0])))
607 #if VERBOSE_IDE_CD_ERRORS
609 /* From Table 124 of the ATAPI 1.2 spec.
610 Unchanged in Table 140 of the ATAPI 2.6 draft standard. */
612 const char * const sense_key_texts[16] = {
613 "No sense data",
614 "Recovered error",
615 "Not ready",
616 "Medium error",
617 "Hardware error",
618 "Illegal request",
619 "Unit attention",
620 "Data protect",
621 "(reserved)",
622 "(reserved)",
623 "(reserved)",
624 "Aborted command",
625 "(reserved)",
626 "(reserved)",
627 "Miscompare",
628 "(reserved)",
632 /* From Table 37 of the ATAPI 2.6 draft standard. */
633 const struct {
634 unsigned short packet_command;
635 const char * const text;
636 } packet_command_texts[] = {
637 { TEST_UNIT_READY, "Test Unit Ready" },
638 { REQUEST_SENSE, "Request Sense" },
639 { INQUIRY, "Inquiry" },
640 { START_STOP, "Start Stop Unit" },
641 { ALLOW_MEDIUM_REMOVAL, "Prevent/Allow Medium Removal" },
642 { READ_CAPACITY, "Read CD-ROM Capacity" },
643 { READ_10, "Read(10)" },
644 { SEEK, "Seek" },
645 { SCMD_READ_TOC, "Read TOC" },
646 { SCMD_READ_SUBCHANNEL, "Read Sub-Channel" },
647 { READ_HEADER, "Read Header" },
648 { STOP_PLAY_SCAN, "Stop Play/Scan" },
649 { SCMD_PLAYAUDIO10, "Play Audio" },
650 { SCMD_PLAYAUDIO_MSF, "Play Audio MSF" },
651 { SCMD_PAUSE_RESUME, "Pause/Resume" },
652 { MODE_SELECT_10, "Mode Select" },
653 { MODE_SENSE_10, "Mode Sense" },
654 { LOAD_UNLOAD, "Load/Unload CD" },
655 { READ_12, "Read(12)" },
656 { READ_CD_MSF, "Read CD MSF" },
657 { SCAN, "Scan" },
658 { SET_CD_SPEED, "Set CD Speed" },
659 { PLAY_CD, "Play CD" },
660 { MECHANISM_STATUS, "Mechanism Status" },
661 { READ_CD, "Read CD" },
662 { DVD_GET_PERFORMANCE, "Get Performance" },
666 /* From Table 125 of the ATAPI 1.2 spec.,
667 with additions from Tables 141 and 142 of the ATAPI 2.6 draft standard. */
669 const struct {
670 unsigned short asc_ascq;
671 const char * const text;
672 } sense_data_texts[] = {
673 { 0x0000, "No additional sense information" },
675 { 0x0011, "Audio play operation in progress" },
676 { 0x0012, "Audio play operation paused" },
677 { 0x0013, "Audio play operation successfully completed" },
678 { 0x0014, "Audio play operation stopped due to error" },
679 { 0x0015, "No current audio status to return" },
681 { 0x0100, "Mechanical positioning or changer error" },
683 { 0x0200, "No seek complete" },
685 { 0x0400, "Logical unit not ready - cause not reportable" },
686 { 0x0401,
687 "Logical unit not ready - in progress (sic) of becoming ready" },
688 { 0x0402, "Logical unit not ready - initializing command required" },
689 { 0x0403, "Logical unit not ready - manual intervention required" },
691 { 0x0501, "Media load - eject failed" },
693 { 0x0600, "No reference position found" },
695 { 0x0900, "Track following error" },
696 { 0x0901, "Tracking servo failure" },
697 { 0x0902, "Focus servo failure" },
698 { 0x0903, "Spindle servo failure" },
700 { 0x1100, "Unrecovered read error" },
701 { 0x1106, "CIRC unrecovered error" },
703 { 0x1500, "Random positioning error" },
704 { 0x1501, "Mechanical positioning or changer error" },
705 { 0x1502, "Positioning error detected by read of medium" },
707 { 0x1700, "Recovered data with no error correction applied" },
708 { 0x1701, "Recovered data with retries" },
709 { 0x1702, "Recovered data with positive head offset" },
710 { 0x1703, "Recovered data with negative head offset" },
711 { 0x1704, "Recovered data with retries and/or CIRC applied" },
712 { 0x1705, "Recovered data using previous sector ID" },
714 { 0x1800, "Recovered data with error correction applied" },
715 { 0x1801, "Recovered data with error correction and retries applied" },
716 { 0x1802, "Recovered data - the data was auto-reallocated" },
717 { 0x1803, "Recovered data with CIRC" },
718 { 0x1804, "Recovered data with L-EC" },
719 /* Following two not in 2.6. */
720 { 0x1805, "Recovered data - recommend reassignment" },
721 { 0x1806, "Recovered data - recommend rewrite" },
723 { 0x1a00, "Parameter list length error" },
725 { 0x2000, "Invalid command operation code" },
727 { 0x2100, "Logical block address out of range" },
729 { 0x2400, "Invalid field in command packet" },
731 { 0x2600, "Invalid field in parameter list" },
732 { 0x2601, "Parameter not supported" },
733 { 0x2602, "Parameter value invalid" },
734 /* Following code not in 2.6. */
735 { 0x2603, "Threshold parameters not supported" },
737 { 0x2800, "Not ready to ready transition, medium may have changed" },
739 { 0x2900, "Power on, reset or bus device reset occurred" },
741 { 0x2a00, "Parameters changed" },
742 { 0x2a01, "Mode parameters changed" },
744 { 0x3000, "Incompatible medium installed" },
745 { 0x3001, "Cannot read medium - unknown format" },
746 { 0x3002, "Cannot read medium - incompatible format" },
748 /* Following code not in 2.6. */
749 { 0x3700, "Rounded parameter" },
751 { 0x3900, "Saving parameters not supported" },
753 { 0x3a00, "Medium not present" },
755 { 0x3f00, "ATAPI CD-ROM drive operating conditions have changed" },
756 { 0x3f01, "Microcode has been changed" },
757 /* Following two not in 2.6. */
758 { 0x3f02, "Changed operating definition" },
759 { 0x3f03, "Inquiry data has changed" },
761 { 0x4000, "Diagnostic failure on component (ASCQ)" },
763 { 0x4400, "Internal ATAPI CD-ROM drive failure" },
765 { 0x4e00, "Overlapped commands attempted" },
767 { 0x5300, "Media load or eject failed" },
768 { 0x5302, "Medium removal prevented" },
770 { 0x5700, "Unable to recover table of contents" },
772 { 0x5a00, "Operator request or state change input (unspecified)" },
773 { 0x5a01, "Operator medium removal request" },
775 /* Following two not in 2.6. */
776 { 0x5b00, "Threshold condition met" },
777 { 0x5c00, "Status change" },
779 { 0x6300, "End of user area encountered on this track" },
781 { 0x6400, "Illegal mode for this track or incompatible medium" },
783 /* Following error is misspelled in ATAPI 2.6 */
784 { 0xb900, "Play operation oborted [sic]" },
786 { 0xbf00, "Loss of streaming" },
788 #endif
791 #endif /* _IDE_CD_H */