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