6811333 Remove prom_printf() message in emlxs driver
[opensolaris.git] / usr / src / uts / common / sys / emul64.h
blobaeafa2211ff6d74b82ce71ccec5e25a6cd5d2133
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_SCSI_ADAPTERS_EMUL64_H
28 #define _SYS_SCSI_ADAPTERS_EMUL64_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * This file defines the commands and structures for three emul64 ioctls,
34 * that may be useful in speeding up tests involving large devices. The
35 * ioctls are documented at
36 * http://lvm.central.sun.com/projects/lagavulin/emul64_design.html#ioctl.
37 * Briefly, there are three ioctls:
39 * EMUL64_WRITE_OFF - ignore all write operations to a specified block
40 * range.
41 * EMUL64_WRITE_ON - enable writes to a specified block range.
42 * EMUL64_ZERO_RANGE - zero all blocks in the specified range.
44 * The emul64_range structure is used to specify a block range for these
45 * ioctls.
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
52 #include <sys/inttypes.h>
53 #include <sys/types.h>
54 #include <sys/scsi/scsi.h>
57 * emul64 ioctl commands:
60 #define EMUL64IOC ('e' << 8)
62 #define EMUL64_WRITE_OFF (EMUL64IOC|37)
63 #define EMUL64_WRITE_ON (EMUL64IOC|38)
64 #define EMUL64_ZERO_RANGE (EMUL64IOC|39)
65 #define EMUL64_ERROR_INJECT (EMUL64IOC|40)
67 struct emul64_range {
68 diskaddr_t emul64_sb; /* starting block # of range */
69 uint64_t emul64_blkcnt; /* # of blocks in range */
72 typedef struct emul64_range emul64_range_t;
75 * Structure to use when specifying an ioctl for a range of blocks on a
76 * specific target.
78 struct emul64_tgt_range {
79 emul64_range_t emul64_blkrange; /* blocks affected by ioctl */
80 ushort_t emul64_target; /* target number of disk */
81 ushort_t emul64_lun; /* lun of disk */
84 typedef struct emul64_tgt_range emul64_tgt_range_t;
87 * Structure to use for specifying error injection sense data
89 #define ERR_INJ_DISABLE 0
90 #define ERR_INJ_ENABLE 1
91 #define ERR_INJ_ENABLE_NODATA 2
93 struct emul64_error_inj_data {
94 ushort_t eccd_target;
95 ushort_t eccd_lun;
96 ushort_t eccd_inj_state; /* ERR_INJ_DISABLE, ... */
97 ushort_t eccd_sns_dlen; /* Number of bytes of sense data */
98 struct scsi_status eccd_scsi_status;
99 uchar_t eccd_pkt_reason;
100 uint_t eccd_pkt_state;
103 #ifdef __cplusplus
105 #endif
107 #endif /* _SYS_SCSI_ADAPTERS_EMUL64_H */