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