xref: /titanic_51/usr/src/lib/libbc/libc/sys/common/cdioctl.h (revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*5d54f3d8Smuffin  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*5d54f3d8Smuffin  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  *
317c478bd9Sstevel@tonic-gate  * Defines for SCSI direct access devices modified for CDROM, based on sddef.h
327c478bd9Sstevel@tonic-gate  *
337c478bd9Sstevel@tonic-gate  */
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * CDROM io controls type definitions
377c478bd9Sstevel@tonic-gate  */
387c478bd9Sstevel@tonic-gate struct cdrom_msf {
397c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_min0;	/* starting minute */
407c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_sec0;	/* starting second */
417c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_frame0;	/* starting frame  */
427c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_min1;	/* ending minute   */
437c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_sec1;	/* ending second   */
447c478bd9Sstevel@tonic-gate 	unsigned char	cdmsf_frame1;	/* ending frame	   */
457c478bd9Sstevel@tonic-gate };
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate struct cdrom_ti {
487c478bd9Sstevel@tonic-gate 	unsigned char	cdti_trk0;	/* starting track */
497c478bd9Sstevel@tonic-gate 	unsigned char	cdti_ind0;	/* starting index */
507c478bd9Sstevel@tonic-gate 	unsigned char	cdti_trk1;	/* ending track */
517c478bd9Sstevel@tonic-gate 	unsigned char	cdti_ind1;	/* ending index */
527c478bd9Sstevel@tonic-gate };
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate struct cdrom_tochdr {
557c478bd9Sstevel@tonic-gate 	unsigned char	cdth_trk0;	/* starting track */
567c478bd9Sstevel@tonic-gate 	unsigned char	cdth_trk1;	/* ending track */
577c478bd9Sstevel@tonic-gate };
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate struct cdrom_tocentry {
607c478bd9Sstevel@tonic-gate 	unsigned char	cdte_track;
617c478bd9Sstevel@tonic-gate 	unsigned char	cdte_adr	:4;
627c478bd9Sstevel@tonic-gate 	unsigned char	cdte_ctrl	:4;
637c478bd9Sstevel@tonic-gate 	unsigned char	cdte_format;
647c478bd9Sstevel@tonic-gate 	union {
657c478bd9Sstevel@tonic-gate 		struct {
667c478bd9Sstevel@tonic-gate 			unsigned char	minute;
677c478bd9Sstevel@tonic-gate 			unsigned char	second;
687c478bd9Sstevel@tonic-gate 			unsigned char	frame;
697c478bd9Sstevel@tonic-gate 		} msf;
707c478bd9Sstevel@tonic-gate 		int	lba;
717c478bd9Sstevel@tonic-gate 	} cdte_addr;
727c478bd9Sstevel@tonic-gate 	unsigned char	cdte_datamode;
737c478bd9Sstevel@tonic-gate };
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate struct cdrom_subchnl {
767c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_format;
777c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_audiostatus;
787c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_adr:	4;
797c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_ctrl:	4;
807c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_trk;
817c478bd9Sstevel@tonic-gate 	unsigned char	cdsc_ind;
827c478bd9Sstevel@tonic-gate 	union {
837c478bd9Sstevel@tonic-gate 		struct {
847c478bd9Sstevel@tonic-gate 			unsigned char	minute;
857c478bd9Sstevel@tonic-gate 			unsigned char	second;
867c478bd9Sstevel@tonic-gate 			unsigned char	frame;
877c478bd9Sstevel@tonic-gate 		} msf;
887c478bd9Sstevel@tonic-gate 		int	lba;
897c478bd9Sstevel@tonic-gate 	} cdsc_absaddr;
907c478bd9Sstevel@tonic-gate 	union {
917c478bd9Sstevel@tonic-gate 		struct {
927c478bd9Sstevel@tonic-gate 			unsigned char	minute;
937c478bd9Sstevel@tonic-gate 			unsigned char	second;
947c478bd9Sstevel@tonic-gate 			unsigned char	frame;
957c478bd9Sstevel@tonic-gate 		} msf;
967c478bd9Sstevel@tonic-gate 		int	lba;
977c478bd9Sstevel@tonic-gate 	} cdsc_reladdr;
987c478bd9Sstevel@tonic-gate };
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate /*
1017c478bd9Sstevel@tonic-gate  * definition of audio volume control structure
1027c478bd9Sstevel@tonic-gate  */
1037c478bd9Sstevel@tonic-gate struct cdrom_volctrl {
1047c478bd9Sstevel@tonic-gate 	unsigned char	channel0;
1057c478bd9Sstevel@tonic-gate 	unsigned char	channel1;
1067c478bd9Sstevel@tonic-gate 	unsigned char	channel2;
1077c478bd9Sstevel@tonic-gate 	unsigned char	channel3;
1087c478bd9Sstevel@tonic-gate };
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate struct cdrom_read {
1117c478bd9Sstevel@tonic-gate 	int	cdread_lba;
1127c478bd9Sstevel@tonic-gate 	caddr_t	cdread_bufaddr;
1137c478bd9Sstevel@tonic-gate 	int	cdread_buflen;
1147c478bd9Sstevel@tonic-gate };
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate /*
1177c478bd9Sstevel@tonic-gate  * CDROM io control commands
1187c478bd9Sstevel@tonic-gate  */
119*5d54f3d8Smuffin #define	CDROMPAUSE	_IO('c', 10)	/* Pause Audio Operation */
1207c478bd9Sstevel@tonic-gate 
121*5d54f3d8Smuffin #define	CDROMRESUME	_IO('c', 11)	/* Resume paused Audio Operation */
1227c478bd9Sstevel@tonic-gate 
123*5d54f3d8Smuffin #define	CDROMPLAYMSF	_IOW('c', 12, struct cdrom_msf)	/* Play Audio MSF */
124*5d54f3d8Smuffin #define	CDROMPLAYTRKIND	_IOW('c', 13, struct cdrom_ti)	/*
1257c478bd9Sstevel@tonic-gate 							 * Play Audio
1267c478bd9Sstevel@tonic-gate `							 * Track/index
1277c478bd9Sstevel@tonic-gate 							 */
1287c478bd9Sstevel@tonic-gate #define	CDROMREADTOCHDR	\
129*5d54f3d8Smuffin 		_IOR('c', 103, struct cdrom_tochdr)	/* Read TOC header */
1307c478bd9Sstevel@tonic-gate #define	CDROMREADTOCENTRY	\
131*5d54f3d8Smuffin 	_IOWR('c', 104, struct cdrom_tocentry)		/* Read a TOC entry */
1327c478bd9Sstevel@tonic-gate 
133*5d54f3d8Smuffin #define	CDROMSTOP	_IO('c', 105)	/* Stop the cdrom drive */
1347c478bd9Sstevel@tonic-gate 
135*5d54f3d8Smuffin #define	CDROMSTART	_IO('c', 106)	/* Start the cdrom drive */
1367c478bd9Sstevel@tonic-gate 
137*5d54f3d8Smuffin #define	CDROMEJECT	_IO('c', 107)	/* Ejects the cdrom caddy */
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate #define	CDROMVOLCTRL	\
140*5d54f3d8Smuffin 	_IOW('c', 14, struct cdrom_volctrl)	/* control output volume */
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate #define	CDROMSUBCHNL	\
143*5d54f3d8Smuffin 	_IOWR('c', 108, struct cdrom_subchnl)	/* read the subchannel data */
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate #define	CDROMREADMODE2	\
146*5d54f3d8Smuffin 	_IOW('c', 110, struct cdrom_read)	/* read CDROM mode 2 data */
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate #define	CDROMREADMODE1	\
149*5d54f3d8Smuffin 	_IOW('c', 111, struct cdrom_read)	/* read CDROM mode 1 data */
150