Home | History | Annotate | Line # | Download | only in common
linux_cdrom.h revision 1.4
      1 /*	$NetBSD: linux_cdrom.h,v 1.4 1999/10/29 15:02:56 mycroft 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 /* DVD-ROM Specific ioctls */
     59 #define	LINUX_DVD_READ_STRUCT	0x5390	/* Read structure */
     60 #define	LINUX_DVD_WRITE_STRUCT	0x5391	/* Write structure */
     61 #define	LINUX_DVD_AUTH		0x5392	/* Authentication */
     62 
     63 struct linux_cdrom_blk {
     64 	unsigned from;
     65 	unsigned short len;
     66 };
     67 
     68 struct linux_cdrom_msf {
     69 	u_char	cdmsf_min0;	/* start minute */
     70 	u_char	cdmsf_sec0;	/* start second */
     71 	u_char	cdmsf_frame0;	/* start frame */
     72 	u_char	cdmsf_min1;	/* end minute */
     73 	u_char	cdmsf_sec1;	/* end second */
     74 	u_char	cdmsf_frame1;	/* end frame */
     75 };
     76 
     77 struct linux_cdrom_ti {
     78 	u_char	cdti_trk0;	/* start track */
     79 	u_char	cdti_ind0;	/* start index */
     80 	u_char	cdti_trk1;	/* end track */
     81 	u_char	cdti_ind1;	/* end index */
     82 };
     83 
     84 struct linux_cdrom_tochdr {
     85 	u_char	cdth_trk0;	/* start track */
     86 	u_char	cdth_trk1;	/* end track */
     87 };
     88 
     89 struct linux_cdrom_msf0 {
     90 	u_char	minute;
     91 	u_char	second;
     92 	u_char	frame;
     93 };
     94 
     95 union linux_cdrom_addr {
     96 	struct	linux_cdrom_msf0 msf;
     97 	int	lba;
     98 };
     99 
    100 struct linux_cdrom_tocentry {
    101 	u_char	cdte_track;
    102 	u_char	cdte_adr	:4;
    103 	u_char	cdte_ctrl	:4;
    104 	u_char	cdte_format;
    105 	union	linux_cdrom_addr cdte_addr;
    106 	u_char	cdte_datamode;
    107 };
    108 
    109 struct linux_cdrom_subchnl {
    110 	u_char	cdsc_format;
    111 	u_char	cdsc_audiostatus;
    112 	u_char	cdsc_adr:	4;
    113 	u_char	cdsc_ctrl:	4;
    114 	u_char	cdsc_trk;
    115 	u_char	cdsc_ind;
    116 	union	linux_cdrom_addr cdsc_absaddr;
    117 	union	linux_cdrom_addr cdsc_reladdr;
    118 };
    119 
    120 struct linux_cdrom_volctrl {
    121 	u_char	channel0;
    122 	u_char	channel1;
    123 	u_char	channel2;
    124 	u_char	channel3;
    125 };
    126 
    127 #endif /* !_LINUX_CDROM_H */
    128