xref: /onnv-gate/usr/src/uts/common/sys/emul64.h (revision 85:1bca8d4eab66)
1*85Scth /*
2*85Scth  * CDDL HEADER START
3*85Scth  *
4*85Scth  * The contents of this file are subject to the terms of the
5*85Scth  * Common Development and Distribution License, Version 1.0 only
6*85Scth  * (the "License").  You may not use this file except in compliance
7*85Scth  * with the License.
8*85Scth  *
9*85Scth  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*85Scth  * or http://www.opensolaris.org/os/licensing.
11*85Scth  * See the License for the specific language governing permissions
12*85Scth  * and limitations under the License.
13*85Scth  *
14*85Scth  * When distributing Covered Code, include this CDDL HEADER in each
15*85Scth  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*85Scth  * If applicable, add the following below this CDDL HEADER, with the
17*85Scth  * fields enclosed by brackets "[]" replaced with your own identifying
18*85Scth  * information: Portions Copyright [yyyy] [name of copyright owner]
19*85Scth  *
20*85Scth  * CDDL HEADER END
21*85Scth  */
22*85Scth /*
23*85Scth  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*85Scth  * Use is subject to license terms.
25*85Scth  */
26*85Scth 
27*85Scth #ifndef _SYS_SCSI_ADAPTERS_EMUL64_H
28*85Scth #define	_SYS_SCSI_ADAPTERS_EMUL64_H
29*85Scth 
30*85Scth #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*85Scth 
32*85Scth /*
33*85Scth  * This file defines the commands and structures for three emul64 ioctls,
34*85Scth  * that may be useful in speeding up tests involving large devices.  The
35*85Scth  * ioctls are documented at
36*85Scth  * http://lvm.central.sun.com/projects/lagavulin/emul64_design.html#ioctl.
37*85Scth  * Briefly, there are three ioctls:
38*85Scth  *
39*85Scth  *	EMUL64_WRITE_OFF - ignore all write operations to a specified block
40*85Scth  *		range.
41*85Scth  *	EMUL64_WRITE_ON - enable writes to a specified block range.
42*85Scth  *	EMUL64_ZERO_RANGE - zero all blocks in the specified range.
43*85Scth  *
44*85Scth  * The emul64_range structure is used to specify a block range for these
45*85Scth  * ioctls.
46*85Scth  */
47*85Scth 
48*85Scth #ifdef __cplusplus
49*85Scth extern "C" {
50*85Scth #endif
51*85Scth 
52*85Scth #include <sys/inttypes.h>
53*85Scth #include <sys/types.h>
54*85Scth 
55*85Scth /*
56*85Scth  * emul64 ioctl commands:
57*85Scth  */
58*85Scth 
59*85Scth #define	EMUL64IOC	('e' << 8)
60*85Scth 
61*85Scth #define	EMUL64_WRITE_OFF	(EMUL64IOC|37)
62*85Scth #define	EMUL64_WRITE_ON		(EMUL64IOC|38)
63*85Scth #define	EMUL64_ZERO_RANGE	(EMUL64IOC|39)
64*85Scth 
65*85Scth struct emul64_range {
66*85Scth 	diskaddr_t	emul64_sb;	/* starting block # of range */
67*85Scth 	uint64_t	emul64_blkcnt;	/* # of blocks in range */
68*85Scth };
69*85Scth 
70*85Scth typedef struct emul64_range emul64_range_t;
71*85Scth 
72*85Scth /*
73*85Scth  * Structure to use when specifying an ioctl for a range of blocks on a
74*85Scth  * specific target.
75*85Scth  */
76*85Scth struct emul64_tgt_range {
77*85Scth 	emul64_range_t	emul64_blkrange; /* blocks affected by ioctl */
78*85Scth 	ushort_t	emul64_target;	/* target number of disk */
79*85Scth 	ushort_t	emul64_lun;	/* lun of disk */
80*85Scth };
81*85Scth 
82*85Scth typedef struct emul64_tgt_range emul64_tgt_range_t;
83*85Scth 
84*85Scth #ifdef __cplusplus
85*85Scth }
86*85Scth #endif
87*85Scth 
88*85Scth #endif /* _SYS_SCSI_ADAPTERS_EMUL64_H */
89