1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
/* $NetBSD: linux_cdrom.h,v 1.8 2008/04/28 20:23:43 martin Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Eric Haszlakiewicz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LINUX_CDROM_H
#define _LINUX_CDROM_H
#include <machine/endian.h>
#define LINUX_CDROMPAUSE 0x5301
#define LINUX_CDROMRESUME 0x5302
#define LINUX_CDROMPLAYMSF 0x5303 /* (struct linux_cdrom_msf) */
#define LINUX_CDROMPLAYTRKIND 0x5304 /* (struct linux_cdrom_ti) */
#define LINUX_CDROMREADTOCHDR 0x5305 /* (struct linux_cdrom_tochdr) */
#define LINUX_CDROMREADTOCENTRY 0x5306 /* (struct linux_cdrom_tocentry) */
#define LINUX_CDROMSTOP 0x5307
#define LINUX_CDROMSTART 0x5308
#define LINUX_CDROMEJECT 0x5309
#define LINUX_CDROMVOLCTRL 0x530a /* (struct linux_cdrom_volctrl) */
#define LINUX_CDROMSUBCHNL 0x530b /* (struct linux_cdrom_subchnl) */
#define LINUX_CDROMEJECT_SW 0x530f /* arg: 0 or 1 */
#define LINUX_CDROMMULTISESSION 0x5310 /* (struct linux_cdrom_multisession) */
#define LINUX_CDROMRESET 0x5312
#define LINUX_CDROMVOLREAD 0x5313 /* (struct linux_cdrom_volctrl) */
#define LINUX_CDROMPLAYBLK 0x5317 /* (struct linux_cdrom_blk) */
#define LINUX_CDROMCLOSETRAY 0x5319 /* */
#define LINUX_CDROM_SET_OPTIONS 0x5320 /* int */
#define LINUX_CDROM_CLEAR_OPTIONS 0x5321 /* int */
#define LINUX_CDROM_SELECT_SPEED 0x5322
#define LINUX_CDROM_SELECT_DISC 0x5323
#define LINUX_CDROM_MEDIA_CHANGED 0x5325
#define LINUX_CDROM_DRIVE_STATUS 0x5326
#define LINUX_CDROM_DISC_STATUS 0x5327
#define LINUX_CDROM_CHANGER_NSLOTS 0x5328
#define LINUX_CDROM_LOCKDOOR 0x5329
#define LINUX_CDROM_DEBUG 0x5330
#define LINUX_CDROM_GET_CAPABILITY 0x5331
/* DVD-ROM Specific ioctls */
#define LINUX_DVD_READ_STRUCT 0x5390 /* Read structure */
#define LINUX_DVD_WRITE_STRUCT 0x5391 /* Write structure */
#define LINUX_DVD_AUTH 0x5392 /* Authentication */
struct linux_cdrom_blk {
unsigned from;
unsigned short len;
};
struct linux_cdrom_msf {
u_char cdmsf_min0; /* start minute */
u_char cdmsf_sec0; /* start second */
u_char cdmsf_frame0; /* start frame */
u_char cdmsf_min1; /* end minute */
u_char cdmsf_sec1; /* end second */
u_char cdmsf_frame1; /* end frame */
};
struct linux_cdrom_ti {
u_char cdti_trk0; /* start track */
u_char cdti_ind0; /* start index */
u_char cdti_trk1; /* end track */
u_char cdti_ind1; /* end index */
};
struct linux_cdrom_tochdr {
u_char cdth_trk0; /* start track */
u_char cdth_trk1; /* end track */
};
struct linux_cdrom_msf0 {
u_char minute;
u_char second;
u_char frame;
};
union linux_cdrom_addr {
struct linux_cdrom_msf0 msf;
int lba;
};
struct linux_cdrom_tocentry {
u_char cdte_track;
u_char cdte_adr :4;
u_char cdte_ctrl :4;
u_char cdte_format;
union linux_cdrom_addr cdte_addr;
u_char cdte_datamode;
};
struct linux_cdrom_subchnl {
u_char cdsc_format;
u_char cdsc_audiostatus;
u_char cdsc_adr: 4;
u_char cdsc_ctrl: 4;
u_char cdsc_trk;
u_char cdsc_ind;
union linux_cdrom_addr cdsc_absaddr;
union linux_cdrom_addr cdsc_reladdr;
};
struct linux_cdrom_volctrl {
u_char channel0;
u_char channel1;
u_char channel2;
u_char channel3;
};
struct linux_cdrom_multisession {
union linux_cdrom_addr addr;
u_char xa_flag;
u_char addr_format;
};
struct linux_cdrom_mechstat_header {
#if BYTE_ORDER == BIG_ENDIAN
u_int8_t fault : 1;
u_int8_t changer_state : 2;
u_int8_t curslot : 5;
u_int8_t mech_state : 3;
u_int8_t door_open : 1;
u_int8_t reserved1 : 4;
#elif BYTE_ORDER == LITTLE_ENDIAN
u_int8_t curslot : 5;
u_int8_t changer_state : 2;
u_int8_t fault : 1;
u_int8_t reserved1 : 4;
u_int8_t door_open : 1;
u_int8_t mech_state : 3;
#endif
u_int8_t curlba[3];
u_int8_t nslots;
u_int16_t slot_tablelen;
};
struct linux_cdrom_slot {
#if BYTE_ORDER == BIG_ENDIAN
u_int8_t disc_present : 1;
u_int8_t reserved1 : 6;
u_int8_t change : 1;
#elif BYTE_ORDER == LITTLE_ENDIAN
u_int8_t change : 1;
u_int8_t reserved1 : 6;
u_int8_t disc_present : 1;
#endif
u_int8_t reserved2[3];
};
#define LINUX_CDROM_MAX_SLOTS 256
struct linux_cdrom_changer_info {
struct linux_cdrom_mechstat_header hdr;
struct linux_cdrom_slot slots[LINUX_CDROM_MAX_SLOTS];
};
#endif /* !_LINUX_CDROM_H */
|