1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _LINUX_CDROM_H
13 #define _LINUX_CDROM_H
15 #include <asm/byteorder.h>
17 #define EDRIVE_CANT_DO_THIS EOPNOTSUPP
19 #define CDROMPAUSE 0x5301
20 #define CDROMRESUME 0x5302
21 #define CDROMPLAYMSF 0x5303
22 #define CDROMPLAYTRKIND 0x5304
23 #define CDROMREADTOCHDR 0x5305
24 #define CDROMREADTOCENTRY 0x5306
25 #define CDROMSTOP 0x5307
26 #define CDROMSTART 0x5308
27 #define CDROMEJECT 0x5309
28 #define CDROMVOLCTRL 0x530a
29 #define CDROMSUBCHNL 0x530b
30 #define CDROMREADMODE2 0x530c
31 #define CDROMREADMODE1 0x530d
32 #define CDROMREADAUDIO 0x530e
33 #define CDROMEJECT_SW 0x530f
34 #define CDROMMULTISESSION 0x5310
35 #define CDROM_GET_MCN 0x5311
36 #define CDROM_GET_UPC CDROM_GET_MCN
37 #define CDROMRESET 0x5312
38 #define CDROMVOLREAD 0x5313
39 #define CDROMREADRAW 0x5314
41 #define CDROMREADCOOKED 0x5315
42 #define CDROMSEEK 0x5316
44 #define CDROMPLAYBLK 0x5317
46 #define CDROMREADALL 0x5318
48 #define CDROMGETSPINDOWN 0x531d
49 #define CDROMSETSPINDOWN 0x531e
51 #define CDROMCLOSETRAY 0x5319
52 #define CDROM_SET_OPTIONS 0x5320
53 #define CDROM_CLEAR_OPTIONS 0x5321
54 #define CDROM_SELECT_SPEED 0x5322
55 #define CDROM_SELECT_DISC 0x5323
56 #define CDROM_MEDIA_CHANGED 0x5325
57 #define CDROM_DRIVE_STATUS 0x5326
58 #define CDROM_DISC_STATUS 0x5327
59 #define CDROM_CHANGER_NSLOTS 0x5328
60 #define CDROM_LOCKDOOR 0x5329
61 #define CDROM_DEBUG 0x5330
62 #define CDROM_GET_CAPABILITY 0x5331
64 #define CDROMAUDIOBUFSIZ 0x5382
66 #define DVD_READ_STRUCT 0x5390
67 #define DVD_WRITE_STRUCT 0x5391
68 #define DVD_AUTH 0x5392
70 #define CDROM_SEND_PACKET 0x5393
71 #define CDROM_NEXT_WRITABLE 0x5394
72 #define CDROM_LAST_WRITTEN 0x5395
83 struct cdrom_msf0 msf;
122 __u8 cdsc_audiostatus;
127 union cdrom_addr cdsc_absaddr;
128 union cdrom_addr cdsc_reladdr;
131 struct cdrom_tocentry
137 union cdrom_addr cdte_addr;
144 char *cdread_bufaddr;
148 struct cdrom_read_audio
150 union cdrom_addr addr;
156 struct cdrom_multisession
158 union cdrom_addr addr;
165 __u8 medium_catalog_number[14];
174 #define CDROM_PACKET_SIZE 12
176 #define CGC_DATA_UNKNOWN 0
177 #define CGC_DATA_WRITE 1
178 #define CGC_DATA_READ 2
179 #define CGC_DATA_NONE 3
181 struct cdrom_generic_command
183 unsigned char cmd[CDROM_PACKET_SIZE];
184 unsigned char __user *buffer;
187 struct request_sense __user *sense;
188 unsigned char data_direction;
191 void __user *reserved[1];
197 #define CD_SYNC_SIZE 12
198 #define CD_MSF_OFFSET 150
199 #define CD_CHUNK_SIZE 24
200 #define CD_NUM_OF_CHUNKS 98
201 #define CD_FRAMESIZE_SUB 96
202 #define CD_HEAD_SIZE 4
203 #define CD_SUBHEAD_SIZE 8
204 #define CD_EDC_SIZE 4
205 #define CD_ZERO_SIZE 8
206 #define CD_ECC_SIZE 276
207 #define CD_FRAMESIZE 2048
208 #define CD_FRAMESIZE_RAW 2352
209 #define CD_FRAMESIZE_RAWER 2646
211 #define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE)
212 #define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE)
214 #define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE)
215 #define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE)
216 #define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD)
218 #define CDROM_LBA 0x01
219 #define CDROM_MSF 0x02
221 #define CDROM_DATA_TRACK 0x04
223 #define CDROM_LEADOUT 0xAA
225 #define CDROM_AUDIO_INVALID 0x00
226 #define CDROM_AUDIO_PLAY 0x11
227 #define CDROM_AUDIO_PAUSED 0x12
228 #define CDROM_AUDIO_COMPLETED 0x13
229 #define CDROM_AUDIO_ERROR 0x14
230 #define CDROM_AUDIO_NO_STATUS 0x15
232 #define CDC_CLOSE_TRAY 0x1
233 #define CDC_OPEN_TRAY 0x2
235 #define CDC_SELECT_SPEED 0x8
236 #define CDC_SELECT_DISC 0x10
237 #define CDC_MULTI_SESSION 0x20
239 #define CDC_MEDIA_CHANGED 0x80
240 #define CDC_PLAY_AUDIO 0x100
241 #define CDC_RESET 0x200
242 #define CDC_DRIVE_STATUS 0x800
243 #define CDC_GENERIC_PACKET 0x1000
244 #define CDC_CD_R 0x2000
245 #define CDC_CD_RW 0x4000
246 #define CDC_DVD 0x8000
247 #define CDC_DVD_R 0x10000
248 #define CDC_DVD_RAM 0x20000
249 #define CDC_MO_DRIVE 0x40000
250 #define CDC_MRW 0x80000
251 #define CDC_MRW_W 0x100000
252 #define CDC_RAM 0x200000
254 #define CDS_NO_INFO 0
255 #define CDS_NO_DISC 1
256 #define CDS_TRAY_OPEN 2
257 #define CDS_DRIVE_NOT_READY 3
258 #define CDS_DISC_OK 4
260 #define CDS_AUDIO 100
261 #define CDS_DATA_1 101
262 #define CDS_DATA_2 102
263 #define CDS_XA_2_1 103
264 #define CDS_XA_2_2 104
265 #define CDS_MIXED 105
267 #define CDO_AUTO_CLOSE 0x1
268 #define CDO_AUTO_EJECT 0x2
269 #define CDO_USE_FFLAGS 0x4
271 #define CDO_CHECK_TYPE 0x10
273 #define CDSL_NONE ((int) (~0U>>1)-1)
274 #define CDSL_CURRENT ((int) (~0U>>1))
276 #define CD_PART_MAX 64
277 #define CD_PART_MASK (CD_PART_MAX - 1)
279 #define GPCMD_BLANK 0xa1
280 #define GPCMD_CLOSE_TRACK 0x5b
281 #define GPCMD_FLUSH_CACHE 0x35
282 #define GPCMD_FORMAT_UNIT 0x04
283 #define GPCMD_GET_CONFIGURATION 0x46
284 #define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
285 #define GPCMD_GET_PERFORMANCE 0xac
286 #define GPCMD_INQUIRY 0x12
287 #define GPCMD_LOAD_UNLOAD 0xa6
288 #define GPCMD_MECHANISM_STATUS 0xbd
289 #define GPCMD_MODE_SELECT_10 0x55
290 #define GPCMD_MODE_SENSE_10 0x5a
291 #define GPCMD_PAUSE_RESUME 0x4b
292 #define GPCMD_PLAY_AUDIO_10 0x45
293 #define GPCMD_PLAY_AUDIO_MSF 0x47
294 #define GPCMD_PLAY_AUDIO_TI 0x48
295 #define GPCMD_PLAY_CD 0xbc
296 #define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
297 #define GPCMD_READ_10 0x28
298 #define GPCMD_READ_12 0xa8
299 #define GPCMD_READ_BUFFER_CAPACITY 0x5c
300 #define GPCMD_READ_CDVD_CAPACITY 0x25
301 #define GPCMD_READ_CD 0xbe
302 #define GPCMD_READ_CD_MSF 0xb9
303 #define GPCMD_READ_DISC_INFO 0x51
304 #define GPCMD_READ_DVD_STRUCTURE 0xad
305 #define GPCMD_READ_FORMAT_CAPACITIES 0x23
306 #define GPCMD_READ_HEADER 0x44
307 #define GPCMD_READ_TRACK_RZONE_INFO 0x52
308 #define GPCMD_READ_SUBCHANNEL 0x42
309 #define GPCMD_READ_TOC_PMA_ATIP 0x43
310 #define GPCMD_REPAIR_RZONE_TRACK 0x58
311 #define GPCMD_REPORT_KEY 0xa4
312 #define GPCMD_REQUEST_SENSE 0x03
313 #define GPCMD_RESERVE_RZONE_TRACK 0x53
314 #define GPCMD_SEND_CUE_SHEET 0x5d
315 #define GPCMD_SCAN 0xba
316 #define GPCMD_SEEK 0x2b
317 #define GPCMD_SEND_DVD_STRUCTURE 0xbf
318 #define GPCMD_SEND_EVENT 0xa2
319 #define GPCMD_SEND_KEY 0xa3
320 #define GPCMD_SEND_OPC 0x54
321 #define GPCMD_SET_READ_AHEAD 0xa7
322 #define GPCMD_SET_STREAMING 0xb6
323 #define GPCMD_START_STOP_UNIT 0x1b
324 #define GPCMD_STOP_PLAY_SCAN 0x4e
325 #define GPCMD_TEST_UNIT_READY 0x00
326 #define GPCMD_VERIFY_10 0x2f
327 #define GPCMD_WRITE_10 0x2a
328 #define GPCMD_WRITE_AND_VERIFY_10 0x2e
330 #define GPCMD_SET_SPEED 0xbb
332 #define GPCMD_PLAYAUDIO_TI 0x48
334 #define GPCMD_GET_MEDIA_STATUS 0xda
336 #define GPMODE_VENDOR_PAGE 0x00
337 #define GPMODE_R_W_ERROR_PAGE 0x01
338 #define GPMODE_WRITE_PARMS_PAGE 0x05
339 #define GPMODE_WCACHING_PAGE 0x08
340 #define GPMODE_AUDIO_CTL_PAGE 0x0e
341 #define GPMODE_POWER_PAGE 0x1a
342 #define GPMODE_FAULT_FAIL_PAGE 0x1c
343 #define GPMODE_TO_PROTECT_PAGE 0x1d
344 #define GPMODE_CAPABILITIES_PAGE 0x2a
345 #define GPMODE_ALL_PAGES 0x3f
347 #define GPMODE_CDROM_PAGE 0x0d
349 #define DVD_STRUCT_PHYSICAL 0x00
350 #define DVD_STRUCT_COPYRIGHT 0x01
351 #define DVD_STRUCT_DISCKEY 0x02
352 #define DVD_STRUCT_BCA 0x03
353 #define DVD_STRUCT_MANUFACT 0x04
356 __u8 book_version : 4;
363 __u8 track_density : 4;
364 __u8 linear_density : 4;
373 struct dvd_physical {
376 struct dvd_layer layer[DVD_LAYERS];
379 struct dvd_copyright {
401 struct dvd_manufact {
412 struct dvd_physical physical;
413 struct dvd_copyright copyright;
414 struct dvd_disckey disckey;
416 struct dvd_manufact manufact;
419 #define DVD_LU_SEND_AGID 0
420 #define DVD_HOST_SEND_CHALLENGE 1
421 #define DVD_LU_SEND_KEY1 2
422 #define DVD_LU_SEND_CHALLENGE 3
423 #define DVD_HOST_SEND_KEY2 4
425 #define DVD_AUTH_ESTABLISHED 5
426 #define DVD_AUTH_FAILURE 6
428 #define DVD_LU_SEND_TITLE_KEY 7
429 #define DVD_LU_SEND_ASF 8
430 #define DVD_INVALIDATE_AGID 9
431 #define DVD_LU_SEND_RPC_STATE 10
432 #define DVD_HOST_SEND_RPC_STATE 11
434 typedef __u8 dvd_key[5];
435 typedef __u8 dvd_challenge[10];
437 struct dvd_lu_send_agid {
442 struct dvd_host_send_challenge {
449 struct dvd_send_key {
456 struct dvd_lu_send_challenge {
463 #define DVD_CPM_NO_COPYRIGHT 0
464 #define DVD_CPM_COPYRIGHTED 1
466 #define DVD_CP_SEC_NONE 0
467 #define DVD_CP_SEC_EXIST 1
469 #define DVD_CGMS_UNRESTRICTED 0
470 #define DVD_CGMS_SINGLE 2
471 #define DVD_CGMS_RESTRICTED 3
473 struct dvd_lu_send_title_key {
484 struct dvd_lu_send_asf {
491 struct dvd_host_send_rpcstate {
496 struct dvd_lu_send_rpcstate {
507 struct dvd_lu_send_agid lsa;
508 struct dvd_host_send_challenge hsc;
509 struct dvd_send_key lsk;
510 struct dvd_lu_send_challenge lsc;
511 struct dvd_send_key hsk;
512 struct dvd_lu_send_title_key lstk;
513 struct dvd_lu_send_asf lsasf;
514 struct dvd_host_send_rpcstate hrpcs;
515 struct dvd_lu_send_rpcstate lrpcs;
518 struct request_sense {
519 #ifdef __BIG_ENDIAN_BITFIELD
522 #elif defined(__LITTLE_ENDIAN_BITFIELD)
527 #ifdef __BIG_ENDIAN_BITFIELD
532 #elif defined(__LITTLE_ENDIAN_BITFIELD)
540 __u8 command_info[4];
548 #define CDF_RWRT 0x0020
549 #define CDF_HWDM 0x0024
550 #define CDF_MRW 0x0028
552 #define CDM_MRW_NOTMRW 0
553 #define CDM_MRW_BGFORMAT_INACTIVE 1
554 #define CDM_MRW_BGFORMAT_ACTIVE 2
555 #define CDM_MRW_BGFORMAT_COMPLETE 3
557 #define MRW_LBA_DMA 0
558 #define MRW_LBA_GAA 1
560 #define MRW_MODE_PC_PRE1 0x2c
561 #define MRW_MODE_PC 0x03
563 struct mrw_feature_desc {
565 #ifdef __BIG_ENDIAN_BITFIELD
567 __u8 feature_version : 4;
570 #elif defined(__LITTLE_ENDIAN_BITFIELD)
573 __u8 feature_version : 4;
577 #ifdef __BIG_ENDIAN_BITFIELD
580 #elif defined(__LITTLE_ENDIAN_BITFIELD)
589 struct rwrt_feature_desc {
591 #ifdef __BIG_ENDIAN_BITFIELD
593 __u8 feature_version : 4;
596 #elif defined(__LITTLE_ENDIAN_BITFIELD)
599 __u8 feature_version : 4;
606 #ifdef __BIG_ENDIAN_BITFIELD
608 __u8 page_present : 1;
609 #elif defined(__LITTLE_ENDIAN_BITFIELD)
610 __u8 page_present : 1;
617 __u16 disc_information_length;
618 #ifdef __BIG_ENDIAN_BITFIELD
621 __u8 border_status : 2;
622 __u8 disc_status : 2;
623 #elif defined(__LITTLE_ENDIAN_BITFIELD)
624 __u8 disc_status : 2;
625 __u8 border_status : 2;
629 #error "Please fix <asm/byteorder.h>"
633 __u8 first_track_lsb;
635 #ifdef __BIG_ENDIAN_BITFIELD
642 #elif defined(__LITTLE_ENDIAN_BITFIELD)
652 __u8 first_track_msb;
657 __u8 disc_bar_code[8];
663 __u16 track_information_length;
667 #ifdef __BIG_ENDIAN_BITFIELD
680 #elif defined(__LITTLE_ENDIAN_BITFIELD)
697 __u32 fixed_packet_size;
699 __u32 last_rec_address;
702 struct feature_header {
709 struct mode_page_header {
710 __u16 mode_data_length;