📄 ide-cd.h
字号:
#else#error "Please fix <asm/byteorder.h>"#endif#if defined(__BIG_ENDIAN_BITFIELD) __u8 reserved5 : 1; /* Drive can return Media Catalog Number (UPC) info. */ __u8 upc : 1; /* Drive can return International Standard Recording Code info. */ __u8 isrc : 1; /* Drive supports C2 error pointers. */ __u8 c2_pointers : 1; /* R-W data will be returned deinterleaved and error corrected. */ __u8 rw_corr : 1; /* Subchannel reads can return combined R-W information. */ __u8 rw_supported : 1; /* Drive can continue a read cdda operation from a loss of streaming.*/ __u8 cdda_accurate : 1; /* Drive can read Red Book audio data. */ __u8 cdda : 1;#elif defined(__LITTLE_ENDIAN_BITFIELD) /* Drive can read Red Book audio data. */ __u8 cdda : 1; /* Drive can continue a read cdda operation from a loss of streaming.*/ __u8 cdda_accurate : 1; /* Subchannel reads can return combined R-W information. */ __u8 rw_supported : 1; /* R-W data will be returned deinterleaved and error corrected. */ __u8 rw_corr : 1; /* Drive supports C2 error pointers. */ __u8 c2_pointers : 1; /* Drive can return International Standard Recording Code info. */ __u8 isrc : 1; /* Drive can return Media Catalog Number (UPC) info. */ __u8 upc : 1; __u8 reserved5 : 1;#else#error "Please fix <asm/byteorder.h>"#endif#if defined(__BIG_ENDIAN_BITFIELD) /* Drive mechanism types. */ mechtype_t mechtype : 3; __u8 reserved6 : 1; /* Drive can eject a disc or changer cartridge. */ __u8 eject : 1; /* State of prevent/allow jumper. */ __u8 prevent_jumper : 1; /* Present state of door lock. */ __u8 lock_state : 1; /* Drive can lock the door. */ __u8 lock : 1;#elif defined(__LITTLE_ENDIAN_BITFIELD) /* Drive can lock the door. */ __u8 lock : 1; /* Present state of door lock. */ __u8 lock_state : 1; /* State of prevent/allow jumper. */ __u8 prevent_jumper : 1; /* Drive can eject a disc or changer cartridge. */ __u8 eject : 1; __u8 reserved6 : 1; /* Drive mechanism types. */ mechtype_t mechtype : 3;#else#error "Please fix <asm/byteorder.h>"#endif#if defined(__BIG_ENDIAN_BITFIELD) __u8 reserved7 : 4; /* Drive supports software slot selection. */ __u8 sss : 1; /* reserved in 1.2 */ /* Changer can report exact contents of slots. */ __u8 disc_present : 1; /* reserved in 1.2 */ /* Audio for each channel can be muted independently. */ __u8 separate_mute : 1; /* Audio level for each channel can be controlled independently. */ __u8 separate_volume : 1;#elif defined(__LITTLE_ENDIAN_BITFIELD) /* Audio level for each channel can be controlled independently. */ __u8 separate_volume : 1; /* Audio for each channel can be muted independently. */ __u8 separate_mute : 1; /* Changer can report exact contents of slots. */ __u8 disc_present : 1; /* reserved in 1.2 */ /* Drive supports software slot selection. */ __u8 sss : 1; /* reserved in 1.2 */ __u8 reserved7 : 4;#else#error "Please fix <asm/byteorder.h>"#endif /* Note: the following four fields are returned in big-endian form. */ /* Maximum speed (in kB/s). */ unsigned short maxspeed; /* Number of discrete volume levels. */ unsigned short n_vol_levels; /* Size of cache in drive, in kB. */ unsigned short buffer_size; /* Current speed (in kB/s). */ unsigned short curspeed; /* Truncate the structure here, so we don't have headaches reading from older drives. */};struct atapi_mechstat_header {#if defined(__BIG_ENDIAN_BITFIELD) __u8 fault : 1; __u8 changer_state : 2; __u8 curslot : 5;#elif defined(__LITTLE_ENDIAN_BITFIELD) __u8 curslot : 5; __u8 changer_state : 2; __u8 fault : 1;#else#error "Please fix <asm/byteorder.h>"#endif#if defined(__BIG_ENDIAN_BITFIELD) __u8 mech_state : 3; __u8 reserved1 : 5;#elif defined(__LITTLE_ENDIAN_BITFIELD) __u8 reserved1 : 5; __u8 mech_state : 3;#else#error "Please fix <asm/byteorder.h>"#endif byte curlba[3]; byte nslots; __u8 short slot_tablelen;};struct atapi_slot {#if defined(__BIG_ENDIAN_BITFIELD) __u8 disc_present : 1; __u8 reserved1 : 6; __u8 change : 1;#elif defined(__LITTLE_ENDIAN_BITFIELD) __u8 change : 1; __u8 reserved1 : 6; __u8 disc_present : 1;#else#error "Please fix <asm/byteorder.h>"#endif byte reserved2[3];};struct atapi_changer_info { struct atapi_mechstat_header hdr; struct atapi_slot slots[0];};/* Extra per-device info for cdrom drives. */struct cdrom_info { /* Buffer for table of contents. NULL if we haven't allocated a TOC buffer for this device yet. */ struct atapi_toc *toc; /* Sector buffer. If a read request wants only the first part of a cdrom block, we cache the rest of the block here, in the expectation that the data is going to be wanted soon. SECTOR_BUFFERED is the number of the first buffered sector, and NSECTORS_BUFFERED is the number of sectors in the buffer. Before the buffer is allocated, we should have SECTOR_BUFFER == NULL and NSECTORS_BUFFERED == 0. */ unsigned long sector_buffered; unsigned long nsectors_buffered; char *sector_buffer; /* The result of the last successful request sense command on this device. */ struct atapi_request_sense sense_data; struct request request_sense_request; struct packet_command request_sense_pc; int dma; unsigned long last_block; unsigned long start_seek; /* Buffer to hold mechanism status and changer slot table. */ struct atapi_changer_info *changer_info; struct ide_cd_config_flags config_flags; struct ide_cd_state_flags state_flags; /* Per-device info needed by cdrom.c generic driver. */ struct cdrom_device_info devinfo;};#define SECTOR_BUFFER_SIZE CD_FRAMESIZE/**************************************************************************** * Descriptions of ATAPI error codes. */#define ARY_LEN(a) ((sizeof(a) / sizeof(a[0])))#if VERBOSE_IDE_CD_ERRORS/* From Table 124 of the ATAPI 1.2 spec. Unchanged in Table 140 of the ATAPI 2.6 draft standard. */const char * const sense_key_texts[16] = { "No sense data", "Recovered error", "Not ready", "Medium error", "Hardware error", "Illegal request", "Unit attention", "Data protect", "(reserved)", "(reserved)", "(reserved)", "Aborted command", "(reserved)", "(reserved)", "Miscompare", "(reserved)",};/* From Table 37 of the ATAPI 2.6 draft standard. */const struct { unsigned short packet_command; const char * const text;} packet_command_texts[] = { { TEST_UNIT_READY, "Test Unit Ready" }, { REQUEST_SENSE, "Request Sense" }, { INQUIRY, "Inquiry" }, { START_STOP, "Start Stop Unit" }, { ALLOW_MEDIUM_REMOVAL, "Prevent/Allow Medium Removal" }, { READ_CAPACITY, "Read CD-ROM Capacity" }, { READ_10, "Read(10)" }, { SEEK, "Seek" }, { SCMD_READ_TOC, "Read TOC" }, { SCMD_READ_SUBCHANNEL, "Read Sub-Channel" }, { READ_HEADER, "Read Header" }, { STOP_PLAY_SCAN, "Stop Play/Scan" }, { SCMD_PLAYAUDIO10, "Play Audio" }, { SCMD_PLAYAUDIO_MSF, "Play Audio MSF" }, { SCMD_PAUSE_RESUME, "Pause/Resume" }, { MODE_SELECT_10, "Mode Select" }, { MODE_SENSE_10, "Mode Sense" }, { LOAD_UNLOAD, "Load/Unload CD" }, { READ_12, "Read(12)" }, { READ_CD_MSF, "Read CD MSF" }, { SCAN, "Scan" }, { SET_CD_SPEED, "Set CD Speed" }, { PLAY_CD, "Play CD" }, { MECHANISM_STATUS, "Mechanism Status" }, { READ_CD, "Read CD" }, { DVD_GET_PERFORMANCE, "Get Performance" },};/* From Table 125 of the ATAPI 1.2 spec., with additions from Tables 141 and 142 of the ATAPI 2.6 draft standard. */const struct { unsigned short asc_ascq; const char * const text;} sense_data_texts[] = { { 0x0000, "No additional sense information" }, { 0x0011, "Audio play operation in progress" }, { 0x0012, "Audio play operation paused" }, { 0x0013, "Audio play operation successfully completed" }, { 0x0014, "Audio play operation stopped due to error" }, { 0x0015, "No current audio status to return" }, { 0x0100, "Mechanical positioning or changer error" }, { 0x0200, "No seek complete" }, { 0x0400, "Logical unit not ready - cause not reportable" }, { 0x0401, "Logical unit not ready - in progress (sic) of becoming ready" }, { 0x0402, "Logical unit not ready - initializing command required" }, { 0x0403, "Logical unit not ready - manual intervention required" }, { 0x0501, "Media load - eject failed" }, { 0x0600, "No reference position found" }, { 0x0900, "Track following error" }, { 0x0901, "Tracking servo failure" }, { 0x0902, "Focus servo failure" }, { 0x0903, "Spindle servo failure" }, { 0x1100, "Unrecovered read error" }, { 0x1106, "CIRC unrecovered error" }, { 0x1500, "Random positioning error" }, { 0x1501, "Mechanical positioning or changer error" }, { 0x1502, "Positioning error detected by read of medium" }, { 0x1700, "Recovered data with no error correction applied" }, { 0x1701, "Recovered data with retries" }, { 0x1702, "Recovered data with positive head offset" }, { 0x1703, "Recovered data with negative head offset" }, { 0x1704, "Recovered data with retries and/or CIRC applied" }, { 0x1705, "Recovered data using previous sector ID" }, { 0x1800, "Recovered data with error correction applied" }, { 0x1801, "Recovered data with error correction and retries applied" }, { 0x1802, "Recovered data - the data was auto-reallocated" }, { 0x1803, "Recovered data with CIRC" }, { 0x1804, "Recovered data with L-EC" }, /* Following two not in 2.6. */ { 0x1805, "Recovered data - recommend reassignment" }, { 0x1806, "Recovered data - recommend rewrite" }, { 0x1a00, "Parameter list length error" }, { 0x2000, "Invalid command operation code" }, { 0x2100, "Logical block address out of range" }, { 0x2400, "Invalid field in command packet" }, { 0x2600, "Invalid field in parameter list" }, { 0x2601, "Parameter not supported" }, { 0x2602, "Parameter value invalid" }, /* Following code not in 2.6. */ { 0x2603, "Threshold parameters not supported" }, { 0x2800, "Not ready to ready transition, medium may have changed" }, { 0x2900, "Power on, reset or bus device reset occurred" }, { 0x2a00, "Parameters changed" }, { 0x2a01, "Mode parameters changed" }, { 0x3000, "Incompatible medium installed" }, { 0x3001, "Cannot read medium - unknown format" }, { 0x3002, "Cannot read medium - incompatible format" }, /* Following code not in 2.6. */ { 0x3700, "Rounded parameter" }, { 0x3900, "Saving parameters not supported" }, { 0x3a00, "Medium not present" }, { 0x3f00, "ATAPI CD-ROM drive operating conditions have changed" }, { 0x3f01, "Microcode has been changed" }, /* Following two not in 2.6. */ { 0x3f02, "Changed operating definition" }, { 0x3f03, "Inquiry data has changed" }, { 0x4000, "Diagnostic failure on component (ASCQ)" }, { 0x4400, "Internal ATAPI CD-ROM drive failure" }, { 0x4e00, "Overlapped commands attempted" }, { 0x5300, "Media load or eject failed" }, { 0x5302, "Medium removal prevented" }, { 0x5700, "Unable to recover table of contents" }, { 0x5a00, "Operator request or state change input (unspecified)" }, { 0x5a01, "Operator medium removal request" }, /* Following two not in 2.6. */ { 0x5b00, "Threshold condition met" }, { 0x5c00, "Status change" }, { 0x6300, "End of user area encountered on this track" }, { 0x6400, "Illegal mode for this track or incompatible medium" }, /* Following error is misspelled in ATAPI 2.6 */ { 0xb900, "Play operation oborted [sic]" }, { 0xbf00, "Loss of streaming" },};#endif#endif /* _IDE_CD_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -