summaryrefslogtreecommitdiff
path: root/usr/src/lib/libbc/libc/sys/common/s5dkio.h
blob: b887e32b5e34cd4178a2276f375245fb89c220c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
 * 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
 * or http://www.opensolaris.org/os/licensing.
 * 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 1990 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS5_DKIO_H
#define	_SYS5_DKIO_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Structures and definitions for disk io control commands
 */

/*
 * Structures used as data by ioctl calls.
 */

/*
 * Used for controller info
 */
struct s5_dk_cinfo {
	char	dki_cname[DK_DEVLEN];	/* controller name (no unit #) */
	short	dki_ctype;		/* controller type */
	short	dki_flags;		/* flags */
	short	dki_cnum;		/* controller number */
	int	dki_addr;		/* controller address */
	int	dki_space;		/* controller bus type */
	int	dki_prio;		/* interrupt priority */
	int	dki_vec;		/* interrupt vector */
	char	dki_dname[DK_DEVLEN];	/* drive name (no unit #) */
	int	dki_unit;		/* unit number */
	int	dki_slave;		/* slave number */
	short	dki_partition;		/* partition number */
	short	dki_maxtransfer;	/* max. transfer size in DEV_BSIZE */
};


/*
 * Disk io control commands
 * Warning: some other ioctls with the DIOC prefix exist elsewhere.
 */
#define	S5DKIOC		(0x04 << 8)
#define	S5DKIOCGGEOM	(S5DKIOC|1)		/* Get geometry */
#define	S5DKIOCSGEOM	(S5DKIOC|2)		/* Set geometry */
#define	S5DKIOCINFO	(S5DKIOC|3)		/* Get info */
#define	S5DKIOCSAPART	(S5DKIOC|4)		/* Set all partitions */
#define	S5DKIOCGAPART	(S5DKIOC|5)		/* Get all partitions */

/*
 * These from hdio.h
 */
#define S5HDKIOC	(0x04 << 8)
#define	S5HDKIOCSTYPE	(S5HDKIOC|101)		/* Set drive info */
#define	S5HDKIOCGTYPE	(S5HDKIOC|102)		/* Get drive info */
#define	S5HDKIOCSBAD	(S5HDKIOC|103)		/* Set bad sector map */
#define	S5HDKIOCGBAD	(S5HDKIOC|104)		/* Get bad sector map */
#define	S5HDKIOCSCMD	(S5HDKIOC|105)		/* Set generic cmd */
#define	S5HDKIOCGDIAG	(S5HDKIOC|106)		/* Get diagnostics */

/*
 * These are from cdio.h
 * CDROM io control commands
 */
#define	S5CDIOC			(0x04 << 8)
#define	S5CDROMPAUSE		(S5CDIOC|151)	/* Pause Audio Operation */
#define	S5CDROMRESUME		(S5CDIOC|152)	/* Resume paused Audio Operation */
#define	S5CDROMPLAYMSF		(S5CDIOC|153)	/* Play Audio MSF */
#define	S5CDROMPLAYTRKIND	(S5CDIOC|154)	/* Play Audio Track/index */
#define	S5CDROMREADTOCHDR	(S5CDIOC|155)	/* Read TOC header */
#define	S5CDROMREADTOCENTRY	(S5CDIOC|156)	/* Read a TOC entry */
#define	S5CDROMSTOP		(S5CDIOC|157)	/* Stop the CDrom drive */
#define	S5CDROMSTART		(S5CDIOC|158)	/* Start the CDrom drive */
#define	S5CDROMEJECT		(S5CDIOC|159)	/* Ejects the CDrom caddy */
#define	S5CDROMVOLCTRL		(S5CDIOC|160)	/* control output volume */
#define	S5CDROMSUBCHNL		(S5CDIOC|161)	/* read the subchannel data */
#define	S5CDROMREADMODE2	(S5CDIOC|162)	/* read CDROM mode 2 data */
#define	S5CDROMREADMODE1	(S5CDIOC|163)	/* read CDROM mode 1 data */

/*
 * From sys/scsi/impl/uscsi.h
 */
/*
 * definition for user-scsi command structure
 */
struct s5_uscsi_cmd {
	int	uscsi_flags;		/* read, write, etc. see below */
	short	uscsi_status;		/* resulting status  */
	short	uscsi_timeout;		/* Command Timeout */
	caddr_t	uscsi_cdb;		/* cdb to send to target */
	caddr_t	uscsi_bufaddr;		/* i/o source/destination */
	u_int	uscsi_buflen;		/* size of i/o to take place */
	u_int	uscsi_resid;		/* resid from i/o operation */
	u_char	uscsi_cdblen;		/* # of valid cdb bytes */
	u_char	uscsi_reserved_1;	/* Reserved for Future Use */
	u_char	uscsi_reserved_2;	/* Reserved for Future Use */
	u_char	uscsi_reserved_3;	/* Reserved for Future Use */
	caddr_t	uscsi_reserved_4;	/* Reserved for Future Use */
	void   *uscsi_reserved_5;	/* Reserved for Future Use */
};

/*
 * User SCSI io control command
 */
#define	S5USCSIIOC	(0x04 << 8)
#define	S5USCSICMD	(S5USCSIIOC|201) 	/* user scsi command */

#ifdef	__cplusplus
}
#endif

#endif /* _SYS5_DKIO_H */