diff options
Diffstat (limited to 'sys/dev/ata/atapi-cd.h')
-rw-r--r-- | sys/dev/ata/atapi-cd.h | 182 |
1 files changed, 55 insertions, 127 deletions
diff --git a/sys/dev/ata/atapi-cd.h b/sys/dev/ata/atapi-cd.h index 19d742c..71d1c03 100644 --- a/sys/dev/ata/atapi-cd.h +++ b/sys/dev/ata/atapi-cd.h @@ -76,6 +76,12 @@ struct audiopage { } port[4]; }; + +/* CDROM Capabilities and Mechanical Status Page */ +struct cappage { + /* mode page data header */ + u_int16_t data_length; + u_int8_t medium_type; #define MST_TYPE_MASK_LOW 0x0f #define MST_FMT_NONE 0x00 #define MST_DATA_120 0x01 @@ -96,126 +102,61 @@ struct audiopage { #define MST_DOOR_OPEN 0x71 #define MST_FMT_ERROR 0x72 -#define MST_MECH_CADDY 0 -#define MST_MECH_TRAY 1 -#define MST_MECH_POPUP 2 -#define MST_MECH_CHANGER 4 -#define MST_MECH_CARTRIDGE 5 - -#define MST_DLEN_32 0 -#define MST_DLEN_16 1 -#define MST_DLEN_24 2 -#define MST_DLEN_24_I2S 3 - -#define ATAPI_CDROM_CAP_PAGE 0x2a - -/* CDROM Capabilities and Mechanical Status Page */ -struct cappage { - /* mode page data header */ - u_int16_t data_length; - u_int8_t medium_type; - u_int8_t dev_spec; - u_int8_t unused[2]; + u_int16_t unused; u_int16_t blk_desc_len; /* capabilities page */ u_int8_t page_code; +#define ATAPI_CDROM_CAP_PAGE 0x2a u_int8_t param_len; -#if BYTE_ORDER == LITTLE_ENDIAN - u_int8_t read_cdr :1; /* supports CD-R read */ - u_int8_t read_cdrw :1; /* supports CD-RW read */ - u_int8_t read_packet :1; /* supports reading packet tracks */ - u_int8_t read_dvdrom :1; /* supports DVD-ROM read */ - u_int8_t read_dvdr :1; /* supports DVD-R read */ - u_int8_t read_dvdram :1; /* supports DVD-RAM read */ - u_int8_t reserved2_67 :2; - - u_int8_t write_cdr :1; /* supports CD-R write */ - u_int8_t write_cdrw :1; /* supports CD-RW write */ - u_int8_t test_write :1; /* supports test writing */ - u_int8_t reserved3_3 :1; - u_int8_t write_dvdr :1; /* supports DVD-R write */ - u_int8_t write_dvdram :1; /* supports DVD-RAM write */ - u_int8_t reserved3_67 :2; - - u_int8_t audio_play :1; /* audio play supported */ - u_int8_t composite :1; /* composite audio/video supported */ - u_int8_t dport1 :1; /* digital audio on port 1 */ - u_int8_t dport2 :1; /* digital audio on port 2 */ - u_int8_t mode2_form1 :1; /* mode 2 form 1 (XA) read */ - u_int8_t mode2_form2 :1; /* mode 2 form 2 format */ - u_int8_t multisession :1; /* multi-session photo-CD */ - u_int8_t burnproof :1; /* supports burnproof */ - - u_int8_t cd_da :1; /* audio-CD read supported */ - u_int8_t cd_da_stream :1; /* CD-DA streaming */ - u_int8_t rw :1; /* combined R-W subchannels */ - u_int8_t rw_corr :1; /* R-W subchannel data corrected */ - u_int8_t c2 :1; /* C2 error pointers supported */ - u_int8_t isrc :1; /* can return the ISRC info */ - u_int8_t upc :1; /* can return the catalog number UPC */ - u_int8_t :1; - - u_int8_t lock :1; /* can be locked */ - u_int8_t locked :1; /* current lock state */ - u_int8_t prevent :1; /* prevent jumper installed */ - u_int8_t eject :1; /* can eject */ - u_int8_t :1; - u_int8_t mech :3; /* loading mechanism type */ - - u_int8_t sep_vol :1; /* independent volume of channels */ - u_int8_t sep_mute :1; /* independent mute of channels */ - u_int8_t:6; -#else - /* This is read using 16-bit stream transfers */ - u_int8_t reserved2_67 :2; - u_int8_t read_dvdram :1; /* supports DVD-RAM read */ - u_int8_t read_dvdr :1; /* supports DVD-R read */ - u_int8_t read_dvdrom :1; /* supports DVD-ROM read */ - u_int8_t read_packet :1; /* supports reading packet tracks */ - u_int8_t read_cdrw :1; /* supports CD-RW read */ - u_int8_t read_cdr :1; /* supports CD-R read */ - - u_int8_t reserved3_67 :2; - u_int8_t write_dvdram :1; /* supports DVD-RAM write */ - u_int8_t write_dvdr :1; /* supports DVD-R write */ - u_int8_t reserved3_3 :1; - u_int8_t test_write :1; /* supports test writing */ - u_int8_t write_cdrw :1; /* supports CD-RW write */ - u_int8_t write_cdr :1; /* supports CD-R write */ - - u_int8_t burnproof :1; /* supports burnproof */ - u_int8_t multisession :1; /* multi-session photo-CD */ - u_int8_t mode2_form2 :1; /* mode 2 form 2 format */ - u_int8_t mode2_form1 :1; /* mode 2 form 1 (XA) read */ - u_int8_t dport2 :1; /* digital audio on port 2 */ - u_int8_t dport1 :1; /* digital audio on port 1 */ - u_int8_t composite :1; /* composite audio/video supported */ - u_int8_t audio_play :1; /* audio play supported */ - - u_int8_t :1; - u_int8_t upc :1; /* can return the catalog number UPC */ - u_int8_t isrc :1; /* can return the ISRC info */ - u_int8_t c2 :1; /* C2 error pointers supported */ - u_int8_t rw_corr :1; /* R-W subchannel data corrected */ - u_int8_t rw :1; /* combined R-W subchannels */ - u_int8_t cd_da_stream :1; /* CD-DA streaming */ - u_int8_t cd_da :1; /* audio-CD read supported */ - - u_int8_t mech :3; /* loading mechanism type */ - u_int8_t :1; - u_int8_t eject :1; /* can eject */ - u_int8_t prevent :1; /* prevent jumper installed */ - u_int8_t locked :1; /* current lock state */ - u_int8_t lock :1; /* can be locked */ - - u_int8_t:6; - u_int8_t sep_mute :1; /* independent mute of channels */ - u_int8_t sep_vol :1; /* independent volume of channels */ -#endif + u_int16_t media; +#define MST_READ_CDR 0x0001 +#define MST_READ_CDRW 0x0002 +#define MST_READ_PACKET 0x0004 +#define MST_READ_DVDROM 0x0008 +#define MST_READ_DVDR 0x0010 +#define MST_READ_DVDRAM 0x0020 +#define MST_WRITE_CDR 0x0100 +#define MST_WRITE_CDRW 0x0200 +#define MST_WRITE_TEST 0x0400 +#define MST_WRITE_DVDR 0x1000 +#define MST_WRITE_DVDRAM 0x2000 + + u_int16_t capabilities; +#define MST_AUDIO_PLAY 0x0001 +#define MST_COMPOSITE 0x0002 +#define MST_AUDIO_P1 0x0004 +#define MST_AUDIO_P2 0x0008 +#define MST_MODE2_f1 0x0010 +#define MST_MODE2_f2 0x0020 +#define MST_MULTISESSION 0x0040 +#define MST_BURNPROOF 0x0080 +#define MST_READ_CDDA 0x0100 +#define MST_CDDA_STREAM 0x0200 +#define MST_COMBINED_RW 0x0400 +#define MST_CORRECTED_RW 0x0800 +#define MST_SUPPORT_C2 0x1000 +#define MST_ISRC 0x2000 +#define MST_UPC 0x4000 + + u_int8_t mechanism; +#define MST_LOCKABLE 0x01 +#define MST_LOCKED 0x02 +#define MST_PREVENT 0x04 +#define MST_EJECT 0x08 +#define MST_MECH_MASK 0xe0 +#define MST_MECH_CADDY 0x00 +#define MST_MECH_TRAY 0x20 +#define MST_MECH_POPUP 0x40 +#define MST_MECH_CHANGER 0x80 +#define MST_MECH_CARTRIDGE 0xa0 + + uint8_t audio; +#define MST_SEP_VOL 0x01 +#define MST_SEP_MUTE 0x02 u_int16_t max_read_speed; /* max raw data rate in bytes/1000 */ u_int16_t max_vol_levels; /* number of discrete volume levels */ @@ -223,21 +164,7 @@ struct cappage { u_int16_t cur_read_speed; /* current data rate in bytes/1000 */ u_int8_t reserved3; -#if BYTE_ORDER == LITTLE_ENDIAN - u_int8_t bckf :1; /* data valid on failing edge of BCK */ - u_int8_t rch :1; /* high LRCK indicates left channel */ - u_int8_t lsbf :1; /* set if LSB first */ - u_int8_t dlen :2; - - u_int8_t :3; -#else - u_int8_t :3; - - u_int8_t dlen :2; - u_int8_t lsbf :1; /* set if LSB first */ - u_int8_t rch :1; /* high LRCK indicates left channel */ - u_int8_t bckf :1; /* data valid on failing edge of BCK */ -#endif + u_int8_t misc; u_int16_t max_write_speed; /* max raw data rate in bytes/1000 */ u_int16_t cur_write_speed; /* current data rate in bytes/1000 */ @@ -379,6 +306,7 @@ struct acd_softc { int flags; /* device state flags */ #define F_LOCKED 0x0001 /* this unit is locked */ + struct mtx queue_mtx; /* queue lock */ struct bio_queue_head queue; /* queue of i/o requests */ TAILQ_HEAD(, acd_devlist) dev_list; /* list of "track" devices */ struct toc toc; /* table of disc contents */ |