mpi2_raid.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. /*
  2. * Copyright (c) 2000-2013 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.09
  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. * 11-18-11 02.00.07 Incorporating additions for MPI v2.5.
  30. * 02-06-12 02.00.08 Added MPI2_RAID_ACTION_PHYSDISK_HIDDEN.
  31. * 07-26-12 02.00.09 Added ElapsedSeconds field to MPI2_RAID_VOL_INDICATOR.
  32. * Added MPI2_RAID_VOL_FLAGS_ELAPSED_SECONDS_VALID define.
  33. * --------------------------------------------------------------------------
  34. */
  35. #ifndef MPI2_RAID_H
  36. #define MPI2_RAID_H
  37. /*****************************************************************************
  38. *
  39. * Integrated RAID Messages
  40. *
  41. *****************************************************************************/
  42. /****************************************************************************
  43. * RAID Action messages
  44. ****************************************************************************/
  45. /*ActionDataWord defines for use with MPI2_RAID_ACTION_DELETE_VOLUME action */
  46. #define MPI2_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000)
  47. #define MPI2_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000001)
  48. /*use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for
  49. *MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
  50. /*ActionDataWord defines for use with
  51. *MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES action */
  52. #define MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD (0x00000001)
  53. /*ActionDataWord for MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE Action */
  54. typedef struct _MPI2_RAID_ACTION_RATE_DATA {
  55. U8 RateToChange; /*0x00 */
  56. U8 RateOrMode; /*0x01 */
  57. U16 DataScrubDuration; /*0x02 */
  58. } MPI2_RAID_ACTION_RATE_DATA, *PTR_MPI2_RAID_ACTION_RATE_DATA,
  59. Mpi2RaidActionRateData_t, *pMpi2RaidActionRateData_t;
  60. #define MPI2_RAID_ACTION_SET_RATE_RESYNC (0x00)
  61. #define MPI2_RAID_ACTION_SET_RATE_DATA_SCRUB (0x01)
  62. #define MPI2_RAID_ACTION_SET_RATE_POWERSAVE_MODE (0x02)
  63. /*ActionDataWord for MPI2_RAID_ACTION_START_RAID_FUNCTION Action */
  64. typedef struct _MPI2_RAID_ACTION_START_RAID_FUNCTION {
  65. U8 RAIDFunction; /*0x00 */
  66. U8 Flags; /*0x01 */
  67. U16 Reserved1; /*0x02 */
  68. } MPI2_RAID_ACTION_START_RAID_FUNCTION,
  69. *PTR_MPI2_RAID_ACTION_START_RAID_FUNCTION,
  70. Mpi2RaidActionStartRaidFunction_t,
  71. *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)
  76. /*defines for the Flags field */
  77. #define MPI2_RAID_ACTION_START_NEW (0x00)
  78. #define MPI2_RAID_ACTION_START_RESUME (0x01)
  79. /*ActionDataWord for MPI2_RAID_ACTION_STOP_RAID_FUNCTION Action */
  80. typedef struct _MPI2_RAID_ACTION_STOP_RAID_FUNCTION {
  81. U8 RAIDFunction; /*0x00 */
  82. U8 Flags; /*0x01 */
  83. U16 Reserved1; /*0x02 */
  84. } MPI2_RAID_ACTION_STOP_RAID_FUNCTION,
  85. *PTR_MPI2_RAID_ACTION_STOP_RAID_FUNCTION,
  86. Mpi2RaidActionStopRaidFunction_t,
  87. *pMpi2RaidActionStopRaidFunction_t;
  88. /*defines for the RAIDFunction field */
  89. #define MPI2_RAID_ACTION_STOP_BACKGROUND_INIT (0x00)
  90. #define MPI2_RAID_ACTION_STOP_ONLINE_CAP_EXPANSION (0x01)
  91. #define MPI2_RAID_ACTION_STOP_CONSISTENCY_CHECK (0x02)
  92. /*defines for the Flags field */
  93. #define MPI2_RAID_ACTION_STOP_ABORT (0x00)
  94. #define MPI2_RAID_ACTION_STOP_PAUSE (0x01)
  95. /*ActionDataWord for MPI2_RAID_ACTION_CREATE_HOT_SPARE Action */
  96. typedef struct _MPI2_RAID_ACTION_HOT_SPARE {
  97. U8 HotSparePool; /*0x00 */
  98. U8 Reserved1; /*0x01 */
  99. U16 DevHandle; /*0x02 */
  100. } MPI2_RAID_ACTION_HOT_SPARE, *PTR_MPI2_RAID_ACTION_HOT_SPARE,
  101. Mpi2RaidActionHotSpare_t, *pMpi2RaidActionHotSpare_t;
  102. /*ActionDataWord for MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE Action */
  103. typedef struct _MPI2_RAID_ACTION_FW_UPDATE_MODE {
  104. U8 Flags; /*0x00 */
  105. U8 DeviceFirmwareUpdateModeTimeout; /*0x01 */
  106. U16 Reserved1; /*0x02 */
  107. } MPI2_RAID_ACTION_FW_UPDATE_MODE,
  108. *PTR_MPI2_RAID_ACTION_FW_UPDATE_MODE,
  109. Mpi2RaidActionFwUpdateMode_t,
  110. *pMpi2RaidActionFwUpdateMode_t;
  111. /*ActionDataWord defines for use with
  112. *MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
  113. #define MPI2_RAID_ACTION_ADATA_DISABLE_FW_UPDATE (0x00)
  114. #define MPI2_RAID_ACTION_ADATA_ENABLE_FW_UPDATE (0x01)
  115. typedef union _MPI2_RAID_ACTION_DATA {
  116. U32 Word;
  117. MPI2_RAID_ACTION_RATE_DATA Rates;
  118. MPI2_RAID_ACTION_START_RAID_FUNCTION StartRaidFunction;
  119. MPI2_RAID_ACTION_STOP_RAID_FUNCTION StopRaidFunction;
  120. MPI2_RAID_ACTION_HOT_SPARE HotSpare;
  121. MPI2_RAID_ACTION_FW_UPDATE_MODE FwUpdateMode;
  122. } MPI2_RAID_ACTION_DATA, *PTR_MPI2_RAID_ACTION_DATA,
  123. Mpi2RaidActionData_t, *pMpi2RaidActionData_t;
  124. /*RAID Action Request Message */
  125. typedef struct _MPI2_RAID_ACTION_REQUEST {
  126. U8 Action; /*0x00 */
  127. U8 Reserved1; /*0x01 */
  128. U8 ChainOffset; /*0x02 */
  129. U8 Function; /*0x03 */
  130. U16 VolDevHandle; /*0x04 */
  131. U8 PhysDiskNum; /*0x06 */
  132. U8 MsgFlags; /*0x07 */
  133. U8 VP_ID; /*0x08 */
  134. U8 VF_ID; /*0x09 */
  135. U16 Reserved2; /*0x0A */
  136. U32 Reserved3; /*0x0C */
  137. MPI2_RAID_ACTION_DATA ActionDataWord; /*0x10 */
  138. MPI2_SGE_SIMPLE_UNION ActionDataSGE; /*0x14 */
  139. } MPI2_RAID_ACTION_REQUEST, *PTR_MPI2_RAID_ACTION_REQUEST,
  140. Mpi2RaidActionRequest_t, *pMpi2RaidActionRequest_t;
  141. /*RAID Action request Action values */
  142. #define MPI2_RAID_ACTION_INDICATOR_STRUCT (0x01)
  143. #define MPI2_RAID_ACTION_CREATE_VOLUME (0x02)
  144. #define MPI2_RAID_ACTION_DELETE_VOLUME (0x03)
  145. #define MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES (0x04)
  146. #define MPI2_RAID_ACTION_ENABLE_ALL_VOLUMES (0x05)
  147. #define MPI2_RAID_ACTION_PHYSDISK_OFFLINE (0x0A)
  148. #define MPI2_RAID_ACTION_PHYSDISK_ONLINE (0x0B)
  149. #define MPI2_RAID_ACTION_FAIL_PHYSDISK (0x0F)
  150. #define MPI2_RAID_ACTION_ACTIVATE_VOLUME (0x11)
  151. #define MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15)
  152. #define MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE (0x17)
  153. #define MPI2_RAID_ACTION_SET_VOLUME_NAME (0x18)
  154. #define MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE (0x19)
  155. #define MPI2_RAID_ACTION_ENABLE_FAILED_VOLUME (0x1C)
  156. #define MPI2_RAID_ACTION_CREATE_HOT_SPARE (0x1D)
  157. #define MPI2_RAID_ACTION_DELETE_HOT_SPARE (0x1E)
  158. #define MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED (0x20)
  159. #define MPI2_RAID_ACTION_START_RAID_FUNCTION (0x21)
  160. #define MPI2_RAID_ACTION_STOP_RAID_FUNCTION (0x22)
  161. #define MPI2_RAID_ACTION_COMPATIBILITY_CHECK (0x23)
  162. #define MPI2_RAID_ACTION_PHYSDISK_HIDDEN (0x24)
  163. #define MPI2_RAID_ACTION_MIN_PRODUCT_SPECIFIC (0x80)
  164. #define MPI2_RAID_ACTION_MAX_PRODUCT_SPECIFIC (0xFF)
  165. /*RAID Volume Creation Structure */
  166. /*
  167. *The following define can be customized for the targeted product.
  168. */
  169. #ifndef MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS
  170. #define MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS (1)
  171. #endif
  172. typedef struct _MPI2_RAID_VOLUME_PHYSDISK {
  173. U8 RAIDSetNum; /*0x00 */
  174. U8 PhysDiskMap; /*0x01 */
  175. U16 PhysDiskDevHandle; /*0x02 */
  176. } MPI2_RAID_VOLUME_PHYSDISK, *PTR_MPI2_RAID_VOLUME_PHYSDISK,
  177. Mpi2RaidVolumePhysDisk_t, *pMpi2RaidVolumePhysDisk_t;
  178. /*defines for the PhysDiskMap field */
  179. #define MPI2_RAIDACTION_PHYSDISK_PRIMARY (0x01)
  180. #define MPI2_RAIDACTION_PHYSDISK_SECONDARY (0x02)
  181. typedef struct _MPI2_RAID_VOLUME_CREATION_STRUCT {
  182. U8 NumPhysDisks; /*0x00 */
  183. U8 VolumeType; /*0x01 */
  184. U16 Reserved1; /*0x02 */
  185. U32 VolumeCreationFlags; /*0x04 */
  186. U32 VolumeSettings; /*0x08 */
  187. U8 Reserved2; /*0x0C */
  188. U8 ResyncRate; /*0x0D */
  189. U16 DataScrubDuration; /*0x0E */
  190. U64 VolumeMaxLBA; /*0x10 */
  191. U32 StripeSize; /*0x18 */
  192. U8 Name[16]; /*0x1C */
  193. MPI2_RAID_VOLUME_PHYSDISK
  194. PhysDisk[MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS]; /*0x2C */
  195. } MPI2_RAID_VOLUME_CREATION_STRUCT,
  196. *PTR_MPI2_RAID_VOLUME_CREATION_STRUCT,
  197. Mpi2RaidVolumeCreationStruct_t,
  198. *pMpi2RaidVolumeCreationStruct_t;
  199. /*use MPI2_RAID_VOL_TYPE_ defines from mpi2_cnfg.h for VolumeType */
  200. /*defines for the VolumeCreationFlags field */
  201. #define MPI2_RAID_VOL_CREATION_DEFAULT_SETTINGS (0x80000000)
  202. #define MPI2_RAID_VOL_CREATION_BACKGROUND_INIT (0x00000004)
  203. #define MPI2_RAID_VOL_CREATION_LOW_LEVEL_INIT (0x00000002)
  204. #define MPI2_RAID_VOL_CREATION_MIGRATE_DATA (0x00000001)
  205. /*The following is an obsolete define.
  206. *It must be shifted left 24 bits in order to set the proper bit.
  207. */
  208. #define MPI2_RAID_VOL_CREATION_USE_DEFAULT_SETTINGS (0x80)
  209. /*RAID Online Capacity Expansion Structure */
  210. typedef struct _MPI2_RAID_ONLINE_CAPACITY_EXPANSION {
  211. U32 Flags; /*0x00 */
  212. U16 DevHandle0; /*0x04 */
  213. U16 Reserved1; /*0x06 */
  214. U16 DevHandle1; /*0x08 */
  215. U16 Reserved2; /*0x0A */
  216. } MPI2_RAID_ONLINE_CAPACITY_EXPANSION,
  217. *PTR_MPI2_RAID_ONLINE_CAPACITY_EXPANSION,
  218. Mpi2RaidOnlineCapacityExpansion_t,
  219. *pMpi2RaidOnlineCapacityExpansion_t;
  220. /*RAID Compatibility Input Structure */
  221. typedef struct _MPI2_RAID_COMPATIBILITY_INPUT_STRUCT {
  222. U16 SourceDevHandle; /*0x00 */
  223. U16 CandidateDevHandle; /*0x02 */
  224. U32 Flags; /*0x04 */
  225. U32 Reserved1; /*0x08 */
  226. U32 Reserved2; /*0x0C */
  227. } MPI2_RAID_COMPATIBILITY_INPUT_STRUCT,
  228. *PTR_MPI2_RAID_COMPATIBILITY_INPUT_STRUCT,
  229. Mpi2RaidCompatibilityInputStruct_t,
  230. *pMpi2RaidCompatibilityInputStruct_t;
  231. /*defines for RAID Compatibility Structure Flags field */
  232. #define MPI2_RAID_COMPAT_SOURCE_IS_VOLUME_FLAG (0x00000002)
  233. #define MPI2_RAID_COMPAT_REPORT_SOURCE_INFO_FLAG (0x00000001)
  234. /*RAID Volume Indicator Structure */
  235. typedef struct _MPI2_RAID_VOL_INDICATOR {
  236. U64 TotalBlocks; /*0x00 */
  237. U64 BlocksRemaining; /*0x08 */
  238. U32 Flags; /*0x10 */
  239. U32 ElapsedSeconds; /* 0x14 */
  240. } MPI2_RAID_VOL_INDICATOR, *PTR_MPI2_RAID_VOL_INDICATOR,
  241. Mpi2RaidVolIndicator_t, *pMpi2RaidVolIndicator_t;
  242. /*defines for RAID Volume Indicator Flags field */
  243. #define MPI2_RAID_VOL_FLAGS_ELAPSED_SECONDS_VALID (0x80000000)
  244. #define MPI2_RAID_VOL_FLAGS_OP_MASK (0x0000000F)
  245. #define MPI2_RAID_VOL_FLAGS_OP_BACKGROUND_INIT (0x00000000)
  246. #define MPI2_RAID_VOL_FLAGS_OP_ONLINE_CAP_EXPANSION (0x00000001)
  247. #define MPI2_RAID_VOL_FLAGS_OP_CONSISTENCY_CHECK (0x00000002)
  248. #define MPI2_RAID_VOL_FLAGS_OP_RESYNC (0x00000003)
  249. #define MPI2_RAID_VOL_FLAGS_OP_MDC (0x00000004)
  250. /*RAID Compatibility Result Structure */
  251. typedef struct _MPI2_RAID_COMPATIBILITY_RESULT_STRUCT {
  252. U8 State; /*0x00 */
  253. U8 Reserved1; /*0x01 */
  254. U16 Reserved2; /*0x02 */
  255. U32 GenericAttributes; /*0x04 */
  256. U32 OEMSpecificAttributes; /*0x08 */
  257. U32 Reserved3; /*0x0C */
  258. U32 Reserved4; /*0x10 */
  259. } MPI2_RAID_COMPATIBILITY_RESULT_STRUCT,
  260. *PTR_MPI2_RAID_COMPATIBILITY_RESULT_STRUCT,
  261. Mpi2RaidCompatibilityResultStruct_t,
  262. *pMpi2RaidCompatibilityResultStruct_t;
  263. /*defines for RAID Compatibility Result Structure State field */
  264. #define MPI2_RAID_COMPAT_STATE_COMPATIBLE (0x00)
  265. #define MPI2_RAID_COMPAT_STATE_NOT_COMPATIBLE (0x01)
  266. /*defines for RAID Compatibility Result Structure GenericAttributes field */
  267. #define MPI2_RAID_COMPAT_GENATTRIB_4K_SECTOR (0x00000010)
  268. #define MPI2_RAID_COMPAT_GENATTRIB_MEDIA_MASK (0x0000000C)
  269. #define MPI2_RAID_COMPAT_GENATTRIB_SOLID_STATE_DRIVE (0x00000008)
  270. #define MPI2_RAID_COMPAT_GENATTRIB_HARD_DISK_DRIVE (0x00000004)
  271. #define MPI2_RAID_COMPAT_GENATTRIB_PROTOCOL_MASK (0x00000003)
  272. #define MPI2_RAID_COMPAT_GENATTRIB_SAS_PROTOCOL (0x00000002)
  273. #define MPI2_RAID_COMPAT_GENATTRIB_SATA_PROTOCOL (0x00000001)
  274. /*RAID Action Reply ActionData union */
  275. typedef union _MPI2_RAID_ACTION_REPLY_DATA {
  276. U32 Word[6];
  277. MPI2_RAID_VOL_INDICATOR RaidVolumeIndicator;
  278. U16 VolDevHandle;
  279. U8 VolumeState;
  280. U8 PhysDiskNum;
  281. MPI2_RAID_COMPATIBILITY_RESULT_STRUCT RaidCompatibilityResult;
  282. } MPI2_RAID_ACTION_REPLY_DATA, *PTR_MPI2_RAID_ACTION_REPLY_DATA,
  283. Mpi2RaidActionReplyData_t, *pMpi2RaidActionReplyData_t;
  284. /*use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for
  285. *MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
  286. /*RAID Action Reply Message */
  287. typedef struct _MPI2_RAID_ACTION_REPLY {
  288. U8 Action; /*0x00 */
  289. U8 Reserved1; /*0x01 */
  290. U8 MsgLength; /*0x02 */
  291. U8 Function; /*0x03 */
  292. U16 VolDevHandle; /*0x04 */
  293. U8 PhysDiskNum; /*0x06 */
  294. U8 MsgFlags; /*0x07 */
  295. U8 VP_ID; /*0x08 */
  296. U8 VF_ID; /*0x09 */
  297. U16 Reserved2; /*0x0A */
  298. U16 Reserved3; /*0x0C */
  299. U16 IOCStatus; /*0x0E */
  300. U32 IOCLogInfo; /*0x10 */
  301. MPI2_RAID_ACTION_REPLY_DATA ActionData; /*0x14 */
  302. } MPI2_RAID_ACTION_REPLY, *PTR_MPI2_RAID_ACTION_REPLY,
  303. Mpi2RaidActionReply_t, *pMpi2RaidActionReply_t;
  304. #endif