mpi2_ioc.h 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411
  1. /*
  2. * Copyright (c) 2000-2010 LSI Corporation.
  3. *
  4. *
  5. * Name: mpi2_ioc.h
  6. * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages
  7. * Creation Date: October 11, 2006
  8. *
  9. * mpi2_ioc.h Version: 02.00.13
  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. * 06-04-07 02.00.01 In IOCFacts Reply structure, renamed MaxDevices to
  18. * MaxTargets.
  19. * Added TotalImageSize field to FWDownload Request.
  20. * Added reserved words to FWUpload Request.
  21. * 06-26-07 02.00.02 Added IR Configuration Change List Event.
  22. * 08-31-07 02.00.03 Removed SystemReplyQueueDepth field from the IOCInit
  23. * request and replaced it with
  24. * ReplyDescriptorPostQueueDepth and ReplyFreeQueueDepth.
  25. * Replaced the MinReplyQueueDepth field of the IOCFacts
  26. * reply with MaxReplyDescriptorPostQueueDepth.
  27. * Added MPI2_RDPQ_DEPTH_MIN define to specify the minimum
  28. * depth for the Reply Descriptor Post Queue.
  29. * Added SASAddress field to Initiator Device Table
  30. * Overflow Event data.
  31. * 10-31-07 02.00.04 Added ReasonCode MPI2_EVENT_SAS_INIT_RC_NOT_RESPONDING
  32. * for SAS Initiator Device Status Change Event data.
  33. * Modified Reason Code defines for SAS Topology Change
  34. * List Event data, including adding a bit for PHY Vacant
  35. * status, and adding a mask for the Reason Code.
  36. * Added define for
  37. * MPI2_EVENT_SAS_TOPO_ES_DELAY_NOT_RESPONDING.
  38. * Added define for MPI2_EXT_IMAGE_TYPE_MEGARAID.
  39. * 12-18-07 02.00.05 Added Boot Status defines for the IOCExceptions field of
  40. * the IOCFacts Reply.
  41. * Removed MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER define.
  42. * Moved MPI2_VERSION_UNION to mpi2.h.
  43. * Changed MPI2_EVENT_NOTIFICATION_REQUEST to use masks
  44. * instead of enables, and added SASBroadcastPrimitiveMasks
  45. * field.
  46. * Added Log Entry Added Event and related structure.
  47. * 02-29-08 02.00.06 Added define MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID.
  48. * Removed define MPI2_IOCFACTS_PROTOCOL_SMP_TARGET.
  49. * Added MaxVolumes and MaxPersistentEntries fields to
  50. * IOCFacts reply.
  51. * Added ProtocalFlags and IOCCapabilities fields to
  52. * MPI2_FW_IMAGE_HEADER.
  53. * Removed MPI2_PORTENABLE_FLAGS_ENABLE_SINGLE_PORT.
  54. * 03-03-08 02.00.07 Fixed MPI2_FW_IMAGE_HEADER by changing Reserved26 to
  55. * a U16 (from a U32).
  56. * Removed extra 's' from EventMasks name.
  57. * 06-27-08 02.00.08 Fixed an offset in a comment.
  58. * 10-02-08 02.00.09 Removed SystemReplyFrameSize from MPI2_IOC_INIT_REQUEST.
  59. * Removed CurReplyFrameSize from MPI2_IOC_FACTS_REPLY and
  60. * renamed MinReplyFrameSize to ReplyFrameSize.
  61. * Added MPI2_IOCFACTS_EXCEPT_IR_FOREIGN_CONFIG_MAX.
  62. * Added two new RAIDOperation values for Integrated RAID
  63. * Operations Status Event data.
  64. * Added four new IR Configuration Change List Event data
  65. * ReasonCode values.
  66. * Added two new ReasonCode defines for SAS Device Status
  67. * Change Event data.
  68. * Added three new DiscoveryStatus bits for the SAS
  69. * Discovery event data.
  70. * Added Multiplexing Status Change bit to the PhyStatus
  71. * field of the SAS Topology Change List event data.
  72. * Removed define for MPI2_INIT_IMAGE_BOOTFLAGS_XMEMCOPY.
  73. * BootFlags are now product-specific.
  74. * Added defines for the indivdual signature bytes
  75. * for MPI2_INIT_IMAGE_FOOTER.
  76. * 01-19-09 02.00.10 Added MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY define.
  77. * Added MPI2_EVENT_SAS_DISC_DS_DOWNSTREAM_INITIATOR
  78. * define.
  79. * Added MPI2_EVENT_SAS_DEV_STAT_RC_SATA_INIT_FAILURE
  80. * define.
  81. * Removed MPI2_EVENT_SAS_DISC_DS_SATA_INIT_FAILURE define.
  82. * 05-06-09 02.00.11 Added MPI2_IOCFACTS_CAPABILITY_RAID_ACCELERATOR define.
  83. * Added MPI2_IOCFACTS_CAPABILITY_MSI_X_INDEX define.
  84. * Added two new reason codes for SAS Device Status Change
  85. * Event.
  86. * Added new event: SAS PHY Counter.
  87. * 07-30-09 02.00.12 Added GPIO Interrupt event define and structure.
  88. * Added MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER define.
  89. * Added new product id family for 2208.
  90. * 10-28-09 02.00.13 Added HostMSIxVectors field to MPI2_IOC_INIT_REQUEST.
  91. * Added MaxMSIxVectors field to MPI2_IOC_FACTS_REPLY.
  92. * Added MinDevHandle field to MPI2_IOC_FACTS_REPLY.
  93. * Added MPI2_IOCFACTS_CAPABILITY_HOST_BASED_DISCOVERY.
  94. * Added MPI2_EVENT_HOST_BASED_DISCOVERY_PHY define.
  95. * Added MPI2_EVENT_SAS_TOPO_ES_NO_EXPANDER define.
  96. * Added Host Based Discovery Phy Event data.
  97. * Added defines for ProductID Product field
  98. * (MPI2_FW_HEADER_PID_).
  99. * Modified values for SAS ProductID Family
  100. * (MPI2_FW_HEADER_PID_FAMILY_).
  101. * --------------------------------------------------------------------------
  102. */
  103. #ifndef MPI2_IOC_H
  104. #define MPI2_IOC_H
  105. /*****************************************************************************
  106. *
  107. * IOC Messages
  108. *
  109. *****************************************************************************/
  110. /****************************************************************************
  111. * IOCInit message
  112. ****************************************************************************/
  113. /* IOCInit Request message */
  114. typedef struct _MPI2_IOC_INIT_REQUEST
  115. {
  116. U8 WhoInit; /* 0x00 */
  117. U8 Reserved1; /* 0x01 */
  118. U8 ChainOffset; /* 0x02 */
  119. U8 Function; /* 0x03 */
  120. U16 Reserved2; /* 0x04 */
  121. U8 Reserved3; /* 0x06 */
  122. U8 MsgFlags; /* 0x07 */
  123. U8 VP_ID; /* 0x08 */
  124. U8 VF_ID; /* 0x09 */
  125. U16 Reserved4; /* 0x0A */
  126. U16 MsgVersion; /* 0x0C */
  127. U16 HeaderVersion; /* 0x0E */
  128. U32 Reserved5; /* 0x10 */
  129. U16 Reserved6; /* 0x14 */
  130. U8 Reserved7; /* 0x16 */
  131. U8 HostMSIxVectors; /* 0x17 */
  132. U16 Reserved8; /* 0x18 */
  133. U16 SystemRequestFrameSize; /* 0x1A */
  134. U16 ReplyDescriptorPostQueueDepth; /* 0x1C */
  135. U16 ReplyFreeQueueDepth; /* 0x1E */
  136. U32 SenseBufferAddressHigh; /* 0x20 */
  137. U32 SystemReplyAddressHigh; /* 0x24 */
  138. U64 SystemRequestFrameBaseAddress; /* 0x28 */
  139. U64 ReplyDescriptorPostQueueAddress;/* 0x30 */
  140. U64 ReplyFreeQueueAddress; /* 0x38 */
  141. U64 TimeStamp; /* 0x40 */
  142. } MPI2_IOC_INIT_REQUEST, MPI2_POINTER PTR_MPI2_IOC_INIT_REQUEST,
  143. Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2IOCInitRequest_t;
  144. /* WhoInit values */
  145. #define MPI2_WHOINIT_NOT_INITIALIZED (0x00)
  146. #define MPI2_WHOINIT_SYSTEM_BIOS (0x01)
  147. #define MPI2_WHOINIT_ROM_BIOS (0x02)
  148. #define MPI2_WHOINIT_PCI_PEER (0x03)
  149. #define MPI2_WHOINIT_HOST_DRIVER (0x04)
  150. #define MPI2_WHOINIT_MANUFACTURER (0x05)
  151. /* MsgVersion */
  152. #define MPI2_IOCINIT_MSGVERSION_MAJOR_MASK (0xFF00)
  153. #define MPI2_IOCINIT_MSGVERSION_MAJOR_SHIFT (8)
  154. #define MPI2_IOCINIT_MSGVERSION_MINOR_MASK (0x00FF)
  155. #define MPI2_IOCINIT_MSGVERSION_MINOR_SHIFT (0)
  156. /* HeaderVersion */
  157. #define MPI2_IOCINIT_HDRVERSION_UNIT_MASK (0xFF00)
  158. #define MPI2_IOCINIT_HDRVERSION_UNIT_SHIFT (8)
  159. #define MPI2_IOCINIT_HDRVERSION_DEV_MASK (0x00FF)
  160. #define MPI2_IOCINIT_HDRVERSION_DEV_SHIFT (0)
  161. /* minimum depth for the Reply Descriptor Post Queue */
  162. #define MPI2_RDPQ_DEPTH_MIN (16)
  163. /* IOCInit Reply message */
  164. typedef struct _MPI2_IOC_INIT_REPLY
  165. {
  166. U8 WhoInit; /* 0x00 */
  167. U8 Reserved1; /* 0x01 */
  168. U8 MsgLength; /* 0x02 */
  169. U8 Function; /* 0x03 */
  170. U16 Reserved2; /* 0x04 */
  171. U8 Reserved3; /* 0x06 */
  172. U8 MsgFlags; /* 0x07 */
  173. U8 VP_ID; /* 0x08 */
  174. U8 VF_ID; /* 0x09 */
  175. U16 Reserved4; /* 0x0A */
  176. U16 Reserved5; /* 0x0C */
  177. U16 IOCStatus; /* 0x0E */
  178. U32 IOCLogInfo; /* 0x10 */
  179. } MPI2_IOC_INIT_REPLY, MPI2_POINTER PTR_MPI2_IOC_INIT_REPLY,
  180. Mpi2IOCInitReply_t, MPI2_POINTER pMpi2IOCInitReply_t;
  181. /****************************************************************************
  182. * IOCFacts message
  183. ****************************************************************************/
  184. /* IOCFacts Request message */
  185. typedef struct _MPI2_IOC_FACTS_REQUEST
  186. {
  187. U16 Reserved1; /* 0x00 */
  188. U8 ChainOffset; /* 0x02 */
  189. U8 Function; /* 0x03 */
  190. U16 Reserved2; /* 0x04 */
  191. U8 Reserved3; /* 0x06 */
  192. U8 MsgFlags; /* 0x07 */
  193. U8 VP_ID; /* 0x08 */
  194. U8 VF_ID; /* 0x09 */
  195. U16 Reserved4; /* 0x0A */
  196. } MPI2_IOC_FACTS_REQUEST, MPI2_POINTER PTR_MPI2_IOC_FACTS_REQUEST,
  197. Mpi2IOCFactsRequest_t, MPI2_POINTER pMpi2IOCFactsRequest_t;
  198. /* IOCFacts Reply message */
  199. typedef struct _MPI2_IOC_FACTS_REPLY
  200. {
  201. U16 MsgVersion; /* 0x00 */
  202. U8 MsgLength; /* 0x02 */
  203. U8 Function; /* 0x03 */
  204. U16 HeaderVersion; /* 0x04 */
  205. U8 IOCNumber; /* 0x06 */
  206. U8 MsgFlags; /* 0x07 */
  207. U8 VP_ID; /* 0x08 */
  208. U8 VF_ID; /* 0x09 */
  209. U16 Reserved1; /* 0x0A */
  210. U16 IOCExceptions; /* 0x0C */
  211. U16 IOCStatus; /* 0x0E */
  212. U32 IOCLogInfo; /* 0x10 */
  213. U8 MaxChainDepth; /* 0x14 */
  214. U8 WhoInit; /* 0x15 */
  215. U8 NumberOfPorts; /* 0x16 */
  216. U8 MaxMSIxVectors; /* 0x17 */
  217. U16 RequestCredit; /* 0x18 */
  218. U16 ProductID; /* 0x1A */
  219. U32 IOCCapabilities; /* 0x1C */
  220. MPI2_VERSION_UNION FWVersion; /* 0x20 */
  221. U16 IOCRequestFrameSize; /* 0x24 */
  222. U16 Reserved3; /* 0x26 */
  223. U16 MaxInitiators; /* 0x28 */
  224. U16 MaxTargets; /* 0x2A */
  225. U16 MaxSasExpanders; /* 0x2C */
  226. U16 MaxEnclosures; /* 0x2E */
  227. U16 ProtocolFlags; /* 0x30 */
  228. U16 HighPriorityCredit; /* 0x32 */
  229. U16 MaxReplyDescriptorPostQueueDepth; /* 0x34 */
  230. U8 ReplyFrameSize; /* 0x36 */
  231. U8 MaxVolumes; /* 0x37 */
  232. U16 MaxDevHandle; /* 0x38 */
  233. U16 MaxPersistentEntries; /* 0x3A */
  234. U16 MinDevHandle; /* 0x3C */
  235. U16 Reserved4; /* 0x3E */
  236. } MPI2_IOC_FACTS_REPLY, MPI2_POINTER PTR_MPI2_IOC_FACTS_REPLY,
  237. Mpi2IOCFactsReply_t, MPI2_POINTER pMpi2IOCFactsReply_t;
  238. /* MsgVersion */
  239. #define MPI2_IOCFACTS_MSGVERSION_MAJOR_MASK (0xFF00)
  240. #define MPI2_IOCFACTS_MSGVERSION_MAJOR_SHIFT (8)
  241. #define MPI2_IOCFACTS_MSGVERSION_MINOR_MASK (0x00FF)
  242. #define MPI2_IOCFACTS_MSGVERSION_MINOR_SHIFT (0)
  243. /* HeaderVersion */
  244. #define MPI2_IOCFACTS_HDRVERSION_UNIT_MASK (0xFF00)
  245. #define MPI2_IOCFACTS_HDRVERSION_UNIT_SHIFT (8)
  246. #define MPI2_IOCFACTS_HDRVERSION_DEV_MASK (0x00FF)
  247. #define MPI2_IOCFACTS_HDRVERSION_DEV_SHIFT (0)
  248. /* IOCExceptions */
  249. #define MPI2_IOCFACTS_EXCEPT_IR_FOREIGN_CONFIG_MAX (0x0100)
  250. #define MPI2_IOCFACTS_EXCEPT_BOOTSTAT_MASK (0x00E0)
  251. #define MPI2_IOCFACTS_EXCEPT_BOOTSTAT_GOOD (0x0000)
  252. #define MPI2_IOCFACTS_EXCEPT_BOOTSTAT_BACKUP (0x0020)
  253. #define MPI2_IOCFACTS_EXCEPT_BOOTSTAT_RESTORED (0x0040)
  254. #define MPI2_IOCFACTS_EXCEPT_BOOTSTAT_CORRUPT_BACKUP (0x0060)
  255. #define MPI2_IOCFACTS_EXCEPT_METADATA_UNSUPPORTED (0x0010)
  256. #define MPI2_IOCFACTS_EXCEPT_MANUFACT_CHECKSUM_FAIL (0x0008)
  257. #define MPI2_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL (0x0004)
  258. #define MPI2_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID (0x0002)
  259. #define MPI2_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0001)
  260. /* defines for WhoInit field are after the IOCInit Request */
  261. /* ProductID field uses MPI2_FW_HEADER_PID_ */
  262. /* IOCCapabilities */
  263. #define MPI2_IOCFACTS_CAPABILITY_HOST_BASED_DISCOVERY (0x00010000)
  264. #define MPI2_IOCFACTS_CAPABILITY_MSI_X_INDEX (0x00008000)
  265. #define MPI2_IOCFACTS_CAPABILITY_RAID_ACCELERATOR (0x00004000)
  266. #define MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY (0x00002000)
  267. #define MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID (0x00001000)
  268. #define MPI2_IOCFACTS_CAPABILITY_TLR (0x00000800)
  269. #define MPI2_IOCFACTS_CAPABILITY_MULTICAST (0x00000100)
  270. #define MPI2_IOCFACTS_CAPABILITY_BIDIRECTIONAL_TARGET (0x00000080)
  271. #define MPI2_IOCFACTS_CAPABILITY_EEDP (0x00000040)
  272. #define MPI2_IOCFACTS_CAPABILITY_EXTENDED_BUFFER (0x00000020)
  273. #define MPI2_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER (0x00000010)
  274. #define MPI2_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER (0x00000008)
  275. #define MPI2_IOCFACTS_CAPABILITY_TASK_SET_FULL_HANDLING (0x00000004)
  276. /* ProtocolFlags */
  277. #define MPI2_IOCFACTS_PROTOCOL_SCSI_TARGET (0x0001)
  278. #define MPI2_IOCFACTS_PROTOCOL_SCSI_INITIATOR (0x0002)
  279. /****************************************************************************
  280. * PortFacts message
  281. ****************************************************************************/
  282. /* PortFacts Request message */
  283. typedef struct _MPI2_PORT_FACTS_REQUEST
  284. {
  285. U16 Reserved1; /* 0x00 */
  286. U8 ChainOffset; /* 0x02 */
  287. U8 Function; /* 0x03 */
  288. U16 Reserved2; /* 0x04 */
  289. U8 PortNumber; /* 0x06 */
  290. U8 MsgFlags; /* 0x07 */
  291. U8 VP_ID; /* 0x08 */
  292. U8 VF_ID; /* 0x09 */
  293. U16 Reserved3; /* 0x0A */
  294. } MPI2_PORT_FACTS_REQUEST, MPI2_POINTER PTR_MPI2_PORT_FACTS_REQUEST,
  295. Mpi2PortFactsRequest_t, MPI2_POINTER pMpi2PortFactsRequest_t;
  296. /* PortFacts Reply message */
  297. typedef struct _MPI2_PORT_FACTS_REPLY
  298. {
  299. U16 Reserved1; /* 0x00 */
  300. U8 MsgLength; /* 0x02 */
  301. U8 Function; /* 0x03 */
  302. U16 Reserved2; /* 0x04 */
  303. U8 PortNumber; /* 0x06 */
  304. U8 MsgFlags; /* 0x07 */
  305. U8 VP_ID; /* 0x08 */
  306. U8 VF_ID; /* 0x09 */
  307. U16 Reserved3; /* 0x0A */
  308. U16 Reserved4; /* 0x0C */
  309. U16 IOCStatus; /* 0x0E */
  310. U32 IOCLogInfo; /* 0x10 */
  311. U8 Reserved5; /* 0x14 */
  312. U8 PortType; /* 0x15 */
  313. U16 Reserved6; /* 0x16 */
  314. U16 MaxPostedCmdBuffers; /* 0x18 */
  315. U16 Reserved7; /* 0x1A */
  316. } MPI2_PORT_FACTS_REPLY, MPI2_POINTER PTR_MPI2_PORT_FACTS_REPLY,
  317. Mpi2PortFactsReply_t, MPI2_POINTER pMpi2PortFactsReply_t;
  318. /* PortType values */
  319. #define MPI2_PORTFACTS_PORTTYPE_INACTIVE (0x00)
  320. #define MPI2_PORTFACTS_PORTTYPE_FC (0x10)
  321. #define MPI2_PORTFACTS_PORTTYPE_ISCSI (0x20)
  322. #define MPI2_PORTFACTS_PORTTYPE_SAS_PHYSICAL (0x30)
  323. #define MPI2_PORTFACTS_PORTTYPE_SAS_VIRTUAL (0x31)
  324. /****************************************************************************
  325. * PortEnable message
  326. ****************************************************************************/
  327. /* PortEnable Request message */
  328. typedef struct _MPI2_PORT_ENABLE_REQUEST
  329. {
  330. U16 Reserved1; /* 0x00 */
  331. U8 ChainOffset; /* 0x02 */
  332. U8 Function; /* 0x03 */
  333. U8 Reserved2; /* 0x04 */
  334. U8 PortFlags; /* 0x05 */
  335. U8 Reserved3; /* 0x06 */
  336. U8 MsgFlags; /* 0x07 */
  337. U8 VP_ID; /* 0x08 */
  338. U8 VF_ID; /* 0x09 */
  339. U16 Reserved4; /* 0x0A */
  340. } MPI2_PORT_ENABLE_REQUEST, MPI2_POINTER PTR_MPI2_PORT_ENABLE_REQUEST,
  341. Mpi2PortEnableRequest_t, MPI2_POINTER pMpi2PortEnableRequest_t;
  342. /* PortEnable Reply message */
  343. typedef struct _MPI2_PORT_ENABLE_REPLY
  344. {
  345. U16 Reserved1; /* 0x00 */
  346. U8 MsgLength; /* 0x02 */
  347. U8 Function; /* 0x03 */
  348. U8 Reserved2; /* 0x04 */
  349. U8 PortFlags; /* 0x05 */
  350. U8 Reserved3; /* 0x06 */
  351. U8 MsgFlags; /* 0x07 */
  352. U8 VP_ID; /* 0x08 */
  353. U8 VF_ID; /* 0x09 */
  354. U16 Reserved4; /* 0x0A */
  355. U16 Reserved5; /* 0x0C */
  356. U16 IOCStatus; /* 0x0E */
  357. U32 IOCLogInfo; /* 0x10 */
  358. } MPI2_PORT_ENABLE_REPLY, MPI2_POINTER PTR_MPI2_PORT_ENABLE_REPLY,
  359. Mpi2PortEnableReply_t, MPI2_POINTER pMpi2PortEnableReply_t;
  360. /****************************************************************************
  361. * EventNotification message
  362. ****************************************************************************/
  363. /* EventNotification Request message */
  364. #define MPI2_EVENT_NOTIFY_EVENTMASK_WORDS (4)
  365. typedef struct _MPI2_EVENT_NOTIFICATION_REQUEST
  366. {
  367. U16 Reserved1; /* 0x00 */
  368. U8 ChainOffset; /* 0x02 */
  369. U8 Function; /* 0x03 */
  370. U16 Reserved2; /* 0x04 */
  371. U8 Reserved3; /* 0x06 */
  372. U8 MsgFlags; /* 0x07 */
  373. U8 VP_ID; /* 0x08 */
  374. U8 VF_ID; /* 0x09 */
  375. U16 Reserved4; /* 0x0A */
  376. U32 Reserved5; /* 0x0C */
  377. U32 Reserved6; /* 0x10 */
  378. U32 EventMasks[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS];/* 0x14 */
  379. U16 SASBroadcastPrimitiveMasks; /* 0x24 */
  380. U16 Reserved7; /* 0x26 */
  381. U32 Reserved8; /* 0x28 */
  382. } MPI2_EVENT_NOTIFICATION_REQUEST,
  383. MPI2_POINTER PTR_MPI2_EVENT_NOTIFICATION_REQUEST,
  384. Mpi2EventNotificationRequest_t, MPI2_POINTER pMpi2EventNotificationRequest_t;
  385. /* EventNotification Reply message */
  386. typedef struct _MPI2_EVENT_NOTIFICATION_REPLY
  387. {
  388. U16 EventDataLength; /* 0x00 */
  389. U8 MsgLength; /* 0x02 */
  390. U8 Function; /* 0x03 */
  391. U16 Reserved1; /* 0x04 */
  392. U8 AckRequired; /* 0x06 */
  393. U8 MsgFlags; /* 0x07 */
  394. U8 VP_ID; /* 0x08 */
  395. U8 VF_ID; /* 0x09 */
  396. U16 Reserved2; /* 0x0A */
  397. U16 Reserved3; /* 0x0C */
  398. U16 IOCStatus; /* 0x0E */
  399. U32 IOCLogInfo; /* 0x10 */
  400. U16 Event; /* 0x14 */
  401. U16 Reserved4; /* 0x16 */
  402. U32 EventContext; /* 0x18 */
  403. U32 EventData[1]; /* 0x1C */
  404. } MPI2_EVENT_NOTIFICATION_REPLY, MPI2_POINTER PTR_MPI2_EVENT_NOTIFICATION_REPLY,
  405. Mpi2EventNotificationReply_t, MPI2_POINTER pMpi2EventNotificationReply_t;
  406. /* AckRequired */
  407. #define MPI2_EVENT_NOTIFICATION_ACK_NOT_REQUIRED (0x00)
  408. #define MPI2_EVENT_NOTIFICATION_ACK_REQUIRED (0x01)
  409. /* Event */
  410. #define MPI2_EVENT_LOG_DATA (0x0001)
  411. #define MPI2_EVENT_STATE_CHANGE (0x0002)
  412. #define MPI2_EVENT_HARD_RESET_RECEIVED (0x0005)
  413. #define MPI2_EVENT_EVENT_CHANGE (0x000A)
  414. #define MPI2_EVENT_TASK_SET_FULL (0x000E)
  415. #define MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE (0x000F)
  416. #define MPI2_EVENT_IR_OPERATION_STATUS (0x0014)
  417. #define MPI2_EVENT_SAS_DISCOVERY (0x0016)
  418. #define MPI2_EVENT_SAS_BROADCAST_PRIMITIVE (0x0017)
  419. #define MPI2_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE (0x0018)
  420. #define MPI2_EVENT_SAS_INIT_TABLE_OVERFLOW (0x0019)
  421. #define MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST (0x001C)
  422. #define MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE (0x001D)
  423. #define MPI2_EVENT_IR_VOLUME (0x001E)
  424. #define MPI2_EVENT_IR_PHYSICAL_DISK (0x001F)
  425. #define MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST (0x0020)
  426. #define MPI2_EVENT_LOG_ENTRY_ADDED (0x0021)
  427. #define MPI2_EVENT_SAS_PHY_COUNTER (0x0022)
  428. #define MPI2_EVENT_GPIO_INTERRUPT (0x0023)
  429. #define MPI2_EVENT_HOST_BASED_DISCOVERY_PHY (0x0024)
  430. /* Log Entry Added Event data */
  431. /* the following structure matches MPI2_LOG_0_ENTRY in mpi2_cnfg.h */
  432. #define MPI2_EVENT_DATA_LOG_DATA_LENGTH (0x1C)
  433. typedef struct _MPI2_EVENT_DATA_LOG_ENTRY_ADDED
  434. {
  435. U64 TimeStamp; /* 0x00 */
  436. U32 Reserved1; /* 0x08 */
  437. U16 LogSequence; /* 0x0C */
  438. U16 LogEntryQualifier; /* 0x0E */
  439. U8 VP_ID; /* 0x10 */
  440. U8 VF_ID; /* 0x11 */
  441. U16 Reserved2; /* 0x12 */
  442. U8 LogData[MPI2_EVENT_DATA_LOG_DATA_LENGTH];/* 0x14 */
  443. } MPI2_EVENT_DATA_LOG_ENTRY_ADDED,
  444. MPI2_POINTER PTR_MPI2_EVENT_DATA_LOG_ENTRY_ADDED,
  445. Mpi2EventDataLogEntryAdded_t, MPI2_POINTER pMpi2EventDataLogEntryAdded_t;
  446. /* GPIO Interrupt Event data */
  447. typedef struct _MPI2_EVENT_DATA_GPIO_INTERRUPT {
  448. U8 GPIONum; /* 0x00 */
  449. U8 Reserved1; /* 0x01 */
  450. U16 Reserved2; /* 0x02 */
  451. } MPI2_EVENT_DATA_GPIO_INTERRUPT,
  452. MPI2_POINTER PTR_MPI2_EVENT_DATA_GPIO_INTERRUPT,
  453. Mpi2EventDataGpioInterrupt_t, MPI2_POINTER pMpi2EventDataGpioInterrupt_t;
  454. /* Hard Reset Received Event data */
  455. typedef struct _MPI2_EVENT_DATA_HARD_RESET_RECEIVED
  456. {
  457. U8 Reserved1; /* 0x00 */
  458. U8 Port; /* 0x01 */
  459. U16 Reserved2; /* 0x02 */
  460. } MPI2_EVENT_DATA_HARD_RESET_RECEIVED,
  461. MPI2_POINTER PTR_MPI2_EVENT_DATA_HARD_RESET_RECEIVED,
  462. Mpi2EventDataHardResetReceived_t,
  463. MPI2_POINTER pMpi2EventDataHardResetReceived_t;
  464. /* Task Set Full Event data */
  465. typedef struct _MPI2_EVENT_DATA_TASK_SET_FULL
  466. {
  467. U16 DevHandle; /* 0x00 */
  468. U16 CurrentDepth; /* 0x02 */
  469. } MPI2_EVENT_DATA_TASK_SET_FULL, MPI2_POINTER PTR_MPI2_EVENT_DATA_TASK_SET_FULL,
  470. Mpi2EventDataTaskSetFull_t, MPI2_POINTER pMpi2EventDataTaskSetFull_t;
  471. /* SAS Device Status Change Event data */
  472. typedef struct _MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE
  473. {
  474. U16 TaskTag; /* 0x00 */
  475. U8 ReasonCode; /* 0x02 */
  476. U8 Reserved1; /* 0x03 */
  477. U8 ASC; /* 0x04 */
  478. U8 ASCQ; /* 0x05 */
  479. U16 DevHandle; /* 0x06 */
  480. U32 Reserved2; /* 0x08 */
  481. U64 SASAddress; /* 0x0C */
  482. U8 LUN[8]; /* 0x14 */
  483. } MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
  484. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE,
  485. Mpi2EventDataSasDeviceStatusChange_t,
  486. MPI2_POINTER pMpi2EventDataSasDeviceStatusChange_t;
  487. /* SAS Device Status Change Event data ReasonCode values */
  488. #define MPI2_EVENT_SAS_DEV_STAT_RC_SMART_DATA (0x05)
  489. #define MPI2_EVENT_SAS_DEV_STAT_RC_UNSUPPORTED (0x07)
  490. #define MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET (0x08)
  491. #define MPI2_EVENT_SAS_DEV_STAT_RC_TASK_ABORT_INTERNAL (0x09)
  492. #define MPI2_EVENT_SAS_DEV_STAT_RC_ABORT_TASK_SET_INTERNAL (0x0A)
  493. #define MPI2_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B)
  494. #define MPI2_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C)
  495. #define MPI2_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION (0x0D)
  496. #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET (0x0E)
  497. #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_TASK_ABORT_INTERNAL (0x0F)
  498. #define MPI2_EVENT_SAS_DEV_STAT_RC_SATA_INIT_FAILURE (0x10)
  499. #define MPI2_EVENT_SAS_DEV_STAT_RC_EXPANDER_REDUCED_FUNCTIONALITY (0x11)
  500. #define MPI2_EVENT_SAS_DEV_STAT_RC_CMP_EXPANDER_REDUCED_FUNCTIONALITY (0x12)
  501. /* Integrated RAID Operation Status Event data */
  502. typedef struct _MPI2_EVENT_DATA_IR_OPERATION_STATUS
  503. {
  504. U16 VolDevHandle; /* 0x00 */
  505. U16 Reserved1; /* 0x02 */
  506. U8 RAIDOperation; /* 0x04 */
  507. U8 PercentComplete; /* 0x05 */
  508. U16 Reserved2; /* 0x06 */
  509. U32 Resereved3; /* 0x08 */
  510. } MPI2_EVENT_DATA_IR_OPERATION_STATUS,
  511. MPI2_POINTER PTR_MPI2_EVENT_DATA_IR_OPERATION_STATUS,
  512. Mpi2EventDataIrOperationStatus_t,
  513. MPI2_POINTER pMpi2EventDataIrOperationStatus_t;
  514. /* Integrated RAID Operation Status Event data RAIDOperation values */
  515. #define MPI2_EVENT_IR_RAIDOP_RESYNC (0x00)
  516. #define MPI2_EVENT_IR_RAIDOP_ONLINE_CAP_EXPANSION (0x01)
  517. #define MPI2_EVENT_IR_RAIDOP_CONSISTENCY_CHECK (0x02)
  518. #define MPI2_EVENT_IR_RAIDOP_BACKGROUND_INIT (0x03)
  519. #define MPI2_EVENT_IR_RAIDOP_MAKE_DATA_CONSISTENT (0x04)
  520. /* Integrated RAID Volume Event data */
  521. typedef struct _MPI2_EVENT_DATA_IR_VOLUME
  522. {
  523. U16 VolDevHandle; /* 0x00 */
  524. U8 ReasonCode; /* 0x02 */
  525. U8 Reserved1; /* 0x03 */
  526. U32 NewValue; /* 0x04 */
  527. U32 PreviousValue; /* 0x08 */
  528. } MPI2_EVENT_DATA_IR_VOLUME, MPI2_POINTER PTR_MPI2_EVENT_DATA_IR_VOLUME,
  529. Mpi2EventDataIrVolume_t, MPI2_POINTER pMpi2EventDataIrVolume_t;
  530. /* Integrated RAID Volume Event data ReasonCode values */
  531. #define MPI2_EVENT_IR_VOLUME_RC_SETTINGS_CHANGED (0x01)
  532. #define MPI2_EVENT_IR_VOLUME_RC_STATUS_FLAGS_CHANGED (0x02)
  533. #define MPI2_EVENT_IR_VOLUME_RC_STATE_CHANGED (0x03)
  534. /* Integrated RAID Physical Disk Event data */
  535. typedef struct _MPI2_EVENT_DATA_IR_PHYSICAL_DISK
  536. {
  537. U16 Reserved1; /* 0x00 */
  538. U8 ReasonCode; /* 0x02 */
  539. U8 PhysDiskNum; /* 0x03 */
  540. U16 PhysDiskDevHandle; /* 0x04 */
  541. U16 Reserved2; /* 0x06 */
  542. U16 Slot; /* 0x08 */
  543. U16 EnclosureHandle; /* 0x0A */
  544. U32 NewValue; /* 0x0C */
  545. U32 PreviousValue; /* 0x10 */
  546. } MPI2_EVENT_DATA_IR_PHYSICAL_DISK,
  547. MPI2_POINTER PTR_MPI2_EVENT_DATA_IR_PHYSICAL_DISK,
  548. Mpi2EventDataIrPhysicalDisk_t, MPI2_POINTER pMpi2EventDataIrPhysicalDisk_t;
  549. /* Integrated RAID Physical Disk Event data ReasonCode values */
  550. #define MPI2_EVENT_IR_PHYSDISK_RC_SETTINGS_CHANGED (0x01)
  551. #define MPI2_EVENT_IR_PHYSDISK_RC_STATUS_FLAGS_CHANGED (0x02)
  552. #define MPI2_EVENT_IR_PHYSDISK_RC_STATE_CHANGED (0x03)
  553. /* Integrated RAID Configuration Change List Event data */
  554. /*
  555. * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
  556. * one and check NumElements at runtime.
  557. */
  558. #ifndef MPI2_EVENT_IR_CONFIG_ELEMENT_COUNT
  559. #define MPI2_EVENT_IR_CONFIG_ELEMENT_COUNT (1)
  560. #endif
  561. typedef struct _MPI2_EVENT_IR_CONFIG_ELEMENT
  562. {
  563. U16 ElementFlags; /* 0x00 */
  564. U16 VolDevHandle; /* 0x02 */
  565. U8 ReasonCode; /* 0x04 */
  566. U8 PhysDiskNum; /* 0x05 */
  567. U16 PhysDiskDevHandle; /* 0x06 */
  568. } MPI2_EVENT_IR_CONFIG_ELEMENT, MPI2_POINTER PTR_MPI2_EVENT_IR_CONFIG_ELEMENT,
  569. Mpi2EventIrConfigElement_t, MPI2_POINTER pMpi2EventIrConfigElement_t;
  570. /* IR Configuration Change List Event data ElementFlags values */
  571. #define MPI2_EVENT_IR_CHANGE_EFLAGS_ELEMENT_TYPE_MASK (0x000F)
  572. #define MPI2_EVENT_IR_CHANGE_EFLAGS_VOLUME_ELEMENT (0x0000)
  573. #define MPI2_EVENT_IR_CHANGE_EFLAGS_VOLPHYSDISK_ELEMENT (0x0001)
  574. #define MPI2_EVENT_IR_CHANGE_EFLAGS_HOTSPARE_ELEMENT (0x0002)
  575. /* IR Configuration Change List Event data ReasonCode values */
  576. #define MPI2_EVENT_IR_CHANGE_RC_ADDED (0x01)
  577. #define MPI2_EVENT_IR_CHANGE_RC_REMOVED (0x02)
  578. #define MPI2_EVENT_IR_CHANGE_RC_NO_CHANGE (0x03)
  579. #define MPI2_EVENT_IR_CHANGE_RC_HIDE (0x04)
  580. #define MPI2_EVENT_IR_CHANGE_RC_UNHIDE (0x05)
  581. #define MPI2_EVENT_IR_CHANGE_RC_VOLUME_CREATED (0x06)
  582. #define MPI2_EVENT_IR_CHANGE_RC_VOLUME_DELETED (0x07)
  583. #define MPI2_EVENT_IR_CHANGE_RC_PD_CREATED (0x08)
  584. #define MPI2_EVENT_IR_CHANGE_RC_PD_DELETED (0x09)
  585. typedef struct _MPI2_EVENT_DATA_IR_CONFIG_CHANGE_LIST
  586. {
  587. U8 NumElements; /* 0x00 */
  588. U8 Reserved1; /* 0x01 */
  589. U8 Reserved2; /* 0x02 */
  590. U8 ConfigNum; /* 0x03 */
  591. U32 Flags; /* 0x04 */
  592. MPI2_EVENT_IR_CONFIG_ELEMENT ConfigElement[MPI2_EVENT_IR_CONFIG_ELEMENT_COUNT]; /* 0x08 */
  593. } MPI2_EVENT_DATA_IR_CONFIG_CHANGE_LIST,
  594. MPI2_POINTER PTR_MPI2_EVENT_DATA_IR_CONFIG_CHANGE_LIST,
  595. Mpi2EventDataIrConfigChangeList_t,
  596. MPI2_POINTER pMpi2EventDataIrConfigChangeList_t;
  597. /* IR Configuration Change List Event data Flags values */
  598. #define MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG (0x00000001)
  599. /* SAS Discovery Event data */
  600. typedef struct _MPI2_EVENT_DATA_SAS_DISCOVERY
  601. {
  602. U8 Flags; /* 0x00 */
  603. U8 ReasonCode; /* 0x01 */
  604. U8 PhysicalPort; /* 0x02 */
  605. U8 Reserved1; /* 0x03 */
  606. U32 DiscoveryStatus; /* 0x04 */
  607. } MPI2_EVENT_DATA_SAS_DISCOVERY,
  608. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_DISCOVERY,
  609. Mpi2EventDataSasDiscovery_t, MPI2_POINTER pMpi2EventDataSasDiscovery_t;
  610. /* SAS Discovery Event data Flags values */
  611. #define MPI2_EVENT_SAS_DISC_DEVICE_CHANGE (0x02)
  612. #define MPI2_EVENT_SAS_DISC_IN_PROGRESS (0x01)
  613. /* SAS Discovery Event data ReasonCode values */
  614. #define MPI2_EVENT_SAS_DISC_RC_STARTED (0x01)
  615. #define MPI2_EVENT_SAS_DISC_RC_COMPLETED (0x02)
  616. /* SAS Discovery Event data DiscoveryStatus values */
  617. #define MPI2_EVENT_SAS_DISC_DS_MAX_ENCLOSURES_EXCEED (0x80000000)
  618. #define MPI2_EVENT_SAS_DISC_DS_MAX_EXPANDERS_EXCEED (0x40000000)
  619. #define MPI2_EVENT_SAS_DISC_DS_MAX_DEVICES_EXCEED (0x20000000)
  620. #define MPI2_EVENT_SAS_DISC_DS_MAX_TOPO_PHYS_EXCEED (0x10000000)
  621. #define MPI2_EVENT_SAS_DISC_DS_DOWNSTREAM_INITIATOR (0x08000000)
  622. #define MPI2_EVENT_SAS_DISC_DS_MULTI_SUBTRACTIVE_SUBTRACTIVE (0x00008000)
  623. #define MPI2_EVENT_SAS_DISC_DS_EXP_MULTI_SUBTRACTIVE (0x00004000)
  624. #define MPI2_EVENT_SAS_DISC_DS_MULTI_PORT_DOMAIN (0x00002000)
  625. #define MPI2_EVENT_SAS_DISC_DS_TABLE_TO_SUBTRACTIVE_LINK (0x00001000)
  626. #define MPI2_EVENT_SAS_DISC_DS_UNSUPPORTED_DEVICE (0x00000800)
  627. #define MPI2_EVENT_SAS_DISC_DS_TABLE_LINK (0x00000400)
  628. #define MPI2_EVENT_SAS_DISC_DS_SUBTRACTIVE_LINK (0x00000200)
  629. #define MPI2_EVENT_SAS_DISC_DS_SMP_CRC_ERROR (0x00000100)
  630. #define MPI2_EVENT_SAS_DISC_DS_SMP_FUNCTION_FAILED (0x00000080)
  631. #define MPI2_EVENT_SAS_DISC_DS_INDEX_NOT_EXIST (0x00000040)
  632. #define MPI2_EVENT_SAS_DISC_DS_OUT_ROUTE_ENTRIES (0x00000020)
  633. #define MPI2_EVENT_SAS_DISC_DS_SMP_TIMEOUT (0x00000010)
  634. #define MPI2_EVENT_SAS_DISC_DS_MULTIPLE_PORTS (0x00000004)
  635. #define MPI2_EVENT_SAS_DISC_DS_UNADDRESSABLE_DEVICE (0x00000002)
  636. #define MPI2_EVENT_SAS_DISC_DS_LOOP_DETECTED (0x00000001)
  637. /* SAS Broadcast Primitive Event data */
  638. typedef struct _MPI2_EVENT_DATA_SAS_BROADCAST_PRIMITIVE
  639. {
  640. U8 PhyNum; /* 0x00 */
  641. U8 Port; /* 0x01 */
  642. U8 PortWidth; /* 0x02 */
  643. U8 Primitive; /* 0x03 */
  644. } MPI2_EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
  645. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_BROADCAST_PRIMITIVE,
  646. Mpi2EventDataSasBroadcastPrimitive_t,
  647. MPI2_POINTER pMpi2EventDataSasBroadcastPrimitive_t;
  648. /* defines for the Primitive field */
  649. #define MPI2_EVENT_PRIMITIVE_CHANGE (0x01)
  650. #define MPI2_EVENT_PRIMITIVE_SES (0x02)
  651. #define MPI2_EVENT_PRIMITIVE_EXPANDER (0x03)
  652. #define MPI2_EVENT_PRIMITIVE_ASYNCHRONOUS_EVENT (0x04)
  653. #define MPI2_EVENT_PRIMITIVE_RESERVED3 (0x05)
  654. #define MPI2_EVENT_PRIMITIVE_RESERVED4 (0x06)
  655. #define MPI2_EVENT_PRIMITIVE_CHANGE0_RESERVED (0x07)
  656. #define MPI2_EVENT_PRIMITIVE_CHANGE1_RESERVED (0x08)
  657. /* SAS Initiator Device Status Change Event data */
  658. typedef struct _MPI2_EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE
  659. {
  660. U8 ReasonCode; /* 0x00 */
  661. U8 PhysicalPort; /* 0x01 */
  662. U16 DevHandle; /* 0x02 */
  663. U64 SASAddress; /* 0x04 */
  664. } MPI2_EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
  665. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_INIT_DEV_STATUS_CHANGE,
  666. Mpi2EventDataSasInitDevStatusChange_t,
  667. MPI2_POINTER pMpi2EventDataSasInitDevStatusChange_t;
  668. /* SAS Initiator Device Status Change event ReasonCode values */
  669. #define MPI2_EVENT_SAS_INIT_RC_ADDED (0x01)
  670. #define MPI2_EVENT_SAS_INIT_RC_NOT_RESPONDING (0x02)
  671. /* SAS Initiator Device Table Overflow Event data */
  672. typedef struct _MPI2_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW
  673. {
  674. U16 MaxInit; /* 0x00 */
  675. U16 CurrentInit; /* 0x02 */
  676. U64 SASAddress; /* 0x04 */
  677. } MPI2_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
  678. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW,
  679. Mpi2EventDataSasInitTableOverflow_t,
  680. MPI2_POINTER pMpi2EventDataSasInitTableOverflow_t;
  681. /* SAS Topology Change List Event data */
  682. /*
  683. * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
  684. * one and check NumEntries at runtime.
  685. */
  686. #ifndef MPI2_EVENT_SAS_TOPO_PHY_COUNT
  687. #define MPI2_EVENT_SAS_TOPO_PHY_COUNT (1)
  688. #endif
  689. typedef struct _MPI2_EVENT_SAS_TOPO_PHY_ENTRY
  690. {
  691. U16 AttachedDevHandle; /* 0x00 */
  692. U8 LinkRate; /* 0x02 */
  693. U8 PhyStatus; /* 0x03 */
  694. } MPI2_EVENT_SAS_TOPO_PHY_ENTRY, MPI2_POINTER PTR_MPI2_EVENT_SAS_TOPO_PHY_ENTRY,
  695. Mpi2EventSasTopoPhyEntry_t, MPI2_POINTER pMpi2EventSasTopoPhyEntry_t;
  696. typedef struct _MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST
  697. {
  698. U16 EnclosureHandle; /* 0x00 */
  699. U16 ExpanderDevHandle; /* 0x02 */
  700. U8 NumPhys; /* 0x04 */
  701. U8 Reserved1; /* 0x05 */
  702. U16 Reserved2; /* 0x06 */
  703. U8 NumEntries; /* 0x08 */
  704. U8 StartPhyNum; /* 0x09 */
  705. U8 ExpStatus; /* 0x0A */
  706. U8 PhysicalPort; /* 0x0B */
  707. MPI2_EVENT_SAS_TOPO_PHY_ENTRY PHY[MPI2_EVENT_SAS_TOPO_PHY_COUNT]; /* 0x0C*/
  708. } MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST,
  709. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST,
  710. Mpi2EventDataSasTopologyChangeList_t,
  711. MPI2_POINTER pMpi2EventDataSasTopologyChangeList_t;
  712. /* values for the ExpStatus field */
  713. #define MPI2_EVENT_SAS_TOPO_ES_NO_EXPANDER (0x00)
  714. #define MPI2_EVENT_SAS_TOPO_ES_ADDED (0x01)
  715. #define MPI2_EVENT_SAS_TOPO_ES_NOT_RESPONDING (0x02)
  716. #define MPI2_EVENT_SAS_TOPO_ES_RESPONDING (0x03)
  717. #define MPI2_EVENT_SAS_TOPO_ES_DELAY_NOT_RESPONDING (0x04)
  718. /* defines for the LinkRate field */
  719. #define MPI2_EVENT_SAS_TOPO_LR_CURRENT_MASK (0xF0)
  720. #define MPI2_EVENT_SAS_TOPO_LR_CURRENT_SHIFT (4)
  721. #define MPI2_EVENT_SAS_TOPO_LR_PREV_MASK (0x0F)
  722. #define MPI2_EVENT_SAS_TOPO_LR_PREV_SHIFT (0)
  723. #define MPI2_EVENT_SAS_TOPO_LR_UNKNOWN_LINK_RATE (0x00)
  724. #define MPI2_EVENT_SAS_TOPO_LR_PHY_DISABLED (0x01)
  725. #define MPI2_EVENT_SAS_TOPO_LR_NEGOTIATION_FAILED (0x02)
  726. #define MPI2_EVENT_SAS_TOPO_LR_SATA_OOB_COMPLETE (0x03)
  727. #define MPI2_EVENT_SAS_TOPO_LR_PORT_SELECTOR (0x04)
  728. #define MPI2_EVENT_SAS_TOPO_LR_SMP_RESET_IN_PROGRESS (0x05)
  729. #define MPI2_EVENT_SAS_TOPO_LR_RATE_1_5 (0x08)
  730. #define MPI2_EVENT_SAS_TOPO_LR_RATE_3_0 (0x09)
  731. #define MPI2_EVENT_SAS_TOPO_LR_RATE_6_0 (0x0A)
  732. /* values for the PhyStatus field */
  733. #define MPI2_EVENT_SAS_TOPO_PHYSTATUS_VACANT (0x80)
  734. #define MPI2_EVENT_SAS_TOPO_PS_MULTIPLEX_CHANGE (0x10)
  735. /* values for the PhyStatus ReasonCode sub-field */
  736. #define MPI2_EVENT_SAS_TOPO_RC_MASK (0x0F)
  737. #define MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED (0x01)
  738. #define MPI2_EVENT_SAS_TOPO_RC_TARG_NOT_RESPONDING (0x02)
  739. #define MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED (0x03)
  740. #define MPI2_EVENT_SAS_TOPO_RC_NO_CHANGE (0x04)
  741. #define MPI2_EVENT_SAS_TOPO_RC_DELAY_NOT_RESPONDING (0x05)
  742. /* SAS Enclosure Device Status Change Event data */
  743. typedef struct _MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE
  744. {
  745. U16 EnclosureHandle; /* 0x00 */
  746. U8 ReasonCode; /* 0x02 */
  747. U8 PhysicalPort; /* 0x03 */
  748. U64 EnclosureLogicalID; /* 0x04 */
  749. U16 NumSlots; /* 0x0C */
  750. U16 StartSlot; /* 0x0E */
  751. U32 PhyBits; /* 0x10 */
  752. } MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE,
  753. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE,
  754. Mpi2EventDataSasEnclDevStatusChange_t,
  755. MPI2_POINTER pMpi2EventDataSasEnclDevStatusChange_t;
  756. /* SAS Enclosure Device Status Change event ReasonCode values */
  757. #define MPI2_EVENT_SAS_ENCL_RC_ADDED (0x01)
  758. #define MPI2_EVENT_SAS_ENCL_RC_NOT_RESPONDING (0x02)
  759. /* SAS PHY Counter Event data */
  760. typedef struct _MPI2_EVENT_DATA_SAS_PHY_COUNTER {
  761. U64 TimeStamp; /* 0x00 */
  762. U32 Reserved1; /* 0x08 */
  763. U8 PhyEventCode; /* 0x0C */
  764. U8 PhyNum; /* 0x0D */
  765. U16 Reserved2; /* 0x0E */
  766. U32 PhyEventInfo; /* 0x10 */
  767. U8 CounterType; /* 0x14 */
  768. U8 ThresholdWindow; /* 0x15 */
  769. U8 TimeUnits; /* 0x16 */
  770. U8 Reserved3; /* 0x17 */
  771. U32 EventThreshold; /* 0x18 */
  772. U16 ThresholdFlags; /* 0x1C */
  773. U16 Reserved4; /* 0x1E */
  774. } MPI2_EVENT_DATA_SAS_PHY_COUNTER,
  775. MPI2_POINTER PTR_MPI2_EVENT_DATA_SAS_PHY_COUNTER,
  776. Mpi2EventDataSasPhyCounter_t, MPI2_POINTER pMpi2EventDataSasPhyCounter_t;
  777. /* use MPI2_SASPHY3_EVENT_CODE_ values from mpi2_cnfg.h for the
  778. * PhyEventCode field
  779. * use MPI2_SASPHY3_COUNTER_TYPE_ values from mpi2_cnfg.h for the
  780. * CounterType field
  781. * use MPI2_SASPHY3_TIME_UNITS_ values from mpi2_cnfg.h for the
  782. * TimeUnits field
  783. * use MPI2_SASPHY3_TFLAGS_ values from mpi2_cnfg.h for the
  784. * ThresholdFlags field
  785. * */
  786. /* Host Based Discovery Phy Event data */
  787. typedef struct _MPI2_EVENT_HBD_PHY_SAS {
  788. U8 Flags; /* 0x00 */
  789. U8 NegotiatedLinkRate; /* 0x01 */
  790. U8 PhyNum; /* 0x02 */
  791. U8 PhysicalPort; /* 0x03 */
  792. U32 Reserved1; /* 0x04 */
  793. U8 InitialFrame[28]; /* 0x08 */
  794. } MPI2_EVENT_HBD_PHY_SAS, MPI2_POINTER PTR_MPI2_EVENT_HBD_PHY_SAS,
  795. Mpi2EventHbdPhySas_t, MPI2_POINTER pMpi2EventHbdPhySas_t;
  796. /* values for the Flags field */
  797. #define MPI2_EVENT_HBD_SAS_FLAGS_FRAME_VALID (0x02)
  798. #define MPI2_EVENT_HBD_SAS_FLAGS_SATA_FRAME (0x01)
  799. /* use MPI2_SAS_NEG_LINK_RATE_ defines from mpi2_cnfg.h for
  800. * the NegotiatedLinkRate field */
  801. typedef union _MPI2_EVENT_HBD_DESCRIPTOR {
  802. MPI2_EVENT_HBD_PHY_SAS Sas;
  803. } MPI2_EVENT_HBD_DESCRIPTOR, MPI2_POINTER PTR_MPI2_EVENT_HBD_DESCRIPTOR,
  804. Mpi2EventHbdDescriptor_t, MPI2_POINTER pMpi2EventHbdDescriptor_t;
  805. typedef struct _MPI2_EVENT_DATA_HBD_PHY {
  806. U8 DescriptorType; /* 0x00 */
  807. U8 Reserved1; /* 0x01 */
  808. U16 Reserved2; /* 0x02 */
  809. U32 Reserved3; /* 0x04 */
  810. MPI2_EVENT_HBD_DESCRIPTOR Descriptor; /* 0x08 */
  811. } MPI2_EVENT_DATA_HBD_PHY, MPI2_POINTER PTR_MPI2_EVENT_DATA_HBD_PHY,
  812. Mpi2EventDataHbdPhy_t, MPI2_POINTER pMpi2EventDataMpi2EventDataHbdPhy_t;
  813. /* values for the DescriptorType field */
  814. #define MPI2_EVENT_HBD_DT_SAS (0x01)
  815. /****************************************************************************
  816. * EventAck message
  817. ****************************************************************************/
  818. /* EventAck Request message */
  819. typedef struct _MPI2_EVENT_ACK_REQUEST
  820. {
  821. U16 Reserved1; /* 0x00 */
  822. U8 ChainOffset; /* 0x02 */
  823. U8 Function; /* 0x03 */
  824. U16 Reserved2; /* 0x04 */
  825. U8 Reserved3; /* 0x06 */
  826. U8 MsgFlags; /* 0x07 */
  827. U8 VP_ID; /* 0x08 */
  828. U8 VF_ID; /* 0x09 */
  829. U16 Reserved4; /* 0x0A */
  830. U16 Event; /* 0x0C */
  831. U16 Reserved5; /* 0x0E */
  832. U32 EventContext; /* 0x10 */
  833. } MPI2_EVENT_ACK_REQUEST, MPI2_POINTER PTR_MPI2_EVENT_ACK_REQUEST,
  834. Mpi2EventAckRequest_t, MPI2_POINTER pMpi2EventAckRequest_t;
  835. /* EventAck Reply message */
  836. typedef struct _MPI2_EVENT_ACK_REPLY
  837. {
  838. U16 Reserved1; /* 0x00 */
  839. U8 MsgLength; /* 0x02 */
  840. U8 Function; /* 0x03 */
  841. U16 Reserved2; /* 0x04 */
  842. U8 Reserved3; /* 0x06 */
  843. U8 MsgFlags; /* 0x07 */
  844. U8 VP_ID; /* 0x08 */
  845. U8 VF_ID; /* 0x09 */
  846. U16 Reserved4; /* 0x0A */
  847. U16 Reserved5; /* 0x0C */
  848. U16 IOCStatus; /* 0x0E */
  849. U32 IOCLogInfo; /* 0x10 */
  850. } MPI2_EVENT_ACK_REPLY, MPI2_POINTER PTR_MPI2_EVENT_ACK_REPLY,
  851. Mpi2EventAckReply_t, MPI2_POINTER pMpi2EventAckReply_t;
  852. /****************************************************************************
  853. * FWDownload message
  854. ****************************************************************************/
  855. /* FWDownload Request message */
  856. typedef struct _MPI2_FW_DOWNLOAD_REQUEST
  857. {
  858. U8 ImageType; /* 0x00 */
  859. U8 Reserved1; /* 0x01 */
  860. U8 ChainOffset; /* 0x02 */
  861. U8 Function; /* 0x03 */
  862. U16 Reserved2; /* 0x04 */
  863. U8 Reserved3; /* 0x06 */
  864. U8 MsgFlags; /* 0x07 */
  865. U8 VP_ID; /* 0x08 */
  866. U8 VF_ID; /* 0x09 */
  867. U16 Reserved4; /* 0x0A */
  868. U32 TotalImageSize; /* 0x0C */
  869. U32 Reserved5; /* 0x10 */
  870. MPI2_MPI_SGE_UNION SGL; /* 0x14 */
  871. } MPI2_FW_DOWNLOAD_REQUEST, MPI2_POINTER PTR_MPI2_FW_DOWNLOAD_REQUEST,
  872. Mpi2FWDownloadRequest, MPI2_POINTER pMpi2FWDownloadRequest;
  873. #define MPI2_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT (0x01)
  874. #define MPI2_FW_DOWNLOAD_ITYPE_FW (0x01)
  875. #define MPI2_FW_DOWNLOAD_ITYPE_BIOS (0x02)
  876. #define MPI2_FW_DOWNLOAD_ITYPE_MANUFACTURING (0x06)
  877. #define MPI2_FW_DOWNLOAD_ITYPE_CONFIG_1 (0x07)
  878. #define MPI2_FW_DOWNLOAD_ITYPE_CONFIG_2 (0x08)
  879. #define MPI2_FW_DOWNLOAD_ITYPE_MEGARAID (0x09)
  880. #define MPI2_FW_DOWNLOAD_ITYPE_COMMON_BOOT_BLOCK (0x0B)
  881. /* FWDownload TransactionContext Element */
  882. typedef struct _MPI2_FW_DOWNLOAD_TCSGE
  883. {
  884. U8 Reserved1; /* 0x00 */
  885. U8 ContextSize; /* 0x01 */
  886. U8 DetailsLength; /* 0x02 */
  887. U8 Flags; /* 0x03 */
  888. U32 Reserved2; /* 0x04 */
  889. U32 ImageOffset; /* 0x08 */
  890. U32 ImageSize; /* 0x0C */
  891. } MPI2_FW_DOWNLOAD_TCSGE, MPI2_POINTER PTR_MPI2_FW_DOWNLOAD_TCSGE,
  892. Mpi2FWDownloadTCSGE_t, MPI2_POINTER pMpi2FWDownloadTCSGE_t;
  893. /* FWDownload Reply message */
  894. typedef struct _MPI2_FW_DOWNLOAD_REPLY
  895. {
  896. U8 ImageType; /* 0x00 */
  897. U8 Reserved1; /* 0x01 */
  898. U8 MsgLength; /* 0x02 */
  899. U8 Function; /* 0x03 */
  900. U16 Reserved2; /* 0x04 */
  901. U8 Reserved3; /* 0x06 */
  902. U8 MsgFlags; /* 0x07 */
  903. U8 VP_ID; /* 0x08 */
  904. U8 VF_ID; /* 0x09 */
  905. U16 Reserved4; /* 0x0A */
  906. U16 Reserved5; /* 0x0C */
  907. U16 IOCStatus; /* 0x0E */
  908. U32 IOCLogInfo; /* 0x10 */
  909. } MPI2_FW_DOWNLOAD_REPLY, MPI2_POINTER PTR_MPI2_FW_DOWNLOAD_REPLY,
  910. Mpi2FWDownloadReply_t, MPI2_POINTER pMpi2FWDownloadReply_t;
  911. /****************************************************************************
  912. * FWUpload message
  913. ****************************************************************************/
  914. /* FWUpload Request message */
  915. typedef struct _MPI2_FW_UPLOAD_REQUEST
  916. {
  917. U8 ImageType; /* 0x00 */
  918. U8 Reserved1; /* 0x01 */
  919. U8 ChainOffset; /* 0x02 */
  920. U8 Function; /* 0x03 */
  921. U16 Reserved2; /* 0x04 */
  922. U8 Reserved3; /* 0x06 */
  923. U8 MsgFlags; /* 0x07 */
  924. U8 VP_ID; /* 0x08 */
  925. U8 VF_ID; /* 0x09 */
  926. U16 Reserved4; /* 0x0A */
  927. U32 Reserved5; /* 0x0C */
  928. U32 Reserved6; /* 0x10 */
  929. MPI2_MPI_SGE_UNION SGL; /* 0x14 */
  930. } MPI2_FW_UPLOAD_REQUEST, MPI2_POINTER PTR_MPI2_FW_UPLOAD_REQUEST,
  931. Mpi2FWUploadRequest_t, MPI2_POINTER pMpi2FWUploadRequest_t;
  932. #define MPI2_FW_UPLOAD_ITYPE_FW_CURRENT (0x00)
  933. #define MPI2_FW_UPLOAD_ITYPE_FW_FLASH (0x01)
  934. #define MPI2_FW_UPLOAD_ITYPE_BIOS_FLASH (0x02)
  935. #define MPI2_FW_UPLOAD_ITYPE_FW_BACKUP (0x05)
  936. #define MPI2_FW_UPLOAD_ITYPE_MANUFACTURING (0x06)
  937. #define MPI2_FW_UPLOAD_ITYPE_CONFIG_1 (0x07)
  938. #define MPI2_FW_UPLOAD_ITYPE_CONFIG_2 (0x08)
  939. #define MPI2_FW_UPLOAD_ITYPE_MEGARAID (0x09)
  940. #define MPI2_FW_UPLOAD_ITYPE_COMPLETE (0x0A)
  941. #define MPI2_FW_UPLOAD_ITYPE_COMMON_BOOT_BLOCK (0x0B)
  942. typedef struct _MPI2_FW_UPLOAD_TCSGE
  943. {
  944. U8 Reserved1; /* 0x00 */
  945. U8 ContextSize; /* 0x01 */
  946. U8 DetailsLength; /* 0x02 */
  947. U8 Flags; /* 0x03 */
  948. U32 Reserved2; /* 0x04 */
  949. U32 ImageOffset; /* 0x08 */
  950. U32 ImageSize; /* 0x0C */
  951. } MPI2_FW_UPLOAD_TCSGE, MPI2_POINTER PTR_MPI2_FW_UPLOAD_TCSGE,
  952. Mpi2FWUploadTCSGE_t, MPI2_POINTER pMpi2FWUploadTCSGE_t;
  953. /* FWUpload Reply message */
  954. typedef struct _MPI2_FW_UPLOAD_REPLY
  955. {
  956. U8 ImageType; /* 0x00 */
  957. U8 Reserved1; /* 0x01 */
  958. U8 MsgLength; /* 0x02 */
  959. U8 Function; /* 0x03 */
  960. U16 Reserved2; /* 0x04 */
  961. U8 Reserved3; /* 0x06 */
  962. U8 MsgFlags; /* 0x07 */
  963. U8 VP_ID; /* 0x08 */
  964. U8 VF_ID; /* 0x09 */
  965. U16 Reserved4; /* 0x0A */
  966. U16 Reserved5; /* 0x0C */
  967. U16 IOCStatus; /* 0x0E */
  968. U32 IOCLogInfo; /* 0x10 */
  969. U32 ActualImageSize; /* 0x14 */
  970. } MPI2_FW_UPLOAD_REPLY, MPI2_POINTER PTR_MPI2_FW_UPLOAD_REPLY,
  971. Mpi2FWUploadReply_t, MPI2_POINTER pMPi2FWUploadReply_t;
  972. /* FW Image Header */
  973. typedef struct _MPI2_FW_IMAGE_HEADER
  974. {
  975. U32 Signature; /* 0x00 */
  976. U32 Signature0; /* 0x04 */
  977. U32 Signature1; /* 0x08 */
  978. U32 Signature2; /* 0x0C */
  979. MPI2_VERSION_UNION MPIVersion; /* 0x10 */
  980. MPI2_VERSION_UNION FWVersion; /* 0x14 */
  981. MPI2_VERSION_UNION NVDATAVersion; /* 0x18 */
  982. MPI2_VERSION_UNION PackageVersion; /* 0x1C */
  983. U16 VendorID; /* 0x20 */
  984. U16 ProductID; /* 0x22 */
  985. U16 ProtocolFlags; /* 0x24 */
  986. U16 Reserved26; /* 0x26 */
  987. U32 IOCCapabilities; /* 0x28 */
  988. U32 ImageSize; /* 0x2C */
  989. U32 NextImageHeaderOffset; /* 0x30 */
  990. U32 Checksum; /* 0x34 */
  991. U32 Reserved38; /* 0x38 */
  992. U32 Reserved3C; /* 0x3C */
  993. U32 Reserved40; /* 0x40 */
  994. U32 Reserved44; /* 0x44 */
  995. U32 Reserved48; /* 0x48 */
  996. U32 Reserved4C; /* 0x4C */
  997. U32 Reserved50; /* 0x50 */
  998. U32 Reserved54; /* 0x54 */
  999. U32 Reserved58; /* 0x58 */
  1000. U32 Reserved5C; /* 0x5C */
  1001. U32 Reserved60; /* 0x60 */
  1002. U32 FirmwareVersionNameWhat; /* 0x64 */
  1003. U8 FirmwareVersionName[32]; /* 0x68 */
  1004. U32 VendorNameWhat; /* 0x88 */
  1005. U8 VendorName[32]; /* 0x8C */
  1006. U32 PackageNameWhat; /* 0x88 */
  1007. U8 PackageName[32]; /* 0x8C */
  1008. U32 ReservedD0; /* 0xD0 */
  1009. U32 ReservedD4; /* 0xD4 */
  1010. U32 ReservedD8; /* 0xD8 */
  1011. U32 ReservedDC; /* 0xDC */
  1012. U32 ReservedE0; /* 0xE0 */
  1013. U32 ReservedE4; /* 0xE4 */
  1014. U32 ReservedE8; /* 0xE8 */
  1015. U32 ReservedEC; /* 0xEC */
  1016. U32 ReservedF0; /* 0xF0 */
  1017. U32 ReservedF4; /* 0xF4 */
  1018. U32 ReservedF8; /* 0xF8 */
  1019. U32 ReservedFC; /* 0xFC */
  1020. } MPI2_FW_IMAGE_HEADER, MPI2_POINTER PTR_MPI2_FW_IMAGE_HEADER,
  1021. Mpi2FWImageHeader_t, MPI2_POINTER pMpi2FWImageHeader_t;
  1022. /* Signature field */
  1023. #define MPI2_FW_HEADER_SIGNATURE_OFFSET (0x00)
  1024. #define MPI2_FW_HEADER_SIGNATURE_MASK (0xFF000000)
  1025. #define MPI2_FW_HEADER_SIGNATURE (0xEA000000)
  1026. /* Signature0 field */
  1027. #define MPI2_FW_HEADER_SIGNATURE0_OFFSET (0x04)
  1028. #define MPI2_FW_HEADER_SIGNATURE0 (0x5AFAA55A)
  1029. /* Signature1 field */
  1030. #define MPI2_FW_HEADER_SIGNATURE1_OFFSET (0x08)
  1031. #define MPI2_FW_HEADER_SIGNATURE1 (0xA55AFAA5)
  1032. /* Signature2 field */
  1033. #define MPI2_FW_HEADER_SIGNATURE2_OFFSET (0x0C)
  1034. #define MPI2_FW_HEADER_SIGNATURE2 (0x5AA55AFA)
  1035. /* defines for using the ProductID field */
  1036. #define MPI2_FW_HEADER_PID_TYPE_MASK (0xF000)
  1037. #define MPI2_FW_HEADER_PID_TYPE_SAS (0x2000)
  1038. #define MPI2_FW_HEADER_PID_PROD_MASK (0x0F00)
  1039. #define MPI2_FW_HEADER_PID_PROD_A (0x0000)
  1040. #define MPI2_FW_HEADER_PID_PROD_MASK (0x0F00)
  1041. #define MPI2_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI (0x0200)
  1042. #define MPI2_FW_HEADER_PID_PROD_IR_SCSI (0x0700)
  1043. #define MPI2_FW_HEADER_PID_FAMILY_MASK (0x00FF)
  1044. /* SAS */
  1045. #define MPI2_FW_HEADER_PID_FAMILY_2108_SAS (0x0013)
  1046. #define MPI2_FW_HEADER_PID_FAMILY_2208_SAS (0x0014)
  1047. /* use MPI2_IOCFACTS_PROTOCOL_ defines for ProtocolFlags field */
  1048. /* use MPI2_IOCFACTS_CAPABILITY_ defines for IOCCapabilities field */
  1049. #define MPI2_FW_HEADER_IMAGESIZE_OFFSET (0x2C)
  1050. #define MPI2_FW_HEADER_NEXTIMAGE_OFFSET (0x30)
  1051. #define MPI2_FW_HEADER_VERNMHWAT_OFFSET (0x64)
  1052. #define MPI2_FW_HEADER_WHAT_SIGNATURE (0x29232840)
  1053. #define MPI2_FW_HEADER_SIZE (0x100)
  1054. /* Extended Image Header */
  1055. typedef struct _MPI2_EXT_IMAGE_HEADER
  1056. {
  1057. U8 ImageType; /* 0x00 */
  1058. U8 Reserved1; /* 0x01 */
  1059. U16 Reserved2; /* 0x02 */
  1060. U32 Checksum; /* 0x04 */
  1061. U32 ImageSize; /* 0x08 */
  1062. U32 NextImageHeaderOffset; /* 0x0C */
  1063. U32 PackageVersion; /* 0x10 */
  1064. U32 Reserved3; /* 0x14 */
  1065. U32 Reserved4; /* 0x18 */
  1066. U32 Reserved5; /* 0x1C */
  1067. U8 IdentifyString[32]; /* 0x20 */
  1068. } MPI2_EXT_IMAGE_HEADER, MPI2_POINTER PTR_MPI2_EXT_IMAGE_HEADER,
  1069. Mpi2ExtImageHeader_t, MPI2_POINTER pMpi2ExtImageHeader_t;
  1070. /* useful offsets */
  1071. #define MPI2_EXT_IMAGE_IMAGETYPE_OFFSET (0x00)
  1072. #define MPI2_EXT_IMAGE_IMAGESIZE_OFFSET (0x08)
  1073. #define MPI2_EXT_IMAGE_NEXTIMAGE_OFFSET (0x0C)
  1074. #define MPI2_EXT_IMAGE_HEADER_SIZE (0x40)
  1075. /* defines for the ImageType field */
  1076. #define MPI2_EXT_IMAGE_TYPE_UNSPECIFIED (0x00)
  1077. #define MPI2_EXT_IMAGE_TYPE_FW (0x01)
  1078. #define MPI2_EXT_IMAGE_TYPE_NVDATA (0x03)
  1079. #define MPI2_EXT_IMAGE_TYPE_BOOTLOADER (0x04)
  1080. #define MPI2_EXT_IMAGE_TYPE_INITIALIZATION (0x05)
  1081. #define MPI2_EXT_IMAGE_TYPE_FLASH_LAYOUT (0x06)
  1082. #define MPI2_EXT_IMAGE_TYPE_SUPPORTED_DEVICES (0x07)
  1083. #define MPI2_EXT_IMAGE_TYPE_MEGARAID (0x08)
  1084. #define MPI2_EXT_IMAGE_TYPE_MAX (MPI2_EXT_IMAGE_TYPE_MEGARAID)
  1085. /* FLASH Layout Extended Image Data */
  1086. /*
  1087. * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
  1088. * one and check RegionsPerLayout at runtime.
  1089. */
  1090. #ifndef MPI2_FLASH_NUMBER_OF_REGIONS
  1091. #define MPI2_FLASH_NUMBER_OF_REGIONS (1)
  1092. #endif
  1093. /*
  1094. * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
  1095. * one and check NumberOfLayouts at runtime.
  1096. */
  1097. #ifndef MPI2_FLASH_NUMBER_OF_LAYOUTS
  1098. #define MPI2_FLASH_NUMBER_OF_LAYOUTS (1)
  1099. #endif
  1100. typedef struct _MPI2_FLASH_REGION
  1101. {
  1102. U8 RegionType; /* 0x00 */
  1103. U8 Reserved1; /* 0x01 */
  1104. U16 Reserved2; /* 0x02 */
  1105. U32 RegionOffset; /* 0x04 */
  1106. U32 RegionSize; /* 0x08 */
  1107. U32 Reserved3; /* 0x0C */
  1108. } MPI2_FLASH_REGION, MPI2_POINTER PTR_MPI2_FLASH_REGION,
  1109. Mpi2FlashRegion_t, MPI2_POINTER pMpi2FlashRegion_t;
  1110. typedef struct _MPI2_FLASH_LAYOUT
  1111. {
  1112. U32 FlashSize; /* 0x00 */
  1113. U32 Reserved1; /* 0x04 */
  1114. U32 Reserved2; /* 0x08 */
  1115. U32 Reserved3; /* 0x0C */
  1116. MPI2_FLASH_REGION Region[MPI2_FLASH_NUMBER_OF_REGIONS];/* 0x10 */
  1117. } MPI2_FLASH_LAYOUT, MPI2_POINTER PTR_MPI2_FLASH_LAYOUT,
  1118. Mpi2FlashLayout_t, MPI2_POINTER pMpi2FlashLayout_t;
  1119. typedef struct _MPI2_FLASH_LAYOUT_DATA
  1120. {
  1121. U8 ImageRevision; /* 0x00 */
  1122. U8 Reserved1; /* 0x01 */
  1123. U8 SizeOfRegion; /* 0x02 */
  1124. U8 Reserved2; /* 0x03 */
  1125. U16 NumberOfLayouts; /* 0x04 */
  1126. U16 RegionsPerLayout; /* 0x06 */
  1127. U16 MinimumSectorAlignment; /* 0x08 */
  1128. U16 Reserved3; /* 0x0A */
  1129. U32 Reserved4; /* 0x0C */
  1130. MPI2_FLASH_LAYOUT Layout[MPI2_FLASH_NUMBER_OF_LAYOUTS];/* 0x10 */
  1131. } MPI2_FLASH_LAYOUT_DATA, MPI2_POINTER PTR_MPI2_FLASH_LAYOUT_DATA,
  1132. Mpi2FlashLayoutData_t, MPI2_POINTER pMpi2FlashLayoutData_t;
  1133. /* defines for the RegionType field */
  1134. #define MPI2_FLASH_REGION_UNUSED (0x00)
  1135. #define MPI2_FLASH_REGION_FIRMWARE (0x01)
  1136. #define MPI2_FLASH_REGION_BIOS (0x02)
  1137. #define MPI2_FLASH_REGION_NVDATA (0x03)
  1138. #define MPI2_FLASH_REGION_FIRMWARE_BACKUP (0x05)
  1139. #define MPI2_FLASH_REGION_MFG_INFORMATION (0x06)
  1140. #define MPI2_FLASH_REGION_CONFIG_1 (0x07)
  1141. #define MPI2_FLASH_REGION_CONFIG_2 (0x08)
  1142. #define MPI2_FLASH_REGION_MEGARAID (0x09)
  1143. #define MPI2_FLASH_REGION_INIT (0x0A)
  1144. /* ImageRevision */
  1145. #define MPI2_FLASH_LAYOUT_IMAGE_REVISION (0x00)
  1146. /* Supported Devices Extended Image Data */
  1147. /*
  1148. * Host code (drivers, BIOS, utilities, etc.) should leave this define set to
  1149. * one and check NumberOfDevices at runtime.
  1150. */
  1151. #ifndef MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES
  1152. #define MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES (1)
  1153. #endif
  1154. typedef struct _MPI2_SUPPORTED_DEVICE
  1155. {
  1156. U16 DeviceID; /* 0x00 */
  1157. U16 VendorID; /* 0x02 */
  1158. U16 DeviceIDMask; /* 0x04 */
  1159. U16 Reserved1; /* 0x06 */
  1160. U8 LowPCIRev; /* 0x08 */
  1161. U8 HighPCIRev; /* 0x09 */
  1162. U16 Reserved2; /* 0x0A */
  1163. U32 Reserved3; /* 0x0C */
  1164. } MPI2_SUPPORTED_DEVICE, MPI2_POINTER PTR_MPI2_SUPPORTED_DEVICE,
  1165. Mpi2SupportedDevice_t, MPI2_POINTER pMpi2SupportedDevice_t;
  1166. typedef struct _MPI2_SUPPORTED_DEVICES_DATA
  1167. {
  1168. U8 ImageRevision; /* 0x00 */
  1169. U8 Reserved1; /* 0x01 */
  1170. U8 NumberOfDevices; /* 0x02 */
  1171. U8 Reserved2; /* 0x03 */
  1172. U32 Reserved3; /* 0x04 */
  1173. MPI2_SUPPORTED_DEVICE SupportedDevice[MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES]; /* 0x08 */
  1174. } MPI2_SUPPORTED_DEVICES_DATA, MPI2_POINTER PTR_MPI2_SUPPORTED_DEVICES_DATA,
  1175. Mpi2SupportedDevicesData_t, MPI2_POINTER pMpi2SupportedDevicesData_t;
  1176. /* ImageRevision */
  1177. #define MPI2_SUPPORTED_DEVICES_IMAGE_REVISION (0x00)
  1178. /* Init Extended Image Data */
  1179. typedef struct _MPI2_INIT_IMAGE_FOOTER
  1180. {
  1181. U32 BootFlags; /* 0x00 */
  1182. U32 ImageSize; /* 0x04 */
  1183. U32 Signature0; /* 0x08 */
  1184. U32 Signature1; /* 0x0C */
  1185. U32 Signature2; /* 0x10 */
  1186. U32 ResetVector; /* 0x14 */
  1187. } MPI2_INIT_IMAGE_FOOTER, MPI2_POINTER PTR_MPI2_INIT_IMAGE_FOOTER,
  1188. Mpi2InitImageFooter_t, MPI2_POINTER pMpi2InitImageFooter_t;
  1189. /* defines for the BootFlags field */
  1190. #define MPI2_INIT_IMAGE_BOOTFLAGS_OFFSET (0x00)
  1191. /* defines for the ImageSize field */
  1192. #define MPI2_INIT_IMAGE_IMAGESIZE_OFFSET (0x04)
  1193. /* defines for the Signature0 field */
  1194. #define MPI2_INIT_IMAGE_SIGNATURE0_OFFSET (0x08)
  1195. #define MPI2_INIT_IMAGE_SIGNATURE0 (0x5AA55AEA)
  1196. /* defines for the Signature1 field */
  1197. #define MPI2_INIT_IMAGE_SIGNATURE1_OFFSET (0x0C)
  1198. #define MPI2_INIT_IMAGE_SIGNATURE1 (0xA55AEAA5)
  1199. /* defines for the Signature2 field */
  1200. #define MPI2_INIT_IMAGE_SIGNATURE2_OFFSET (0x10)
  1201. #define MPI2_INIT_IMAGE_SIGNATURE2 (0x5AEAA55A)
  1202. /* Signature fields as individual bytes */
  1203. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_0 (0xEA)
  1204. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_1 (0x5A)
  1205. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_2 (0xA5)
  1206. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_3 (0x5A)
  1207. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_4 (0xA5)
  1208. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_5 (0xEA)
  1209. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_6 (0x5A)
  1210. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_7 (0xA5)
  1211. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_8 (0x5A)
  1212. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_9 (0xA5)
  1213. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_A (0xEA)
  1214. #define MPI2_INIT_IMAGE_SIGNATURE_BYTE_B (0x5A)
  1215. /* defines for the ResetVector field */
  1216. #define MPI2_INIT_IMAGE_RESETVECTOR_OFFSET (0x14)
  1217. #endif