1
2
3
4
5
6
7
8
9
10 #ifndef _LINUX_CDROM_H
11 #define _LINUX_CDROM_H
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #define SCMD_READ_TOC 0x43
28 #define SCMD_PLAYAUDIO_MSF 0x47
29 #define SCMD_PLAYAUDIO_TI 0x48
30 #define SCMD_PAUSE_RESUME 0x4B
31 #define SCMD_READ_SUBCHANNEL 0x42
32 #define SCMD_PLAYAUDIO10 0x45
33 #define SCMD_READ_HEADER 0x44
34
35
36
37
38
39 #define SCMD_PLAYAUDIO12 0xA5
40 #define SCMD_PLAYTRACK_REL12 0xA9
41
42
43
44
45
46 #define SCMD_CD_PLAYBACK_CONTROL 0xC9
47 #define SCMD_CD_PLAYBACK_STATUS 0xC4
48
49
50
51
52
53 struct scsi_capacity
54 {
55 u_long capacity;
56 u_long lbasize;
57 };
58
59
60
61
62
63 #define ERR_RECOVERY_PARMS 0x01
64 #define DISCO_RECO_PARMS 0x02
65 #define FORMAT_PARMS 0x03
66 #define GEOMETRY_PARMS 0x04
67 #define CERTIFICATION_PARMS 0x06
68 #define CACHE_PARMS 0x38
69
70
71
72
73
74 struct ccs_modesel_head
75 {
76 u_char _r1;
77 u_char medium;
78 u_char _r2;
79 u_char block_desc_length;
80 u_char density;
81 u_char number_blocks_hi;
82 u_char number_blocks_med;
83 u_char number_blocks_lo;
84 u_char _r3;
85 u_char block_length_hi;
86 u_short block_length;
87 };
88
89
90
91
92
93 struct ccs_err_recovery
94 {
95 u_char _r1 : 2;
96 u_char page_code : 6;
97 u_char page_length;
98 u_char awre : 1;
99 u_char arre : 1;
100 u_char tb : 1;
101 u_char rc : 1;
102 u_char eec : 1;
103 u_char per : 1;
104 u_char dte : 1;
105 u_char dcr : 1;
106 u_char retry_count;
107 u_char correction_span;
108 u_char head_offset_count;
109 u_char strobe_offset_count;
110 u_char recovery_time_limit;
111 };
112
113
114
115
116
117 struct ccs_disco_reco
118 {
119 u_char _r1 : 2;
120 u_char page_code : 6;
121 u_char page_length;
122 u_char buffer_full_ratio;
123 u_char buffer_empty_ratio;
124 u_short bus_inactivity_limit;
125 u_short disconnect_time_limit;
126 u_short connect_time_limit;
127 u_short _r2;
128 };
129
130
131
132
133
134 struct ccs_geometry
135 {
136 u_char _r1 : 2;
137 u_char page_code : 6;
138 u_char page_length;
139 u_char cyl_ub;
140 u_char cyl_mb;
141 u_char cyl_lb;
142 u_char heads;
143 u_char precomp_cyl_ub;
144 u_char precomp_cyl_mb;
145 u_char precomp_cyl_lb;
146 u_char current_cyl_ub;
147 u_char current_cyl_mb;
148 u_char current_cyl_lb;
149 u_short step_rate;
150 u_char landing_cyl_ub;
151 u_char landing_cyl_mb;
152 u_char landing_cyl_lb;
153 u_char _r2;
154 u_char _r3;
155 u_char _r4;
156 };
157
158
159
160
161
162 struct ccs_cache
163 {
164 u_char _r1 : 2;
165 u_char page_code : 6;
166 u_char page_length;
167 u_char mode;
168 u_char threshold;
169 u_char max_prefetch;
170 u_char max_multiplier;
171 u_char min_prefetch;
172 u_char min_multiplier;
173 u_char _r2[8];
174 };
175
176
177
178
179
180 struct cdrom_msf
181 {
182 u_char cdmsf_min0;
183 u_char cdmsf_sec0;
184 u_char cdmsf_frame0;
185 u_char cdmsf_min1;
186 u_char cdmsf_sec1;
187 u_char cdmsf_frame1;
188 };
189
190 struct cdrom_ti
191 {
192 u_char cdti_trk0;
193 u_char cdti_ind0;
194 u_char cdti_trk1;
195 u_char cdti_ind1;
196 };
197
198 struct cdrom_tochdr
199 {
200 u_char cdth_trk0;
201 u_char cdth_trk1;
202 };
203
204 struct cdrom_tocentry
205 {
206 u_char cdte_track;
207 u_char cdte_adr :4;
208 u_char cdte_ctrl :4;
209 u_char cdte_format;
210 union
211 {
212 struct
213 {
214 u_char minute;
215 u_char second;
216 u_char frame;
217 } msf;
218 int lba;
219 } cdte_addr;
220 u_char cdte_datamode;
221 };
222
223
224
225
226
227 #define CDROM_LBA 0x01
228 #define CDROM_MSF 0x02
229
230
231
232
233
234 #define CDROM_DATA_TRACK 0x04
235
236
237
238
239
240 #define CDROM_LEADOUT 0xAA
241
242 struct cdrom_subchnl
243 {
244 u_char cdsc_format;
245 u_char cdsc_audiostatus;
246 u_char cdsc_adr: 4;
247 u_char cdsc_ctrl: 4;
248 u_char cdsc_trk;
249 u_char cdsc_ind;
250 union
251 {
252 struct
253 {
254 u_char minute;
255 u_char second;
256 u_char frame;
257 } msf;
258 int lba;
259 } cdsc_absaddr;
260 union
261 {
262 struct
263 {
264 u_char minute;
265 u_char second;
266 u_char frame;
267 } msf;
268 int lba;
269 } cdsc_reladdr;
270 };
271
272
273
274
275
276 #define CDROM_AUDIO_INVALID 0x00
277 #define CDROM_AUDIO_PLAY 0x11
278 #define CDROM_AUDIO_PAUSED 0x12
279 #define CDROM_AUDIO_COMPLETED 0x13
280 #define CDROM_AUDIO_ERROR 0x14
281 #define CDROM_AUDIO_NO_STATUS 0x15
282
283 struct cdrom_volctrl
284 {
285 u_char channel0;
286 u_char channel1;
287 u_char channel2;
288 u_char channel3;
289 };
290
291 struct cdrom_read
292 {
293 int cdread_lba;
294 caddr_t cdread_bufaddr;
295 int cdread_buflen;
296 };
297
298 #ifdef FIVETWELVE
299 #define CDROM_MODE1_SIZE 512
300 #else
301 #define CDROM_MODE1_SIZE 2048
302 #endif FIVETWELVE
303 #define CDROM_MODE2_SIZE 2336
304
305
306
307
308
309 #define CDROMPAUSE 0x5301
310 #define CDROMRESUME 0x5302
311
312 #define CDROMPLAYMSF 0x5303
313
314
315 #define CDROMPLAYTRKIND 0x5304
316
317
318 #define CDROMREADTOCHDR 0x5305
319
320 #define CDROMREADTOCENTRY 0x5306
321
322
323 #define CDROMSTOP 0x5307
324 #define CDROMSTART 0x5308
325
326 #define CDROMEJECT 0x5309
327
328 #define CDROMVOLCTRL 0x530a
329
330
331 #define CDROMSUBCHNL 0x530b
332
333
334 #define CDROMREADMODE2 0x530c
335
336
337 #define CDROMREADMODE1 0x530d
338
339
340 #endif _LINUX_CDROM_H