cdio.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CDIO_H
#define _SYS_CDIO_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* CDROM io controls type definitions
*/
struct cdrom_msf {
unsigned char cdmsf_min0; /* starting minute */
unsigned char cdmsf_sec0; /* starting second */
unsigned char cdmsf_frame0; /* starting frame */
unsigned char cdmsf_min1; /* ending minute */
unsigned char cdmsf_sec1; /* ending second */
unsigned char cdmsf_frame1; /* ending frame */
};
struct cdrom_ti {
unsigned char cdti_trk0; /* starting track */
unsigned char cdti_ind0; /* starting index */
unsigned char cdti_trk1; /* ending track */
unsigned char cdti_ind1; /* ending index */
};
struct cdrom_tochdr {
unsigned char cdth_trk0; /* starting track */
unsigned char cdth_trk1; /* ending track */
};
struct cdrom_tocentry {
unsigned char cdte_track;
unsigned cdte_adr :4;
unsigned cdte_ctrl :4;
unsigned char cdte_format;
union {
struct {
unsigned char minute;
unsigned char second;
unsigned char frame;
} msf;
int lba;
} cdte_addr;
unsigned char cdte_datamode;
};
/*
* CDROM address format definition, for use with struct cdrom_tocentry
*/
#define CDROM_LBA 0x01
#define CDROM_MSF 0x02
/*
* Bitmask for CD-ROM data track in the cdte_ctrl field
* A track is either data or audio.
*/
#define CDROM_DATA_TRACK 0x04
/*
* For CDROMREADTOCENTRY, set the cdte_track to CDROM_LEADOUT to get
* the information for the leadout track.
*/
#define CDROM_LEADOUT 0xAA
struct cdrom_subchnl {
unsigned char cdsc_format;
unsigned char cdsc_audiostatus;
unsigned cdsc_adr: 4;
unsigned cdsc_ctrl: 4;
unsigned char cdsc_trk;
unsigned char cdsc_ind;
union {
struct {
unsigned char minute;
unsigned char second;
unsigned char frame;
} msf;
int lba;
} cdsc_absaddr;
union {
struct {
unsigned char minute;
unsigned char second;
unsigned char frame;
} msf;
int lba;
} cdsc_reladdr;
};
/*
* Definition for audio status returned from Read Sub-channel
*/
/*
* definition of audio volume control structure
*/
struct cdrom_volctrl {
unsigned char channel0;
unsigned char channel1;
unsigned char channel2;
unsigned char channel3;
};
struct cdrom_read {
int cdread_lba;
int cdread_buflen;
};
#if defined(_SYSCALL32)
struct cdrom_read32 {
int cdread_lba;
int cdread_buflen;
};
#endif /* _SYSCALL32 */
/*
*/
struct cdrom_cdda {
unsigned int cdda_addr;
unsigned int cdda_length;
unsigned char cdda_subcode;
};
#if defined(_SYSCALL32)
struct cdrom_cdda32 {
unsigned int cdda_addr;
unsigned int cdda_length;
unsigned char cdda_subcode;
};
#endif /* _SYSCALL32 */
/*
* Definitions for cdda_subcode field
*/
/*
*/
struct cdrom_cdxa {
unsigned int cdxa_addr;
unsigned int cdxa_length;
unsigned char cdxa_format;
};
#if defined(_SYSCALL32)
struct cdrom_cdxa32 {
unsigned int cdxa_addr;
unsigned int cdxa_length;
unsigned char cdxa_format;
};
#endif /* _SYSCALL32 */
/*
* Definitions for cdxa_format field
*/
/*
* Definition of subcode structure
*/
struct cdrom_subcode {
unsigned int cdsc_length;
};
#if defined(_SYSCALL32)
struct cdrom_subcode32 {
unsigned int cdsc_length;
};
#endif /* _SYSCALL32 */
/*
* Definitions for block size supported
*/
#define CDROM_BLK_512 512
#define CDROM_BLK_1024 1024
#define CDROM_BLK_2048 2048
#define CDROM_BLK_2056 2056
#define CDROM_BLK_2324 2324
#define CDROM_BLK_2336 2336
#define CDROM_BLK_2340 2340
#define CDROM_BLK_2352 2352
#define CDROM_BLK_2368 2368
#define CDROM_BLK_2448 2448
#define CDROM_BLK_2646 2646
#define CDROM_BLK_2647 2647
#define CDROM_BLK_SUBCODE 96
/*
* Definitions for drive speed supported
*/
#define CDROM_NORMAL_SPEED 0x00
#define CDROM_DOUBLE_SPEED 0x01
#define CDROM_QUAD_SPEED 0x03
#define CDROM_TWELVE_SPEED 0x0C
#define CDROM_MAXIMUM_SPEED 0xff
/*
* CDROM io control commands
*/
/*
* Additional commands for CD-ROM
*/
/*
*
* Group 2 Commands
*
*/
/*
*
* Group 5 Commands
*
*/
/*
* These defines are for SCMD_READ_CD command.
* See Expected Sector Type Field Definition (SCSI MMC-2 Spec section 6.1.15)
* This information is used to figure out which block size to use.
*/
/*
*
* Group 6 Commands
*
*/
#define CDROM_MODE2_SIZE 2336
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CDIO_H */