xref: /titanic_51/usr/src/cmd/cdrw/mmc.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_MMC_H
28*7c478bd9Sstevel@tonic-gate #define	_MMC_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #define	SENSE_DATA_SIZE		16
37*7c478bd9Sstevel@tonic-gate #define	PAGE_CODE_2A_SIZE	26
38*7c478bd9Sstevel@tonic-gate #define	TRACK_INFO_SIZE		36
39*7c478bd9Sstevel@tonic-gate #define	DISC_INFO_BLOCK_SIZE	32
40*7c478bd9Sstevel@tonic-gate #define	INQUIRY_DATA_LENGTH	96
41*7c478bd9Sstevel@tonic-gate #define	GET_PERF_DATA_LEN	24
42*7c478bd9Sstevel@tonic-gate #define	SET_STREAM_DATA_LEN	28
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #define	DEFAULT_SCSI_TIMEOUT	60
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate int test_unit_ready(int fd);
47*7c478bd9Sstevel@tonic-gate int inquiry(int fd, uchar_t *inq);
48*7c478bd9Sstevel@tonic-gate int read_capacity(int fd, uchar_t *capbuf);
49*7c478bd9Sstevel@tonic-gate int read_track_info(int fd, int trackno, uchar_t *ti);
50*7c478bd9Sstevel@tonic-gate int mode_sense(int fd, uchar_t pc, int dbd, int page_len, uchar_t *buffer);
51*7c478bd9Sstevel@tonic-gate int mode_select(int fd, int page_len, uchar_t *buffer);
52*7c478bd9Sstevel@tonic-gate int read_toc(int fd, int format, int trackno, int buflen, uchar_t *buf);
53*7c478bd9Sstevel@tonic-gate int read_disc_info(int fd, uchar_t *di);
54*7c478bd9Sstevel@tonic-gate int get_configuration(int fd, uint16_t feature, int bufsize, uchar_t *buf);
55*7c478bd9Sstevel@tonic-gate int read10(int fd, uint32_t start_blk, uint16_t nblk, uchar_t *buf,
56*7c478bd9Sstevel@tonic-gate     uint32_t bufsize);
57*7c478bd9Sstevel@tonic-gate int write10(int fd, uint32_t start_blk, uint16_t nblk, uchar_t *buf,
58*7c478bd9Sstevel@tonic-gate     uint32_t bufsize);
59*7c478bd9Sstevel@tonic-gate int close_track(int fd, int trackno, int close_session, int immediate);
60*7c478bd9Sstevel@tonic-gate int blank_disc(int fd, int type, int immediate);
61*7c478bd9Sstevel@tonic-gate int read_cd(int fd, uint32_t start_blk, uint16_t nblk, uchar_t sector_type,
62*7c478bd9Sstevel@tonic-gate     uchar_t *buf, uint32_t bufsize);
63*7c478bd9Sstevel@tonic-gate int load_unload(int fd, int load);
64*7c478bd9Sstevel@tonic-gate int prevent_allow_mr(int fd, int op);
65*7c478bd9Sstevel@tonic-gate int read_header(int fd, uint32_t lba, uchar_t *buf);
66*7c478bd9Sstevel@tonic-gate int set_cd_speed(int fd, uint16_t read_speed, uint16_t write_speed);
67*7c478bd9Sstevel@tonic-gate int get_performance(int fd, int get_write_performance, uchar_t *perf);
68*7c478bd9Sstevel@tonic-gate int set_streaming(int fd, uchar_t *buf);
69*7c478bd9Sstevel@tonic-gate int rezero_unit(int fd);
70*7c478bd9Sstevel@tonic-gate int start_stop(int fd, int start);
71*7c478bd9Sstevel@tonic-gate int flush_cache(int fd);
72*7c478bd9Sstevel@tonic-gate int set_reservation(int fd, ulong_t size);
73*7c478bd9Sstevel@tonic-gate int format_media(int fd);
74*7c478bd9Sstevel@tonic-gate uint32_t read_format_capacity(int fd, uint_t *bsize);
75*7c478bd9Sstevel@tonic-gate 
76*7c478bd9Sstevel@tonic-gate int uscsi_error;		/* used for debugging failed uscsi */
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate #define	REZERO_UNIT_CMD 	0x01
79*7c478bd9Sstevel@tonic-gate #define	FORMAT_UNIT_CMD		0x04
80*7c478bd9Sstevel@tonic-gate #define	INQUIRY_CMD		0x12
81*7c478bd9Sstevel@tonic-gate #define	MODE_SELECT_6_CMD	0x15
82*7c478bd9Sstevel@tonic-gate #define	MODE_SENSE_6_CMD	0x1A
83*7c478bd9Sstevel@tonic-gate #define	START_STOP_CMD		0x1B
84*7c478bd9Sstevel@tonic-gate #define	PREVENT_ALLOW_CMD	0x1E
85*7c478bd9Sstevel@tonic-gate #define	READ_FORMAT_CAP_CMD	0x23
86*7c478bd9Sstevel@tonic-gate #define	READ_CAP_CMD		0x25
87*7c478bd9Sstevel@tonic-gate #define	READ_10_CMD		0x28
88*7c478bd9Sstevel@tonic-gate #define	WRITE_10_CMD		0x2A
89*7c478bd9Sstevel@tonic-gate #define	SYNC_CACHE_CMD		0x35
90*7c478bd9Sstevel@tonic-gate #define	READ_TOC_CMD		0x43
91*7c478bd9Sstevel@tonic-gate #define	MODE_SELECT_10_CMD	0x55
92*7c478bd9Sstevel@tonic-gate #define	MODE_SENSE_10_CMD	0x5A
93*7c478bd9Sstevel@tonic-gate #define	READ_HDR_CMD		0x44
94*7c478bd9Sstevel@tonic-gate #define	GET_CONFIG_CMD		0x46
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate #define	READ_INFO_CMD		0x51
97*7c478bd9Sstevel@tonic-gate #define	READ_TRACK_CMD		0x52
98*7c478bd9Sstevel@tonic-gate #define	SET_RESERVATION_CMD	0x53
99*7c478bd9Sstevel@tonic-gate #define	CLOSE_TRACK_CMD		0x5B
100*7c478bd9Sstevel@tonic-gate 
101*7c478bd9Sstevel@tonic-gate #define	BLANK_CMD		0xA1
102*7c478bd9Sstevel@tonic-gate #define	GET_PERFORMANCE_CMD	0xAC
103*7c478bd9Sstevel@tonic-gate #define	READ_DVD_STRUCTURE	0xAD
104*7c478bd9Sstevel@tonic-gate #define	READ_CD_CMD		0xBE
105*7c478bd9Sstevel@tonic-gate #define	SET_CD_SPEED		0xBB
106*7c478bd9Sstevel@tonic-gate 
107*7c478bd9Sstevel@tonic-gate #define	STREAM_CMD		0xB6
108*7c478bd9Sstevel@tonic-gate #define	READ_AUDIO_CMD		0xD8
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
111*7c478bd9Sstevel@tonic-gate }
112*7c478bd9Sstevel@tonic-gate #endif
113*7c478bd9Sstevel@tonic-gate 
114*7c478bd9Sstevel@tonic-gate #endif /* _MMC_H */
115