xref: /titanic_51/usr/src/lib/libbc/libc/sys/common/cdioctl.h (revision d624471bb6b5999909f7fb3a8fe4cdef10004294)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  *
31  * Defines for SCSI direct access devices modified for CDROM, based on sddef.h
32  *
33  */
34 
35 /*
36  * CDROM io controls type definitions
37  */
38 struct cdrom_msf {
39 	unsigned char	cdmsf_min0;	/* starting minute */
40 	unsigned char	cdmsf_sec0;	/* starting second */
41 	unsigned char	cdmsf_frame0;	/* starting frame  */
42 	unsigned char	cdmsf_min1;	/* ending minute   */
43 	unsigned char	cdmsf_sec1;	/* ending second   */
44 	unsigned char	cdmsf_frame1;	/* ending frame	   */
45 };
46 
47 struct cdrom_ti {
48 	unsigned char	cdti_trk0;	/* starting track */
49 	unsigned char	cdti_ind0;	/* starting index */
50 	unsigned char	cdti_trk1;	/* ending track */
51 	unsigned char	cdti_ind1;	/* ending index */
52 };
53 
54 struct cdrom_tochdr {
55 	unsigned char	cdth_trk0;	/* starting track */
56 	unsigned char	cdth_trk1;	/* ending track */
57 };
58 
59 struct cdrom_tocentry {
60 	unsigned char	cdte_track;
61 	unsigned char	cdte_adr	:4;
62 	unsigned char	cdte_ctrl	:4;
63 	unsigned char	cdte_format;
64 	union {
65 		struct {
66 			unsigned char	minute;
67 			unsigned char	second;
68 			unsigned char	frame;
69 		} msf;
70 		int	lba;
71 	} cdte_addr;
72 	unsigned char	cdte_datamode;
73 };
74 
75 struct cdrom_subchnl {
76 	unsigned char	cdsc_format;
77 	unsigned char	cdsc_audiostatus;
78 	unsigned char	cdsc_adr:	4;
79 	unsigned char	cdsc_ctrl:	4;
80 	unsigned char	cdsc_trk;
81 	unsigned char	cdsc_ind;
82 	union {
83 		struct {
84 			unsigned char	minute;
85 			unsigned char	second;
86 			unsigned char	frame;
87 		} msf;
88 		int	lba;
89 	} cdsc_absaddr;
90 	union {
91 		struct {
92 			unsigned char	minute;
93 			unsigned char	second;
94 			unsigned char	frame;
95 		} msf;
96 		int	lba;
97 	} cdsc_reladdr;
98 };
99 
100 /*
101  * definition of audio volume control structure
102  */
103 struct cdrom_volctrl {
104 	unsigned char	channel0;
105 	unsigned char	channel1;
106 	unsigned char	channel2;
107 	unsigned char	channel3;
108 };
109 
110 struct cdrom_read {
111 	int	cdread_lba;
112 	caddr_t	cdread_bufaddr;
113 	int	cdread_buflen;
114 };
115 
116 /*
117  * CDROM io control commands
118  */
119 #define	CDROMPAUSE	_IO('c', 10)	/* Pause Audio Operation */
120 
121 #define	CDROMRESUME	_IO('c', 11)	/* Resume paused Audio Operation */
122 
123 #define	CDROMPLAYMSF	_IOW('c', 12, struct cdrom_msf)	/* Play Audio MSF */
124 #define	CDROMPLAYTRKIND	_IOW('c', 13, struct cdrom_ti)	/*
125 							 * Play Audio
126 `							 * Track/index
127 							 */
128 #define	CDROMREADTOCHDR	\
129 		_IOR('c', 103, struct cdrom_tochdr)	/* Read TOC header */
130 #define	CDROMREADTOCENTRY	\
131 	_IOWR('c', 104, struct cdrom_tocentry)		/* Read a TOC entry */
132 
133 #define	CDROMSTOP	_IO('c', 105)	/* Stop the cdrom drive */
134 
135 #define	CDROMSTART	_IO('c', 106)	/* Start the cdrom drive */
136 
137 #define	CDROMEJECT	_IO('c', 107)	/* Ejects the cdrom caddy */
138 
139 #define	CDROMVOLCTRL	\
140 	_IOW('c', 14, struct cdrom_volctrl)	/* control output volume */
141 
142 #define	CDROMSUBCHNL	\
143 	_IOWR('c', 108, struct cdrom_subchnl)	/* read the subchannel data */
144 
145 #define	CDROMREADMODE2	\
146 	_IOW('c', 110, struct cdrom_read)	/* read CDROM mode 2 data */
147 
148 #define	CDROMREADMODE1	\
149 	_IOW('c', 111, struct cdrom_read)	/* read CDROM mode 1 data */
150