]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/cdio.h
xnu-123.5.tar.gz
[apple/xnu.git] / bsd / sys / cdio.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
23 /*
24 * The NEXTSTEP Software License Agreement specifies the terms
25 * and conditions for redistribution.
26 */
27
28 #ifndef _SYS_CDIO_H_
29 #define _SYS_CDIO_H_
30
31 /* Shared between kernel & process */
32
33 struct cd_toc_entry {
34 u_char nothing1;
35 u_char control:4;
36 u_char addr_type:4;
37 u_char track;
38 u_char nothing2;
39 u_char addr[4];
40 };
41
42 struct cd_sub_channel_header {
43 u_char nothing1;
44 u_char audio_status;
45 #define CD_AS_AUDIO_INVALID 0x00
46 #define CD_AS_PLAY_IN_PROGRESS 0x11
47 #define CD_AS_PLAY_PAUSED 0x12
48 #define CD_AS_PLAY_COMPLETED 0x13
49 #define CD_AS_PLAY_ERROR 0x14
50 #define CD_AS_NO_STATUS 0x15
51 u_char data_len[2];
52 };
53
54 struct cd_sub_channel_position_data {
55 u_char data_format;
56 u_char control:4;
57 u_char addr_type:4;
58 u_char track_number;
59 u_char index_number;
60 u_char absaddr[4];
61 u_char reladdr[4];
62 };
63
64 struct cd_sub_channel_media_catalog {
65 u_char data_format;
66 u_char nothing1;
67 u_char nothing2;
68 u_char nothing3;
69 u_char :7;
70 u_char mc_valid:1;
71 u_char mc_number[15];
72 };
73
74 struct cd_sub_channel_track_info {
75 u_char data_format;
76 u_char nothing1;
77 u_char track_number;
78 u_char nothing2;
79 u_char :7;
80 u_char ti_valid:1;
81 u_char ti_number[15];
82 };
83
84 struct cd_sub_channel_info {
85 struct cd_sub_channel_header header;
86 union {
87 struct cd_sub_channel_position_data position;
88 struct cd_sub_channel_media_catalog media_catalog;
89 struct cd_sub_channel_track_info track_info;
90 } what;
91 };
92
93 /*
94 * Ioctls for the CD drive
95 */
96 struct ioc_play_track {
97 u_char start_track;
98 u_char start_index;
99 u_char end_track;
100 u_char end_index;
101 };
102
103 #define CDIOCPLAYTRACKS _IOW('c', 1, struct ioc_play_track)
104 struct ioc_play_blocks {
105 int blk;
106 int len;
107 };
108 #define CDIOCPLAYBLOCKS _IOW('c', 2, struct ioc_play_blocks)
109
110 struct ioc_read_subchannel {
111 u_char address_format;
112 #define CD_LBA_FORMAT 1
113 #define CD_MSF_FORMAT 2
114 u_char data_format;
115 #define CD_SUBQ_DATA 0
116 #define CD_CURRENT_POSITION 1
117 #define CD_MEDIA_CATALOG 2
118 #define CD_TRACK_INFO 3
119 u_char track;
120 int data_len;
121 struct cd_sub_channel_info *data;
122 };
123 #define CDIOCREADSUBCHANNEL _IOWR('c', 3, struct ioc_read_subchannel )
124
125 struct ioc_toc_header {
126 u_short len;
127 u_char starting_track;
128 u_char ending_track;
129 };
130
131 #define CDIOREADTOCHEADER _IOR('c', 4, struct ioc_toc_header)
132
133 struct ioc_read_toc_entry {
134 u_char address_format;
135 u_char starting_track;
136 u_short data_len;
137 struct cd_toc_entry *data;
138 };
139 #define CDIOREADTOCENTRYS _IOWR('c', 5, struct ioc_read_toc_entry)
140
141 struct ioc_patch {
142 u_char patch[4]; /* one for each channel */
143 };
144 #define CDIOCSETPATCH _IOW('c', 9, struct ioc_patch)
145
146 struct ioc_vol {
147 u_char vol[4]; /* one for each channel */
148 };
149 #define CDIOCGETVOL _IOR('c', 10, struct ioc_vol)
150 #define CDIOCSETVOL _IOW('c', 11, struct ioc_vol)
151 #define CDIOCSETMONO _IO('c', 12)
152 #define CDIOCSETSTEREO _IO('c', 13)
153 #define CDIOCSETMUTE _IO('c', 14)
154 #define CDIOCSETLEFT _IO('c', 15)
155 #define CDIOCSETRIGHT _IO('c', 16)
156 #define CDIOCSETDEBUG _IO('c', 17)
157 #define CDIOCCLRDEBUG _IO('c', 18)
158 #define CDIOCPAUSE _IO('c', 19)
159 #define CDIOCRESUME _IO('c', 20)
160 #define CDIOCRESET _IO('c', 21)
161 #define CDIOCSTART _IO('c', 22)
162 #define CDIOCSTOP _IO('c', 23)
163 #define CDIOCEJECT _IO('c', 24)
164 #define CDIOCALLOW _IO('c', 25)
165 #define CDIOCPREVENT _IO('c', 26)
166
167 struct ioc_play_msf {
168 u_char start_m;
169 u_char start_s;
170 u_char start_f;
171 u_char end_m;
172 u_char end_s;
173 u_char end_f;
174 };
175 #define CDIOCPLAYMSF _IOW('c', 25, struct ioc_play_msf)
176
177 #endif /* !_SYS_CDIO_H_ */