xref: /onnv-gate/usr/src/uts/common/sys/dkio.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _SYS_DKIO_H
28*0Sstevel@tonic-gate #define	_SYS_DKIO_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SunOS-4.0 5.19 */
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #include <sys/dklabel.h>	/* Needed for NDKMAP define */
33*0Sstevel@tonic-gate 
34*0Sstevel@tonic-gate #ifdef	__cplusplus
35*0Sstevel@tonic-gate extern "C" {
36*0Sstevel@tonic-gate #endif
37*0Sstevel@tonic-gate 
38*0Sstevel@tonic-gate /*
39*0Sstevel@tonic-gate  * Structures and definitions for disk io control commands
40*0Sstevel@tonic-gate  */
41*0Sstevel@tonic-gate 
42*0Sstevel@tonic-gate /*
43*0Sstevel@tonic-gate  * Structures used as data by ioctl calls.
44*0Sstevel@tonic-gate  */
45*0Sstevel@tonic-gate 
46*0Sstevel@tonic-gate #define	DK_DEVLEN	16		/* device name max length, including */
47*0Sstevel@tonic-gate 					/* unit # & NULL (ie - "xyc1") */
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate /*
50*0Sstevel@tonic-gate  * Used for controller info
51*0Sstevel@tonic-gate  */
52*0Sstevel@tonic-gate struct dk_cinfo {
53*0Sstevel@tonic-gate 	char	dki_cname[DK_DEVLEN];	/* controller name (no unit #) */
54*0Sstevel@tonic-gate 	ushort_t dki_ctype;		/* controller type */
55*0Sstevel@tonic-gate 	ushort_t dki_flags;		/* flags */
56*0Sstevel@tonic-gate 	ushort_t dki_cnum;		/* controller number */
57*0Sstevel@tonic-gate 	uint_t	dki_addr;		/* controller address */
58*0Sstevel@tonic-gate 	uint_t	dki_space;		/* controller bus type */
59*0Sstevel@tonic-gate 	uint_t	dki_prio;		/* interrupt priority */
60*0Sstevel@tonic-gate 	uint_t	dki_vec;		/* interrupt vector */
61*0Sstevel@tonic-gate 	char	dki_dname[DK_DEVLEN];	/* drive name (no unit #) */
62*0Sstevel@tonic-gate 	uint_t	dki_unit;		/* unit number */
63*0Sstevel@tonic-gate 	uint_t	dki_slave;		/* slave number */
64*0Sstevel@tonic-gate 	ushort_t dki_partition;		/* partition number */
65*0Sstevel@tonic-gate 	ushort_t dki_maxtransfer;	/* max. transfer size in DEV_BSIZE */
66*0Sstevel@tonic-gate };
67*0Sstevel@tonic-gate 
68*0Sstevel@tonic-gate /*
69*0Sstevel@tonic-gate  * Controller types
70*0Sstevel@tonic-gate  */
71*0Sstevel@tonic-gate #define	DKC_UNKNOWN	0
72*0Sstevel@tonic-gate #define	DKC_CDROM	1	/* CD-ROM, SCSI or otherwise */
73*0Sstevel@tonic-gate #define	DKC_WDC2880	2
74*0Sstevel@tonic-gate #define	DKC_XXX_0	3	/* unassigned */
75*0Sstevel@tonic-gate #define	DKC_XXX_1	4	/* unassigned */
76*0Sstevel@tonic-gate #define	DKC_DSD5215	5
77*0Sstevel@tonic-gate #define	DKC_ACB4000	7
78*0Sstevel@tonic-gate #define	DKC_MD21	8
79*0Sstevel@tonic-gate #define	DKC_XXX_2	9	/* unassigned */
80*0Sstevel@tonic-gate #define	DKC_NCRFLOPPY	10
81*0Sstevel@tonic-gate #define	DKC_SMSFLOPPY	12
82*0Sstevel@tonic-gate #define	DKC_SCSI_CCS	13	/* SCSI CCS compatible */
83*0Sstevel@tonic-gate #define	DKC_INTEL82072	14	/* native floppy chip */
84*0Sstevel@tonic-gate #define	DKC_MD		16	/* meta-disk (virtual-disk) driver */
85*0Sstevel@tonic-gate #define	DKC_INTEL82077	19	/* 82077 floppy disk controller */
86*0Sstevel@tonic-gate #define	DKC_DIRECT	20	/* Intel direct attached device i.e. IDE */
87*0Sstevel@tonic-gate #define	DKC_PCMCIA_MEM	21	/* PCMCIA memory disk-like type */
88*0Sstevel@tonic-gate #define	DKC_PCMCIA_ATA	22	/* PCMCIA AT Attached type */
89*0Sstevel@tonic-gate 
90*0Sstevel@tonic-gate /*
91*0Sstevel@tonic-gate  * Sun reserves up through 1023
92*0Sstevel@tonic-gate  */
93*0Sstevel@tonic-gate 
94*0Sstevel@tonic-gate #define	DKC_CUSTOMER_BASE	1024
95*0Sstevel@tonic-gate 
96*0Sstevel@tonic-gate /*
97*0Sstevel@tonic-gate  * Flags
98*0Sstevel@tonic-gate  */
99*0Sstevel@tonic-gate #define	DKI_BAD144	0x01	/* use DEC std 144 bad sector fwding */
100*0Sstevel@tonic-gate #define	DKI_MAPTRK	0x02	/* controller does track mapping */
101*0Sstevel@tonic-gate #define	DKI_FMTTRK	0x04	/* formats only full track at a time */
102*0Sstevel@tonic-gate #define	DKI_FMTVOL	0x08	/* formats only full volume at a time */
103*0Sstevel@tonic-gate #define	DKI_FMTCYL	0x10	/* formats only full cylinders at a time */
104*0Sstevel@tonic-gate #define	DKI_HEXUNIT	0x20	/* unit number is printed as 3 hex digits */
105*0Sstevel@tonic-gate #define	DKI_PCMCIA_PFD	0x40	/* PCMCIA pseudo-floppy memory card */
106*0Sstevel@tonic-gate 
107*0Sstevel@tonic-gate /*
108*0Sstevel@tonic-gate  * Used for all partitions
109*0Sstevel@tonic-gate  */
110*0Sstevel@tonic-gate struct dk_allmap {
111*0Sstevel@tonic-gate 	struct dk_map	dka_map[NDKMAP];
112*0Sstevel@tonic-gate };
113*0Sstevel@tonic-gate 
114*0Sstevel@tonic-gate #if defined(_SYSCALL32)
115*0Sstevel@tonic-gate struct dk_allmap32 {
116*0Sstevel@tonic-gate 	struct dk_map32	dka_map[NDKMAP];
117*0Sstevel@tonic-gate };
118*0Sstevel@tonic-gate #endif /* _SYSCALL32 */
119*0Sstevel@tonic-gate 
120*0Sstevel@tonic-gate /*
121*0Sstevel@tonic-gate  * Definition of a disk's geometry
122*0Sstevel@tonic-gate  */
123*0Sstevel@tonic-gate struct dk_geom {
124*0Sstevel@tonic-gate 	unsigned short	dkg_ncyl;	/* # of data cylinders */
125*0Sstevel@tonic-gate 	unsigned short	dkg_acyl;	/* # of alternate cylinders */
126*0Sstevel@tonic-gate 	unsigned short	dkg_bcyl;	/* cyl offset (for fixed head area) */
127*0Sstevel@tonic-gate 	unsigned short	dkg_nhead;	/* # of heads */
128*0Sstevel@tonic-gate 	unsigned short	dkg_obs1;	/* obsolete */
129*0Sstevel@tonic-gate 	unsigned short	dkg_nsect;	/* # of data sectors per track */
130*0Sstevel@tonic-gate 	unsigned short	dkg_intrlv;	/* interleave factor */
131*0Sstevel@tonic-gate 	unsigned short	dkg_obs2;	/* obsolete */
132*0Sstevel@tonic-gate 	unsigned short	dkg_obs3;	/* obsolete */
133*0Sstevel@tonic-gate 	unsigned short	dkg_apc;	/* alternates per cyl (SCSI only) */
134*0Sstevel@tonic-gate 	unsigned short	dkg_rpm;	/* revolutions per minute */
135*0Sstevel@tonic-gate 	unsigned short	dkg_pcyl;	/* # of physical cylinders */
136*0Sstevel@tonic-gate 	unsigned short	dkg_write_reinstruct;	/* # sectors to skip, writes */
137*0Sstevel@tonic-gate 	unsigned short	dkg_read_reinstruct;	/* # sectors to skip, reads */
138*0Sstevel@tonic-gate 	unsigned short	dkg_extra[7];	/* for compatible expansion */
139*0Sstevel@tonic-gate };
140*0Sstevel@tonic-gate 
141*0Sstevel@tonic-gate /*
142*0Sstevel@tonic-gate  * These defines are for historic compatibility with old drivers.
143*0Sstevel@tonic-gate  */
144*0Sstevel@tonic-gate #define	dkg_bhead	dkg_obs1	/* used to be head offset */
145*0Sstevel@tonic-gate #define	dkg_gap1	dkg_obs2	/* used to be gap1 */
146*0Sstevel@tonic-gate #define	dkg_gap2	dkg_obs3	/* used to be gap2 */
147*0Sstevel@tonic-gate 
148*0Sstevel@tonic-gate /*
149*0Sstevel@tonic-gate  * Disk io control commands
150*0Sstevel@tonic-gate  * Warning: some other ioctls with the DIOC prefix exist elsewhere.
151*0Sstevel@tonic-gate  * The Generic DKIOC numbers are from	0   -  50.
152*0Sstevel@tonic-gate  *	The Floppy Driver uses		51  - 100.
153*0Sstevel@tonic-gate  *	The Hard Disk (except SCSI)	101 - 106.	(these are obsolete)
154*0Sstevel@tonic-gate  *	The CDROM Driver		151 - 200.
155*0Sstevel@tonic-gate  *	The USCSI ioctl			201 - 250.
156*0Sstevel@tonic-gate  */
157*0Sstevel@tonic-gate #define	DKIOC		(0x04 << 8)
158*0Sstevel@tonic-gate 
159*0Sstevel@tonic-gate /*
160*0Sstevel@tonic-gate  * The following ioctls are generic in nature and need to be
161*0Sstevel@tonic-gate  * suported as appropriate by all disk drivers
162*0Sstevel@tonic-gate  */
163*0Sstevel@tonic-gate #define	DKIOCGGEOM	(DKIOC|1)		/* Get geometry */
164*0Sstevel@tonic-gate #define	DKIOCINFO	(DKIOC|3)		/* Get info */
165*0Sstevel@tonic-gate #define	DKIOCEJECT	(DKIOC|6)		/* Generic 'eject' */
166*0Sstevel@tonic-gate #define	DKIOCGVTOC	(DKIOC|11)		/* Get VTOC */
167*0Sstevel@tonic-gate #define	DKIOCSVTOC	(DKIOC|12)		/* Set VTOC & Write to Disk */
168*0Sstevel@tonic-gate 
169*0Sstevel@tonic-gate /*
170*0Sstevel@tonic-gate  * The following ioctls are used by Sun drivers to communicate
171*0Sstevel@tonic-gate  * with their associated format routines. Support of these ioctls
172*0Sstevel@tonic-gate  * is not required of foreign drivers
173*0Sstevel@tonic-gate  */
174*0Sstevel@tonic-gate #define	DKIOCSGEOM	(DKIOC|2)		/* Set geometry */
175*0Sstevel@tonic-gate #define	DKIOCSAPART	(DKIOC|4)		/* Set all partitions */
176*0Sstevel@tonic-gate #define	DKIOCGAPART	(DKIOC|5)		/* Get all partitions */
177*0Sstevel@tonic-gate #define	DKIOCG_PHYGEOM	(DKIOC|32)		/* get physical geometry */
178*0Sstevel@tonic-gate #define	DKIOCG_VIRTGEOM	(DKIOC|33)		/* get virtual geometry */
179*0Sstevel@tonic-gate 
180*0Sstevel@tonic-gate /*
181*0Sstevel@tonic-gate  * The following ioctl's are removable media support
182*0Sstevel@tonic-gate  */
183*0Sstevel@tonic-gate #define	DKIOCLOCK	(DKIOC|7)	/* Generic 'lock' */
184*0Sstevel@tonic-gate #define	DKIOCUNLOCK	(DKIOC|8)	/* Generic 'unlock' */
185*0Sstevel@tonic-gate #define	DKIOCSTATE	(DKIOC|13)	/* Inquire insert/eject state */
186*0Sstevel@tonic-gate #define	DKIOCREMOVABLE	(DKIOC|16)	/* is media removable */
187*0Sstevel@tonic-gate 
188*0Sstevel@tonic-gate /*
189*0Sstevel@tonic-gate  * Ioctl to force driver to re-read the alternate partition and rebuild
190*0Sstevel@tonic-gate  * the internal defect map.
191*0Sstevel@tonic-gate  */
192*0Sstevel@tonic-gate #define	DKIOCADDBAD	(DKIOC|20)	/* Re-read the alternate map (IDE) */
193*0Sstevel@tonic-gate #define	DKIOCGETDEF	(DKIOC|21)	/* read defect list (IDE)	   */
194*0Sstevel@tonic-gate 
195*0Sstevel@tonic-gate /*
196*0Sstevel@tonic-gate  * Used by applications to get disk defect information from IDE
197*0Sstevel@tonic-gate  * drives.
198*0Sstevel@tonic-gate  */
199*0Sstevel@tonic-gate #ifdef _SYSCALL32
200*0Sstevel@tonic-gate struct defect_header32 {
201*0Sstevel@tonic-gate 	int		head;
202*0Sstevel@tonic-gate 	caddr32_t	buffer;
203*0Sstevel@tonic-gate };
204*0Sstevel@tonic-gate #endif /* _SYSCALL32 */
205*0Sstevel@tonic-gate 
206*0Sstevel@tonic-gate struct defect_header {
207*0Sstevel@tonic-gate 	int		head;
208*0Sstevel@tonic-gate 	caddr_t		buffer;
209*0Sstevel@tonic-gate };
210*0Sstevel@tonic-gate 
211*0Sstevel@tonic-gate #define	DKIOCPARTINFO	(DKIOC|22)	/* Get partition or slice parameters */
212*0Sstevel@tonic-gate 
213*0Sstevel@tonic-gate /*
214*0Sstevel@tonic-gate  * Used by applications to get partition or slice information
215*0Sstevel@tonic-gate  */
216*0Sstevel@tonic-gate #ifdef _SYSCALL32
217*0Sstevel@tonic-gate struct part_info32 {
218*0Sstevel@tonic-gate 	daddr32_t	p_start;
219*0Sstevel@tonic-gate 	int		p_length;
220*0Sstevel@tonic-gate };
221*0Sstevel@tonic-gate #endif /* _SYSCALL32 */
222*0Sstevel@tonic-gate 
223*0Sstevel@tonic-gate struct part_info {
224*0Sstevel@tonic-gate 	daddr_t		p_start;
225*0Sstevel@tonic-gate 	int		p_length;
226*0Sstevel@tonic-gate };
227*0Sstevel@tonic-gate 
228*0Sstevel@tonic-gate /* The following ioctls are for Optical Memory Device */
229*0Sstevel@tonic-gate #define	DKIOC_EBP_ENABLE  (DKIOC|40)	/* enable by pass erase on write */
230*0Sstevel@tonic-gate #define	DKIOC_EBP_DISABLE (DKIOC|41)	/* disable by pass erase on write */
231*0Sstevel@tonic-gate 
232*0Sstevel@tonic-gate /*
233*0Sstevel@tonic-gate  * This state enum is the argument passed to the DKIOCSTATE ioctl.
234*0Sstevel@tonic-gate  */
235*0Sstevel@tonic-gate enum dkio_state { DKIO_NONE, DKIO_EJECTED, DKIO_INSERTED, DKIO_DEV_GONE };
236*0Sstevel@tonic-gate 
237*0Sstevel@tonic-gate #define	DKIOCGMEDIAINFO	(DKIOC|42)	/* get information about the media */
238*0Sstevel@tonic-gate 
239*0Sstevel@tonic-gate /*
240*0Sstevel@tonic-gate  * ioctls to read/write mboot info.
241*0Sstevel@tonic-gate  */
242*0Sstevel@tonic-gate #define	DKIOCGMBOOT	(DKIOC|43)	/* get mboot info */
243*0Sstevel@tonic-gate #define	DKIOCSMBOOT	(DKIOC|44)	/* set mboot info */
244*0Sstevel@tonic-gate 
245*0Sstevel@tonic-gate /*
246*0Sstevel@tonic-gate  * ioctl to get the device temperature.
247*0Sstevel@tonic-gate  */
248*0Sstevel@tonic-gate #define	DKIOCGTEMPERATURE	(DKIOC|45)	/* get temperature */
249*0Sstevel@tonic-gate 
250*0Sstevel@tonic-gate /*
251*0Sstevel@tonic-gate  * Used for providing the temperature.
252*0Sstevel@tonic-gate  */
253*0Sstevel@tonic-gate 
254*0Sstevel@tonic-gate struct	dk_temperature	{
255*0Sstevel@tonic-gate 	uint_t		dkt_flags;	/* Flags */
256*0Sstevel@tonic-gate 	short		dkt_cur_temp;	/* Current disk temperature */
257*0Sstevel@tonic-gate 	short		dkt_ref_temp;	/* reference disk temperature */
258*0Sstevel@tonic-gate };
259*0Sstevel@tonic-gate 
260*0Sstevel@tonic-gate #define	DKT_BYPASS_PM		0x1
261*0Sstevel@tonic-gate #define	DKT_INVALID_TEMP	0xFFFF
262*0Sstevel@tonic-gate 
263*0Sstevel@tonic-gate 
264*0Sstevel@tonic-gate /*
265*0Sstevel@tonic-gate  * Used for Media info or the current profile info
266*0Sstevel@tonic-gate  */
267*0Sstevel@tonic-gate struct dk_minfo {
268*0Sstevel@tonic-gate 	uint_t		dki_media_type;	/* Media type or profile info */
269*0Sstevel@tonic-gate 	uint_t		dki_lbsize;	/* Logical blocksize of media */
270*0Sstevel@tonic-gate 	diskaddr_t	dki_capacity;	/* Capacity as # of dki_lbsize blks */
271*0Sstevel@tonic-gate };
272*0Sstevel@tonic-gate 
273*0Sstevel@tonic-gate /*
274*0Sstevel@tonic-gate  * Media types or profiles known
275*0Sstevel@tonic-gate  */
276*0Sstevel@tonic-gate #define	DK_UNKNOWN		0x00	/* Media inserted - type unknown */
277*0Sstevel@tonic-gate 
278*0Sstevel@tonic-gate 
279*0Sstevel@tonic-gate /*
280*0Sstevel@tonic-gate  * SFF 8090 Specification Version 3, media types 0x01 - 0xfffe are retained to
281*0Sstevel@tonic-gate  * maintain compatibility with SFF8090.  The following define the
282*0Sstevel@tonic-gate  * optical media type.
283*0Sstevel@tonic-gate  */
284*0Sstevel@tonic-gate #define	DK_MO_ERASABLE		0x03 /* MO Erasable */
285*0Sstevel@tonic-gate #define	DK_MO_WRITEONCE		0x04 /* MO Write once */
286*0Sstevel@tonic-gate #define	DK_AS_MO		0x05 /* AS MO */
287*0Sstevel@tonic-gate #define	DK_CDROM		0x08 /* CDROM */
288*0Sstevel@tonic-gate #define	DK_CDR			0x09 /* CD-R */
289*0Sstevel@tonic-gate #define	DK_CDRW			0x0A /* CD-RW */
290*0Sstevel@tonic-gate #define	DK_DVDROM		0x10 /* DVD-ROM */
291*0Sstevel@tonic-gate #define	DK_DVDR			0x11 /* DVD-R */
292*0Sstevel@tonic-gate #define	DK_DVDRAM		0x12 /* DVD_RAM or DVD-RW */
293*0Sstevel@tonic-gate 
294*0Sstevel@tonic-gate /*
295*0Sstevel@tonic-gate  * Media types for other rewritable magnetic media
296*0Sstevel@tonic-gate  */
297*0Sstevel@tonic-gate #define	DK_FIXED_DISK		0x10001	/* Fixed disk SCSI or otherwise */
298*0Sstevel@tonic-gate #define	DK_FLOPPY		0x10002 /* Floppy media */
299*0Sstevel@tonic-gate #define	DK_ZIP			0x10003 /* IOMEGA ZIP media */
300*0Sstevel@tonic-gate #define	DK_JAZ			0x10004 /* IOMEGA JAZ media */
301*0Sstevel@tonic-gate 
302*0Sstevel@tonic-gate #define	DKIOCSETEFI	(DKIOC|17)		/* Set EFI info */
303*0Sstevel@tonic-gate #define	DKIOCGETEFI	(DKIOC|18)		/* Get EFI info */
304*0Sstevel@tonic-gate 
305*0Sstevel@tonic-gate #define	DKIOCPARTITION	(DKIOC|9)		/* Get partition info */
306*0Sstevel@tonic-gate 
307*0Sstevel@tonic-gate /*
308*0Sstevel@tonic-gate  * Ioctls to get/set volume capabilities related to Logical Volume Managers.
309*0Sstevel@tonic-gate  * They include the ability to get/set capabilities and to issue a read to a
310*0Sstevel@tonic-gate  * specific underlying device of a replicated device.
311*0Sstevel@tonic-gate  */
312*0Sstevel@tonic-gate 
313*0Sstevel@tonic-gate #define	DKIOCGETVOLCAP	(DKIOC | 25)	/* Get volume capabilities */
314*0Sstevel@tonic-gate #define	DKIOCSETVOLCAP	(DKIOC | 26)	/* Set volume capabilities */
315*0Sstevel@tonic-gate #define	DKIOCDMR	(DKIOC | 27)	/* Issue a directed read */
316*0Sstevel@tonic-gate 
317*0Sstevel@tonic-gate typedef uint_t volcapinfo_t;
318*0Sstevel@tonic-gate 
319*0Sstevel@tonic-gate typedef uint_t volcapset_t;
320*0Sstevel@tonic-gate 
321*0Sstevel@tonic-gate #define	DKV_ABR_CAP 0x00000001		/* Support Appl.Based Recovery */
322*0Sstevel@tonic-gate #define	DKV_DMR_CAP 0x00000002		/* Support Directed  Mirror Read */
323*0Sstevel@tonic-gate 
324*0Sstevel@tonic-gate typedef struct volcap {
325*0Sstevel@tonic-gate 	volcapinfo_t vc_info;	/* Capabilities available */
326*0Sstevel@tonic-gate 	volcapset_t vc_set;	/* Capabilities set */
327*0Sstevel@tonic-gate } volcap_t;
328*0Sstevel@tonic-gate 
329*0Sstevel@tonic-gate #define	VOL_SIDENAME 256
330*0Sstevel@tonic-gate 
331*0Sstevel@tonic-gate typedef struct vol_directed_rd {
332*0Sstevel@tonic-gate 	int		vdr_flags;
333*0Sstevel@tonic-gate 	offset_t	vdr_offset;
334*0Sstevel@tonic-gate 	size_t		vdr_nbytes;
335*0Sstevel@tonic-gate 	size_t		vdr_bytesread;
336*0Sstevel@tonic-gate 	void		*vdr_data;
337*0Sstevel@tonic-gate 	int		vdr_side;
338*0Sstevel@tonic-gate 	char		vdr_side_name[VOL_SIDENAME];
339*0Sstevel@tonic-gate } vol_directed_rd_t;
340*0Sstevel@tonic-gate 
341*0Sstevel@tonic-gate #define	DKV_SIDE_INIT		(-1)
342*0Sstevel@tonic-gate #define	DKV_DMR_NEXT_SIDE	0x00000001
343*0Sstevel@tonic-gate #define	DKV_DMR_DONE		0x00000002
344*0Sstevel@tonic-gate #define	DKV_DMR_ERROR		0x00000004
345*0Sstevel@tonic-gate #define	DKV_DMR_SUCCESS		0x00000008
346*0Sstevel@tonic-gate #define	DKV_DMR_SHORT		0x00000010
347*0Sstevel@tonic-gate 
348*0Sstevel@tonic-gate #ifdef _MULTI_DATAMODEL
349*0Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
350*0Sstevel@tonic-gate #pragma pack(4)
351*0Sstevel@tonic-gate #endif
352*0Sstevel@tonic-gate typedef struct vol_directed_rd32 {
353*0Sstevel@tonic-gate 	int32_t		vdr_flags;
354*0Sstevel@tonic-gate 	offset_t	vdr_offset;	/* 64-bit element on 32-bit alignment */
355*0Sstevel@tonic-gate 	size32_t	vdr_nbytes;
356*0Sstevel@tonic-gate 	size32_t	vdr_bytesread;
357*0Sstevel@tonic-gate 	caddr32_t	vdr_data;
358*0Sstevel@tonic-gate 	int32_t		vdr_side;
359*0Sstevel@tonic-gate 	char		vdr_side_name[VOL_SIDENAME];
360*0Sstevel@tonic-gate } vol_directed_rd32_t;
361*0Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
362*0Sstevel@tonic-gate #pragma pack()
363*0Sstevel@tonic-gate #endif
364*0Sstevel@tonic-gate #endif	/* _MULTI_DATAMODEL */
365*0Sstevel@tonic-gate 
366*0Sstevel@tonic-gate #ifdef	__cplusplus
367*0Sstevel@tonic-gate }
368*0Sstevel@tonic-gate #endif
369*0Sstevel@tonic-gate 
370*0Sstevel@tonic-gate #endif /* _SYS_DKIO_H */
371