~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/drivers/ide/ide-cd.h

Version: ~ [ 2.2.5 ] ~ [ 2.4.1 ] ~ [ 2.4.9 ] ~ [ 2.6.17.10 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.