1
2
3
4
5
6
7
8
9 #ifndef _LINUX_CDROM_H
10 #define _LINUX_CDROM_H
11
12
13
14
15 #define CD_MINS 74
16 #define CD_SECS 60
17 #define CD_FRAMES 75
18
19 #define CD_SYNC_SIZE 12
20 #define CD_HEAD_SIZE 4
21 #define CD_SUBHEAD_SIZE 8
22 #define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE)
23 #define CD_XA_SYNC_HEAD (CD_XA_HEAD+12)
24
25 #define CD_FRAMESIZE 2048
26 #define CD_FRAMESIZE_RAW 2352
27
28 #define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE)
29 #define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE)
30
31 #define CD_EDC_SIZE 4
32 #define CD_ZERO_SIZE 8
33 #define CD_ECC_SIZE 276
34 #define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE)
35
36 #define CD_FRAMESIZE_SUB 96
37 #define CD_MSF_OFFSET 150
38
39 #define CD_CHUNK_SIZE 24
40 #define CD_NUM_OF_CHUNKS 98
41
42 #define CD_FRAMESIZE_XA CD_FRAMESIZE_RAW1
43 #define CD_BLOCK_OFFSET CD_MSF_OFFSET
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 struct cdrom_msf
69 {
70 u_char cdmsf_min0;
71 u_char cdmsf_sec0;
72 u_char cdmsf_frame0;
73 u_char cdmsf_min1;
74 u_char cdmsf_sec1;
75 u_char cdmsf_frame1;
76 };
77
78 struct cdrom_ti
79 {
80 u_char cdti_trk0;
81 u_char cdti_ind0;
82 u_char cdti_trk1;
83 u_char cdti_ind1;
84 };
85
86 struct cdrom_tochdr
87 {
88 u_char cdth_trk0;
89 u_char cdth_trk1;
90 };
91
92 struct cdrom_tocentry
93 {
94 u_char cdte_track;
95 u_char cdte_adr :4;
96 u_char cdte_ctrl :4;
97 u_char cdte_format;
98 union
99 {
100 struct
101 {
102 u_char minute;
103 u_char second;
104 u_char frame;
105 } msf;
106 int lba;
107 } cdte_addr;
108 u_char cdte_datamode;
109 };
110
111
112
113
114 #define CDROM_LBA 0x01
115 #define CDROM_MSF 0x02
116
117
118
119
120 #define CDROM_DATA_TRACK 0x04
121
122
123
124
125 #define CDROM_LEADOUT 0xAA
126
127 struct cdrom_subchnl
128 {
129 u_char cdsc_format;
130 u_char cdsc_audiostatus;
131 u_char cdsc_adr: 4;
132 u_char cdsc_ctrl: 4;
133 u_char cdsc_trk;
134 u_char cdsc_ind;
135 union
136 {
137 struct
138 {
139 u_char minute;
140 u_char second;
141 u_char frame;
142 } msf;
143 int lba;
144 } cdsc_absaddr;
145 union
146 {
147 struct
148 {
149 u_char minute;
150 u_char second;
151 u_char frame;
152 } msf;
153 int lba;
154 } cdsc_reladdr;
155 };
156
157
158
159
160 #define CDROM_AUDIO_INVALID 0x00
161 #define CDROM_AUDIO_PLAY 0x11
162 #define CDROM_AUDIO_PAUSED 0x12
163 #define CDROM_AUDIO_COMPLETED 0x13
164 #define CDROM_AUDIO_ERROR 0x14
165 #define CDROM_AUDIO_NO_STATUS 0x15
166
167 struct cdrom_volctrl
168 {
169 u_char channel0;
170 u_char channel1;
171 u_char channel2;
172 u_char channel3;
173 };
174
175 struct cdrom_read
176 {
177 int cdread_lba;
178 caddr_t cdread_bufaddr;
179 int cdread_buflen;
180 };
181
182
183
184
185
186 struct cdrom_read_audio
187 {
188 union
189 {
190 struct
191 {
192 u_char minute;
193 u_char second;
194 u_char frame;
195 } msf;
196 int lba;
197 } addr;
198 u_char addr_format;
199 int nframes;
200 u_char *buf;
201 };
202
203
204
205
206
207
208 struct cdrom_multisession
209 {
210 union
211 {
212 struct
213 {
214 u_char minute;
215 u_char second;
216 u_char frame;
217 } msf;
218 int lba;
219 } addr;
220 u_char xa_flag;
221 u_char addr_format;
222 };
223
224 #ifdef FIVETWELVE
225 #define CDROM_MODE1_SIZE 512
226 #else
227 #define CDROM_MODE1_SIZE 2048
228 #endif FIVETWELVE
229 #define CDROM_MODE2_SIZE 2336
230
231
232
233
234
235
236 #define CDROMPAUSE 0x5301
237 #define CDROMRESUME 0x5302
238 #define CDROMPLAYMSF 0x5303
239 #define CDROMPLAYTRKIND 0x5304
240
241 #define CDROMREADTOCHDR 0x5305
242 #define CDROMREADTOCENTRY 0x5306
243
244 #define CDROMSTOP 0x5307
245 #define CDROMSTART 0x5308
246
247 #define CDROMEJECT 0x5309
248
249 #define CDROMVOLCTRL 0x530a
250
251 #define CDROMSUBCHNL 0x530b
252
253 #define CDROMREADMODE2 0x530c
254
255
256 #define CDROMREADMODE1 0x530d
257
258
259 #define CDROMREADAUDIO 0x530e
260
261
262
263
264 #define CDROMEJECT_SW 0x530f
265
266
267
268
269 #define CDROMMULTISESSION 0x5310
270
271
272
273
274
275 #define CDROM_GET_UPC 0x5311
276
277 #define CDROMRESET 0x5312
278 #define CDROMVOLREAD 0x5313
279
280
281
282
283
284 #define CDROMREADRAW 0x5314
285 #define CDROMREADCOOKED 0x5315
286 #define CDROMSEEK 0x5316
287
288
289
290
291
292
293
294
295
296
297 #define SCMD_READ_TOC 0x43
298 #define SCMD_PLAYAUDIO_MSF 0x47
299 #define SCMD_PLAYAUDIO_TI 0x48
300 #define SCMD_PAUSE_RESUME 0x4B
301 #define SCMD_READ_SUBCHANNEL 0x42
302 #define SCMD_PLAYAUDIO10 0x45
303 #define SCMD_READ_HEADER 0x44
304
305
306
307
308 #define SCMD_PLAYAUDIO12 0xA5
309 #define SCMD_PLAYTRACK_REL12 0xA9
310
311
312
313
314 #define SCMD_CD_PLAYBACK_CONTROL 0xC9
315 #define SCMD_CD_PLAYBACK_STATUS 0xC4
316
317
318
319
320 struct scsi_capacity
321 {
322 u_long capacity;
323 u_long lbasize;
324 };
325
326
327
328
329 #define ERR_RECOVERY_PARMS 0x01
330 #define DISCO_RECO_PARMS 0x02
331 #define FORMAT_PARMS 0x03
332 #define GEOMETRY_PARMS 0x04
333 #define CERTIFICATION_PARMS 0x06
334 #define CACHE_PARMS 0x38
335
336
337
338
339 struct ccs_modesel_head
340 {
341 u_char _r1;
342 u_char medium;
343 u_char _r2;
344 u_char block_desc_length;
345 u_char density;
346 u_char number_blocks_hi;
347 u_char number_blocks_med;
348 u_char number_blocks_lo;
349 u_char _r3;
350 u_char block_length_hi;
351 u_short block_length;
352 };
353
354
355
356
357 struct ccs_err_recovery
358 {
359 u_char _r1 : 2;
360 u_char page_code : 6;
361 u_char page_length;
362 u_char awre : 1;
363 u_char arre : 1;
364 u_char tb : 1;
365 u_char rc : 1;
366 u_char eec : 1;
367 u_char per : 1;
368 u_char dte : 1;
369 u_char dcr : 1;
370 u_char retry_count;
371 u_char correction_span;
372 u_char head_offset_count;
373 u_char strobe_offset_count;
374 u_char recovery_time_limit;
375 };
376
377
378
379
380 struct ccs_disco_reco
381 {
382 u_char _r1 : 2;
383 u_char page_code : 6;
384 u_char page_length;
385 u_char buffer_full_ratio;
386 u_char buffer_empty_ratio;
387 u_short bus_inactivity_limit;
388 u_short disconnect_time_limit;
389 u_short connect_time_limit;
390 u_short _r2;
391 };
392
393
394
395
396 struct ccs_geometry
397 {
398 u_char _r1 : 2;
399 u_char page_code : 6;
400 u_char page_length;
401 u_char cyl_ub;
402 u_char cyl_mb;
403 u_char cyl_lb;
404 u_char heads;
405 u_char precomp_cyl_ub;
406 u_char precomp_cyl_mb;
407 u_char precomp_cyl_lb;
408 u_char current_cyl_ub;
409 u_char current_cyl_mb;
410 u_char current_cyl_lb;
411 u_short step_rate;
412 u_char landing_cyl_ub;
413 u_char landing_cyl_mb;
414 u_char landing_cyl_lb;
415 u_char _r2;
416 u_char _r3;
417 u_char _r4;
418 };
419
420
421
422
423 struct ccs_cache
424 {
425 u_char _r1 : 2;
426 u_char page_code : 6;
427 u_char page_length;
428 u_char mode;
429 u_char threshold;
430 u_char max_prefetch;
431 u_char max_multiplier;
432 u_char min_prefetch;
433 u_char min_multiplier;
434 u_char _r2[8];
435 };
436
437 #endif _LINUX_CDROM_H
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454