xref: /onnv-gate/usr/src/uts/common/sys/cdio.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _SYS_CDIO_H
28*0Sstevel@tonic-gate #define	_SYS_CDIO_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #ifdef	__cplusplus
33*0Sstevel@tonic-gate extern "C" {
34*0Sstevel@tonic-gate #endif
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate /*
37*0Sstevel@tonic-gate  * CDROM io controls type definitions
38*0Sstevel@tonic-gate  */
39*0Sstevel@tonic-gate struct cdrom_msf {
40*0Sstevel@tonic-gate 	unsigned char	cdmsf_min0;	/* starting minute */
41*0Sstevel@tonic-gate 	unsigned char	cdmsf_sec0;	/* starting second */
42*0Sstevel@tonic-gate 	unsigned char	cdmsf_frame0;	/* starting frame  */
43*0Sstevel@tonic-gate 	unsigned char	cdmsf_min1;	/* ending minute   */
44*0Sstevel@tonic-gate 	unsigned char	cdmsf_sec1;	/* ending second   */
45*0Sstevel@tonic-gate 	unsigned char	cdmsf_frame1;	/* ending frame	   */
46*0Sstevel@tonic-gate };
47*0Sstevel@tonic-gate 
48*0Sstevel@tonic-gate struct cdrom_ti {
49*0Sstevel@tonic-gate 	unsigned char	cdti_trk0;	/* starting track */
50*0Sstevel@tonic-gate 	unsigned char	cdti_ind0;	/* starting index */
51*0Sstevel@tonic-gate 	unsigned char	cdti_trk1;	/* ending track */
52*0Sstevel@tonic-gate 	unsigned char	cdti_ind1;	/* ending index */
53*0Sstevel@tonic-gate };
54*0Sstevel@tonic-gate 
55*0Sstevel@tonic-gate struct cdrom_tochdr {
56*0Sstevel@tonic-gate 	unsigned char	cdth_trk0;	/* starting track */
57*0Sstevel@tonic-gate 	unsigned char	cdth_trk1;	/* ending track */
58*0Sstevel@tonic-gate };
59*0Sstevel@tonic-gate 
60*0Sstevel@tonic-gate struct cdrom_tocentry {
61*0Sstevel@tonic-gate 	unsigned char	cdte_track;
62*0Sstevel@tonic-gate 	unsigned	cdte_adr	:4;
63*0Sstevel@tonic-gate 	unsigned	cdte_ctrl	:4;
64*0Sstevel@tonic-gate 	unsigned char	cdte_format;
65*0Sstevel@tonic-gate 	union {
66*0Sstevel@tonic-gate 		struct {
67*0Sstevel@tonic-gate 			unsigned char	minute;
68*0Sstevel@tonic-gate 			unsigned char	second;
69*0Sstevel@tonic-gate 			unsigned char	frame;
70*0Sstevel@tonic-gate 		} msf;
71*0Sstevel@tonic-gate 		int	lba;
72*0Sstevel@tonic-gate 	} cdte_addr;
73*0Sstevel@tonic-gate 	unsigned char	cdte_datamode;
74*0Sstevel@tonic-gate };
75*0Sstevel@tonic-gate 
76*0Sstevel@tonic-gate /*
77*0Sstevel@tonic-gate  * CDROM address format definition, for use with struct cdrom_tocentry
78*0Sstevel@tonic-gate  */
79*0Sstevel@tonic-gate #define	CDROM_LBA	0x01
80*0Sstevel@tonic-gate #define	CDROM_MSF	0x02
81*0Sstevel@tonic-gate 
82*0Sstevel@tonic-gate /*
83*0Sstevel@tonic-gate  * Bitmask for CD-ROM data track in the cdte_ctrl field
84*0Sstevel@tonic-gate  * A track is either data or audio.
85*0Sstevel@tonic-gate  */
86*0Sstevel@tonic-gate #define	CDROM_DATA_TRACK	0x04
87*0Sstevel@tonic-gate 
88*0Sstevel@tonic-gate /*
89*0Sstevel@tonic-gate  * For CDROMREADTOCENTRY, set the cdte_track to CDROM_LEADOUT to get
90*0Sstevel@tonic-gate  * the information for the leadout track.
91*0Sstevel@tonic-gate  */
92*0Sstevel@tonic-gate #define	CDROM_LEADOUT	0xAA
93*0Sstevel@tonic-gate 
94*0Sstevel@tonic-gate struct cdrom_subchnl {
95*0Sstevel@tonic-gate 	unsigned char	cdsc_format;
96*0Sstevel@tonic-gate 	unsigned char	cdsc_audiostatus;
97*0Sstevel@tonic-gate 	unsigned	cdsc_adr:	4;
98*0Sstevel@tonic-gate 	unsigned	cdsc_ctrl:	4;
99*0Sstevel@tonic-gate 	unsigned char	cdsc_trk;
100*0Sstevel@tonic-gate 	unsigned char	cdsc_ind;
101*0Sstevel@tonic-gate 	union {
102*0Sstevel@tonic-gate 		struct {
103*0Sstevel@tonic-gate 			unsigned char	minute;
104*0Sstevel@tonic-gate 			unsigned char	second;
105*0Sstevel@tonic-gate 			unsigned char	frame;
106*0Sstevel@tonic-gate 		} msf;
107*0Sstevel@tonic-gate 		int	lba;
108*0Sstevel@tonic-gate 	} cdsc_absaddr;
109*0Sstevel@tonic-gate 	union {
110*0Sstevel@tonic-gate 		struct {
111*0Sstevel@tonic-gate 			unsigned char	minute;
112*0Sstevel@tonic-gate 			unsigned char	second;
113*0Sstevel@tonic-gate 			unsigned char	frame;
114*0Sstevel@tonic-gate 		} msf;
115*0Sstevel@tonic-gate 		int	lba;
116*0Sstevel@tonic-gate 	} cdsc_reladdr;
117*0Sstevel@tonic-gate };
118*0Sstevel@tonic-gate 
119*0Sstevel@tonic-gate /*
120*0Sstevel@tonic-gate  * Definition for audio status returned from Read Sub-channel
121*0Sstevel@tonic-gate  */
122*0Sstevel@tonic-gate #define	CDROM_AUDIO_INVALID	0x00	/* audio status not supported */
123*0Sstevel@tonic-gate #define	CDROM_AUDIO_PLAY	0x11	/* audio play operation in progress */
124*0Sstevel@tonic-gate #define	CDROM_AUDIO_PAUSED	0x12	/* audio play operation paused */
125*0Sstevel@tonic-gate #define	CDROM_AUDIO_COMPLETED	0x13	/* audio play successfully completed */
126*0Sstevel@tonic-gate #define	CDROM_AUDIO_ERROR	0x14	/* audio play stopped due to error */
127*0Sstevel@tonic-gate #define	CDROM_AUDIO_NO_STATUS	0x15	/* no current audio status to return */
128*0Sstevel@tonic-gate 
129*0Sstevel@tonic-gate /*
130*0Sstevel@tonic-gate  * definition of audio volume control structure
131*0Sstevel@tonic-gate  */
132*0Sstevel@tonic-gate struct cdrom_volctrl {
133*0Sstevel@tonic-gate 	unsigned char	channel0;
134*0Sstevel@tonic-gate 	unsigned char	channel1;
135*0Sstevel@tonic-gate 	unsigned char	channel2;
136*0Sstevel@tonic-gate 	unsigned char	channel3;
137*0Sstevel@tonic-gate };
138*0Sstevel@tonic-gate 
139*0Sstevel@tonic-gate struct cdrom_read {
140*0Sstevel@tonic-gate 	int		cdread_lba;
141*0Sstevel@tonic-gate 	caddr_t		cdread_bufaddr;
142*0Sstevel@tonic-gate 	int		cdread_buflen;
143*0Sstevel@tonic-gate };
144*0Sstevel@tonic-gate 
145*0Sstevel@tonic-gate #if defined(_SYSCALL32)
146*0Sstevel@tonic-gate 
147*0Sstevel@tonic-gate struct cdrom_read32 {
148*0Sstevel@tonic-gate 	int		cdread_lba;
149*0Sstevel@tonic-gate 	caddr32_t	cdread_bufaddr;
150*0Sstevel@tonic-gate 	int		cdread_buflen;
151*0Sstevel@tonic-gate };
152*0Sstevel@tonic-gate 
153*0Sstevel@tonic-gate #define	cdrom_read32tocdrom_read(cdrd32, cdrd)				\
154*0Sstevel@tonic-gate 	cdrd->cdread_lba	= cdrd32->cdread_lba;			\
155*0Sstevel@tonic-gate 	cdrd->cdread_bufaddr	= (caddr_t)(uintptr_t)cdrd32->cdread_bufaddr; \
156*0Sstevel@tonic-gate 	cdrd->cdread_buflen	= cdrd32->cdread_buflen
157*0Sstevel@tonic-gate 
158*0Sstevel@tonic-gate #define	cdrom_readtocdrom_read32(cdrd, cdrd32)				\
159*0Sstevel@tonic-gate 	cdrd32->cdread_lba	= cdrd->cdread_lba;			\
160*0Sstevel@tonic-gate 	cdrd32->cdread_bufaddr	= (caddr32_t)(uintptr_t)cdrd->cdread_bufaddr; \
161*0Sstevel@tonic-gate 	cdrd32->cdread_buflen	= cdrd->cdread_buflen
162*0Sstevel@tonic-gate 
163*0Sstevel@tonic-gate #endif	/* _SYSCALL32 */
164*0Sstevel@tonic-gate 
165*0Sstevel@tonic-gate /*
166*0Sstevel@tonic-gate  * Definition of CD/DA structure
167*0Sstevel@tonic-gate  */
168*0Sstevel@tonic-gate struct cdrom_cdda {
169*0Sstevel@tonic-gate 	unsigned int	cdda_addr;
170*0Sstevel@tonic-gate 	unsigned int	cdda_length;
171*0Sstevel@tonic-gate 	caddr_t		cdda_data;
172*0Sstevel@tonic-gate 	unsigned char	cdda_subcode;
173*0Sstevel@tonic-gate };
174*0Sstevel@tonic-gate 
175*0Sstevel@tonic-gate #if defined(_SYSCALL32)
176*0Sstevel@tonic-gate struct cdrom_cdda32 {
177*0Sstevel@tonic-gate 	unsigned int	cdda_addr;
178*0Sstevel@tonic-gate 	unsigned int	cdda_length;
179*0Sstevel@tonic-gate 	caddr32_t	cdda_data;
180*0Sstevel@tonic-gate 	unsigned char	cdda_subcode;
181*0Sstevel@tonic-gate };
182*0Sstevel@tonic-gate 
183*0Sstevel@tonic-gate #define	cdrom_cdda32tocdrom_cdda(cdda32, cdda)			\
184*0Sstevel@tonic-gate 	cdda->cdda_addr		= cdda32->cdda_addr;		\
185*0Sstevel@tonic-gate 	cdda->cdda_length	= cdda32->cdda_length;		\
186*0Sstevel@tonic-gate 	cdda->cdda_data		= (caddr_t)(uintptr_t)cdda32->cdda_data; \
187*0Sstevel@tonic-gate 	cdda->cdda_subcode	= cdda32->cdda_subcode
188*0Sstevel@tonic-gate 
189*0Sstevel@tonic-gate #define	cdrom_cddatocdrom_cdda32(cdda, cdda32)			\
190*0Sstevel@tonic-gate 	cdda32->cdda_addr	= cdda->cdda_addr;		\
191*0Sstevel@tonic-gate 	cdda32->cdda_length	= cdda->cdda_length;		\
192*0Sstevel@tonic-gate 	cdda32->cdda_data	= (caddr32_t)(uintptr_t)cdda->cdda_data; \
193*0Sstevel@tonic-gate 	cdda32->cdda_subcode	= cdda->cdda_subcode
194*0Sstevel@tonic-gate 
195*0Sstevel@tonic-gate #endif	/* _SYSCALL32 */
196*0Sstevel@tonic-gate 
197*0Sstevel@tonic-gate /*
198*0Sstevel@tonic-gate  * Definitions for cdda_subcode field
199*0Sstevel@tonic-gate  */
200*0Sstevel@tonic-gate #define	CDROM_DA_NO_SUBCODE	0x00	/* CD/DA data with no subcode */
201*0Sstevel@tonic-gate #define	CDROM_DA_SUBQ		0x01	/* CD/DA data with sub Q code */
202*0Sstevel@tonic-gate #define	CDROM_DA_ALL_SUBCODE	0x02	/* CD/DA data with all subcode */
203*0Sstevel@tonic-gate #define	CDROM_DA_SUBCODE_ONLY	0x03	/* All subcode only */
204*0Sstevel@tonic-gate 
205*0Sstevel@tonic-gate /*
206*0Sstevel@tonic-gate  * Definition of CD/XA structure
207*0Sstevel@tonic-gate  */
208*0Sstevel@tonic-gate struct cdrom_cdxa {
209*0Sstevel@tonic-gate 	unsigned int	cdxa_addr;
210*0Sstevel@tonic-gate 	unsigned int	cdxa_length;
211*0Sstevel@tonic-gate 	caddr_t		cdxa_data;
212*0Sstevel@tonic-gate 	unsigned char	cdxa_format;
213*0Sstevel@tonic-gate };
214*0Sstevel@tonic-gate 
215*0Sstevel@tonic-gate #if defined(_SYSCALL32)
216*0Sstevel@tonic-gate 
217*0Sstevel@tonic-gate struct cdrom_cdxa32 {
218*0Sstevel@tonic-gate 	unsigned int	cdxa_addr;
219*0Sstevel@tonic-gate 	unsigned int	cdxa_length;
220*0Sstevel@tonic-gate 	caddr32_t	cdxa_data;
221*0Sstevel@tonic-gate 	unsigned char	cdxa_format;
222*0Sstevel@tonic-gate };
223*0Sstevel@tonic-gate 
224*0Sstevel@tonic-gate #define	cdrom_cdxa32tocdrom_cdxa(cdxa32, cdxa)				\
225*0Sstevel@tonic-gate 	cdxa->cdxa_addr		= cdxa32->cdxa_addr;			\
226*0Sstevel@tonic-gate 	cdxa->cdxa_length	= cdxa32->cdxa_length;			\
227*0Sstevel@tonic-gate 	cdxa->cdxa_data		= (caddr_t)(uintptr_t)cdxa32->cdxa_data; \
228*0Sstevel@tonic-gate 	cdxa->cdxa_format	= cdxa32->cdxa_format
229*0Sstevel@tonic-gate 
230*0Sstevel@tonic-gate #define	cdrom_cdxatocdrom_cdxa32(cdxa, cdxa32)				\
231*0Sstevel@tonic-gate 	cdxa32->cdxa_addr	= cdxa->cdxa_addr;			\
232*0Sstevel@tonic-gate 	cdxa32->cdxa_length	= cdxa->cdxa_length;			\
233*0Sstevel@tonic-gate 	cdxa32->cdxa_data	= (caddr32_t)(uintptr_t)cdxa->cdxa_data; \
234*0Sstevel@tonic-gate 	cdxa32->cdxa_format	= cdxa->cdxa_format
235*0Sstevel@tonic-gate 
236*0Sstevel@tonic-gate #endif	/* _SYSCALL32 */
237*0Sstevel@tonic-gate 
238*0Sstevel@tonic-gate /*
239*0Sstevel@tonic-gate  * Definitions for cdxa_format field
240*0Sstevel@tonic-gate  */
241*0Sstevel@tonic-gate #define	CDROM_XA_DATA		0x00	/* CD/XA data only */
242*0Sstevel@tonic-gate #define	CDROM_XA_SECTOR_DATA	0x01	/* CD/XA all sector data */
243*0Sstevel@tonic-gate #define	CDROM_XA_DATA_W_ERROR	0x02	/* CD/XA data with error flags data */
244*0Sstevel@tonic-gate 
245*0Sstevel@tonic-gate /*
246*0Sstevel@tonic-gate  * Definition of subcode structure
247*0Sstevel@tonic-gate  */
248*0Sstevel@tonic-gate struct cdrom_subcode {
249*0Sstevel@tonic-gate 	unsigned int	cdsc_length;
250*0Sstevel@tonic-gate 	caddr_t		cdsc_addr;
251*0Sstevel@tonic-gate };
252*0Sstevel@tonic-gate 
253*0Sstevel@tonic-gate #if defined(_SYSCALL32)
254*0Sstevel@tonic-gate 
255*0Sstevel@tonic-gate struct cdrom_subcode32 {
256*0Sstevel@tonic-gate 	unsigned int	cdsc_length;
257*0Sstevel@tonic-gate 	caddr32_t	cdsc_addr;
258*0Sstevel@tonic-gate };
259*0Sstevel@tonic-gate 
260*0Sstevel@tonic-gate #define	cdrom_subcode32tocdrom_subcode(cdsc32, cdsc)			\
261*0Sstevel@tonic-gate 	cdsc->cdsc_length	= cdsc32->cdsc_length;			\
262*0Sstevel@tonic-gate 	cdsc->cdsc_addr		= (caddr_t)(uintptr_t)cdsc32->cdsc_addr
263*0Sstevel@tonic-gate 
264*0Sstevel@tonic-gate #define	cdrom_subcodetocdrom_subcode32(cdsc, cdsc32)			\
265*0Sstevel@tonic-gate 	cdsc32->cdsc_length	= cdsc->cdsc_length;			\
266*0Sstevel@tonic-gate 	cdsc32->cdsc_addr	= (caddr32_t)(uintptr_t)cdsc->cdsc_addr
267*0Sstevel@tonic-gate 
268*0Sstevel@tonic-gate #endif	/* _SYSCALL32 */
269*0Sstevel@tonic-gate 
270*0Sstevel@tonic-gate /*
271*0Sstevel@tonic-gate  * Definitions for block size supported
272*0Sstevel@tonic-gate  */
273*0Sstevel@tonic-gate #define	CDROM_BLK_512		512
274*0Sstevel@tonic-gate #define	CDROM_BLK_1024		1024
275*0Sstevel@tonic-gate #define	CDROM_BLK_2048		2048
276*0Sstevel@tonic-gate #define	CDROM_BLK_2056		2056
277*0Sstevel@tonic-gate #define	CDROM_BLK_2324		2324
278*0Sstevel@tonic-gate #define	CDROM_BLK_2336		2336
279*0Sstevel@tonic-gate #define	CDROM_BLK_2340		2340
280*0Sstevel@tonic-gate #define	CDROM_BLK_2352		2352
281*0Sstevel@tonic-gate #define	CDROM_BLK_2368		2368
282*0Sstevel@tonic-gate #define	CDROM_BLK_2448		2448
283*0Sstevel@tonic-gate #define	CDROM_BLK_2646		2646
284*0Sstevel@tonic-gate #define	CDROM_BLK_2647		2647
285*0Sstevel@tonic-gate #define	CDROM_BLK_SUBCODE	96
286*0Sstevel@tonic-gate 
287*0Sstevel@tonic-gate /*
288*0Sstevel@tonic-gate  * Definitions for drive speed supported
289*0Sstevel@tonic-gate  */
290*0Sstevel@tonic-gate #define	CDROM_NORMAL_SPEED	0x00
291*0Sstevel@tonic-gate #define	CDROM_DOUBLE_SPEED	0x01
292*0Sstevel@tonic-gate #define	CDROM_QUAD_SPEED	0x03
293*0Sstevel@tonic-gate #define	CDROM_TWELVE_SPEED	0x0C
294*0Sstevel@tonic-gate #define	CDROM_MAXIMUM_SPEED	0xff
295*0Sstevel@tonic-gate 
296*0Sstevel@tonic-gate /*
297*0Sstevel@tonic-gate  * CDROM io control commands
298*0Sstevel@tonic-gate  */
299*0Sstevel@tonic-gate #define	CDIOC			(0x04 << 8)
300*0Sstevel@tonic-gate #define	CDROMPAUSE		(CDIOC|151)	/* Pause Audio Operation */
301*0Sstevel@tonic-gate #define	CDROMRESUME		(CDIOC|152) /* Resume paused Audio Operation */
302*0Sstevel@tonic-gate #define	CDROMPLAYMSF		(CDIOC|153)	/* Play Audio MSF */
303*0Sstevel@tonic-gate #define	CDROMPLAYTRKIND		(CDIOC|154)	/* Play Audio Track/index */
304*0Sstevel@tonic-gate #define	CDROMREADTOCHDR		(CDIOC|155)	/* Read TOC header */
305*0Sstevel@tonic-gate #define	CDROMREADTOCENTRY	(CDIOC|156)	/* Read a TOC entry */
306*0Sstevel@tonic-gate #define	CDROMSTOP		(CDIOC|157)	/* Stop the cdrom drive */
307*0Sstevel@tonic-gate #define	CDROMSTART		(CDIOC|158)	/* Start the cdrom drive */
308*0Sstevel@tonic-gate #define	CDROMEJECT		(CDIOC|159)	/* Ejects the cdrom caddy */
309*0Sstevel@tonic-gate #define	CDROMVOLCTRL		(CDIOC|160)	/* control output volume */
310*0Sstevel@tonic-gate #define	CDROMSUBCHNL		(CDIOC|161)	/* read the subchannel data */
311*0Sstevel@tonic-gate #define	CDROMREADMODE2		(CDIOC|162)	/* read CDROM mode 2 data */
312*0Sstevel@tonic-gate #define	CDROMREADMODE1		(CDIOC|163)	/* read CDROM mode 1 data */
313*0Sstevel@tonic-gate 
314*0Sstevel@tonic-gate #define	CDROMREADOFFSET		(CDIOC|164)	/* read multi-session offset */
315*0Sstevel@tonic-gate 
316*0Sstevel@tonic-gate #define	CDROMGBLKMODE		(CDIOC|165)	/* get current block mode */
317*0Sstevel@tonic-gate #define	CDROMSBLKMODE		(CDIOC|166)	/* set current block mode */
318*0Sstevel@tonic-gate #define	CDROMCDDA		(CDIOC|167)	/* read CD/DA data */
319*0Sstevel@tonic-gate #define	CDROMCDXA		(CDIOC|168)	/* read CD/XA data */
320*0Sstevel@tonic-gate #define	CDROMSUBCODE		(CDIOC|169)	/* read subcode */
321*0Sstevel@tonic-gate #define	CDROMGDRVSPEED		(CDIOC|170)	/* get current drive speed */
322*0Sstevel@tonic-gate #define	CDROMSDRVSPEED		(CDIOC|171)	/* set current drive speed */
323*0Sstevel@tonic-gate 
324*0Sstevel@tonic-gate #define	CDROMCLOSETRAY		(CDIOC|172)	/* close cd tray,load media */
325*0Sstevel@tonic-gate 
326*0Sstevel@tonic-gate /*
327*0Sstevel@tonic-gate  * Additional commands for CD-ROM
328*0Sstevel@tonic-gate  */
329*0Sstevel@tonic-gate /*
330*0Sstevel@tonic-gate  *
331*0Sstevel@tonic-gate  *	Group 2 Commands
332*0Sstevel@tonic-gate  *
333*0Sstevel@tonic-gate  */
334*0Sstevel@tonic-gate 
335*0Sstevel@tonic-gate #define	SCMD_READ_TOC		0x43		/* optional SCSI command */
336*0Sstevel@tonic-gate #define	SCMD_PLAYAUDIO_MSF	0x47		/* optional SCSI command */
337*0Sstevel@tonic-gate #define	SCMD_PLAYAUDIO_TI	0x48		/* optional SCSI command */
338*0Sstevel@tonic-gate #define	SCMD_PAUSE_RESUME	0x4B		/* optional SCSI command */
339*0Sstevel@tonic-gate #define	SCMD_READ_SUBCHANNEL	0x42		/* optional SCSI command */
340*0Sstevel@tonic-gate #define	SCMD_PLAYAUDIO10	0x45		/* optional SCSI command */
341*0Sstevel@tonic-gate #define	SCMD_PLAYTRACK_REL10	0x49		/* optional SCSI command */
342*0Sstevel@tonic-gate #define	SCMD_READ_HEADER	0x44		/* optional SCSI command */
343*0Sstevel@tonic-gate 
344*0Sstevel@tonic-gate /*
345*0Sstevel@tonic-gate  *
346*0Sstevel@tonic-gate  *	Group 5 Commands
347*0Sstevel@tonic-gate  *
348*0Sstevel@tonic-gate  */
349*0Sstevel@tonic-gate #define	SCMD_PLAYAUDIO12	0xA5		/* optional SCSI command */
350*0Sstevel@tonic-gate #define	SCMD_PLAYTRACK_REL12	0xA9		/* optional SCSI command */
351*0Sstevel@tonic-gate #define	SCMD_READ_CD		0xBE	/* Universal way of accessing CD data */
352*0Sstevel@tonic-gate 
353*0Sstevel@tonic-gate /*
354*0Sstevel@tonic-gate  * These defines are for SCMD_READ_CD command.
355*0Sstevel@tonic-gate  * See Expected Sector Type Field Definition (SCSI MMC-2 Spec section 6.1.15)
356*0Sstevel@tonic-gate  * This information is used to figure out which block size to use.
357*0Sstevel@tonic-gate  */
358*0Sstevel@tonic-gate #define	READ_CD_EST_ALLTYPE	0x0	/* All Types */
359*0Sstevel@tonic-gate #define	READ_CD_EST_CDDA	0x1	/* Only CD-DA */
360*0Sstevel@tonic-gate #define	READ_CD_EST_MODE1	0x2	/* Only Yellow Book 2048 bytes */
361*0Sstevel@tonic-gate #define	READ_CD_EST_MODE2	0x3	/* Only Yellow Book 2336 byte sectors */
362*0Sstevel@tonic-gate #define	READ_CD_EST_MODE2FORM1	0x4	/* Only sectors with 2048 bytes */
363*0Sstevel@tonic-gate #define	READ_CD_EST_MODE2FORM2	0x5	/* Only sectors with 2324 bytes */
364*0Sstevel@tonic-gate #define	READ_CD_EST_RSVD1	0x6	/* reserved */
365*0Sstevel@tonic-gate #define	READ_CD_EST_RSVD2	0x7	/* reserved */
366*0Sstevel@tonic-gate 
367*0Sstevel@tonic-gate 
368*0Sstevel@tonic-gate /*
369*0Sstevel@tonic-gate  *
370*0Sstevel@tonic-gate  *	Group 6 Commands
371*0Sstevel@tonic-gate  *
372*0Sstevel@tonic-gate  */
373*0Sstevel@tonic-gate 
374*0Sstevel@tonic-gate #define	SCMD_CD_PLAYBACK_CONTROL 0xC9	/* SONY unique SCSI command */
375*0Sstevel@tonic-gate #define	SCMD_CD_PLAYBACK_STATUS	0xC4	/* SONY unique SCSI command */
376*0Sstevel@tonic-gate #define	SCMD_READ_CDDA		0xD8	/* Vendor unique SCSI command */
377*0Sstevel@tonic-gate #define	SCMD_READ_CDXA		0xDB	/* Vendor unique SCSI command */
378*0Sstevel@tonic-gate #define	SCMD_READ_ALL_SUBCODES	0xDF	/* Vendor unique SCSI command */
379*0Sstevel@tonic-gate 
380*0Sstevel@tonic-gate #define	CDROM_MODE2_SIZE	2336
381*0Sstevel@tonic-gate 
382*0Sstevel@tonic-gate #ifdef	__cplusplus
383*0Sstevel@tonic-gate }
384*0Sstevel@tonic-gate #endif
385*0Sstevel@tonic-gate 
386*0Sstevel@tonic-gate #endif	/* _SYS_CDIO_H */
387