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