1700 Add SCSI UNMAP support
[unleashed.git] / usr / src / uts / common / sys / raidioctl.h
blob6be3d0674f640e2981b2e1073e98b5b3d66c2218
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_RAIDIOCTL_H
27 #define _SYS_RAIDIOCTL_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
34 * map ioctls
36 #define RAID_IOC (('R' << 16) | ('D' << 8))
37 #define RAID_GETCONFIG (RAID_IOC|1) /* Get raid information */
38 #define RAID_UPDATEFW (RAID_IOC|4) /* Update IOC firmware */
39 #define RAID_NUMVOLUMES (RAID_IOC|6) /* Retrieve max RAID volumes */
42 * define raid status flags
44 #define RAID_FLAG_ENABLED 0x01
45 #define RAID_FLAG_QUIESCED 0x02
46 #define RAID_FLAG_RESYNCING 0x04
47 #define RAID_STATE_OPTIMAL 0x00
48 #define RAID_STATE_DEGRADED 0x01
49 #define RAID_STATE_FAILED 0x02
52 * define disk status flags
54 #define RAID_DISKSTATUS_GOOD 0x0
55 #define RAID_DISKSTATUS_FAILED 0x1
56 #define RAID_DISKSTATUS_MISSING 0x2
59 * maximum number of disks allowed in a raid volume
61 #define RAID_MAXDISKS 32
63 typedef struct raid_config {
64 int targetid;
65 uint8_t state;
66 uint8_t flags;
67 int raid_level;
68 int ndisks;
69 int disk[RAID_MAXDISKS];
70 int diskstatus[RAID_MAXDISKS];
71 diskaddr_t raid_capacity;
72 int unitid;
73 } raid_config_t;
76 * Defines for type
78 #define FW_TYPE_UCODE 0x1;
79 #define FW_TYPE_FCODE 0x2;
81 typedef struct update_flash {
82 caddr_t ptrbuffer;
83 uint_t size;
84 uint8_t type;
85 } update_flash_t;
87 #if defined(_SYSCALL32)
88 typedef struct update_flash_32 {
89 caddr32_t ptrbuffer;
90 uint32_t size;
91 uint8_t type;
92 } update_flash_32_t;
93 #endif
95 #ifdef __cplusplus
97 #endif
99 #endif /* _SYS_RAIDIOCTL_H */