mpi2_raid.h 13 KB

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