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