1 /* $NetBSD: linux_cdrom.h,v 1.7 2005/12/11 12:20:19 christos Exp $ */
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Eric Haszlakiewicz.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _LINUX_CDROM_H
33 #define _LINUX_CDROM_H
35 #include <machine/endian.h>
37 #define LINUX_CDROMPAUSE 0x5301
38 #define LINUX_CDROMRESUME 0x5302
39 #define LINUX_CDROMPLAYMSF 0x5303 /* (struct linux_cdrom_msf) */
40 #define LINUX_CDROMPLAYTRKIND 0x5304 /* (struct linux_cdrom_ti) */
41 #define LINUX_CDROMREADTOCHDR 0x5305 /* (struct linux_cdrom_tochdr) */
42 #define LINUX_CDROMREADTOCENTRY 0x5306 /* (struct linux_cdrom_tocentry) */
43 #define LINUX_CDROMSTOP 0x5307
44 #define LINUX_CDROMSTART 0x5308
45 #define LINUX_CDROMEJECT 0x5309
46 #define LINUX_CDROMVOLCTRL 0x530a /* (struct linux_cdrom_volctrl) */
47 #define LINUX_CDROMSUBCHNL 0x530b /* (struct linux_cdrom_subchnl) */
48 #define LINUX_CDROMEJECT_SW 0x530f /* arg: 0 or 1 */
49 #define LINUX_CDROMMULTISESSION 0x5310 /* (struct linux_cdrom_multisession) */
50 #define LINUX_CDROMRESET 0x5312
51 #define LINUX_CDROMVOLREAD 0x5313 /* (struct linux_cdrom_volctrl) */
52 #define LINUX_CDROMPLAYBLK 0x5317 /* (struct linux_cdrom_blk) */
53 #define LINUX_CDROMCLOSETRAY 0x5319 /* */
54 #define LINUX_CDROM_SET_OPTIONS 0x5320 /* int */
55 #define LINUX_CDROM_CLEAR_OPTIONS 0x5321 /* int */
56 #define LINUX_CDROM_SELECT_SPEED 0x5322
57 #define LINUX_CDROM_SELECT_DISC 0x5323
58 #define LINUX_CDROM_MEDIA_CHANGED 0x5325
59 #define LINUX_CDROM_DRIVE_STATUS 0x5326
60 #define LINUX_CDROM_DISC_STATUS 0x5327
61 #define LINUX_CDROM_CHANGER_NSLOTS 0x5328
62 #define LINUX_CDROM_LOCKDOOR 0x5329
63 #define LINUX_CDROM_DEBUG 0x5330
64 #define LINUX_CDROM_GET_CAPABILITY 0x5331
66 /* DVD-ROM Specific ioctls */
67 #define LINUX_DVD_READ_STRUCT 0x5390 /* Read structure */
68 #define LINUX_DVD_WRITE_STRUCT 0x5391 /* Write structure */
69 #define LINUX_DVD_AUTH 0x5392 /* Authentication */
71 struct linux_cdrom_blk
{
76 struct linux_cdrom_msf
{
77 u_char cdmsf_min0
; /* start minute */
78 u_char cdmsf_sec0
; /* start second */
79 u_char cdmsf_frame0
; /* start frame */
80 u_char cdmsf_min1
; /* end minute */
81 u_char cdmsf_sec1
; /* end second */
82 u_char cdmsf_frame1
; /* end frame */
85 struct linux_cdrom_ti
{
86 u_char cdti_trk0
; /* start track */
87 u_char cdti_ind0
; /* start index */
88 u_char cdti_trk1
; /* end track */
89 u_char cdti_ind1
; /* end index */
92 struct linux_cdrom_tochdr
{
93 u_char cdth_trk0
; /* start track */
94 u_char cdth_trk1
; /* end track */
97 struct linux_cdrom_msf0
{
103 union linux_cdrom_addr
{
104 struct linux_cdrom_msf0 msf
;
108 struct linux_cdrom_tocentry
{
113 union linux_cdrom_addr cdte_addr
;
114 u_char cdte_datamode
;
117 struct linux_cdrom_subchnl
{
119 u_char cdsc_audiostatus
;
124 union linux_cdrom_addr cdsc_absaddr
;
125 union linux_cdrom_addr cdsc_reladdr
;
128 struct linux_cdrom_volctrl
{
135 struct linux_cdrom_multisession
{
136 union linux_cdrom_addr addr
;
141 struct linux_cdrom_mechstat_header
{
142 #if BYTE_ORDER == BIG_ENDIAN
144 u_int8_t changer_state
: 2;
145 u_int8_t curslot
: 5;
146 u_int8_t mech_state
: 3;
147 u_int8_t door_open
: 1;
148 u_int8_t reserved1
: 4;
149 #elif BYTE_ORDER == LITTLE_ENDIAN
150 u_int8_t curslot
: 5;
151 u_int8_t changer_state
: 2;
153 u_int8_t reserved1
: 4;
154 u_int8_t door_open
: 1;
155 u_int8_t mech_state
: 3;
159 u_int16_t slot_tablelen
;
162 struct linux_cdrom_slot
{
163 #if BYTE_ORDER == BIG_ENDIAN
164 u_int8_t disc_present
: 1;
165 u_int8_t reserved1
: 6;
167 #elif BYTE_ORDER == LITTLE_ENDIAN
169 u_int8_t reserved1
: 6;
170 u_int8_t disc_present
: 1;
172 u_int8_t reserved2
[3];
175 #define LINUX_CDROM_MAX_SLOTS 256
177 struct linux_cdrom_changer_info
{
178 struct linux_cdrom_mechstat_header hdr
;
179 struct linux_cdrom_slot slots
[LINUX_CDROM_MAX_SLOTS
];
182 #endif /* !_LINUX_CDROM_H */