mpi2_raid.h 14 KB

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