PM: OMAP3: Removed a couple of unused variables from DVFS code
[linux-ginger.git] / drivers / scsi / mpt2sas / mpi / mpi2_raid.h
blob7134816d9046880d332ceb631cb7f0047865e5a5
1 /*
2 * Copyright (c) 2000-2008 LSI Corporation.
5 * Name: mpi2_raid.h
6 * Title: MPI Integrated RAID messages and structures
7 * Creation Date: April 26, 2007
9 * mpi2_raid.h Version: 02.00.03
11 * Version History
12 * ---------------
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 * --------------------------------------------------------------------------
26 #ifndef MPI2_RAID_H
27 #define MPI2_RAID_H
29 /*****************************************************************************
31 * Integrated RAID Messages
33 *****************************************************************************/
35 /****************************************************************************
36 * RAID Action messages
37 ****************************************************************************/
39 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DELETE_VOLUME action */
40 #define MPI2_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000)
41 #define MPI2_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000001)
43 /* use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
45 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES action */
46 #define MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD (0x00000001)
48 /* ActionDataWord for MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE Action */
49 typedef struct _MPI2_RAID_ACTION_RATE_DATA
51 U8 RateToChange; /* 0x00 */
52 U8 RateOrMode; /* 0x01 */
53 U16 DataScrubDuration; /* 0x02 */
54 } MPI2_RAID_ACTION_RATE_DATA, MPI2_POINTER PTR_MPI2_RAID_ACTION_RATE_DATA,
55 Mpi2RaidActionRateData_t, MPI2_POINTER pMpi2RaidActionRateData_t;
57 #define MPI2_RAID_ACTION_SET_RATE_RESYNC (0x00)
58 #define MPI2_RAID_ACTION_SET_RATE_DATA_SCRUB (0x01)
59 #define MPI2_RAID_ACTION_SET_RATE_POWERSAVE_MODE (0x02)
61 /* ActionDataWord for MPI2_RAID_ACTION_START_RAID_FUNCTION Action */
62 typedef struct _MPI2_RAID_ACTION_START_RAID_FUNCTION
64 U8 RAIDFunction; /* 0x00 */
65 U8 Flags; /* 0x01 */
66 U16 Reserved1; /* 0x02 */
67 } MPI2_RAID_ACTION_START_RAID_FUNCTION,
68 MPI2_POINTER PTR_MPI2_RAID_ACTION_START_RAID_FUNCTION,
69 Mpi2RaidActionStartRaidFunction_t,
70 MPI2_POINTER pMpi2RaidActionStartRaidFunction_t;
72 /* defines for the RAIDFunction field */
73 #define MPI2_RAID_ACTION_START_BACKGROUND_INIT (0x00)
74 #define MPI2_RAID_ACTION_START_ONLINE_CAP_EXPANSION (0x01)
75 #define MPI2_RAID_ACTION_START_CONSISTENCY_CHECK (0x02)
77 /* defines for the Flags field */
78 #define MPI2_RAID_ACTION_START_NEW (0x00)
79 #define MPI2_RAID_ACTION_START_RESUME (0x01)
81 /* ActionDataWord for MPI2_RAID_ACTION_STOP_RAID_FUNCTION Action */
82 typedef struct _MPI2_RAID_ACTION_STOP_RAID_FUNCTION
84 U8 RAIDFunction; /* 0x00 */
85 U8 Flags; /* 0x01 */
86 U16 Reserved1; /* 0x02 */
87 } MPI2_RAID_ACTION_STOP_RAID_FUNCTION,
88 MPI2_POINTER PTR_MPI2_RAID_ACTION_STOP_RAID_FUNCTION,
89 Mpi2RaidActionStopRaidFunction_t,
90 MPI2_POINTER pMpi2RaidActionStopRaidFunction_t;
92 /* defines for the RAIDFunction field */
93 #define MPI2_RAID_ACTION_STOP_BACKGROUND_INIT (0x00)
94 #define MPI2_RAID_ACTION_STOP_ONLINE_CAP_EXPANSION (0x01)
95 #define MPI2_RAID_ACTION_STOP_CONSISTENCY_CHECK (0x02)
97 /* defines for the Flags field */
98 #define MPI2_RAID_ACTION_STOP_ABORT (0x00)
99 #define MPI2_RAID_ACTION_STOP_PAUSE (0x01)
101 /* ActionDataWord for MPI2_RAID_ACTION_CREATE_HOT_SPARE Action */
102 typedef struct _MPI2_RAID_ACTION_HOT_SPARE
104 U8 HotSparePool; /* 0x00 */
105 U8 Reserved1; /* 0x01 */
106 U16 DevHandle; /* 0x02 */
107 } MPI2_RAID_ACTION_HOT_SPARE, MPI2_POINTER PTR_MPI2_RAID_ACTION_HOT_SPARE,
108 Mpi2RaidActionHotSpare_t, MPI2_POINTER pMpi2RaidActionHotSpare_t;
110 /* ActionDataWord for MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE Action */
111 typedef struct _MPI2_RAID_ACTION_FW_UPDATE_MODE
113 U8 Flags; /* 0x00 */
114 U8 DeviceFirmwareUpdateModeTimeout; /* 0x01 */
115 U16 Reserved1; /* 0x02 */
116 } MPI2_RAID_ACTION_FW_UPDATE_MODE,
117 MPI2_POINTER PTR_MPI2_RAID_ACTION_FW_UPDATE_MODE,
118 Mpi2RaidActionFwUpdateMode_t, MPI2_POINTER pMpi2RaidActionFwUpdateMode_t;
120 /* ActionDataWord defines for use with MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
121 #define MPI2_RAID_ACTION_ADATA_DISABLE_FW_UPDATE (0x00)
122 #define MPI2_RAID_ACTION_ADATA_ENABLE_FW_UPDATE (0x01)
124 typedef union _MPI2_RAID_ACTION_DATA
126 U32 Word;
127 MPI2_RAID_ACTION_RATE_DATA Rates;
128 MPI2_RAID_ACTION_START_RAID_FUNCTION StartRaidFunction;
129 MPI2_RAID_ACTION_STOP_RAID_FUNCTION StopRaidFunction;
130 MPI2_RAID_ACTION_HOT_SPARE HotSpare;
131 MPI2_RAID_ACTION_FW_UPDATE_MODE FwUpdateMode;
132 } MPI2_RAID_ACTION_DATA, MPI2_POINTER PTR_MPI2_RAID_ACTION_DATA,
133 Mpi2RaidActionData_t, MPI2_POINTER pMpi2RaidActionData_t;
136 /* RAID Action Request Message */
137 typedef struct _MPI2_RAID_ACTION_REQUEST
139 U8 Action; /* 0x00 */
140 U8 Reserved1; /* 0x01 */
141 U8 ChainOffset; /* 0x02 */
142 U8 Function; /* 0x03 */
143 U16 VolDevHandle; /* 0x04 */
144 U8 PhysDiskNum; /* 0x06 */
145 U8 MsgFlags; /* 0x07 */
146 U8 VP_ID; /* 0x08 */
147 U8 VF_ID; /* 0x09 */
148 U16 Reserved2; /* 0x0A */
149 U32 Reserved3; /* 0x0C */
150 MPI2_RAID_ACTION_DATA ActionDataWord; /* 0x10 */
151 MPI2_SGE_SIMPLE_UNION ActionDataSGE; /* 0x14 */
152 } MPI2_RAID_ACTION_REQUEST, MPI2_POINTER PTR_MPI2_RAID_ACTION_REQUEST,
153 Mpi2RaidActionRequest_t, MPI2_POINTER pMpi2RaidActionRequest_t;
155 /* RAID Action request Action values */
157 #define MPI2_RAID_ACTION_INDICATOR_STRUCT (0x01)
158 #define MPI2_RAID_ACTION_CREATE_VOLUME (0x02)
159 #define MPI2_RAID_ACTION_DELETE_VOLUME (0x03)
160 #define MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES (0x04)
161 #define MPI2_RAID_ACTION_ENABLE_ALL_VOLUMES (0x05)
162 #define MPI2_RAID_ACTION_PHYSDISK_OFFLINE (0x0A)
163 #define MPI2_RAID_ACTION_PHYSDISK_ONLINE (0x0B)
164 #define MPI2_RAID_ACTION_FAIL_PHYSDISK (0x0F)
165 #define MPI2_RAID_ACTION_ACTIVATE_VOLUME (0x11)
166 #define MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15)
167 #define MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE (0x17)
168 #define MPI2_RAID_ACTION_SET_VOLUME_NAME (0x18)
169 #define MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE (0x19)
170 #define MPI2_RAID_ACTION_ENABLE_FAILED_VOLUME (0x1C)
171 #define MPI2_RAID_ACTION_CREATE_HOT_SPARE (0x1D)
172 #define MPI2_RAID_ACTION_DELETE_HOT_SPARE (0x1E)
173 #define MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED (0x20)
174 #define MPI2_RAID_ACTION_START_RAID_FUNCTION (0x21)
175 #define MPI2_RAID_ACTION_STOP_RAID_FUNCTION (0x22)
178 /* RAID Volume Creation Structure */
181 * The following define can be customized for the targeted product.
183 #ifndef MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS
184 #define MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS (1)
185 #endif
187 typedef struct _MPI2_RAID_VOLUME_PHYSDISK
189 U8 RAIDSetNum; /* 0x00 */
190 U8 PhysDiskMap; /* 0x01 */
191 U16 PhysDiskDevHandle; /* 0x02 */
192 } MPI2_RAID_VOLUME_PHYSDISK, MPI2_POINTER PTR_MPI2_RAID_VOLUME_PHYSDISK,
193 Mpi2RaidVolumePhysDisk_t, MPI2_POINTER pMpi2RaidVolumePhysDisk_t;
195 /* defines for the PhysDiskMap field */
196 #define MPI2_RAIDACTION_PHYSDISK_PRIMARY (0x01)
197 #define MPI2_RAIDACTION_PHYSDISK_SECONDARY (0x02)
199 typedef struct _MPI2_RAID_VOLUME_CREATION_STRUCT
201 U8 NumPhysDisks; /* 0x00 */
202 U8 VolumeType; /* 0x01 */
203 U16 Reserved1; /* 0x02 */
204 U32 VolumeCreationFlags; /* 0x04 */
205 U32 VolumeSettings; /* 0x08 */
206 U8 Reserved2; /* 0x0C */
207 U8 ResyncRate; /* 0x0D */
208 U16 DataScrubDuration; /* 0x0E */
209 U64 VolumeMaxLBA; /* 0x10 */
210 U32 StripeSize; /* 0x18 */
211 U8 Name[16]; /* 0x1C */
212 MPI2_RAID_VOLUME_PHYSDISK PhysDisk[MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS];/* 0x2C */
213 } MPI2_RAID_VOLUME_CREATION_STRUCT,
214 MPI2_POINTER PTR_MPI2_RAID_VOLUME_CREATION_STRUCT,
215 Mpi2RaidVolumeCreationStruct_t, MPI2_POINTER pMpi2RaidVolumeCreationStruct_t;
217 /* use MPI2_RAID_VOL_TYPE_ defines from mpi2_cnfg.h for VolumeType */
219 /* defines for the VolumeCreationFlags field */
220 #define MPI2_RAID_VOL_CREATION_USE_DEFAULT_SETTINGS (0x80)
221 #define MPI2_RAID_VOL_CREATION_BACKGROUND_INIT (0x04)
222 #define MPI2_RAID_VOL_CREATION_LOW_LEVEL_INIT (0x02)
223 #define MPI2_RAID_VOL_CREATION_MIGRATE_DATA (0x01)
226 /* RAID Online Capacity Expansion Structure */
228 typedef struct _MPI2_RAID_ONLINE_CAPACITY_EXPANSION
230 U32 Flags; /* 0x00 */
231 U16 DevHandle0; /* 0x04 */
232 U16 Reserved1; /* 0x06 */
233 U16 DevHandle1; /* 0x08 */
234 U16 Reserved2; /* 0x0A */
235 } MPI2_RAID_ONLINE_CAPACITY_EXPANSION,
236 MPI2_POINTER PTR_MPI2_RAID_ONLINE_CAPACITY_EXPANSION,
237 Mpi2RaidOnlineCapacityExpansion_t,
238 MPI2_POINTER pMpi2RaidOnlineCapacityExpansion_t;
241 /* RAID Volume Indicator Structure */
243 typedef struct _MPI2_RAID_VOL_INDICATOR
245 U64 TotalBlocks; /* 0x00 */
246 U64 BlocksRemaining; /* 0x08 */
247 U32 Flags; /* 0x10 */
248 } MPI2_RAID_VOL_INDICATOR, MPI2_POINTER PTR_MPI2_RAID_VOL_INDICATOR,
249 Mpi2RaidVolIndicator_t, MPI2_POINTER pMpi2RaidVolIndicator_t;
251 /* defines for RAID Volume Indicator Flags field */
252 #define MPI2_RAID_VOL_FLAGS_OP_MASK (0x0000000F)
253 #define MPI2_RAID_VOL_FLAGS_OP_BACKGROUND_INIT (0x00000000)
254 #define MPI2_RAID_VOL_FLAGS_OP_ONLINE_CAP_EXPANSION (0x00000001)
255 #define MPI2_RAID_VOL_FLAGS_OP_CONSISTENCY_CHECK (0x00000002)
256 #define MPI2_RAID_VOL_FLAGS_OP_RESYNC (0x00000003)
259 /* RAID Action Reply ActionData union */
260 typedef union _MPI2_RAID_ACTION_REPLY_DATA
262 U32 Word[5];
263 MPI2_RAID_VOL_INDICATOR RaidVolumeIndicator;
264 U16 VolDevHandle;
265 U8 VolumeState;
266 U8 PhysDiskNum;
267 } MPI2_RAID_ACTION_REPLY_DATA, MPI2_POINTER PTR_MPI2_RAID_ACTION_REPLY_DATA,
268 Mpi2RaidActionReplyData_t, MPI2_POINTER pMpi2RaidActionReplyData_t;
270 /* use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
273 /* RAID Action Reply Message */
274 typedef struct _MPI2_RAID_ACTION_REPLY
276 U8 Action; /* 0x00 */
277 U8 Reserved1; /* 0x01 */
278 U8 MsgLength; /* 0x02 */
279 U8 Function; /* 0x03 */
280 U16 VolDevHandle; /* 0x04 */
281 U8 PhysDiskNum; /* 0x06 */
282 U8 MsgFlags; /* 0x07 */
283 U8 VP_ID; /* 0x08 */
284 U8 VF_ID; /* 0x09 */
285 U16 Reserved2; /* 0x0A */
286 U16 Reserved3; /* 0x0C */
287 U16 IOCStatus; /* 0x0E */
288 U32 IOCLogInfo; /* 0x10 */
289 MPI2_RAID_ACTION_REPLY_DATA ActionData; /* 0x14 */
290 } MPI2_RAID_ACTION_REPLY, MPI2_POINTER PTR_MPI2_RAID_ACTION_REPLY,
291 Mpi2RaidActionReply_t, MPI2_POINTER pMpi2RaidActionReply_t;
294 #endif