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