xref: /titanic_44/usr/src/lib/libbc/libc/sys/common/s5dkio.h (revision 62a24de03df1f2399ceda704cb3874dabc98bbbd)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1990 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS5_DKIO_H
28 #define	_SYS5_DKIO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Structures and definitions for disk io control commands
38  */
39 
40 /*
41  * Structures used as data by ioctl calls.
42  */
43 
44 /*
45  * Used for controller info
46  */
47 struct s5_dk_cinfo {
48 	char	dki_cname[DK_DEVLEN];	/* controller name (no unit #) */
49 	short	dki_ctype;		/* controller type */
50 	short	dki_flags;		/* flags */
51 	short	dki_cnum;		/* controller number */
52 	int	dki_addr;		/* controller address */
53 	int	dki_space;		/* controller bus type */
54 	int	dki_prio;		/* interrupt priority */
55 	int	dki_vec;		/* interrupt vector */
56 	char	dki_dname[DK_DEVLEN];	/* drive name (no unit #) */
57 	int	dki_unit;		/* unit number */
58 	int	dki_slave;		/* slave number */
59 	short	dki_partition;		/* partition number */
60 	short	dki_maxtransfer;	/* max. transfer size in DEV_BSIZE */
61 };
62 
63 
64 /*
65  * Disk io control commands
66  * Warning: some other ioctls with the DIOC prefix exist elsewhere.
67  */
68 #define	S5DKIOC		(0x04 << 8)
69 #define	S5DKIOCGGEOM	(S5DKIOC|1)		/* Get geometry */
70 #define	S5DKIOCSGEOM	(S5DKIOC|2)		/* Set geometry */
71 #define	S5DKIOCINFO	(S5DKIOC|3)		/* Get info */
72 #define	S5DKIOCSAPART	(S5DKIOC|4)		/* Set all partitions */
73 #define	S5DKIOCGAPART	(S5DKIOC|5)		/* Get all partitions */
74 
75 /*
76  * These from hdio.h
77  */
78 #define S5HDKIOC	(0x04 << 8)
79 #define	S5HDKIOCSTYPE	(S5HDKIOC|101)		/* Set drive info */
80 #define	S5HDKIOCGTYPE	(S5HDKIOC|102)		/* Get drive info */
81 #define	S5HDKIOCSBAD	(S5HDKIOC|103)		/* Set bad sector map */
82 #define	S5HDKIOCGBAD	(S5HDKIOC|104)		/* Get bad sector map */
83 #define	S5HDKIOCSCMD	(S5HDKIOC|105)		/* Set generic cmd */
84 #define	S5HDKIOCGDIAG	(S5HDKIOC|106)		/* Get diagnostics */
85 
86 /*
87  * These are from cdio.h
88  * CDROM io control commands
89  */
90 #define	S5CDIOC			(0x04 << 8)
91 #define	S5CDROMPAUSE		(S5CDIOC|151)	/* Pause Audio Operation */
92 #define	S5CDROMRESUME		(S5CDIOC|152)	/* Resume paused Audio Operation */
93 #define	S5CDROMPLAYMSF		(S5CDIOC|153)	/* Play Audio MSF */
94 #define	S5CDROMPLAYTRKIND	(S5CDIOC|154)	/* Play Audio Track/index */
95 #define	S5CDROMREADTOCHDR	(S5CDIOC|155)	/* Read TOC header */
96 #define	S5CDROMREADTOCENTRY	(S5CDIOC|156)	/* Read a TOC entry */
97 #define	S5CDROMSTOP		(S5CDIOC|157)	/* Stop the CDrom drive */
98 #define	S5CDROMSTART		(S5CDIOC|158)	/* Start the CDrom drive */
99 #define	S5CDROMEJECT		(S5CDIOC|159)	/* Ejects the CDrom caddy */
100 #define	S5CDROMVOLCTRL		(S5CDIOC|160)	/* control output volume */
101 #define	S5CDROMSUBCHNL		(S5CDIOC|161)	/* read the subchannel data */
102 #define	S5CDROMREADMODE2	(S5CDIOC|162)	/* read CDROM mode 2 data */
103 #define	S5CDROMREADMODE1	(S5CDIOC|163)	/* read CDROM mode 1 data */
104 
105 /*
106  * From sys/scsi/impl/uscsi.h
107  */
108 /*
109  * definition for user-scsi command structure
110  */
111 struct s5_uscsi_cmd {
112 	int	uscsi_flags;		/* read, write, etc. see below */
113 	short	uscsi_status;		/* resulting status  */
114 	short	uscsi_timeout;		/* Command Timeout */
115 	caddr_t	uscsi_cdb;		/* cdb to send to target */
116 	caddr_t	uscsi_bufaddr;		/* i/o source/destination */
117 	u_int	uscsi_buflen;		/* size of i/o to take place */
118 	u_int	uscsi_resid;		/* resid from i/o operation */
119 	u_char	uscsi_cdblen;		/* # of valid cdb bytes */
120 	u_char	uscsi_reserved_1;	/* Reserved for Future Use */
121 	u_char	uscsi_reserved_2;	/* Reserved for Future Use */
122 	u_char	uscsi_reserved_3;	/* Reserved for Future Use */
123 	caddr_t	uscsi_reserved_4;	/* Reserved for Future Use */
124 	void   *uscsi_reserved_5;	/* Reserved for Future Use */
125 };
126 
127 /*
128  * User SCSI io control command
129  */
130 #define	S5USCSIIOC	(0x04 << 8)
131 #define	S5USCSICMD	(S5USCSIIOC|201) 	/* user scsi command */
132 
133 #ifdef	__cplusplus
134 }
135 #endif
136 
137 #endif /* _SYS5_DKIO_H */
138