Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mpi2_raid.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2000-2012 LSI Corporation.
3  *
4  *
5  * Name: mpi2_raid.h
6  * Title: MPI Integrated RAID messages and structures
7  * Creation Date: April 26, 2007
8  *
9  * mpi2_raid.h Version: 02.00.08
10  *
11  * Version History
12  * ---------------
13  *
14  * Date Version Description
15  * -------- -------- ------------------------------------------------------
16  * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A.
17  * 08-31-07 02.00.01 Modifications to RAID Action request and reply,
18  * including the Actions and ActionData.
19  * 02-29-08 02.00.02 Added MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD.
20  * 05-21-08 02.00.03 Added MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS so that
21  * the PhysDisk array in MPI2_RAID_VOLUME_CREATION_STRUCT
22  * can be sized by the build environment.
23  * 07-30-09 02.00.04 Added proper define for the Use Default Settings bit of
24  * VolumeCreationFlags and marked the old one as obsolete.
25  * 05-12-10 02.00.05 Added MPI2_RAID_VOL_FLAGS_OP_MDC define.
26  * 08-24-10 02.00.06 Added MPI2_RAID_ACTION_COMPATIBILITY_CHECK along with
27  * related structures and defines.
28  * Added product-specific range to RAID Action values.
29  * 02-06-12 02.00.08 Added MPI2_RAID_ACTION_PHYSDISK_HIDDEN.
30  * --------------------------------------------------------------------------
31  */
32 
33 #ifndef MPI2_RAID_H
34 #define MPI2_RAID_H
35 
36 /*****************************************************************************
37 *
38 * Integrated RAID Messages
39 *
40 *****************************************************************************/
41 
42 /****************************************************************************
43 * RAID Action messages
44 ****************************************************************************/
45 
46 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DELETE_VOLUME action */
47 #define MPI2_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000)
48 #define MPI2_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000001)
49 
50 /* use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
51 
52 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES action */
53 #define MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD (0x00000001)
54 
55 /* ActionDataWord for MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE Action */
57 {
58  U8 RateToChange; /* 0x00 */
59  U8 RateOrMode; /* 0x01 */
60  U16 DataScrubDuration; /* 0x02 */
63 
64 #define MPI2_RAID_ACTION_SET_RATE_RESYNC (0x00)
65 #define MPI2_RAID_ACTION_SET_RATE_DATA_SCRUB (0x01)
66 #define MPI2_RAID_ACTION_SET_RATE_POWERSAVE_MODE (0x02)
67 
68 /* ActionDataWord for MPI2_RAID_ACTION_START_RAID_FUNCTION Action */
70 {
71  U8 RAIDFunction; /* 0x00 */
72  U8 Flags; /* 0x01 */
73  U16 Reserved1; /* 0x02 */
78 
79 /* defines for the RAIDFunction field */
80 #define MPI2_RAID_ACTION_START_BACKGROUND_INIT (0x00)
81 #define MPI2_RAID_ACTION_START_ONLINE_CAP_EXPANSION (0x01)
82 #define MPI2_RAID_ACTION_START_CONSISTENCY_CHECK (0x02)
83 
84 /* defines for the Flags field */
85 #define MPI2_RAID_ACTION_START_NEW (0x00)
86 #define MPI2_RAID_ACTION_START_RESUME (0x01)
87 
88 /* ActionDataWord for MPI2_RAID_ACTION_STOP_RAID_FUNCTION Action */
90 {
91  U8 RAIDFunction; /* 0x00 */
92  U8 Flags; /* 0x01 */
93  U16 Reserved1; /* 0x02 */
98 
99 /* defines for the RAIDFunction field */
100 #define MPI2_RAID_ACTION_STOP_BACKGROUND_INIT (0x00)
101 #define MPI2_RAID_ACTION_STOP_ONLINE_CAP_EXPANSION (0x01)
102 #define MPI2_RAID_ACTION_STOP_CONSISTENCY_CHECK (0x02)
103 
104 /* defines for the Flags field */
105 #define MPI2_RAID_ACTION_STOP_ABORT (0x00)
106 #define MPI2_RAID_ACTION_STOP_PAUSE (0x01)
107 
108 /* ActionDataWord for MPI2_RAID_ACTION_CREATE_HOT_SPARE Action */
110 {
111  U8 HotSparePool; /* 0x00 */
112  U8 Reserved1; /* 0x01 */
113  U16 DevHandle; /* 0x02 */
116 
117 /* ActionDataWord for MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE Action */
119 {
120  U8 Flags; /* 0x00 */
122  U16 Reserved1; /* 0x02 */
126 
127 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
128 #define MPI2_RAID_ACTION_ADATA_DISABLE_FW_UPDATE (0x00)
129 #define MPI2_RAID_ACTION_ADATA_ENABLE_FW_UPDATE (0x01)
130 
132 {
141 
142 
143 /* RAID Action Request Message */
145 {
146  U8 Action; /* 0x00 */
147  U8 Reserved1; /* 0x01 */
148  U8 ChainOffset; /* 0x02 */
149  U8 Function; /* 0x03 */
150  U16 VolDevHandle; /* 0x04 */
151  U8 PhysDiskNum; /* 0x06 */
152  U8 MsgFlags; /* 0x07 */
153  U8 VP_ID; /* 0x08 */
154  U8 VF_ID; /* 0x09 */
155  U16 Reserved2; /* 0x0A */
156  U32 Reserved3; /* 0x0C */
161 
162 /* RAID Action request Action values */
163 
164 #define MPI2_RAID_ACTION_INDICATOR_STRUCT (0x01)
165 #define MPI2_RAID_ACTION_CREATE_VOLUME (0x02)
166 #define MPI2_RAID_ACTION_DELETE_VOLUME (0x03)
167 #define MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES (0x04)
168 #define MPI2_RAID_ACTION_ENABLE_ALL_VOLUMES (0x05)
169 #define MPI2_RAID_ACTION_PHYSDISK_OFFLINE (0x0A)
170 #define MPI2_RAID_ACTION_PHYSDISK_ONLINE (0x0B)
171 #define MPI2_RAID_ACTION_FAIL_PHYSDISK (0x0F)
172 #define MPI2_RAID_ACTION_ACTIVATE_VOLUME (0x11)
173 #define MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15)
174 #define MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE (0x17)
175 #define MPI2_RAID_ACTION_SET_VOLUME_NAME (0x18)
176 #define MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE (0x19)
177 #define MPI2_RAID_ACTION_ENABLE_FAILED_VOLUME (0x1C)
178 #define MPI2_RAID_ACTION_CREATE_HOT_SPARE (0x1D)
179 #define MPI2_RAID_ACTION_DELETE_HOT_SPARE (0x1E)
180 #define MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED (0x20)
181 #define MPI2_RAID_ACTION_START_RAID_FUNCTION (0x21)
182 #define MPI2_RAID_ACTION_STOP_RAID_FUNCTION (0x22)
183 #define MPI2_RAID_ACTION_COMPATIBILITY_CHECK (0x23)
184 #define MPI2_RAID_ACTION_PHYSDISK_HIDDEN (0x24)
185 #define MPI2_RAID_ACTION_MIN_PRODUCT_SPECIFIC (0x80)
186 #define MPI2_RAID_ACTION_MAX_PRODUCT_SPECIFIC (0xFF)
187 
188 /* RAID Volume Creation Structure */
189 
190 /*
191  * The following define can be customized for the targeted product.
192  */
193 #ifndef MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS
194 #define MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS (1)
195 #endif
196 
198 {
199  U8 RAIDSetNum; /* 0x00 */
200  U8 PhysDiskMap; /* 0x01 */
201  U16 PhysDiskDevHandle; /* 0x02 */
204 
205 /* defines for the PhysDiskMap field */
206 #define MPI2_RAIDACTION_PHYSDISK_PRIMARY (0x01)
207 #define MPI2_RAIDACTION_PHYSDISK_SECONDARY (0x02)
208 
210 {
211  U8 NumPhysDisks; /* 0x00 */
212  U8 VolumeType; /* 0x01 */
213  U16 Reserved1; /* 0x02 */
215  U32 VolumeSettings; /* 0x08 */
216  U8 Reserved2; /* 0x0C */
217  U8 ResyncRate; /* 0x0D */
218  U16 DataScrubDuration; /* 0x0E */
219  U64 VolumeMaxLBA; /* 0x10 */
220  U32 StripeSize; /* 0x18 */
221  U8 Name[16]; /* 0x1C */
226 
227 /* use MPI2_RAID_VOL_TYPE_ defines from mpi2_cnfg.h for VolumeType */
228 
229 /* defines for the VolumeCreationFlags field */
230 #define MPI2_RAID_VOL_CREATION_DEFAULT_SETTINGS (0x80000000)
231 #define MPI2_RAID_VOL_CREATION_BACKGROUND_INIT (0x00000004)
232 #define MPI2_RAID_VOL_CREATION_LOW_LEVEL_INIT (0x00000002)
233 #define MPI2_RAID_VOL_CREATION_MIGRATE_DATA (0x00000001)
234 /* The following is an obsolete define.
235  * It must be shifted left 24 bits in order to set the proper bit.
236  */
237 #define MPI2_RAID_VOL_CREATION_USE_DEFAULT_SETTINGS (0x80)
238 
239 
240 /* RAID Online Capacity Expansion Structure */
241 
243 {
244  U32 Flags; /* 0x00 */
245  U16 DevHandle0; /* 0x04 */
246  U16 Reserved1; /* 0x06 */
247  U16 DevHandle1; /* 0x08 */
248  U16 Reserved2; /* 0x0A */
253 
254 /* RAID Compatibility Input Structure */
255 
257  U16 SourceDevHandle; /* 0x00 */
259  U32 Flags; /* 0x04 */
260  U32 Reserved1; /* 0x08 */
261  U32 Reserved2; /* 0x0C */
266 
267 /* defines for RAID Compatibility Structure Flags field */
268 #define MPI2_RAID_COMPAT_SOURCE_IS_VOLUME_FLAG (0x00000002)
269 #define MPI2_RAID_COMPAT_REPORT_SOURCE_INFO_FLAG (0x00000001)
270 
271 
272 /* RAID Volume Indicator Structure */
273 
275 {
276  U64 TotalBlocks; /* 0x00 */
277  U64 BlocksRemaining; /* 0x08 */
278  U32 Flags; /* 0x10 */
281 
282 /* defines for RAID Volume Indicator Flags field */
283 #define MPI2_RAID_VOL_FLAGS_OP_MASK (0x0000000F)
284 #define MPI2_RAID_VOL_FLAGS_OP_BACKGROUND_INIT (0x00000000)
285 #define MPI2_RAID_VOL_FLAGS_OP_ONLINE_CAP_EXPANSION (0x00000001)
286 #define MPI2_RAID_VOL_FLAGS_OP_CONSISTENCY_CHECK (0x00000002)
287 #define MPI2_RAID_VOL_FLAGS_OP_RESYNC (0x00000003)
288 #define MPI2_RAID_VOL_FLAGS_OP_MDC (0x00000004)
289 
290 /* RAID Compatibility Result Structure */
291 
293  U8 State; /* 0x00 */
294  U8 Reserved1; /* 0x01 */
295  U16 Reserved2; /* 0x02 */
296  U32 GenericAttributes; /* 0x04 */
298  U32 Reserved3; /* 0x0C */
299  U32 Reserved4; /* 0x10 */
304 
305 /* defines for RAID Compatibility Result Structure State field */
306 #define MPI2_RAID_COMPAT_STATE_COMPATIBLE (0x00)
307 #define MPI2_RAID_COMPAT_STATE_NOT_COMPATIBLE (0x01)
308 
309 /* defines for RAID Compatibility Result Structure GenericAttributes field */
310 #define MPI2_RAID_COMPAT_GENATTRIB_4K_SECTOR (0x00000010)
311 
312 #define MPI2_RAID_COMPAT_GENATTRIB_MEDIA_MASK (0x0000000C)
313 #define MPI2_RAID_COMPAT_GENATTRIB_SOLID_STATE_DRIVE (0x00000008)
314 #define MPI2_RAID_COMPAT_GENATTRIB_HARD_DISK_DRIVE (0x00000004)
315 
316 #define MPI2_RAID_COMPAT_GENATTRIB_PROTOCOL_MASK (0x00000003)
317 #define MPI2_RAID_COMPAT_GENATTRIB_SAS_PROTOCOL (0x00000002)
318 #define MPI2_RAID_COMPAT_GENATTRIB_SATA_PROTOCOL (0x00000001)
319 
320 /* RAID Action Reply ActionData union */
322 {
323  U32 Word[5];
331 
332 /* use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
333 
334 
335 /* RAID Action Reply Message */
337 {
338  U8 Action; /* 0x00 */
339  U8 Reserved1; /* 0x01 */
340  U8 MsgLength; /* 0x02 */
341  U8 Function; /* 0x03 */
342  U16 VolDevHandle; /* 0x04 */
343  U8 PhysDiskNum; /* 0x06 */
344  U8 MsgFlags; /* 0x07 */
345  U8 VP_ID; /* 0x08 */
346  U8 VF_ID; /* 0x09 */
347  U16 Reserved2; /* 0x0A */
348  U16 Reserved3; /* 0x0C */
349  U16 IOCStatus; /* 0x0E */
350  U32 IOCLogInfo; /* 0x10 */
354 
355 
356 #endif
357