linux_cdrom.h revision 1.2 1 /* $NetBSD: linux_cdrom.h,v 1.2 1998/10/01 02:30:37 erh Exp $ */
2
3 /*
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the NetBSD
18 * Foundation, Inc. and its contributors.
19 * 4. Neither the name of The NetBSD Foundation nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
24 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
27 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36 #ifndef _COMMON_LINUX_CDROM_H
37 #define _COMMON_LINUX_CDROM_H
38
39 #define LINUX_CDROMPAUSE 0x5301
40 #define LINUX_CDROMRESUME 0x5302
41 #define LINUX_CDROMPLAYMSF 0x5303 /* (struct linux_cdrom_msf) */
42 #define LINUX_CDROMPLAYTRKIND 0x5304 /* (struct linux_cdrom_ti) */
43 #define LINUX_CDROMREADTOCHDR 0x5305 /* (struct linux_cdrom_tochdr) */
44 #define LINUX_CDROMREADTOCENTRY 0x5306 /* (struct linux_cdrom_tocentry) */
45 #define LINUX_CDROMSTOP 0x5307
46 #define LINUX_CDROMSTART 0x5308
47 #define LINUX_CDROMEJECT 0x5309
48 #define LINUX_CDROMVOLCTRL 0x530a /* (struct linux_cdrom_volctrl) */
49 #define LINUX_CDROMSUBCHNL 0x530b /* (struct linux_cdrom_subchnl) */
50 #define LINUX_CDROMEJECT_SW 0x530f /* arg: 0 or 1 */
51 #define LINUX_CDROMRESET 0x5312
52 #define LINUX_CDROMVOLREAD 0x5313 /* (struct linux_cdrom_volctrl) */
53 #define LINUX_CDROMPLAYBLK 0x5317 /* (struct linux_cdrom_blk) */
54
55 struct linux_cdrom_blk {
56 unsigned from;
57 unsigned short len;
58 };
59
60 struct linux_cdrom_msf {
61 u_char cdmsf_min0; /* start minute */
62 u_char cdmsf_sec0; /* start second */
63 u_char cdmsf_frame0; /* start frame */
64 u_char cdmsf_min1; /* end minute */
65 u_char cdmsf_sec1; /* end second */
66 u_char cdmsf_frame1; /* end frame */
67 };
68
69 struct linux_cdrom_ti {
70 u_char cdti_trk0; /* start track */
71 u_char cdti_ind0; /* start index */
72 u_char cdti_trk1; /* end track */
73 u_char cdti_ind1; /* end index */
74 };
75
76 struct linux_cdrom_tochdr {
77 u_char cdth_trk0; /* start track */
78 u_char cdth_trk1; /* end track */
79 };
80
81 struct linux_cdrom_msf0 {
82 u_char minute;
83 u_char second;
84 u_char frame;
85 };
86
87 union linux_cdrom_addr {
88 struct linux_cdrom_msf0 msf;
89 int lba;
90 };
91
92 struct linux_cdrom_tocentry {
93 u_char cdte_track;
94 u_char cdte_adr :4;
95 u_char cdte_ctrl :4;
96 u_char cdte_format;
97 union linux_cdrom_addr cdte_addr;
98 u_char cdte_datamode;
99 };
100
101 struct linux_cdrom_subchnl {
102 u_char cdsc_format;
103 u_char cdsc_audiostatus;
104 u_char cdsc_adr: 4;
105 u_char cdsc_ctrl: 4;
106 u_char cdsc_trk;
107 u_char cdsc_ind;
108 union linux_cdrom_addr cdsc_absaddr;
109 union linux_cdrom_addr cdsc_reladdr;
110 };
111
112 struct linux_cdrom_volctrl {
113 u_char channel0;
114 u_char channel1;
115 u_char channel2;
116 u_char channel3;
117 };
118
119 #endif /* !_COMMON_LINUX_CDROM_H */
120