xref: /illumos-gate/usr/src/uts/common/sys/cdio.h (revision 2d6eb4a5)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*30a83a24Scth  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _SYS_CDIO_H
287c478bd9Sstevel@tonic-gate #define	_SYS_CDIO_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate /*
357c478bd9Sstevel@tonic-gate  * CDROM io controls type definitions
367c478bd9Sstevel@tonic-gate  */
377c478bd9Sstevel@tonic-gate struct cdrom_msf {
387c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_min0;	/* starting minute */
397c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_sec0;	/* starting second */
407c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_frame0;	/* starting frame  */
417c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_min1;	/* ending minute   */
427c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_sec1;	/* ending second   */
437c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_frame1;	/* ending frame	   */
447c478bd9Sstevel@tonic-gate };
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate struct cdrom_ti {
477c478bd9Sstevel@tonic-gate 	unsigned char	cdti_trk0;	/* starting track */
487c478bd9Sstevel@tonic-gate 	unsigned char	cdti_ind0;	/* starting index */
497c478bd9Sstevel@tonic-gate 	unsigned char	cdti_trk1;	/* ending track */
507c478bd9Sstevel@tonic-gate 	unsigned char	cdti_ind1;	/* ending index */
517c478bd9Sstevel@tonic-gate };
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate struct cdrom_tochdr {
547c478bd9Sstevel@tonic-gate 	unsigned char	cdth_trk0;	/* starting track */
557c478bd9Sstevel@tonic-gate 	unsigned char	cdth_trk1;	/* ending track */
567c478bd9Sstevel@tonic-gate };
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate struct cdrom_tocentry {
597c478bd9Sstevel@tonic-gate 	unsigned char	cdte_track;
607c478bd9Sstevel@tonic-gate 	unsigned	cdte_adr	:4;
617c478bd9Sstevel@tonic-gate 	unsigned	cdte_ctrl	:4;
627c478bd9Sstevel@tonic-gate 	unsigned char	cdte_format;
637c478bd9Sstevel@tonic-gate 	union {
647c478bd9Sstevel@tonic-gate 		struct {
657c478bd9Sstevel@tonic-gate 			unsigned char	minute;
667c478bd9Sstevel@tonic-gate 			unsigned char	second;
677c478bd9Sstevel@tonic-gate 			unsigned char	frame;
687c478bd9Sstevel@tonic-gate 		} msf;
697c478bd9Sstevel@tonic-gate 		int	lba;
707c478bd9Sstevel@tonic-gate 	} cdte_addr;
717c478bd9Sstevel@tonic-gate 	unsigned char	cdte_datamode;
727c478bd9Sstevel@tonic-gate };
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate /*
757c478bd9Sstevel@tonic-gate  * CDROM address format definition, for use with struct cdrom_tocentry
767c478bd9Sstevel@tonic-gate  */
777c478bd9Sstevel@tonic-gate #define	CDROM_LBA	0x01
787c478bd9Sstevel@tonic-gate #define	CDROM_MSF	0x02
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate /*
817c478bd9Sstevel@tonic-gate  * Bitmask for CD-ROM data track in the cdte_ctrl field
827c478bd9Sstevel@tonic-gate  * A track is either data or audio.
837c478bd9Sstevel@tonic-gate  */
847c478bd9Sstevel@tonic-gate #define	CDROM_DATA_TRACK	0x04
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate /*
877c478bd9Sstevel@tonic-gate  * For CDROMREADTOCENTRY, set the cdte_track to CDROM_LEADOUT to get
887c478bd9Sstevel@tonic-gate  * the information for the leadout track.
897c478bd9Sstevel@tonic-gate  */
907c478bd9Sstevel@tonic-gate #define	CDROM_LEADOUT	0xAA
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate struct cdrom_subchnl {
937c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_format;
947c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_audiostatus;
957c478bd9Sstevel@tonic-gate 	unsigned	cdsc_adr:	4;
967c478bd9Sstevel@tonic-gate 	unsigned	cdsc_ctrl:	4;
977c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_trk;
987c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_ind;
997c478bd9Sstevel@tonic-gate 	union {
1007c478bd9Sstevel@tonic-gate 		struct {
1017c478bd9Sstevel@tonic-gate 			unsigned char	minute;
1027c478bd9Sstevel@tonic-gate 			unsigned char	second;
1037c478bd9Sstevel@tonic-gate 			unsigned char	frame;
1047c478bd9Sstevel@tonic-gate 		} msf;
1057c478bd9Sstevel@tonic-gate 		int	lba;
1067c478bd9Sstevel@tonic-gate 	} cdsc_absaddr;
1077c478bd9Sstevel@tonic-gate 	union {
1087c478bd9Sstevel@tonic-gate 		struct {
1097c478bd9Sstevel@tonic-gate 			unsigned char	minute;
1107c478bd9Sstevel@tonic-gate 			unsigned char	second;
1117c478bd9Sstevel@tonic-gate 			unsigned char	frame;
1127c478bd9Sstevel@tonic-gate 		} msf;
1137c478bd9Sstevel@tonic-gate 		int	lba;
1147c478bd9Sstevel@tonic-gate 	} cdsc_reladdr;
1157c478bd9Sstevel@tonic-gate };
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate /*
1187c478bd9Sstevel@tonic-gate  * Definition for audio status returned from Read Sub-channel
1197c478bd9Sstevel@tonic-gate  */
1207c478bd9Sstevel@tonic-gate #define	CDROM_AUDIO_INVALID	0x00	/* audio status not supported */
1217c478bd9Sstevel@tonic-gate #define	CDROM_AUDIO_PLAY	0x11	/* audio play operation in progress */
1227c478bd9Sstevel@tonic-gate #define	CDROM_AUDIO_PAUSED	0x12	/* audio play operation paused */
1237c478bd9Sstevel@tonic-gate #define	CDROM_AUDIO_COMPLETED	0x13	/* audio play successfully completed */
1247c478bd9Sstevel@tonic-gate #define	CDROM_AUDIO_ERROR	0x14	/* audio play stopped due to error */
1257c478bd9Sstevel@tonic-gate #define	CDROM_AUDIO_NO_STATUS	0x15	/* no current audio status to return */
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate /*
1287c478bd9Sstevel@tonic-gate  * definition of audio volume control structure
1297c478bd9Sstevel@tonic-gate  */
1307c478bd9Sstevel@tonic-gate struct cdrom_volctrl {
1317c478bd9Sstevel@tonic-gate 	unsigned char	channel0;
1327c478bd9Sstevel@tonic-gate 	unsigned char	channel1;
1337c478bd9Sstevel@tonic-gate 	unsigned char	channel2;
1347c478bd9Sstevel@tonic-gate 	unsigned char	channel3;
1357c478bd9Sstevel@tonic-gate };
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate struct cdrom_read {
1387c478bd9Sstevel@tonic-gate 	int		cdread_lba;
1397c478bd9Sstevel@tonic-gate 	caddr_t		cdread_bufaddr;
1407c478bd9Sstevel@tonic-gate 	int		cdread_buflen;
1417c478bd9Sstevel@tonic-gate };
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate struct cdrom_read32 {
1467c478bd9Sstevel@tonic-gate 	int		cdread_lba;
1477c478bd9Sstevel@tonic-gate 	caddr32_t	cdread_bufaddr;
1487c478bd9Sstevel@tonic-gate 	int		cdread_buflen;
1497c478bd9Sstevel@tonic-gate };
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate #define	cdrom_read32tocdrom_read(cdrd32, cdrd)				\
1527c478bd9Sstevel@tonic-gate 	cdrd->cdread_lba	= cdrd32->cdread_lba;			\
1537c478bd9Sstevel@tonic-gate 	cdrd->cdread_bufaddr	= (caddr_t)(uintptr_t)cdrd32->cdread_bufaddr; \
1547c478bd9Sstevel@tonic-gate 	cdrd->cdread_buflen	= cdrd32->cdread_buflen
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate #define	cdrom_readtocdrom_read32(cdrd, cdrd32)				\
1577c478bd9Sstevel@tonic-gate 	cdrd32->cdread_lba	= cdrd->cdread_lba;			\
1587c478bd9Sstevel@tonic-gate 	cdrd32->cdread_bufaddr	= (caddr32_t)(uintptr_t)cdrd->cdread_bufaddr; \
1597c478bd9Sstevel@tonic-gate 	cdrd32->cdread_buflen	= cdrd->cdread_buflen
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate /*
1647c478bd9Sstevel@tonic-gate  * Definition of CD/DA structure
1657c478bd9Sstevel@tonic-gate  */
1667c478bd9Sstevel@tonic-gate struct cdrom_cdda {
1677c478bd9Sstevel@tonic-gate 	unsigned int	cdda_addr;
1687c478bd9Sstevel@tonic-gate 	unsigned int	cdda_length;
1697c478bd9Sstevel@tonic-gate 	caddr_t		cdda_data;
1707c478bd9Sstevel@tonic-gate 	unsigned char	cdda_subcode;
1717c478bd9Sstevel@tonic-gate };
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1747c478bd9Sstevel@tonic-gate struct cdrom_cdda32 {
1757c478bd9Sstevel@tonic-gate 	unsigned int	cdda_addr;
1767c478bd9Sstevel@tonic-gate 	unsigned int	cdda_length;
1777c478bd9Sstevel@tonic-gate 	caddr32_t	cdda_data;
1787c478bd9Sstevel@tonic-gate 	unsigned char	cdda_subcode;
1797c478bd9Sstevel@tonic-gate };
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate #define	cdrom_cdda32tocdrom_cdda(cdda32, cdda)			\
1827c478bd9Sstevel@tonic-gate 	cdda->cdda_addr		= cdda32->cdda_addr;		\
1837c478bd9Sstevel@tonic-gate 	cdda->cdda_length	= cdda32->cdda_length;		\
1847c478bd9Sstevel@tonic-gate 	cdda->cdda_data		= (caddr_t)(uintptr_t)cdda32->cdda_data; \
1857c478bd9Sstevel@tonic-gate 	cdda->cdda_subcode	= cdda32->cdda_subcode
1867c478bd9Sstevel@tonic-gate 
1877c478bd9Sstevel@tonic-gate #define	cdrom_cddatocdrom_cdda32(cdda, cdda32)			\
1887c478bd9Sstevel@tonic-gate 	cdda32->cdda_addr	= cdda->cdda_addr;		\
1897c478bd9Sstevel@tonic-gate 	cdda32->cdda_length	= cdda->cdda_length;		\
1907c478bd9Sstevel@tonic-gate 	cdda32->cdda_data	= (caddr32_t)(uintptr_t)cdda->cdda_data; \
1917c478bd9Sstevel@tonic-gate 	cdda32->cdda_subcode	= cdda->cdda_subcode
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate /*
1967c478bd9Sstevel@tonic-gate  * Definitions for cdda_subcode field
1977c478bd9Sstevel@tonic-gate  */
1987c478bd9Sstevel@tonic-gate #define	CDROM_DA_NO_SUBCODE	0x00	/* CD/DA data with no subcode */
1997c478bd9Sstevel@tonic-gate #define	CDROM_DA_SUBQ		0x01	/* CD/DA data with sub Q code */
2007c478bd9Sstevel@tonic-gate #define	CDROM_DA_ALL_SUBCODE	0x02	/* CD/DA data with all subcode */
2017c478bd9Sstevel@tonic-gate #define	CDROM_DA_SUBCODE_ONLY	0x03	/* All subcode only */
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate /*
2047c478bd9Sstevel@tonic-gate  * Definition of CD/XA structure
2057c478bd9Sstevel@tonic-gate  */
2067c478bd9Sstevel@tonic-gate struct cdrom_cdxa {
2077c478bd9Sstevel@tonic-gate 	unsigned int	cdxa_addr;
2087c478bd9Sstevel@tonic-gate 	unsigned int	cdxa_length;
2097c478bd9Sstevel@tonic-gate 	caddr_t		cdxa_data;
2107c478bd9Sstevel@tonic-gate 	unsigned char	cdxa_format;
2117c478bd9Sstevel@tonic-gate };
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate struct cdrom_cdxa32 {
2167c478bd9Sstevel@tonic-gate 	unsigned int	cdxa_addr;
2177c478bd9Sstevel@tonic-gate 	unsigned int	cdxa_length;
2187c478bd9Sstevel@tonic-gate 	caddr32_t	cdxa_data;
2197c478bd9Sstevel@tonic-gate 	unsigned char	cdxa_format;
2207c478bd9Sstevel@tonic-gate };
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate #define	cdrom_cdxa32tocdrom_cdxa(cdxa32, cdxa)				\
2237c478bd9Sstevel@tonic-gate 	cdxa->cdxa_addr		= cdxa32->cdxa_addr;			\
2247c478bd9Sstevel@tonic-gate 	cdxa->cdxa_length	= cdxa32->cdxa_length;			\
2257c478bd9Sstevel@tonic-gate 	cdxa->cdxa_data		= (caddr_t)(uintptr_t)cdxa32->cdxa_data; \
2267c478bd9Sstevel@tonic-gate 	cdxa->cdxa_format	= cdxa32->cdxa_format
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate #define	cdrom_cdxatocdrom_cdxa32(cdxa, cdxa32)				\
2297c478bd9Sstevel@tonic-gate 	cdxa32->cdxa_addr	= cdxa->cdxa_addr;			\
2307c478bd9Sstevel@tonic-gate 	cdxa32->cdxa_length	= cdxa->cdxa_length;			\
2317c478bd9Sstevel@tonic-gate 	cdxa32->cdxa_data	= (caddr32_t)(uintptr_t)cdxa->cdxa_data; \
2327c478bd9Sstevel@tonic-gate 	cdxa32->cdxa_format	= cdxa->cdxa_format
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2357c478bd9Sstevel@tonic-gate 
2367c478bd9Sstevel@tonic-gate /*
2377c478bd9Sstevel@tonic-gate  * Definitions for cdxa_format field
2387c478bd9Sstevel@tonic-gate  */
2397c478bd9Sstevel@tonic-gate #define	CDROM_XA_DATA		0x00	/* CD/XA data only */
2407c478bd9Sstevel@tonic-gate #define	CDROM_XA_SECTOR_DATA	0x01	/* CD/XA all sector data */
2417c478bd9Sstevel@tonic-gate #define	CDROM_XA_DATA_W_ERROR	0x02	/* CD/XA data with error flags data */
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate /*
2447c478bd9Sstevel@tonic-gate  * Definition of subcode structure
2457c478bd9Sstevel@tonic-gate  */
2467c478bd9Sstevel@tonic-gate struct cdrom_subcode {
2477c478bd9Sstevel@tonic-gate 	unsigned int	cdsc_length;
2487c478bd9Sstevel@tonic-gate 	caddr_t		cdsc_addr;
2497c478bd9Sstevel@tonic-gate };
2507c478bd9Sstevel@tonic-gate 
2517c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate struct cdrom_subcode32 {
2547c478bd9Sstevel@tonic-gate 	unsigned int	cdsc_length;
2557c478bd9Sstevel@tonic-gate 	caddr32_t	cdsc_addr;
2567c478bd9Sstevel@tonic-gate };
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate #define	cdrom_subcode32tocdrom_subcode(cdsc32, cdsc)			\
2597c478bd9Sstevel@tonic-gate 	cdsc->cdsc_length	= cdsc32->cdsc_length;			\
2607c478bd9Sstevel@tonic-gate 	cdsc->cdsc_addr		= (caddr_t)(uintptr_t)cdsc32->cdsc_addr
2617c478bd9Sstevel@tonic-gate 
2627c478bd9Sstevel@tonic-gate #define	cdrom_subcodetocdrom_subcode32(cdsc, cdsc32)			\
2637c478bd9Sstevel@tonic-gate 	cdsc32->cdsc_length	= cdsc->cdsc_length;			\
2647c478bd9Sstevel@tonic-gate 	cdsc32->cdsc_addr	= (caddr32_t)(uintptr_t)cdsc->cdsc_addr
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2677c478bd9Sstevel@tonic-gate 
2687c478bd9Sstevel@tonic-gate /*
2697c478bd9Sstevel@tonic-gate  * Definitions for block size supported
2707c478bd9Sstevel@tonic-gate  */
2717c478bd9Sstevel@tonic-gate #define	CDROM_BLK_512		512
2727c478bd9Sstevel@tonic-gate #define	CDROM_BLK_1024		1024
2737c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2048		2048
2747c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2056		2056
2757c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2324		2324
2767c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2336		2336
2777c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2340		2340
2787c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2352		2352
2797c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2368		2368
2807c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2448		2448
2817c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2646		2646
2827c478bd9Sstevel@tonic-gate #define	CDROM_BLK_2647		2647
2837c478bd9Sstevel@tonic-gate #define	CDROM_BLK_SUBCODE	96
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate /*
2867c478bd9Sstevel@tonic-gate  * Definitions for drive speed supported
2877c478bd9Sstevel@tonic-gate  */
2887c478bd9Sstevel@tonic-gate #define	CDROM_NORMAL_SPEED	0x00
2897c478bd9Sstevel@tonic-gate #define	CDROM_DOUBLE_SPEED	0x01
2907c478bd9Sstevel@tonic-gate #define	CDROM_QUAD_SPEED	0x03
2917c478bd9Sstevel@tonic-gate #define	CDROM_TWELVE_SPEED	0x0C
2927c478bd9Sstevel@tonic-gate #define	CDROM_MAXIMUM_SPEED	0xff
2937c478bd9Sstevel@tonic-gate 
2947c478bd9Sstevel@tonic-gate /*
2957c478bd9Sstevel@tonic-gate  * CDROM io control commands
2967c478bd9Sstevel@tonic-gate  */
2977c478bd9Sstevel@tonic-gate #define	CDIOC			(0x04 << 8)
2987c478bd9Sstevel@tonic-gate #define	CDROMPAUSE		(CDIOC|151)	/* Pause Audio Operation */
2997c478bd9Sstevel@tonic-gate #define	CDROMRESUME		(CDIOC|152) /* Resume paused Audio Operation */
3007c478bd9Sstevel@tonic-gate #define	CDROMPLAYMSF		(CDIOC|153)	/* Play Audio MSF */
3017c478bd9Sstevel@tonic-gate #define	CDROMPLAYTRKIND		(CDIOC|154)	/* Play Audio Track/index */
3027c478bd9Sstevel@tonic-gate #define	CDROMREADTOCHDR		(CDIOC|155)	/* Read TOC header */
3037c478bd9Sstevel@tonic-gate #define	CDROMREADTOCENTRY	(CDIOC|156)	/* Read a TOC entry */
3047c478bd9Sstevel@tonic-gate #define	CDROMSTOP		(CDIOC|157)	/* Stop the cdrom drive */
3057c478bd9Sstevel@tonic-gate #define	CDROMSTART		(CDIOC|158)	/* Start the cdrom drive */
3067c478bd9Sstevel@tonic-gate #define	CDROMEJECT		(CDIOC|159)	/* Ejects the cdrom caddy */
3077c478bd9Sstevel@tonic-gate #define	CDROMVOLCTRL		(CDIOC|160)	/* control output volume */
3087c478bd9Sstevel@tonic-gate #define	CDROMSUBCHNL		(CDIOC|161)	/* read the subchannel data */
3097c478bd9Sstevel@tonic-gate #define	CDROMREADMODE2		(CDIOC|162)	/* read CDROM mode 2 data */
3107c478bd9Sstevel@tonic-gate #define	CDROMREADMODE1		(CDIOC|163)	/* read CDROM mode 1 data */
3117c478bd9Sstevel@tonic-gate 
3127c478bd9Sstevel@tonic-gate #define	CDROMREADOFFSET		(CDIOC|164)	/* read multi-session offset */
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate #define	CDROMGBLKMODE		(CDIOC|165)	/* get current block mode */
3157c478bd9Sstevel@tonic-gate #define	CDROMSBLKMODE		(CDIOC|166)	/* set current block mode */
3167c478bd9Sstevel@tonic-gate #define	CDROMCDDA		(CDIOC|167)	/* read CD/DA data */
3177c478bd9Sstevel@tonic-gate #define	CDROMCDXA		(CDIOC|168)	/* read CD/XA data */
3187c478bd9Sstevel@tonic-gate #define	CDROMSUBCODE		(CDIOC|169)	/* read subcode */
3197c478bd9Sstevel@tonic-gate #define	CDROMGDRVSPEED		(CDIOC|170)	/* get current drive speed */
3207c478bd9Sstevel@tonic-gate #define	CDROMSDRVSPEED		(CDIOC|171)	/* set current drive speed */
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate #define	CDROMCLOSETRAY		(CDIOC|172)	/* close cd tray,load media */
3237c478bd9Sstevel@tonic-gate 
3247c478bd9Sstevel@tonic-gate /*
3257c478bd9Sstevel@tonic-gate  * Additional commands for CD-ROM
3267c478bd9Sstevel@tonic-gate  */
3277c478bd9Sstevel@tonic-gate /*
3287c478bd9Sstevel@tonic-gate  *
3297c478bd9Sstevel@tonic-gate  *	Group 2 Commands
3307c478bd9Sstevel@tonic-gate  *
3317c478bd9Sstevel@tonic-gate  */
332*30a83a24Scth #define	SCMD_READ_SUBCHANNEL	0x42		/* optional SCSI command */
3337c478bd9Sstevel@tonic-gate #define	SCMD_READ_TOC		0x43		/* optional SCSI command */
334*30a83a24Scth #define	SCMD_READ_HEADER	0x44		/* optional SCSI command */
335*30a83a24Scth #define	SCMD_PLAYAUDIO10	0x45		/* optional SCSI command */
3367c478bd9Sstevel@tonic-gate #define	SCMD_PLAYAUDIO_MSF	0x47		/* optional SCSI command */
3377c478bd9Sstevel@tonic-gate #define	SCMD_PLAYAUDIO_TI	0x48		/* optional SCSI command */
3387c478bd9Sstevel@tonic-gate #define	SCMD_PLAYTRACK_REL10	0x49		/* optional SCSI command */
339*30a83a24Scth #define	SCMD_PAUSE_RESUME	0x4B		/* optional SCSI command */
3407c478bd9Sstevel@tonic-gate 
3417c478bd9Sstevel@tonic-gate /*
3427c478bd9Sstevel@tonic-gate  *
3437c478bd9Sstevel@tonic-gate  *	Group 5 Commands
3447c478bd9Sstevel@tonic-gate  *
3457c478bd9Sstevel@tonic-gate  */
3467c478bd9Sstevel@tonic-gate #define	SCMD_PLAYAUDIO12	0xA5		/* optional SCSI command */
3477c478bd9Sstevel@tonic-gate #define	SCMD_PLAYTRACK_REL12	0xA9		/* optional SCSI command */
348*30a83a24Scth #define	SCMD_SET_CDROM_SPEED	0xBB		/* optional SCSI command */
3497c478bd9Sstevel@tonic-gate #define	SCMD_READ_CD		0xBE	/* Universal way of accessing CD data */
3507c478bd9Sstevel@tonic-gate 
3517c478bd9Sstevel@tonic-gate /*
3527c478bd9Sstevel@tonic-gate  * These defines are for SCMD_READ_CD command.
3537c478bd9Sstevel@tonic-gate  * See Expected Sector Type Field Definition (SCSI MMC-2 Spec section 6.1.15)
3547c478bd9Sstevel@tonic-gate  * This information is used to figure out which block size to use.
3557c478bd9Sstevel@tonic-gate  */
3567c478bd9Sstevel@tonic-gate #define	READ_CD_EST_ALLTYPE	0x0	/* All Types */
3577c478bd9Sstevel@tonic-gate #define	READ_CD_EST_CDDA	0x1	/* Only CD-DA */
3587c478bd9Sstevel@tonic-gate #define	READ_CD_EST_MODE1	0x2	/* Only Yellow Book 2048 bytes */
3597c478bd9Sstevel@tonic-gate #define	READ_CD_EST_MODE2	0x3	/* Only Yellow Book 2336 byte sectors */
3607c478bd9Sstevel@tonic-gate #define	READ_CD_EST_MODE2FORM1	0x4	/* Only sectors with 2048 bytes */
3617c478bd9Sstevel@tonic-gate #define	READ_CD_EST_MODE2FORM2	0x5	/* Only sectors with 2324 bytes */
3627c478bd9Sstevel@tonic-gate #define	READ_CD_EST_RSVD1	0x6	/* reserved */
3637c478bd9Sstevel@tonic-gate #define	READ_CD_EST_RSVD2	0x7	/* reserved */
3647c478bd9Sstevel@tonic-gate 
3657c478bd9Sstevel@tonic-gate 
3667c478bd9Sstevel@tonic-gate /*
3677c478bd9Sstevel@tonic-gate  *
3687c478bd9Sstevel@tonic-gate  *	Group 6 Commands
3697c478bd9Sstevel@tonic-gate  *
3707c478bd9Sstevel@tonic-gate  */
3717c478bd9Sstevel@tonic-gate #define	SCMD_CD_PLAYBACK_CONTROL 0xC9	/* SONY unique SCSI command */
3727c478bd9Sstevel@tonic-gate #define	SCMD_CD_PLAYBACK_STATUS	0xC4	/* SONY unique SCSI command */
3737c478bd9Sstevel@tonic-gate #define	SCMD_READ_CDDA		0xD8	/* Vendor unique SCSI command */
3747c478bd9Sstevel@tonic-gate #define	SCMD_READ_CDXA		0xDB	/* Vendor unique SCSI command */
3757c478bd9Sstevel@tonic-gate #define	SCMD_READ_ALL_SUBCODES	0xDF	/* Vendor unique SCSI command */
3767c478bd9Sstevel@tonic-gate 
3777c478bd9Sstevel@tonic-gate #define	CDROM_MODE2_SIZE	2336
3787c478bd9Sstevel@tonic-gate 
379*30a83a24Scth /*
380*30a83a24Scth  * scsi_key_strings for CDROM cdio SCMD_ definitions
381*30a83a24Scth  */
382*30a83a24Scth #define	SCSI_CMDS_KEY_STRINGS_CDIO				\
383*30a83a24Scth /* 0x42 */ SCMD_READ_SUBCHANNEL,	"read_subchannel",		\
384*30a83a24Scth /* 0x43 */ SCMD_READ_TOC,		"read_toc",			\
385*30a83a24Scth /* 0x44 */ SCMD_REPORT_DENSITIES |					\
386*30a83a24Scth 		SCMD_READ_HEADER,	"report_densities/read_header",	\
387*30a83a24Scth /* 0x45 */ SCMD_PLAYAUDIO10,		"playaudio",			\
388*30a83a24Scth /* 0x46 */ SCMD_GET_CONFIGURATION,	"get_configuration",		\
389*30a83a24Scth /* 0x47 */ SCMD_PLAYAUDIO_MSF,		"playaudio_msf",		\
390*30a83a24Scth /* 0x48 */ SCMD_PLAYAUDIO_TI,		"playaudio_ti",			\
391*30a83a24Scth /* 0x49 */ SCMD_PLAYTRACK_REL10,	"playaudio_rel",		\
392*30a83a24Scth /* 0x4b */ SCMD_PAUSE_RESUME,		"pause_resume",			\
393*30a83a24Scth 									\
394*30a83a24Scth /* 0xa5 */ SCMD_PLAYAUDIO12,		"playaudio(12)",		\
395*30a83a24Scth /* 0xa9 */ SCMD_PLAYTRACK_REL12,	"playtrack_rel",		\
396*30a83a24Scth /* 0xbb */ SCMD_SET_CDROM_SPEED,	"set_cd_speed",			\
397*30a83a24Scth /* 0xbe */ SCMD_READ_CD,		"read_cd",			\
398*30a83a24Scth 									\
399*30a83a24Scth /* 0xc4 */ SCMD_CD_PLAYBACK_STATUS,	"cd_playback_status",		\
400*30a83a24Scth /* 0xc9 */ SCMD_CD_PLAYBACK_CONTROL,	"cd_playback_control",		\
401*30a83a24Scth /* 0xd8 */ SCMD_READ_CDDA,		"read_cdda",			\
402*30a83a24Scth /* 0xdb */ SCMD_READ_CDXA,		"read_cdxa",			\
403*30a83a24Scth /* 0xdf */ SCMD_READ_ALL_SUBCODES,	"read_all_subcodes"
404*30a83a24Scth 
4057c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
4067c478bd9Sstevel@tonic-gate }
4077c478bd9Sstevel@tonic-gate #endif
4087c478bd9Sstevel@tonic-gate 
4097c478bd9Sstevel@tonic-gate #endif	/* _SYS_CDIO_H */
410