mpi2_raid.h 14 KB

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