xref: /titanic_53/usr/src/cmd/cdrw/mmc.h (revision 9858459238fb4f2d8f924f4d3fe9f51ed2e32564)
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*98584592Sarutz  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_MMC_H
287c478bd9Sstevel@tonic-gate #define	_MMC_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
36*98584592Sarutz /* bytelengths for some SCSI data structures */
377c478bd9Sstevel@tonic-gate #define	SENSE_DATA_SIZE		16
387c478bd9Sstevel@tonic-gate #define	TRACK_INFO_SIZE		36
397c478bd9Sstevel@tonic-gate #define	DISC_INFO_BLOCK_SIZE	32
407c478bd9Sstevel@tonic-gate #define	INQUIRY_DATA_LENGTH	96
417c478bd9Sstevel@tonic-gate #define	GET_PERF_DATA_LEN	24
427c478bd9Sstevel@tonic-gate #define	SET_STREAM_DATA_LEN	28
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #define	DEFAULT_SCSI_TIMEOUT	60
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate int test_unit_ready(int fd);
477c478bd9Sstevel@tonic-gate int inquiry(int fd, uchar_t *inq);
487c478bd9Sstevel@tonic-gate int read_capacity(int fd, uchar_t *capbuf);
497c478bd9Sstevel@tonic-gate int read_track_info(int fd, int trackno, uchar_t *ti);
507c478bd9Sstevel@tonic-gate int mode_sense(int fd, uchar_t pc, int dbd, int page_len, uchar_t *buffer);
517c478bd9Sstevel@tonic-gate int mode_select(int fd, int page_len, uchar_t *buffer);
527c478bd9Sstevel@tonic-gate int read_toc(int fd, int format, int trackno, int buflen, uchar_t *buf);
537c478bd9Sstevel@tonic-gate int read_disc_info(int fd, uchar_t *di);
547c478bd9Sstevel@tonic-gate int get_configuration(int fd, uint16_t feature, int bufsize, uchar_t *buf);
557c478bd9Sstevel@tonic-gate int read10(int fd, uint32_t start_blk, uint16_t nblk, uchar_t *buf,
567c478bd9Sstevel@tonic-gate     uint32_t bufsize);
577c478bd9Sstevel@tonic-gate int write10(int fd, uint32_t start_blk, uint16_t nblk, uchar_t *buf,
587c478bd9Sstevel@tonic-gate     uint32_t bufsize);
597c478bd9Sstevel@tonic-gate int close_track(int fd, int trackno, int close_session, int immediate);
607c478bd9Sstevel@tonic-gate int blank_disc(int fd, int type, int immediate);
617c478bd9Sstevel@tonic-gate int read_cd(int fd, uint32_t start_blk, uint16_t nblk, uchar_t sector_type,
627c478bd9Sstevel@tonic-gate     uchar_t *buf, uint32_t bufsize);
637c478bd9Sstevel@tonic-gate int load_unload(int fd, int load);
647c478bd9Sstevel@tonic-gate int prevent_allow_mr(int fd, int op);
657c478bd9Sstevel@tonic-gate int read_header(int fd, uint32_t lba, uchar_t *buf);
667c478bd9Sstevel@tonic-gate int set_cd_speed(int fd, uint16_t read_speed, uint16_t write_speed);
677c478bd9Sstevel@tonic-gate int get_performance(int fd, int get_write_performance, uchar_t *perf);
687c478bd9Sstevel@tonic-gate int set_streaming(int fd, uchar_t *buf);
697c478bd9Sstevel@tonic-gate int rezero_unit(int fd);
707c478bd9Sstevel@tonic-gate int start_stop(int fd, int start);
717c478bd9Sstevel@tonic-gate int flush_cache(int fd);
727c478bd9Sstevel@tonic-gate int set_reservation(int fd, ulong_t size);
737c478bd9Sstevel@tonic-gate int format_media(int fd);
747c478bd9Sstevel@tonic-gate uint32_t read_format_capacity(int fd, uint_t *bsize);
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate int uscsi_error;		/* used for debugging failed uscsi */
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate #define	REZERO_UNIT_CMD 	0x01
797c478bd9Sstevel@tonic-gate #define	FORMAT_UNIT_CMD		0x04
807c478bd9Sstevel@tonic-gate #define	INQUIRY_CMD		0x12
817c478bd9Sstevel@tonic-gate #define	MODE_SELECT_6_CMD	0x15
827c478bd9Sstevel@tonic-gate #define	MODE_SENSE_6_CMD	0x1A
837c478bd9Sstevel@tonic-gate #define	START_STOP_CMD		0x1B
847c478bd9Sstevel@tonic-gate #define	PREVENT_ALLOW_CMD	0x1E
857c478bd9Sstevel@tonic-gate #define	READ_FORMAT_CAP_CMD	0x23
867c478bd9Sstevel@tonic-gate #define	READ_CAP_CMD		0x25
877c478bd9Sstevel@tonic-gate #define	READ_10_CMD		0x28
887c478bd9Sstevel@tonic-gate #define	WRITE_10_CMD		0x2A
897c478bd9Sstevel@tonic-gate #define	SYNC_CACHE_CMD		0x35
907c478bd9Sstevel@tonic-gate #define	READ_TOC_CMD		0x43
917c478bd9Sstevel@tonic-gate #define	MODE_SELECT_10_CMD	0x55
927c478bd9Sstevel@tonic-gate #define	MODE_SENSE_10_CMD	0x5A
937c478bd9Sstevel@tonic-gate #define	READ_HDR_CMD		0x44
947c478bd9Sstevel@tonic-gate #define	GET_CONFIG_CMD		0x46
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate #define	READ_INFO_CMD		0x51
977c478bd9Sstevel@tonic-gate #define	READ_TRACK_CMD		0x52
987c478bd9Sstevel@tonic-gate #define	SET_RESERVATION_CMD	0x53
997c478bd9Sstevel@tonic-gate #define	CLOSE_TRACK_CMD		0x5B
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate #define	BLANK_CMD		0xA1
1027c478bd9Sstevel@tonic-gate #define	GET_PERFORMANCE_CMD	0xAC
1037c478bd9Sstevel@tonic-gate #define	READ_DVD_STRUCTURE	0xAD
1047c478bd9Sstevel@tonic-gate #define	READ_CD_CMD		0xBE
1057c478bd9Sstevel@tonic-gate #define	SET_CD_SPEED		0xBB
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate #define	STREAM_CMD		0xB6
1087c478bd9Sstevel@tonic-gate #define	READ_AUDIO_CMD		0xD8
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1117c478bd9Sstevel@tonic-gate }
1127c478bd9Sstevel@tonic-gate #endif
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #endif /* _MMC_H */
115