xref: /onnv-gate/usr/src/uts/common/sys/cdio.h (revision 173:1711d947ee87)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*173Scth  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _SYS_CDIO_H
280Sstevel@tonic-gate #define	_SYS_CDIO_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /*
370Sstevel@tonic-gate  * CDROM io controls type definitions
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate struct cdrom_msf {
400Sstevel@tonic-gate 	unsigned char	cdmsf_min0;	/* starting minute */
410Sstevel@tonic-gate 	unsigned char	cdmsf_sec0;	/* starting second */
420Sstevel@tonic-gate 	unsigned char	cdmsf_frame0;	/* starting frame  */
430Sstevel@tonic-gate 	unsigned char	cdmsf_min1;	/* ending minute   */
440Sstevel@tonic-gate 	unsigned char	cdmsf_sec1;	/* ending second   */
450Sstevel@tonic-gate 	unsigned char	cdmsf_frame1;	/* ending frame	   */
460Sstevel@tonic-gate };
470Sstevel@tonic-gate 
480Sstevel@tonic-gate struct cdrom_ti {
490Sstevel@tonic-gate 	unsigned char	cdti_trk0;	/* starting track */
500Sstevel@tonic-gate 	unsigned char	cdti_ind0;	/* starting index */
510Sstevel@tonic-gate 	unsigned char	cdti_trk1;	/* ending track */
520Sstevel@tonic-gate 	unsigned char	cdti_ind1;	/* ending index */
530Sstevel@tonic-gate };
540Sstevel@tonic-gate 
550Sstevel@tonic-gate struct cdrom_tochdr {
560Sstevel@tonic-gate 	unsigned char	cdth_trk0;	/* starting track */
570Sstevel@tonic-gate 	unsigned char	cdth_trk1;	/* ending track */
580Sstevel@tonic-gate };
590Sstevel@tonic-gate 
600Sstevel@tonic-gate struct cdrom_tocentry {
610Sstevel@tonic-gate 	unsigned char	cdte_track;
620Sstevel@tonic-gate 	unsigned	cdte_adr	:4;
630Sstevel@tonic-gate 	unsigned	cdte_ctrl	:4;
640Sstevel@tonic-gate 	unsigned char	cdte_format;
650Sstevel@tonic-gate 	union {
660Sstevel@tonic-gate 		struct {
670Sstevel@tonic-gate 			unsigned char	minute;
680Sstevel@tonic-gate 			unsigned char	second;
690Sstevel@tonic-gate 			unsigned char	frame;
700Sstevel@tonic-gate 		} msf;
710Sstevel@tonic-gate 		int	lba;
720Sstevel@tonic-gate 	} cdte_addr;
730Sstevel@tonic-gate 	unsigned char	cdte_datamode;
740Sstevel@tonic-gate };
750Sstevel@tonic-gate 
760Sstevel@tonic-gate /*
770Sstevel@tonic-gate  * CDROM address format definition, for use with struct cdrom_tocentry
780Sstevel@tonic-gate  */
790Sstevel@tonic-gate #define	CDROM_LBA	0x01
800Sstevel@tonic-gate #define	CDROM_MSF	0x02
810Sstevel@tonic-gate 
820Sstevel@tonic-gate /*
830Sstevel@tonic-gate  * Bitmask for CD-ROM data track in the cdte_ctrl field
840Sstevel@tonic-gate  * A track is either data or audio.
850Sstevel@tonic-gate  */
860Sstevel@tonic-gate #define	CDROM_DATA_TRACK	0x04
870Sstevel@tonic-gate 
880Sstevel@tonic-gate /*
890Sstevel@tonic-gate  * For CDROMREADTOCENTRY, set the cdte_track to CDROM_LEADOUT to get
900Sstevel@tonic-gate  * the information for the leadout track.
910Sstevel@tonic-gate  */
920Sstevel@tonic-gate #define	CDROM_LEADOUT	0xAA
930Sstevel@tonic-gate 
940Sstevel@tonic-gate struct cdrom_subchnl {
950Sstevel@tonic-gate 	unsigned char	cdsc_format;
960Sstevel@tonic-gate 	unsigned char	cdsc_audiostatus;
970Sstevel@tonic-gate 	unsigned	cdsc_adr:	4;
980Sstevel@tonic-gate 	unsigned	cdsc_ctrl:	4;
990Sstevel@tonic-gate 	unsigned char	cdsc_trk;
1000Sstevel@tonic-gate 	unsigned char	cdsc_ind;
1010Sstevel@tonic-gate 	union {
1020Sstevel@tonic-gate 		struct {
1030Sstevel@tonic-gate 			unsigned char	minute;
1040Sstevel@tonic-gate 			unsigned char	second;
1050Sstevel@tonic-gate 			unsigned char	frame;
1060Sstevel@tonic-gate 		} msf;
1070Sstevel@tonic-gate 		int	lba;
1080Sstevel@tonic-gate 	} cdsc_absaddr;
1090Sstevel@tonic-gate 	union {
1100Sstevel@tonic-gate 		struct {
1110Sstevel@tonic-gate 			unsigned char	minute;
1120Sstevel@tonic-gate 			unsigned char	second;
1130Sstevel@tonic-gate 			unsigned char	frame;
1140Sstevel@tonic-gate 		} msf;
1150Sstevel@tonic-gate 		int	lba;
1160Sstevel@tonic-gate 	} cdsc_reladdr;
1170Sstevel@tonic-gate };
1180Sstevel@tonic-gate 
1190Sstevel@tonic-gate /*
1200Sstevel@tonic-gate  * Definition for audio status returned from Read Sub-channel
1210Sstevel@tonic-gate  */
1220Sstevel@tonic-gate #define	CDROM_AUDIO_INVALID	0x00	/* audio status not supported */
1230Sstevel@tonic-gate #define	CDROM_AUDIO_PLAY	0x11	/* audio play operation in progress */
1240Sstevel@tonic-gate #define	CDROM_AUDIO_PAUSED	0x12	/* audio play operation paused */
1250Sstevel@tonic-gate #define	CDROM_AUDIO_COMPLETED	0x13	/* audio play successfully completed */
1260Sstevel@tonic-gate #define	CDROM_AUDIO_ERROR	0x14	/* audio play stopped due to error */
1270Sstevel@tonic-gate #define	CDROM_AUDIO_NO_STATUS	0x15	/* no current audio status to return */
1280Sstevel@tonic-gate 
1290Sstevel@tonic-gate /*
1300Sstevel@tonic-gate  * definition of audio volume control structure
1310Sstevel@tonic-gate  */
1320Sstevel@tonic-gate struct cdrom_volctrl {
1330Sstevel@tonic-gate 	unsigned char	channel0;
1340Sstevel@tonic-gate 	unsigned char	channel1;
1350Sstevel@tonic-gate 	unsigned char	channel2;
1360Sstevel@tonic-gate 	unsigned char	channel3;
1370Sstevel@tonic-gate };
1380Sstevel@tonic-gate 
1390Sstevel@tonic-gate struct cdrom_read {
1400Sstevel@tonic-gate 	int		cdread_lba;
1410Sstevel@tonic-gate 	caddr_t		cdread_bufaddr;
1420Sstevel@tonic-gate 	int		cdread_buflen;
1430Sstevel@tonic-gate };
1440Sstevel@tonic-gate 
1450Sstevel@tonic-gate #if defined(_SYSCALL32)
1460Sstevel@tonic-gate 
1470Sstevel@tonic-gate struct cdrom_read32 {
1480Sstevel@tonic-gate 	int		cdread_lba;
1490Sstevel@tonic-gate 	caddr32_t	cdread_bufaddr;
1500Sstevel@tonic-gate 	int		cdread_buflen;
1510Sstevel@tonic-gate };
1520Sstevel@tonic-gate 
1530Sstevel@tonic-gate #define	cdrom_read32tocdrom_read(cdrd32, cdrd)				\
1540Sstevel@tonic-gate 	cdrd->cdread_lba	= cdrd32->cdread_lba;			\
1550Sstevel@tonic-gate 	cdrd->cdread_bufaddr	= (caddr_t)(uintptr_t)cdrd32->cdread_bufaddr; \
1560Sstevel@tonic-gate 	cdrd->cdread_buflen	= cdrd32->cdread_buflen
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate #define	cdrom_readtocdrom_read32(cdrd, cdrd32)				\
1590Sstevel@tonic-gate 	cdrd32->cdread_lba	= cdrd->cdread_lba;			\
1600Sstevel@tonic-gate 	cdrd32->cdread_bufaddr	= (caddr32_t)(uintptr_t)cdrd->cdread_bufaddr; \
1610Sstevel@tonic-gate 	cdrd32->cdread_buflen	= cdrd->cdread_buflen
1620Sstevel@tonic-gate 
1630Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1640Sstevel@tonic-gate 
1650Sstevel@tonic-gate /*
1660Sstevel@tonic-gate  * Definition of CD/DA structure
1670Sstevel@tonic-gate  */
1680Sstevel@tonic-gate struct cdrom_cdda {
1690Sstevel@tonic-gate 	unsigned int	cdda_addr;
1700Sstevel@tonic-gate 	unsigned int	cdda_length;
1710Sstevel@tonic-gate 	caddr_t		cdda_data;
1720Sstevel@tonic-gate 	unsigned char	cdda_subcode;
1730Sstevel@tonic-gate };
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate #if defined(_SYSCALL32)
1760Sstevel@tonic-gate struct cdrom_cdda32 {
1770Sstevel@tonic-gate 	unsigned int	cdda_addr;
1780Sstevel@tonic-gate 	unsigned int	cdda_length;
1790Sstevel@tonic-gate 	caddr32_t	cdda_data;
1800Sstevel@tonic-gate 	unsigned char	cdda_subcode;
1810Sstevel@tonic-gate };
1820Sstevel@tonic-gate 
1830Sstevel@tonic-gate #define	cdrom_cdda32tocdrom_cdda(cdda32, cdda)			\
1840Sstevel@tonic-gate 	cdda->cdda_addr		= cdda32->cdda_addr;		\
1850Sstevel@tonic-gate 	cdda->cdda_length	= cdda32->cdda_length;		\
1860Sstevel@tonic-gate 	cdda->cdda_data		= (caddr_t)(uintptr_t)cdda32->cdda_data; \
1870Sstevel@tonic-gate 	cdda->cdda_subcode	= cdda32->cdda_subcode
1880Sstevel@tonic-gate 
1890Sstevel@tonic-gate #define	cdrom_cddatocdrom_cdda32(cdda, cdda32)			\
1900Sstevel@tonic-gate 	cdda32->cdda_addr	= cdda->cdda_addr;		\
1910Sstevel@tonic-gate 	cdda32->cdda_length	= cdda->cdda_length;		\
1920Sstevel@tonic-gate 	cdda32->cdda_data	= (caddr32_t)(uintptr_t)cdda->cdda_data; \
1930Sstevel@tonic-gate 	cdda32->cdda_subcode	= cdda->cdda_subcode
1940Sstevel@tonic-gate 
1950Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1960Sstevel@tonic-gate 
1970Sstevel@tonic-gate /*
1980Sstevel@tonic-gate  * Definitions for cdda_subcode field
1990Sstevel@tonic-gate  */
2000Sstevel@tonic-gate #define	CDROM_DA_NO_SUBCODE	0x00	/* CD/DA data with no subcode */
2010Sstevel@tonic-gate #define	CDROM_DA_SUBQ		0x01	/* CD/DA data with sub Q code */
2020Sstevel@tonic-gate #define	CDROM_DA_ALL_SUBCODE	0x02	/* CD/DA data with all subcode */
2030Sstevel@tonic-gate #define	CDROM_DA_SUBCODE_ONLY	0x03	/* All subcode only */
2040Sstevel@tonic-gate 
2050Sstevel@tonic-gate /*
2060Sstevel@tonic-gate  * Definition of CD/XA structure
2070Sstevel@tonic-gate  */
2080Sstevel@tonic-gate struct cdrom_cdxa {
2090Sstevel@tonic-gate 	unsigned int	cdxa_addr;
2100Sstevel@tonic-gate 	unsigned int	cdxa_length;
2110Sstevel@tonic-gate 	caddr_t		cdxa_data;
2120Sstevel@tonic-gate 	unsigned char	cdxa_format;
2130Sstevel@tonic-gate };
2140Sstevel@tonic-gate 
2150Sstevel@tonic-gate #if defined(_SYSCALL32)
2160Sstevel@tonic-gate 
2170Sstevel@tonic-gate struct cdrom_cdxa32 {
2180Sstevel@tonic-gate 	unsigned int	cdxa_addr;
2190Sstevel@tonic-gate 	unsigned int	cdxa_length;
2200Sstevel@tonic-gate 	caddr32_t	cdxa_data;
2210Sstevel@tonic-gate 	unsigned char	cdxa_format;
2220Sstevel@tonic-gate };
2230Sstevel@tonic-gate 
2240Sstevel@tonic-gate #define	cdrom_cdxa32tocdrom_cdxa(cdxa32, cdxa)				\
2250Sstevel@tonic-gate 	cdxa->cdxa_addr		= cdxa32->cdxa_addr;			\
2260Sstevel@tonic-gate 	cdxa->cdxa_length	= cdxa32->cdxa_length;			\
2270Sstevel@tonic-gate 	cdxa->cdxa_data		= (caddr_t)(uintptr_t)cdxa32->cdxa_data; \
2280Sstevel@tonic-gate 	cdxa->cdxa_format	= cdxa32->cdxa_format
2290Sstevel@tonic-gate 
2300Sstevel@tonic-gate #define	cdrom_cdxatocdrom_cdxa32(cdxa, cdxa32)				\
2310Sstevel@tonic-gate 	cdxa32->cdxa_addr	= cdxa->cdxa_addr;			\
2320Sstevel@tonic-gate 	cdxa32->cdxa_length	= cdxa->cdxa_length;			\
2330Sstevel@tonic-gate 	cdxa32->cdxa_data	= (caddr32_t)(uintptr_t)cdxa->cdxa_data; \
2340Sstevel@tonic-gate 	cdxa32->cdxa_format	= cdxa->cdxa_format
2350Sstevel@tonic-gate 
2360Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2370Sstevel@tonic-gate 
2380Sstevel@tonic-gate /*
2390Sstevel@tonic-gate  * Definitions for cdxa_format field
2400Sstevel@tonic-gate  */
2410Sstevel@tonic-gate #define	CDROM_XA_DATA		0x00	/* CD/XA data only */
2420Sstevel@tonic-gate #define	CDROM_XA_SECTOR_DATA	0x01	/* CD/XA all sector data */
2430Sstevel@tonic-gate #define	CDROM_XA_DATA_W_ERROR	0x02	/* CD/XA data with error flags data */
2440Sstevel@tonic-gate 
2450Sstevel@tonic-gate /*
2460Sstevel@tonic-gate  * Definition of subcode structure
2470Sstevel@tonic-gate  */
2480Sstevel@tonic-gate struct cdrom_subcode {
2490Sstevel@tonic-gate 	unsigned int	cdsc_length;
2500Sstevel@tonic-gate 	caddr_t		cdsc_addr;
2510Sstevel@tonic-gate };
2520Sstevel@tonic-gate 
2530Sstevel@tonic-gate #if defined(_SYSCALL32)
2540Sstevel@tonic-gate 
2550Sstevel@tonic-gate struct cdrom_subcode32 {
2560Sstevel@tonic-gate 	unsigned int	cdsc_length;
2570Sstevel@tonic-gate 	caddr32_t	cdsc_addr;
2580Sstevel@tonic-gate };
2590Sstevel@tonic-gate 
2600Sstevel@tonic-gate #define	cdrom_subcode32tocdrom_subcode(cdsc32, cdsc)			\
2610Sstevel@tonic-gate 	cdsc->cdsc_length	= cdsc32->cdsc_length;			\
2620Sstevel@tonic-gate 	cdsc->cdsc_addr		= (caddr_t)(uintptr_t)cdsc32->cdsc_addr
2630Sstevel@tonic-gate 
2640Sstevel@tonic-gate #define	cdrom_subcodetocdrom_subcode32(cdsc, cdsc32)			\
2650Sstevel@tonic-gate 	cdsc32->cdsc_length	= cdsc->cdsc_length;			\
2660Sstevel@tonic-gate 	cdsc32->cdsc_addr	= (caddr32_t)(uintptr_t)cdsc->cdsc_addr
2670Sstevel@tonic-gate 
2680Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2690Sstevel@tonic-gate 
2700Sstevel@tonic-gate /*
2710Sstevel@tonic-gate  * Definitions for block size supported
2720Sstevel@tonic-gate  */
2730Sstevel@tonic-gate #define	CDROM_BLK_512		512
2740Sstevel@tonic-gate #define	CDROM_BLK_1024		1024
2750Sstevel@tonic-gate #define	CDROM_BLK_2048		2048
2760Sstevel@tonic-gate #define	CDROM_BLK_2056		2056
2770Sstevel@tonic-gate #define	CDROM_BLK_2324		2324
2780Sstevel@tonic-gate #define	CDROM_BLK_2336		2336
2790Sstevel@tonic-gate #define	CDROM_BLK_2340		2340
2800Sstevel@tonic-gate #define	CDROM_BLK_2352		2352
2810Sstevel@tonic-gate #define	CDROM_BLK_2368		2368
2820Sstevel@tonic-gate #define	CDROM_BLK_2448		2448
2830Sstevel@tonic-gate #define	CDROM_BLK_2646		2646
2840Sstevel@tonic-gate #define	CDROM_BLK_2647		2647
2850Sstevel@tonic-gate #define	CDROM_BLK_SUBCODE	96
2860Sstevel@tonic-gate 
2870Sstevel@tonic-gate /*
2880Sstevel@tonic-gate  * Definitions for drive speed supported
2890Sstevel@tonic-gate  */
2900Sstevel@tonic-gate #define	CDROM_NORMAL_SPEED	0x00
2910Sstevel@tonic-gate #define	CDROM_DOUBLE_SPEED	0x01
2920Sstevel@tonic-gate #define	CDROM_QUAD_SPEED	0x03
2930Sstevel@tonic-gate #define	CDROM_TWELVE_SPEED	0x0C
2940Sstevel@tonic-gate #define	CDROM_MAXIMUM_SPEED	0xff
2950Sstevel@tonic-gate 
2960Sstevel@tonic-gate /*
2970Sstevel@tonic-gate  * CDROM io control commands
2980Sstevel@tonic-gate  */
2990Sstevel@tonic-gate #define	CDIOC			(0x04 << 8)
3000Sstevel@tonic-gate #define	CDROMPAUSE		(CDIOC|151)	/* Pause Audio Operation */
3010Sstevel@tonic-gate #define	CDROMRESUME		(CDIOC|152) /* Resume paused Audio Operation */
3020Sstevel@tonic-gate #define	CDROMPLAYMSF		(CDIOC|153)	/* Play Audio MSF */
3030Sstevel@tonic-gate #define	CDROMPLAYTRKIND		(CDIOC|154)	/* Play Audio Track/index */
3040Sstevel@tonic-gate #define	CDROMREADTOCHDR		(CDIOC|155)	/* Read TOC header */
3050Sstevel@tonic-gate #define	CDROMREADTOCENTRY	(CDIOC|156)	/* Read a TOC entry */
3060Sstevel@tonic-gate #define	CDROMSTOP		(CDIOC|157)	/* Stop the cdrom drive */
3070Sstevel@tonic-gate #define	CDROMSTART		(CDIOC|158)	/* Start the cdrom drive */
3080Sstevel@tonic-gate #define	CDROMEJECT		(CDIOC|159)	/* Ejects the cdrom caddy */
3090Sstevel@tonic-gate #define	CDROMVOLCTRL		(CDIOC|160)	/* control output volume */
3100Sstevel@tonic-gate #define	CDROMSUBCHNL		(CDIOC|161)	/* read the subchannel data */
3110Sstevel@tonic-gate #define	CDROMREADMODE2		(CDIOC|162)	/* read CDROM mode 2 data */
3120Sstevel@tonic-gate #define	CDROMREADMODE1		(CDIOC|163)	/* read CDROM mode 1 data */
3130Sstevel@tonic-gate 
3140Sstevel@tonic-gate #define	CDROMREADOFFSET		(CDIOC|164)	/* read multi-session offset */
3150Sstevel@tonic-gate 
3160Sstevel@tonic-gate #define	CDROMGBLKMODE		(CDIOC|165)	/* get current block mode */
3170Sstevel@tonic-gate #define	CDROMSBLKMODE		(CDIOC|166)	/* set current block mode */
3180Sstevel@tonic-gate #define	CDROMCDDA		(CDIOC|167)	/* read CD/DA data */
3190Sstevel@tonic-gate #define	CDROMCDXA		(CDIOC|168)	/* read CD/XA data */
3200Sstevel@tonic-gate #define	CDROMSUBCODE		(CDIOC|169)	/* read subcode */
3210Sstevel@tonic-gate #define	CDROMGDRVSPEED		(CDIOC|170)	/* get current drive speed */
3220Sstevel@tonic-gate #define	CDROMSDRVSPEED		(CDIOC|171)	/* set current drive speed */
3230Sstevel@tonic-gate 
3240Sstevel@tonic-gate #define	CDROMCLOSETRAY		(CDIOC|172)	/* close cd tray,load media */
3250Sstevel@tonic-gate 
3260Sstevel@tonic-gate /*
3270Sstevel@tonic-gate  * Additional commands for CD-ROM
3280Sstevel@tonic-gate  */
3290Sstevel@tonic-gate /*
3300Sstevel@tonic-gate  *
3310Sstevel@tonic-gate  *	Group 2 Commands
3320Sstevel@tonic-gate  *
3330Sstevel@tonic-gate  */
334*173Scth #define	SCMD_READ_SUBCHANNEL	0x42		/* optional SCSI command */
3350Sstevel@tonic-gate #define	SCMD_READ_TOC		0x43		/* optional SCSI command */
336*173Scth #define	SCMD_READ_HEADER	0x44		/* optional SCSI command */
337*173Scth #define	SCMD_PLAYAUDIO10	0x45		/* optional SCSI command */
3380Sstevel@tonic-gate #define	SCMD_PLAYAUDIO_MSF	0x47		/* optional SCSI command */
3390Sstevel@tonic-gate #define	SCMD_PLAYAUDIO_TI	0x48		/* optional SCSI command */
340*173Scth #define	SCMD_PLAYTRACK_REL10	0x49		/* optional SCSI command */
3410Sstevel@tonic-gate #define	SCMD_PAUSE_RESUME	0x4B		/* optional SCSI command */
3420Sstevel@tonic-gate 
3430Sstevel@tonic-gate /*
3440Sstevel@tonic-gate  *
3450Sstevel@tonic-gate  *	Group 5 Commands
3460Sstevel@tonic-gate  *
3470Sstevel@tonic-gate  */
3480Sstevel@tonic-gate #define	SCMD_PLAYAUDIO12	0xA5		/* optional SCSI command */
3490Sstevel@tonic-gate #define	SCMD_PLAYTRACK_REL12	0xA9		/* optional SCSI command */
350*173Scth #define	SCMD_SET_CDROM_SPEED	0xBB		/* optional SCSI command */
3510Sstevel@tonic-gate #define	SCMD_READ_CD		0xBE	/* Universal way of accessing CD data */
3520Sstevel@tonic-gate 
3530Sstevel@tonic-gate /*
3540Sstevel@tonic-gate  * These defines are for SCMD_READ_CD command.
3550Sstevel@tonic-gate  * See Expected Sector Type Field Definition (SCSI MMC-2 Spec section 6.1.15)
3560Sstevel@tonic-gate  * This information is used to figure out which block size to use.
3570Sstevel@tonic-gate  */
3580Sstevel@tonic-gate #define	READ_CD_EST_ALLTYPE	0x0	/* All Types */
3590Sstevel@tonic-gate #define	READ_CD_EST_CDDA	0x1	/* Only CD-DA */
3600Sstevel@tonic-gate #define	READ_CD_EST_MODE1	0x2	/* Only Yellow Book 2048 bytes */
3610Sstevel@tonic-gate #define	READ_CD_EST_MODE2	0x3	/* Only Yellow Book 2336 byte sectors */
3620Sstevel@tonic-gate #define	READ_CD_EST_MODE2FORM1	0x4	/* Only sectors with 2048 bytes */
3630Sstevel@tonic-gate #define	READ_CD_EST_MODE2FORM2	0x5	/* Only sectors with 2324 bytes */
3640Sstevel@tonic-gate #define	READ_CD_EST_RSVD1	0x6	/* reserved */
3650Sstevel@tonic-gate #define	READ_CD_EST_RSVD2	0x7	/* reserved */
3660Sstevel@tonic-gate 
3670Sstevel@tonic-gate 
3680Sstevel@tonic-gate /*
3690Sstevel@tonic-gate  *
3700Sstevel@tonic-gate  *	Group 6 Commands
3710Sstevel@tonic-gate  *
3720Sstevel@tonic-gate  */
3730Sstevel@tonic-gate #define	SCMD_CD_PLAYBACK_CONTROL 0xC9	/* SONY unique SCSI command */
3740Sstevel@tonic-gate #define	SCMD_CD_PLAYBACK_STATUS	0xC4	/* SONY unique SCSI command */
3750Sstevel@tonic-gate #define	SCMD_READ_CDDA		0xD8	/* Vendor unique SCSI command */
3760Sstevel@tonic-gate #define	SCMD_READ_CDXA		0xDB	/* Vendor unique SCSI command */
3770Sstevel@tonic-gate #define	SCMD_READ_ALL_SUBCODES	0xDF	/* Vendor unique SCSI command */
3780Sstevel@tonic-gate 
3790Sstevel@tonic-gate #define	CDROM_MODE2_SIZE	2336
3800Sstevel@tonic-gate 
381*173Scth /*
382*173Scth  * scsi_key_strings for CDROM cdio SCMD_ definitions
383*173Scth  */
384*173Scth #define	SCSI_CMDS_KEY_STRINGS_CDIO				\
385*173Scth /* 0x42 */ SCMD_READ_SUBCHANNEL,	"read_subchannel",		\
386*173Scth /* 0x43 */ SCMD_READ_TOC,		"read_toc",			\
387*173Scth /* 0x44 */ SCMD_REPORT_DENSITIES |					\
388*173Scth 		SCMD_READ_HEADER,	"report_densities/read_header",	\
389*173Scth /* 0x45 */ SCMD_PLAYAUDIO10,		"playaudio",			\
390*173Scth /* 0x46 */ SCMD_GET_CONFIGURATION,	"get_configuration",		\
391*173Scth /* 0x47 */ SCMD_PLAYAUDIO_MSF,		"playaudio_msf",		\
392*173Scth /* 0x48 */ SCMD_PLAYAUDIO_TI,		"playaudio_ti",			\
393*173Scth /* 0x49 */ SCMD_PLAYTRACK_REL10,	"playaudio_rel",		\
394*173Scth /* 0x4b */ SCMD_PAUSE_RESUME,		"pause_resume",			\
395*173Scth 									\
396*173Scth /* 0xa5 */ SCMD_PLAYAUDIO12,		"playaudio(12)",		\
397*173Scth /* 0xa9 */ SCMD_PLAYTRACK_REL12,	"playtrack_rel",		\
398*173Scth /* 0xbb */ SCMD_SET_CDROM_SPEED,	"set_cd_speed",			\
399*173Scth /* 0xbe */ SCMD_READ_CD,		"read_cd",			\
400*173Scth 									\
401*173Scth /* 0xc4 */ SCMD_CD_PLAYBACK_STATUS,	"cd_playback_status",		\
402*173Scth /* 0xc9 */ SCMD_CD_PLAYBACK_CONTROL,	"cd_playback_control",		\
403*173Scth /* 0xd8 */ SCMD_READ_CDDA,		"read_cdda",			\
404*173Scth /* 0xdb */ SCMD_READ_CDXA,		"read_cdxa",			\
405*173Scth /* 0xdf */ SCMD_READ_ALL_SUBCODES,	"read_all_subcodes"
406*173Scth 
4070Sstevel@tonic-gate #ifdef	__cplusplus
4080Sstevel@tonic-gate }
4090Sstevel@tonic-gate #endif
4100Sstevel@tonic-gate 
4110Sstevel@tonic-gate #endif	/* _SYS_CDIO_H */
412