mpi2.h 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright 2000-2015 Avago Technologies. All rights reserved.
  4. *
  5. *
  6. * Name: mpi2.h
  7. * Title: MPI Message independent structures and definitions
  8. * including System Interface Register Set and
  9. * scatter/gather formats.
  10. * Creation Date: June 21, 2006
  11. *
  12. * mpi2.h Version: 02.00.50
  13. *
  14. * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  15. * prefix are for use only on MPI v2.5 products, and must not be used
  16. * with MPI v2.0 products. Unless otherwise noted, names beginning with
  17. * MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products.
  18. *
  19. * Version History
  20. * ---------------
  21. *
  22. * Date Version Description
  23. * -------- -------- ------------------------------------------------------
  24. * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A.
  25. * 06-04-07 02.00.01 Bumped MPI2_HEADER_VERSION_UNIT.
  26. * 06-26-07 02.00.02 Bumped MPI2_HEADER_VERSION_UNIT.
  27. * 08-31-07 02.00.03 Bumped MPI2_HEADER_VERSION_UNIT.
  28. * Moved ReplyPostHostIndex register to offset 0x6C of the
  29. * MPI2_SYSTEM_INTERFACE_REGS and modified the define for
  30. * MPI2_REPLY_POST_HOST_INDEX_OFFSET.
  31. * Added union of request descriptors.
  32. * Added union of reply descriptors.
  33. * 10-31-07 02.00.04 Bumped MPI2_HEADER_VERSION_UNIT.
  34. * Added define for MPI2_VERSION_02_00.
  35. * Fixed the size of the FunctionDependent5 field in the
  36. * MPI2_DEFAULT_REPLY structure.
  37. * 12-18-07 02.00.05 Bumped MPI2_HEADER_VERSION_UNIT.
  38. * Removed the MPI-defined Fault Codes and extended the
  39. * product specific codes up to 0xEFFF.
  40. * Added a sixth key value for the WriteSequence register
  41. * and changed the flush value to 0x0.
  42. * Added message function codes for Diagnostic Buffer Post
  43. * and Diagnsotic Release.
  44. * New IOCStatus define: MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED
  45. * Moved MPI2_VERSION_UNION from mpi2_ioc.h.
  46. * 02-29-08 02.00.06 Bumped MPI2_HEADER_VERSION_UNIT.
  47. * 03-03-08 02.00.07 Bumped MPI2_HEADER_VERSION_UNIT.
  48. * 05-21-08 02.00.08 Bumped MPI2_HEADER_VERSION_UNIT.
  49. * Added #defines for marking a reply descriptor as unused.
  50. * 06-27-08 02.00.09 Bumped MPI2_HEADER_VERSION_UNIT.
  51. * 10-02-08 02.00.10 Bumped MPI2_HEADER_VERSION_UNIT.
  52. * Moved LUN field defines from mpi2_init.h.
  53. * 01-19-09 02.00.11 Bumped MPI2_HEADER_VERSION_UNIT.
  54. * 05-06-09 02.00.12 Bumped MPI2_HEADER_VERSION_UNIT.
  55. * In all request and reply descriptors, replaced VF_ID
  56. * field with MSIxIndex field.
  57. * Removed DevHandle field from
  58. * MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR and made those
  59. * bytes reserved.
  60. * Added RAID Accelerator functionality.
  61. * 07-30-09 02.00.13 Bumped MPI2_HEADER_VERSION_UNIT.
  62. * 10-28-09 02.00.14 Bumped MPI2_HEADER_VERSION_UNIT.
  63. * Added MSI-x index mask and shift for Reply Post Host
  64. * Index register.
  65. * Added function code for Host Based Discovery Action.
  66. * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT.
  67. * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL.
  68. * Added defines for product-specific range of message
  69. * function codes, 0xF0 to 0xFF.
  70. * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT.
  71. * Added alternative defines for the SGE Direction bit.
  72. * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT.
  73. * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT.
  74. * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define.
  75. * 02-23-11 02.00.19 Bumped MPI2_HEADER_VERSION_UNIT.
  76. * Added MPI2_FUNCTION_SEND_HOST_MESSAGE.
  77. * 03-09-11 02.00.20 Bumped MPI2_HEADER_VERSION_UNIT.
  78. * 05-25-11 02.00.21 Bumped MPI2_HEADER_VERSION_UNIT.
  79. * 08-24-11 02.00.22 Bumped MPI2_HEADER_VERSION_UNIT.
  80. * 11-18-11 02.00.23 Bumped MPI2_HEADER_VERSION_UNIT.
  81. * Incorporating additions for MPI v2.5.
  82. * 02-06-12 02.00.24 Bumped MPI2_HEADER_VERSION_UNIT.
  83. * 03-29-12 02.00.25 Bumped MPI2_HEADER_VERSION_UNIT.
  84. * Added Hard Reset delay timings.
  85. * 07-10-12 02.00.26 Bumped MPI2_HEADER_VERSION_UNIT.
  86. * 07-26-12 02.00.27 Bumped MPI2_HEADER_VERSION_UNIT.
  87. * 11-27-12 02.00.28 Bumped MPI2_HEADER_VERSION_UNIT.
  88. * 12-20-12 02.00.29 Bumped MPI2_HEADER_VERSION_UNIT.
  89. * Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET.
  90. * 04-09-13 02.00.30 Bumped MPI2_HEADER_VERSION_UNIT.
  91. * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT.
  92. * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT.
  93. * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT.
  94. * 01-08-14 02.00.34 Bumped MPI2_HEADER_VERSION_UNIT
  95. * 06-13-14 02.00.35 Bumped MPI2_HEADER_VERSION_UNIT.
  96. * 11-18-14 02.00.36 Updated copyright information.
  97. * Bumped MPI2_HEADER_VERSION_UNIT.
  98. * 03-16-15 02.00.37 Bumped MPI2_HEADER_VERSION_UNIT.
  99. * Added Scratchpad registers to
  100. * MPI2_SYSTEM_INTERFACE_REGS.
  101. * Added MPI2_DIAG_SBR_RELOAD.
  102. * 03-19-15 02.00.38 Bumped MPI2_HEADER_VERSION_UNIT.
  103. * 05-25-15 02.00.39 Bumped MPI2_HEADER_VERSION_UNIT.
  104. * 08-25-15 02.00.40 Bumped MPI2_HEADER_VERSION_UNIT.
  105. * 12-15-15 02.00.41 Bumped MPI_HEADER_VERSION_UNIT
  106. * 01-01-16 02.00.42 Bumped MPI_HEADER_VERSION_UNIT
  107. * 04-05-16 02.00.43 Modified MPI26_DIAG_BOOT_DEVICE_SELECT defines
  108. * to be unique within first 32 characters.
  109. * Removed AHCI support.
  110. * Removed SOP support.
  111. * Bumped MPI2_HEADER_VERSION_UNIT.
  112. * 04-10-16 02.00.44 Bumped MPI2_HEADER_VERSION_UNIT.
  113. * 07-06-16 02.00.45 Bumped MPI2_HEADER_VERSION_UNIT.
  114. * 09-02-16 02.00.46 Bumped MPI2_HEADER_VERSION_UNIT.
  115. * 11-23-16 02.00.47 Bumped MPI2_HEADER_VERSION_UNIT.
  116. * 02-03-17 02.00.48 Bumped MPI2_HEADER_VERSION_UNIT.
  117. * 06-13-17 02.00.49 Bumped MPI2_HEADER_VERSION_UNIT.
  118. * 09-29-17 02.00.50 Bumped MPI2_HEADER_VERSION_UNIT.
  119. * --------------------------------------------------------------------------
  120. */
  121. #ifndef MPI2_H
  122. #define MPI2_H
  123. /*****************************************************************************
  124. *
  125. * MPI Version Definitions
  126. *
  127. *****************************************************************************/
  128. #define MPI2_VERSION_MAJOR_MASK (0xFF00)
  129. #define MPI2_VERSION_MAJOR_SHIFT (8)
  130. #define MPI2_VERSION_MINOR_MASK (0x00FF)
  131. #define MPI2_VERSION_MINOR_SHIFT (0)
  132. /*major version for all MPI v2.x */
  133. #define MPI2_VERSION_MAJOR (0x02)
  134. /*minor version for MPI v2.0 compatible products */
  135. #define MPI2_VERSION_MINOR (0x00)
  136. #define MPI2_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \
  137. MPI2_VERSION_MINOR)
  138. #define MPI2_VERSION_02_00 (0x0200)
  139. /*minor version for MPI v2.5 compatible products */
  140. #define MPI25_VERSION_MINOR (0x05)
  141. #define MPI25_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \
  142. MPI25_VERSION_MINOR)
  143. #define MPI2_VERSION_02_05 (0x0205)
  144. /*minor version for MPI v2.6 compatible products */
  145. #define MPI26_VERSION_MINOR (0x06)
  146. #define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \
  147. MPI26_VERSION_MINOR)
  148. #define MPI2_VERSION_02_06 (0x0206)
  149. /* Unit and Dev versioning for this MPI header set */
  150. #define MPI2_HEADER_VERSION_UNIT (0x32)
  151. #define MPI2_HEADER_VERSION_DEV (0x00)
  152. #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00)
  153. #define MPI2_HEADER_VERSION_UNIT_SHIFT (8)
  154. #define MPI2_HEADER_VERSION_DEV_MASK (0x00FF)
  155. #define MPI2_HEADER_VERSION_DEV_SHIFT (0)
  156. #define MPI2_HEADER_VERSION ((MPI2_HEADER_VERSION_UNIT << 8) | \
  157. MPI2_HEADER_VERSION_DEV)
  158. /*****************************************************************************
  159. *
  160. * IOC State Definitions
  161. *
  162. *****************************************************************************/
  163. #define MPI2_IOC_STATE_RESET (0x00000000)
  164. #define MPI2_IOC_STATE_READY (0x10000000)
  165. #define MPI2_IOC_STATE_OPERATIONAL (0x20000000)
  166. #define MPI2_IOC_STATE_FAULT (0x40000000)
  167. #define MPI2_IOC_STATE_MASK (0xF0000000)
  168. #define MPI2_IOC_STATE_SHIFT (28)
  169. /*Fault state range for prodcut specific codes */
  170. #define MPI2_FAULT_PRODUCT_SPECIFIC_MIN (0x0000)
  171. #define MPI2_FAULT_PRODUCT_SPECIFIC_MAX (0xEFFF)
  172. /*****************************************************************************
  173. *
  174. * System Interface Register Definitions
  175. *
  176. *****************************************************************************/
  177. typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS {
  178. U32 Doorbell; /*0x00 */
  179. U32 WriteSequence; /*0x04 */
  180. U32 HostDiagnostic; /*0x08 */
  181. U32 Reserved1; /*0x0C */
  182. U32 DiagRWData; /*0x10 */
  183. U32 DiagRWAddressLow; /*0x14 */
  184. U32 DiagRWAddressHigh; /*0x18 */
  185. U32 Reserved2[5]; /*0x1C */
  186. U32 HostInterruptStatus; /*0x30 */
  187. U32 HostInterruptMask; /*0x34 */
  188. U32 DCRData; /*0x38 */
  189. U32 DCRAddress; /*0x3C */
  190. U32 Reserved3[2]; /*0x40 */
  191. U32 ReplyFreeHostIndex; /*0x48 */
  192. U32 Reserved4[8]; /*0x4C */
  193. U32 ReplyPostHostIndex; /*0x6C */
  194. U32 Reserved5; /*0x70 */
  195. U32 HCBSize; /*0x74 */
  196. U32 HCBAddressLow; /*0x78 */
  197. U32 HCBAddressHigh; /*0x7C */
  198. U32 Reserved6[12]; /*0x80 */
  199. U32 Scratchpad[4]; /*0xB0 */
  200. U32 RequestDescriptorPostLow; /*0xC0 */
  201. U32 RequestDescriptorPostHigh; /*0xC4 */
  202. U32 AtomicRequestDescriptorPost;/*0xC8 */
  203. U32 Reserved7[13]; /*0xCC */
  204. } MPI2_SYSTEM_INTERFACE_REGS,
  205. *PTR_MPI2_SYSTEM_INTERFACE_REGS,
  206. Mpi2SystemInterfaceRegs_t,
  207. *pMpi2SystemInterfaceRegs_t;
  208. /*
  209. *Defines for working with the Doorbell register.
  210. */
  211. #define MPI2_DOORBELL_OFFSET (0x00000000)
  212. /*IOC --> System values */
  213. #define MPI2_DOORBELL_USED (0x08000000)
  214. #define MPI2_DOORBELL_WHO_INIT_MASK (0x07000000)
  215. #define MPI2_DOORBELL_WHO_INIT_SHIFT (24)
  216. #define MPI2_DOORBELL_FAULT_CODE_MASK (0x0000FFFF)
  217. #define MPI2_DOORBELL_DATA_MASK (0x0000FFFF)
  218. /*System --> IOC values */
  219. #define MPI2_DOORBELL_FUNCTION_MASK (0xFF000000)
  220. #define MPI2_DOORBELL_FUNCTION_SHIFT (24)
  221. #define MPI2_DOORBELL_ADD_DWORDS_MASK (0x00FF0000)
  222. #define MPI2_DOORBELL_ADD_DWORDS_SHIFT (16)
  223. /*
  224. *Defines for the WriteSequence register
  225. */
  226. #define MPI2_WRITE_SEQUENCE_OFFSET (0x00000004)
  227. #define MPI2_WRSEQ_KEY_VALUE_MASK (0x0000000F)
  228. #define MPI2_WRSEQ_FLUSH_KEY_VALUE (0x0)
  229. #define MPI2_WRSEQ_1ST_KEY_VALUE (0xF)
  230. #define MPI2_WRSEQ_2ND_KEY_VALUE (0x4)
  231. #define MPI2_WRSEQ_3RD_KEY_VALUE (0xB)
  232. #define MPI2_WRSEQ_4TH_KEY_VALUE (0x2)
  233. #define MPI2_WRSEQ_5TH_KEY_VALUE (0x7)
  234. #define MPI2_WRSEQ_6TH_KEY_VALUE (0xD)
  235. /*
  236. *Defines for the HostDiagnostic register
  237. */
  238. #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x00000008)
  239. #define MPI2_DIAG_SBR_RELOAD (0x00002000)
  240. #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK (0x00001800)
  241. #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT (0x00000000)
  242. #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW (0x00000800)
  243. /* Defines for V7A/V7R HostDiagnostic Register */
  244. #define MPI26_DIAG_BOOT_DEVICE_SEL_64FLASH (0x00000000)
  245. #define MPI26_DIAG_BOOT_DEVICE_SEL_64HCDW (0x00000800)
  246. #define MPI26_DIAG_BOOT_DEVICE_SEL_32FLASH (0x00001000)
  247. #define MPI26_DIAG_BOOT_DEVICE_SEL_32HCDW (0x00001800)
  248. #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG (0x00000400)
  249. #define MPI2_DIAG_FORCE_HCB_ON_RESET (0x00000200)
  250. #define MPI2_DIAG_HCB_MODE (0x00000100)
  251. #define MPI2_DIAG_DIAG_WRITE_ENABLE (0x00000080)
  252. #define MPI2_DIAG_FLASH_BAD_SIG (0x00000040)
  253. #define MPI2_DIAG_RESET_HISTORY (0x00000020)
  254. #define MPI2_DIAG_DIAG_RW_ENABLE (0x00000010)
  255. #define MPI2_DIAG_RESET_ADAPTER (0x00000004)
  256. #define MPI2_DIAG_HOLD_IOC_RESET (0x00000002)
  257. /*
  258. *Offsets for DiagRWData and address
  259. */
  260. #define MPI2_DIAG_RW_DATA_OFFSET (0x00000010)
  261. #define MPI2_DIAG_RW_ADDRESS_LOW_OFFSET (0x00000014)
  262. #define MPI2_DIAG_RW_ADDRESS_HIGH_OFFSET (0x00000018)
  263. /*
  264. *Defines for the HostInterruptStatus register
  265. */
  266. #define MPI2_HOST_INTERRUPT_STATUS_OFFSET (0x00000030)
  267. #define MPI2_HIS_SYS2IOC_DB_STATUS (0x80000000)
  268. #define MPI2_HIS_IOP_DOORBELL_STATUS MPI2_HIS_SYS2IOC_DB_STATUS
  269. #define MPI2_HIS_RESET_IRQ_STATUS (0x40000000)
  270. #define MPI2_HIS_REPLY_DESCRIPTOR_INTERRUPT (0x00000008)
  271. #define MPI2_HIS_IOC2SYS_DB_STATUS (0x00000001)
  272. #define MPI2_HIS_DOORBELL_INTERRUPT MPI2_HIS_IOC2SYS_DB_STATUS
  273. /*
  274. *Defines for the HostInterruptMask register
  275. */
  276. #define MPI2_HOST_INTERRUPT_MASK_OFFSET (0x00000034)
  277. #define MPI2_HIM_RESET_IRQ_MASK (0x40000000)
  278. #define MPI2_HIM_REPLY_INT_MASK (0x00000008)
  279. #define MPI2_HIM_RIM MPI2_HIM_REPLY_INT_MASK
  280. #define MPI2_HIM_IOC2SYS_DB_MASK (0x00000001)
  281. #define MPI2_HIM_DIM MPI2_HIM_IOC2SYS_DB_MASK
  282. /*
  283. *Offsets for DCRData and address
  284. */
  285. #define MPI2_DCR_DATA_OFFSET (0x00000038)
  286. #define MPI2_DCR_ADDRESS_OFFSET (0x0000003C)
  287. /*
  288. *Offset for the Reply Free Queue
  289. */
  290. #define MPI2_REPLY_FREE_HOST_INDEX_OFFSET (0x00000048)
  291. /*
  292. *Defines for the Reply Descriptor Post Queue
  293. */
  294. #define MPI2_REPLY_POST_HOST_INDEX_OFFSET (0x0000006C)
  295. #define MPI2_REPLY_POST_HOST_INDEX_MASK (0x00FFFFFF)
  296. #define MPI2_RPHI_MSIX_INDEX_MASK (0xFF000000)
  297. #define MPI2_RPHI_MSIX_INDEX_SHIFT (24)
  298. #define MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET (0x0000030C) /*MPI v2.5 only*/
  299. /*
  300. *Defines for the HCBSize and address
  301. */
  302. #define MPI2_HCB_SIZE_OFFSET (0x00000074)
  303. #define MPI2_HCB_SIZE_SIZE_MASK (0xFFFFF000)
  304. #define MPI2_HCB_SIZE_HCB_ENABLE (0x00000001)
  305. #define MPI2_HCB_ADDRESS_LOW_OFFSET (0x00000078)
  306. #define MPI2_HCB_ADDRESS_HIGH_OFFSET (0x0000007C)
  307. /*
  308. *Offsets for the Scratchpad registers
  309. */
  310. #define MPI26_SCRATCHPAD0_OFFSET (0x000000B0)
  311. #define MPI26_SCRATCHPAD1_OFFSET (0x000000B4)
  312. #define MPI26_SCRATCHPAD2_OFFSET (0x000000B8)
  313. #define MPI26_SCRATCHPAD3_OFFSET (0x000000BC)
  314. /*
  315. *Offsets for the Request Descriptor Post Queue
  316. */
  317. #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET (0x000000C0)
  318. #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET (0x000000C4)
  319. #define MPI26_ATOMIC_REQUEST_DESCRIPTOR_POST_OFFSET (0x000000C8)
  320. /*Hard Reset delay timings */
  321. #define MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC (50000)
  322. #define MPI2_HARD_RESET_PCIE_RESET_READ_WINDOW_MICRO_SEC (255000)
  323. #define MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC (256000)
  324. /*****************************************************************************
  325. *
  326. * Message Descriptors
  327. *
  328. *****************************************************************************/
  329. /*Request Descriptors */
  330. /*Default Request Descriptor */
  331. typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR {
  332. U8 RequestFlags; /*0x00 */
  333. U8 MSIxIndex; /*0x01 */
  334. U16 SMID; /*0x02 */
  335. U16 LMID; /*0x04 */
  336. U16 DescriptorTypeDependent; /*0x06 */
  337. } MPI2_DEFAULT_REQUEST_DESCRIPTOR,
  338. *PTR_MPI2_DEFAULT_REQUEST_DESCRIPTOR,
  339. Mpi2DefaultRequestDescriptor_t,
  340. *pMpi2DefaultRequestDescriptor_t;
  341. /*defines for the RequestFlags field */
  342. #define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x1E)
  343. #define MPI2_REQ_DESCRIPT_FLAGS_TYPE_RSHIFT (1)
  344. #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00)
  345. #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET (0x02)
  346. #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06)
  347. #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE (0x08)
  348. #define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR (0x0A)
  349. #define MPI25_REQ_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO (0x0C)
  350. #define MPI26_REQ_DESCRIPT_FLAGS_PCIE_ENCAPSULATED (0x10)
  351. #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01)
  352. /*High Priority Request Descriptor */
  353. typedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR {
  354. U8 RequestFlags; /*0x00 */
  355. U8 MSIxIndex; /*0x01 */
  356. U16 SMID; /*0x02 */
  357. U16 LMID; /*0x04 */
  358. U16 Reserved1; /*0x06 */
  359. } MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR,
  360. *PTR_MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR,
  361. Mpi2HighPriorityRequestDescriptor_t,
  362. *pMpi2HighPriorityRequestDescriptor_t;
  363. /*SCSI IO Request Descriptor */
  364. typedef struct _MPI2_SCSI_IO_REQUEST_DESCRIPTOR {
  365. U8 RequestFlags; /*0x00 */
  366. U8 MSIxIndex; /*0x01 */
  367. U16 SMID; /*0x02 */
  368. U16 LMID; /*0x04 */
  369. U16 DevHandle; /*0x06 */
  370. } MPI2_SCSI_IO_REQUEST_DESCRIPTOR,
  371. *PTR_MPI2_SCSI_IO_REQUEST_DESCRIPTOR,
  372. Mpi2SCSIIORequestDescriptor_t,
  373. *pMpi2SCSIIORequestDescriptor_t;
  374. /*SCSI Target Request Descriptor */
  375. typedef struct _MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR {
  376. U8 RequestFlags; /*0x00 */
  377. U8 MSIxIndex; /*0x01 */
  378. U16 SMID; /*0x02 */
  379. U16 LMID; /*0x04 */
  380. U16 IoIndex; /*0x06 */
  381. } MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR,
  382. *PTR_MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR,
  383. Mpi2SCSITargetRequestDescriptor_t,
  384. *pMpi2SCSITargetRequestDescriptor_t;
  385. /*RAID Accelerator Request Descriptor */
  386. typedef struct _MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR {
  387. U8 RequestFlags; /*0x00 */
  388. U8 MSIxIndex; /*0x01 */
  389. U16 SMID; /*0x02 */
  390. U16 LMID; /*0x04 */
  391. U16 Reserved; /*0x06 */
  392. } MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR,
  393. *PTR_MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR,
  394. Mpi2RAIDAcceleratorRequestDescriptor_t,
  395. *pMpi2RAIDAcceleratorRequestDescriptor_t;
  396. /*Fast Path SCSI IO Request Descriptor */
  397. typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
  398. MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR,
  399. *PTR_MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR,
  400. Mpi25FastPathSCSIIORequestDescriptor_t,
  401. *pMpi25FastPathSCSIIORequestDescriptor_t;
  402. /*PCIe Encapsulated Request Descriptor */
  403. typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
  404. MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
  405. *PTR_MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
  406. Mpi26PCIeEncapsulatedRequestDescriptor_t,
  407. *pMpi26PCIeEncapsulatedRequestDescriptor_t;
  408. /*union of Request Descriptors */
  409. typedef union _MPI2_REQUEST_DESCRIPTOR_UNION {
  410. MPI2_DEFAULT_REQUEST_DESCRIPTOR Default;
  411. MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR HighPriority;
  412. MPI2_SCSI_IO_REQUEST_DESCRIPTOR SCSIIO;
  413. MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR SCSITarget;
  414. MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR RAIDAccelerator;
  415. MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR FastPathSCSIIO;
  416. MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR PCIeEncapsulated;
  417. U64 Words;
  418. } MPI2_REQUEST_DESCRIPTOR_UNION,
  419. *PTR_MPI2_REQUEST_DESCRIPTOR_UNION,
  420. Mpi2RequestDescriptorUnion_t,
  421. *pMpi2RequestDescriptorUnion_t;
  422. /*Atomic Request Descriptors */
  423. /*
  424. * All Atomic Request Descriptors have the same format, so the following
  425. * structure is used for all Atomic Request Descriptors:
  426. * Atomic Default Request Descriptor
  427. * Atomic High Priority Request Descriptor
  428. * Atomic SCSI IO Request Descriptor
  429. * Atomic SCSI Target Request Descriptor
  430. * Atomic RAID Accelerator Request Descriptor
  431. * Atomic Fast Path SCSI IO Request Descriptor
  432. * Atomic PCIe Encapsulated Request Descriptor
  433. */
  434. /*Atomic Request Descriptor */
  435. typedef struct _MPI26_ATOMIC_REQUEST_DESCRIPTOR {
  436. U8 RequestFlags; /* 0x00 */
  437. U8 MSIxIndex; /* 0x01 */
  438. U16 SMID; /* 0x02 */
  439. } MPI26_ATOMIC_REQUEST_DESCRIPTOR,
  440. *PTR_MPI26_ATOMIC_REQUEST_DESCRIPTOR,
  441. Mpi26AtomicRequestDescriptor_t,
  442. *pMpi26AtomicRequestDescriptor_t;
  443. /*for the RequestFlags field, use the same
  444. *defines as MPI2_DEFAULT_REQUEST_DESCRIPTOR
  445. */
  446. /*Reply Descriptors */
  447. /*Default Reply Descriptor */
  448. typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR {
  449. U8 ReplyFlags; /*0x00 */
  450. U8 MSIxIndex; /*0x01 */
  451. U16 DescriptorTypeDependent1; /*0x02 */
  452. U32 DescriptorTypeDependent2; /*0x04 */
  453. } MPI2_DEFAULT_REPLY_DESCRIPTOR,
  454. *PTR_MPI2_DEFAULT_REPLY_DESCRIPTOR,
  455. Mpi2DefaultReplyDescriptor_t,
  456. *pMpi2DefaultReplyDescriptor_t;
  457. /*defines for the ReplyFlags field */
  458. #define MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK (0x0F)
  459. #define MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS (0x00)
  460. #define MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY (0x01)
  461. #define MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS (0x02)
  462. #define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER (0x03)
  463. #define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS (0x05)
  464. #define MPI25_RPY_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO_SUCCESS (0x06)
  465. #define MPI26_RPY_DESCRIPT_FLAGS_PCIE_ENCAPSULATED_SUCCESS (0x08)
  466. #define MPI2_RPY_DESCRIPT_FLAGS_UNUSED (0x0F)
  467. /*values for marking a reply descriptor as unused */
  468. #define MPI2_RPY_DESCRIPT_UNUSED_WORD0_MARK (0xFFFFFFFF)
  469. #define MPI2_RPY_DESCRIPT_UNUSED_WORD1_MARK (0xFFFFFFFF)
  470. /*Address Reply Descriptor */
  471. typedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR {
  472. U8 ReplyFlags; /*0x00 */
  473. U8 MSIxIndex; /*0x01 */
  474. U16 SMID; /*0x02 */
  475. U32 ReplyFrameAddress; /*0x04 */
  476. } MPI2_ADDRESS_REPLY_DESCRIPTOR,
  477. *PTR_MPI2_ADDRESS_REPLY_DESCRIPTOR,
  478. Mpi2AddressReplyDescriptor_t,
  479. *pMpi2AddressReplyDescriptor_t;
  480. #define MPI2_ADDRESS_REPLY_SMID_INVALID (0x00)
  481. /*SCSI IO Success Reply Descriptor */
  482. typedef struct _MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR {
  483. U8 ReplyFlags; /*0x00 */
  484. U8 MSIxIndex; /*0x01 */
  485. U16 SMID; /*0x02 */
  486. U16 TaskTag; /*0x04 */
  487. U16 Reserved1; /*0x06 */
  488. } MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
  489. *PTR_MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
  490. Mpi2SCSIIOSuccessReplyDescriptor_t,
  491. *pMpi2SCSIIOSuccessReplyDescriptor_t;
  492. /*TargetAssist Success Reply Descriptor */
  493. typedef struct _MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR {
  494. U8 ReplyFlags; /*0x00 */
  495. U8 MSIxIndex; /*0x01 */
  496. U16 SMID; /*0x02 */
  497. U8 SequenceNumber; /*0x04 */
  498. U8 Reserved1; /*0x05 */
  499. U16 IoIndex; /*0x06 */
  500. } MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR,
  501. *PTR_MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR,
  502. Mpi2TargetAssistSuccessReplyDescriptor_t,
  503. *pMpi2TargetAssistSuccessReplyDescriptor_t;
  504. /*Target Command Buffer Reply Descriptor */
  505. typedef struct _MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR {
  506. U8 ReplyFlags; /*0x00 */
  507. U8 MSIxIndex; /*0x01 */
  508. U8 VP_ID; /*0x02 */
  509. U8 Flags; /*0x03 */
  510. U16 InitiatorDevHandle; /*0x04 */
  511. U16 IoIndex; /*0x06 */
  512. } MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR,
  513. *PTR_MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR,
  514. Mpi2TargetCommandBufferReplyDescriptor_t,
  515. *pMpi2TargetCommandBufferReplyDescriptor_t;
  516. /*defines for Flags field */
  517. #define MPI2_RPY_DESCRIPT_TCB_FLAGS_PHYNUM_MASK (0x3F)
  518. /*RAID Accelerator Success Reply Descriptor */
  519. typedef struct _MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR {
  520. U8 ReplyFlags; /*0x00 */
  521. U8 MSIxIndex; /*0x01 */
  522. U16 SMID; /*0x02 */
  523. U32 Reserved; /*0x04 */
  524. } MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR,
  525. *PTR_MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR,
  526. Mpi2RAIDAcceleratorSuccessReplyDescriptor_t,
  527. *pMpi2RAIDAcceleratorSuccessReplyDescriptor_t;
  528. /*Fast Path SCSI IO Success Reply Descriptor */
  529. typedef MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR
  530. MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
  531. *PTR_MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
  532. Mpi25FastPathSCSIIOSuccessReplyDescriptor_t,
  533. *pMpi25FastPathSCSIIOSuccessReplyDescriptor_t;
  534. /*PCIe Encapsulated Success Reply Descriptor */
  535. typedef MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR
  536. MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR,
  537. *PTR_MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR,
  538. Mpi26PCIeEncapsulatedSuccessReplyDescriptor_t,
  539. *pMpi26PCIeEncapsulatedSuccessReplyDescriptor_t;
  540. /*union of Reply Descriptors */
  541. typedef union _MPI2_REPLY_DESCRIPTORS_UNION {
  542. MPI2_DEFAULT_REPLY_DESCRIPTOR Default;
  543. MPI2_ADDRESS_REPLY_DESCRIPTOR AddressReply;
  544. MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR SCSIIOSuccess;
  545. MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR TargetAssistSuccess;
  546. MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR TargetCommandBuffer;
  547. MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR RAIDAcceleratorSuccess;
  548. MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR FastPathSCSIIOSuccess;
  549. MPI26_PCIE_ENCAPSULATED_SUCCESS_REPLY_DESCRIPTOR
  550. PCIeEncapsulatedSuccess;
  551. U64 Words;
  552. } MPI2_REPLY_DESCRIPTORS_UNION,
  553. *PTR_MPI2_REPLY_DESCRIPTORS_UNION,
  554. Mpi2ReplyDescriptorsUnion_t,
  555. *pMpi2ReplyDescriptorsUnion_t;
  556. /*****************************************************************************
  557. *
  558. * Message Functions
  559. *
  560. *****************************************************************************/
  561. #define MPI2_FUNCTION_SCSI_IO_REQUEST (0x00)
  562. #define MPI2_FUNCTION_SCSI_TASK_MGMT (0x01)
  563. #define MPI2_FUNCTION_IOC_INIT (0x02)
  564. #define MPI2_FUNCTION_IOC_FACTS (0x03)
  565. #define MPI2_FUNCTION_CONFIG (0x04)
  566. #define MPI2_FUNCTION_PORT_FACTS (0x05)
  567. #define MPI2_FUNCTION_PORT_ENABLE (0x06)
  568. #define MPI2_FUNCTION_EVENT_NOTIFICATION (0x07)
  569. #define MPI2_FUNCTION_EVENT_ACK (0x08)
  570. #define MPI2_FUNCTION_FW_DOWNLOAD (0x09)
  571. #define MPI2_FUNCTION_TARGET_ASSIST (0x0B)
  572. #define MPI2_FUNCTION_TARGET_STATUS_SEND (0x0C)
  573. #define MPI2_FUNCTION_TARGET_MODE_ABORT (0x0D)
  574. #define MPI2_FUNCTION_FW_UPLOAD (0x12)
  575. #define MPI2_FUNCTION_RAID_ACTION (0x15)
  576. #define MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH (0x16)
  577. #define MPI2_FUNCTION_TOOLBOX (0x17)
  578. #define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18)
  579. #define MPI2_FUNCTION_SMP_PASSTHROUGH (0x1A)
  580. #define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B)
  581. #define MPI2_FUNCTION_IO_UNIT_CONTROL (0x1B)
  582. #define MPI2_FUNCTION_SATA_PASSTHROUGH (0x1C)
  583. #define MPI2_FUNCTION_DIAG_BUFFER_POST (0x1D)
  584. #define MPI2_FUNCTION_DIAG_RELEASE (0x1E)
  585. #define MPI2_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24)
  586. #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25)
  587. #define MPI2_FUNCTION_RAID_ACCELERATOR (0x2C)
  588. #define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION (0x2F)
  589. #define MPI2_FUNCTION_PWR_MGMT_CONTROL (0x30)
  590. #define MPI2_FUNCTION_SEND_HOST_MESSAGE (0x31)
  591. #define MPI2_FUNCTION_NVME_ENCAPSULATED (0x33)
  592. #define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC (0xF0)
  593. #define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC (0xFF)
  594. /*Doorbell functions */
  595. #define MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET (0x40)
  596. #define MPI2_FUNCTION_HANDSHAKE (0x42)
  597. /*****************************************************************************
  598. *
  599. * IOC Status Values
  600. *
  601. *****************************************************************************/
  602. /*mask for IOCStatus status value */
  603. #define MPI2_IOCSTATUS_MASK (0x7FFF)
  604. /****************************************************************************
  605. * Common IOCStatus values for all replies
  606. ****************************************************************************/
  607. #define MPI2_IOCSTATUS_SUCCESS (0x0000)
  608. #define MPI2_IOCSTATUS_INVALID_FUNCTION (0x0001)
  609. #define MPI2_IOCSTATUS_BUSY (0x0002)
  610. #define MPI2_IOCSTATUS_INVALID_SGL (0x0003)
  611. #define MPI2_IOCSTATUS_INTERNAL_ERROR (0x0004)
  612. #define MPI2_IOCSTATUS_INVALID_VPID (0x0005)
  613. #define MPI2_IOCSTATUS_INSUFFICIENT_RESOURCES (0x0006)
  614. #define MPI2_IOCSTATUS_INVALID_FIELD (0x0007)
  615. #define MPI2_IOCSTATUS_INVALID_STATE (0x0008)
  616. #define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED (0x0009)
  617. #define MPI2_IOCSTATUS_INSUFFICIENT_POWER (0x000A)
  618. /****************************************************************************
  619. * Config IOCStatus values
  620. ****************************************************************************/
  621. #define MPI2_IOCSTATUS_CONFIG_INVALID_ACTION (0x0020)
  622. #define MPI2_IOCSTATUS_CONFIG_INVALID_TYPE (0x0021)
  623. #define MPI2_IOCSTATUS_CONFIG_INVALID_PAGE (0x0022)
  624. #define MPI2_IOCSTATUS_CONFIG_INVALID_DATA (0x0023)
  625. #define MPI2_IOCSTATUS_CONFIG_NO_DEFAULTS (0x0024)
  626. #define MPI2_IOCSTATUS_CONFIG_CANT_COMMIT (0x0025)
  627. /****************************************************************************
  628. * SCSI IO Reply
  629. ****************************************************************************/
  630. #define MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR (0x0040)
  631. #define MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE (0x0042)
  632. #define MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE (0x0043)
  633. #define MPI2_IOCSTATUS_SCSI_DATA_OVERRUN (0x0044)
  634. #define MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN (0x0045)
  635. #define MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR (0x0046)
  636. #define MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR (0x0047)
  637. #define MPI2_IOCSTATUS_SCSI_TASK_TERMINATED (0x0048)
  638. #define MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH (0x0049)
  639. #define MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED (0x004A)
  640. #define MPI2_IOCSTATUS_SCSI_IOC_TERMINATED (0x004B)
  641. #define MPI2_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C)
  642. /****************************************************************************
  643. * For use by SCSI Initiator and SCSI Target end-to-end data protection
  644. ****************************************************************************/
  645. #define MPI2_IOCSTATUS_EEDP_GUARD_ERROR (0x004D)
  646. #define MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR (0x004E)
  647. #define MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR (0x004F)
  648. /****************************************************************************
  649. * SCSI Target values
  650. ****************************************************************************/
  651. #define MPI2_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062)
  652. #define MPI2_IOCSTATUS_TARGET_ABORTED (0x0063)
  653. #define MPI2_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064)
  654. #define MPI2_IOCSTATUS_TARGET_NO_CONNECTION (0x0065)
  655. #define MPI2_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A)
  656. #define MPI2_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D)
  657. #define MPI2_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E)
  658. #define MPI2_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006F)
  659. #define MPI2_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT (0x0070)
  660. #define MPI2_IOCSTATUS_TARGET_NAK_RECEIVED (0x0071)
  661. /****************************************************************************
  662. * Serial Attached SCSI values
  663. ****************************************************************************/
  664. #define MPI2_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090)
  665. #define MPI2_IOCSTATUS_SAS_SMP_DATA_OVERRUN (0x0091)
  666. /****************************************************************************
  667. * Diagnostic Buffer Post / Diagnostic Release values
  668. ****************************************************************************/
  669. #define MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED (0x00A0)
  670. /****************************************************************************
  671. * RAID Accelerator values
  672. ****************************************************************************/
  673. #define MPI2_IOCSTATUS_RAID_ACCEL_ERROR (0x00B0)
  674. /****************************************************************************
  675. * IOCStatus flag to indicate that log info is available
  676. ****************************************************************************/
  677. #define MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE (0x8000)
  678. /****************************************************************************
  679. * IOCLogInfo Types
  680. ****************************************************************************/
  681. #define MPI2_IOCLOGINFO_TYPE_MASK (0xF0000000)
  682. #define MPI2_IOCLOGINFO_TYPE_SHIFT (28)
  683. #define MPI2_IOCLOGINFO_TYPE_NONE (0x0)
  684. #define MPI2_IOCLOGINFO_TYPE_SCSI (0x1)
  685. #define MPI2_IOCLOGINFO_TYPE_FC (0x2)
  686. #define MPI2_IOCLOGINFO_TYPE_SAS (0x3)
  687. #define MPI2_IOCLOGINFO_TYPE_ISCSI (0x4)
  688. #define MPI2_IOCLOGINFO_LOG_DATA_MASK (0x0FFFFFFF)
  689. /*****************************************************************************
  690. *
  691. * Standard Message Structures
  692. *
  693. *****************************************************************************/
  694. /****************************************************************************
  695. *Request Message Header for all request messages
  696. ****************************************************************************/
  697. typedef struct _MPI2_REQUEST_HEADER {
  698. U16 FunctionDependent1; /*0x00 */
  699. U8 ChainOffset; /*0x02 */
  700. U8 Function; /*0x03 */
  701. U16 FunctionDependent2; /*0x04 */
  702. U8 FunctionDependent3; /*0x06 */
  703. U8 MsgFlags; /*0x07 */
  704. U8 VP_ID; /*0x08 */
  705. U8 VF_ID; /*0x09 */
  706. U16 Reserved1; /*0x0A */
  707. } MPI2_REQUEST_HEADER, *PTR_MPI2_REQUEST_HEADER,
  708. MPI2RequestHeader_t, *pMPI2RequestHeader_t;
  709. /****************************************************************************
  710. * Default Reply
  711. ****************************************************************************/
  712. typedef struct _MPI2_DEFAULT_REPLY {
  713. U16 FunctionDependent1; /*0x00 */
  714. U8 MsgLength; /*0x02 */
  715. U8 Function; /*0x03 */
  716. U16 FunctionDependent2; /*0x04 */
  717. U8 FunctionDependent3; /*0x06 */
  718. U8 MsgFlags; /*0x07 */
  719. U8 VP_ID; /*0x08 */
  720. U8 VF_ID; /*0x09 */
  721. U16 Reserved1; /*0x0A */
  722. U16 FunctionDependent5; /*0x0C */
  723. U16 IOCStatus; /*0x0E */
  724. U32 IOCLogInfo; /*0x10 */
  725. } MPI2_DEFAULT_REPLY, *PTR_MPI2_DEFAULT_REPLY,
  726. MPI2DefaultReply_t, *pMPI2DefaultReply_t;
  727. /*common version structure/union used in messages and configuration pages */
  728. typedef struct _MPI2_VERSION_STRUCT {
  729. U8 Dev; /*0x00 */
  730. U8 Unit; /*0x01 */
  731. U8 Minor; /*0x02 */
  732. U8 Major; /*0x03 */
  733. } MPI2_VERSION_STRUCT;
  734. typedef union _MPI2_VERSION_UNION {
  735. MPI2_VERSION_STRUCT Struct;
  736. U32 Word;
  737. } MPI2_VERSION_UNION;
  738. /*LUN field defines, common to many structures */
  739. #define MPI2_LUN_FIRST_LEVEL_ADDRESSING (0x0000FFFF)
  740. #define MPI2_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000)
  741. #define MPI2_LUN_THIRD_LEVEL_ADDRESSING (0x0000FFFF)
  742. #define MPI2_LUN_FOURTH_LEVEL_ADDRESSING (0xFFFF0000)
  743. #define MPI2_LUN_LEVEL_1_WORD (0xFF00)
  744. #define MPI2_LUN_LEVEL_1_DWORD (0x0000FF00)
  745. /*****************************************************************************
  746. *
  747. * Fusion-MPT MPI Scatter Gather Elements
  748. *
  749. *****************************************************************************/
  750. /****************************************************************************
  751. * MPI Simple Element structures
  752. ****************************************************************************/
  753. typedef struct _MPI2_SGE_SIMPLE32 {
  754. U32 FlagsLength;
  755. U32 Address;
  756. } MPI2_SGE_SIMPLE32, *PTR_MPI2_SGE_SIMPLE32,
  757. Mpi2SGESimple32_t, *pMpi2SGESimple32_t;
  758. typedef struct _MPI2_SGE_SIMPLE64 {
  759. U32 FlagsLength;
  760. U64 Address;
  761. } MPI2_SGE_SIMPLE64, *PTR_MPI2_SGE_SIMPLE64,
  762. Mpi2SGESimple64_t, *pMpi2SGESimple64_t;
  763. typedef struct _MPI2_SGE_SIMPLE_UNION {
  764. U32 FlagsLength;
  765. union {
  766. U32 Address32;
  767. U64 Address64;
  768. } u;
  769. } MPI2_SGE_SIMPLE_UNION,
  770. *PTR_MPI2_SGE_SIMPLE_UNION,
  771. Mpi2SGESimpleUnion_t,
  772. *pMpi2SGESimpleUnion_t;
  773. /****************************************************************************
  774. * MPI Chain Element structures - for MPI v2.0 products only
  775. ****************************************************************************/
  776. typedef struct _MPI2_SGE_CHAIN32 {
  777. U16 Length;
  778. U8 NextChainOffset;
  779. U8 Flags;
  780. U32 Address;
  781. } MPI2_SGE_CHAIN32, *PTR_MPI2_SGE_CHAIN32,
  782. Mpi2SGEChain32_t, *pMpi2SGEChain32_t;
  783. typedef struct _MPI2_SGE_CHAIN64 {
  784. U16 Length;
  785. U8 NextChainOffset;
  786. U8 Flags;
  787. U64 Address;
  788. } MPI2_SGE_CHAIN64, *PTR_MPI2_SGE_CHAIN64,
  789. Mpi2SGEChain64_t, *pMpi2SGEChain64_t;
  790. typedef struct _MPI2_SGE_CHAIN_UNION {
  791. U16 Length;
  792. U8 NextChainOffset;
  793. U8 Flags;
  794. union {
  795. U32 Address32;
  796. U64 Address64;
  797. } u;
  798. } MPI2_SGE_CHAIN_UNION,
  799. *PTR_MPI2_SGE_CHAIN_UNION,
  800. Mpi2SGEChainUnion_t,
  801. *pMpi2SGEChainUnion_t;
  802. /****************************************************************************
  803. * MPI Transaction Context Element structures - for MPI v2.0 products only
  804. ****************************************************************************/
  805. typedef struct _MPI2_SGE_TRANSACTION32 {
  806. U8 Reserved;
  807. U8 ContextSize;
  808. U8 DetailsLength;
  809. U8 Flags;
  810. U32 TransactionContext[1];
  811. U32 TransactionDetails[1];
  812. } MPI2_SGE_TRANSACTION32,
  813. *PTR_MPI2_SGE_TRANSACTION32,
  814. Mpi2SGETransaction32_t,
  815. *pMpi2SGETransaction32_t;
  816. typedef struct _MPI2_SGE_TRANSACTION64 {
  817. U8 Reserved;
  818. U8 ContextSize;
  819. U8 DetailsLength;
  820. U8 Flags;
  821. U32 TransactionContext[2];
  822. U32 TransactionDetails[1];
  823. } MPI2_SGE_TRANSACTION64,
  824. *PTR_MPI2_SGE_TRANSACTION64,
  825. Mpi2SGETransaction64_t,
  826. *pMpi2SGETransaction64_t;
  827. typedef struct _MPI2_SGE_TRANSACTION96 {
  828. U8 Reserved;
  829. U8 ContextSize;
  830. U8 DetailsLength;
  831. U8 Flags;
  832. U32 TransactionContext[3];
  833. U32 TransactionDetails[1];
  834. } MPI2_SGE_TRANSACTION96, *PTR_MPI2_SGE_TRANSACTION96,
  835. Mpi2SGETransaction96_t, *pMpi2SGETransaction96_t;
  836. typedef struct _MPI2_SGE_TRANSACTION128 {
  837. U8 Reserved;
  838. U8 ContextSize;
  839. U8 DetailsLength;
  840. U8 Flags;
  841. U32 TransactionContext[4];
  842. U32 TransactionDetails[1];
  843. } MPI2_SGE_TRANSACTION128, *PTR_MPI2_SGE_TRANSACTION128,
  844. Mpi2SGETransaction_t128, *pMpi2SGETransaction_t128;
  845. typedef struct _MPI2_SGE_TRANSACTION_UNION {
  846. U8 Reserved;
  847. U8 ContextSize;
  848. U8 DetailsLength;
  849. U8 Flags;
  850. union {
  851. U32 TransactionContext32[1];
  852. U32 TransactionContext64[2];
  853. U32 TransactionContext96[3];
  854. U32 TransactionContext128[4];
  855. } u;
  856. U32 TransactionDetails[1];
  857. } MPI2_SGE_TRANSACTION_UNION,
  858. *PTR_MPI2_SGE_TRANSACTION_UNION,
  859. Mpi2SGETransactionUnion_t,
  860. *pMpi2SGETransactionUnion_t;
  861. /****************************************************************************
  862. * MPI SGE union for IO SGL's - for MPI v2.0 products only
  863. ****************************************************************************/
  864. typedef struct _MPI2_MPI_SGE_IO_UNION {
  865. union {
  866. MPI2_SGE_SIMPLE_UNION Simple;
  867. MPI2_SGE_CHAIN_UNION Chain;
  868. } u;
  869. } MPI2_MPI_SGE_IO_UNION, *PTR_MPI2_MPI_SGE_IO_UNION,
  870. Mpi2MpiSGEIOUnion_t, *pMpi2MpiSGEIOUnion_t;
  871. /****************************************************************************
  872. * MPI SGE union for SGL's with Simple and Transaction elements - for MPI v2.0 products only
  873. ****************************************************************************/
  874. typedef struct _MPI2_SGE_TRANS_SIMPLE_UNION {
  875. union {
  876. MPI2_SGE_SIMPLE_UNION Simple;
  877. MPI2_SGE_TRANSACTION_UNION Transaction;
  878. } u;
  879. } MPI2_SGE_TRANS_SIMPLE_UNION,
  880. *PTR_MPI2_SGE_TRANS_SIMPLE_UNION,
  881. Mpi2SGETransSimpleUnion_t,
  882. *pMpi2SGETransSimpleUnion_t;
  883. /****************************************************************************
  884. * All MPI SGE types union
  885. ****************************************************************************/
  886. typedef struct _MPI2_MPI_SGE_UNION {
  887. union {
  888. MPI2_SGE_SIMPLE_UNION Simple;
  889. MPI2_SGE_CHAIN_UNION Chain;
  890. MPI2_SGE_TRANSACTION_UNION Transaction;
  891. } u;
  892. } MPI2_MPI_SGE_UNION, *PTR_MPI2_MPI_SGE_UNION,
  893. Mpi2MpiSgeUnion_t, *pMpi2MpiSgeUnion_t;
  894. /****************************************************************************
  895. * MPI SGE field definition and masks
  896. ****************************************************************************/
  897. /*Flags field bit definitions */
  898. #define MPI2_SGE_FLAGS_LAST_ELEMENT (0x80)
  899. #define MPI2_SGE_FLAGS_END_OF_BUFFER (0x40)
  900. #define MPI2_SGE_FLAGS_ELEMENT_TYPE_MASK (0x30)
  901. #define MPI2_SGE_FLAGS_LOCAL_ADDRESS (0x08)
  902. #define MPI2_SGE_FLAGS_DIRECTION (0x04)
  903. #define MPI2_SGE_FLAGS_ADDRESS_SIZE (0x02)
  904. #define MPI2_SGE_FLAGS_END_OF_LIST (0x01)
  905. #define MPI2_SGE_FLAGS_SHIFT (24)
  906. #define MPI2_SGE_LENGTH_MASK (0x00FFFFFF)
  907. #define MPI2_SGE_CHAIN_LENGTH_MASK (0x0000FFFF)
  908. /*Element Type */
  909. #define MPI2_SGE_FLAGS_TRANSACTION_ELEMENT (0x00)
  910. #define MPI2_SGE_FLAGS_SIMPLE_ELEMENT (0x10)
  911. #define MPI2_SGE_FLAGS_CHAIN_ELEMENT (0x30)
  912. #define MPI2_SGE_FLAGS_ELEMENT_MASK (0x30)
  913. /*Address location */
  914. #define MPI2_SGE_FLAGS_SYSTEM_ADDRESS (0x00)
  915. /*Direction */
  916. #define MPI2_SGE_FLAGS_IOC_TO_HOST (0x00)
  917. #define MPI2_SGE_FLAGS_HOST_TO_IOC (0x04)
  918. #define MPI2_SGE_FLAGS_DEST (MPI2_SGE_FLAGS_IOC_TO_HOST)
  919. #define MPI2_SGE_FLAGS_SOURCE (MPI2_SGE_FLAGS_HOST_TO_IOC)
  920. /*Address Size */
  921. #define MPI2_SGE_FLAGS_32_BIT_ADDRESSING (0x00)
  922. #define MPI2_SGE_FLAGS_64_BIT_ADDRESSING (0x02)
  923. /*Context Size */
  924. #define MPI2_SGE_FLAGS_32_BIT_CONTEXT (0x00)
  925. #define MPI2_SGE_FLAGS_64_BIT_CONTEXT (0x02)
  926. #define MPI2_SGE_FLAGS_96_BIT_CONTEXT (0x04)
  927. #define MPI2_SGE_FLAGS_128_BIT_CONTEXT (0x06)
  928. #define MPI2_SGE_CHAIN_OFFSET_MASK (0x00FF0000)
  929. #define MPI2_SGE_CHAIN_OFFSET_SHIFT (16)
  930. /****************************************************************************
  931. * MPI SGE operation Macros
  932. ****************************************************************************/
  933. /*SIMPLE FlagsLength manipulations... */
  934. #define MPI2_SGE_SET_FLAGS(f) ((U32)(f) << MPI2_SGE_FLAGS_SHIFT)
  935. #define MPI2_SGE_GET_FLAGS(f) (((f) & ~MPI2_SGE_LENGTH_MASK) >> \
  936. MPI2_SGE_FLAGS_SHIFT)
  937. #define MPI2_SGE_LENGTH(f) ((f) & MPI2_SGE_LENGTH_MASK)
  938. #define MPI2_SGE_CHAIN_LENGTH(f) ((f) & MPI2_SGE_CHAIN_LENGTH_MASK)
  939. #define MPI2_SGE_SET_FLAGS_LENGTH(f, l) (MPI2_SGE_SET_FLAGS(f) | \
  940. MPI2_SGE_LENGTH(l))
  941. #define MPI2_pSGE_GET_FLAGS(psg) MPI2_SGE_GET_FLAGS((psg)->FlagsLength)
  942. #define MPI2_pSGE_GET_LENGTH(psg) MPI2_SGE_LENGTH((psg)->FlagsLength)
  943. #define MPI2_pSGE_SET_FLAGS_LENGTH(psg, f, l) ((psg)->FlagsLength = \
  944. MPI2_SGE_SET_FLAGS_LENGTH(f, l))
  945. /*CAUTION - The following are READ-MODIFY-WRITE! */
  946. #define MPI2_pSGE_SET_FLAGS(psg, f) ((psg)->FlagsLength |= \
  947. MPI2_SGE_SET_FLAGS(f))
  948. #define MPI2_pSGE_SET_LENGTH(psg, l) ((psg)->FlagsLength |= \
  949. MPI2_SGE_LENGTH(l))
  950. #define MPI2_GET_CHAIN_OFFSET(x) ((x & MPI2_SGE_CHAIN_OFFSET_MASK) >> \
  951. MPI2_SGE_CHAIN_OFFSET_SHIFT)
  952. /*****************************************************************************
  953. *
  954. * Fusion-MPT IEEE Scatter Gather Elements
  955. *
  956. *****************************************************************************/
  957. /****************************************************************************
  958. * IEEE Simple Element structures
  959. ****************************************************************************/
  960. /*MPI2_IEEE_SGE_SIMPLE32 is for MPI v2.0 products only */
  961. typedef struct _MPI2_IEEE_SGE_SIMPLE32 {
  962. U32 Address;
  963. U32 FlagsLength;
  964. } MPI2_IEEE_SGE_SIMPLE32, *PTR_MPI2_IEEE_SGE_SIMPLE32,
  965. Mpi2IeeeSgeSimple32_t, *pMpi2IeeeSgeSimple32_t;
  966. typedef struct _MPI2_IEEE_SGE_SIMPLE64 {
  967. U64 Address;
  968. U32 Length;
  969. U16 Reserved1;
  970. U8 Reserved2;
  971. U8 Flags;
  972. } MPI2_IEEE_SGE_SIMPLE64, *PTR_MPI2_IEEE_SGE_SIMPLE64,
  973. Mpi2IeeeSgeSimple64_t, *pMpi2IeeeSgeSimple64_t;
  974. typedef union _MPI2_IEEE_SGE_SIMPLE_UNION {
  975. MPI2_IEEE_SGE_SIMPLE32 Simple32;
  976. MPI2_IEEE_SGE_SIMPLE64 Simple64;
  977. } MPI2_IEEE_SGE_SIMPLE_UNION,
  978. *PTR_MPI2_IEEE_SGE_SIMPLE_UNION,
  979. Mpi2IeeeSgeSimpleUnion_t,
  980. *pMpi2IeeeSgeSimpleUnion_t;
  981. /****************************************************************************
  982. * IEEE Chain Element structures
  983. ****************************************************************************/
  984. /*MPI2_IEEE_SGE_CHAIN32 is for MPI v2.0 products only */
  985. typedef MPI2_IEEE_SGE_SIMPLE32 MPI2_IEEE_SGE_CHAIN32;
  986. /*MPI2_IEEE_SGE_CHAIN64 is for MPI v2.0 products only */
  987. typedef MPI2_IEEE_SGE_SIMPLE64 MPI2_IEEE_SGE_CHAIN64;
  988. typedef union _MPI2_IEEE_SGE_CHAIN_UNION {
  989. MPI2_IEEE_SGE_CHAIN32 Chain32;
  990. MPI2_IEEE_SGE_CHAIN64 Chain64;
  991. } MPI2_IEEE_SGE_CHAIN_UNION,
  992. *PTR_MPI2_IEEE_SGE_CHAIN_UNION,
  993. Mpi2IeeeSgeChainUnion_t,
  994. *pMpi2IeeeSgeChainUnion_t;
  995. /*MPI25_IEEE_SGE_CHAIN64 is for MPI v2.5 and later */
  996. typedef struct _MPI25_IEEE_SGE_CHAIN64 {
  997. U64 Address;
  998. U32 Length;
  999. U16 Reserved1;
  1000. U8 NextChainOffset;
  1001. U8 Flags;
  1002. } MPI25_IEEE_SGE_CHAIN64,
  1003. *PTR_MPI25_IEEE_SGE_CHAIN64,
  1004. Mpi25IeeeSgeChain64_t,
  1005. *pMpi25IeeeSgeChain64_t;
  1006. /****************************************************************************
  1007. * All IEEE SGE types union
  1008. ****************************************************************************/
  1009. /*MPI2_IEEE_SGE_UNION is for MPI v2.0 products only */
  1010. typedef struct _MPI2_IEEE_SGE_UNION {
  1011. union {
  1012. MPI2_IEEE_SGE_SIMPLE_UNION Simple;
  1013. MPI2_IEEE_SGE_CHAIN_UNION Chain;
  1014. } u;
  1015. } MPI2_IEEE_SGE_UNION, *PTR_MPI2_IEEE_SGE_UNION,
  1016. Mpi2IeeeSgeUnion_t, *pMpi2IeeeSgeUnion_t;
  1017. /****************************************************************************
  1018. * IEEE SGE union for IO SGL's
  1019. ****************************************************************************/
  1020. typedef union _MPI25_SGE_IO_UNION {
  1021. MPI2_IEEE_SGE_SIMPLE64 IeeeSimple;
  1022. MPI25_IEEE_SGE_CHAIN64 IeeeChain;
  1023. } MPI25_SGE_IO_UNION, *PTR_MPI25_SGE_IO_UNION,
  1024. Mpi25SGEIOUnion_t, *pMpi25SGEIOUnion_t;
  1025. /****************************************************************************
  1026. * IEEE SGE field definitions and masks
  1027. ****************************************************************************/
  1028. /*Flags field bit definitions */
  1029. #define MPI2_IEEE_SGE_FLAGS_ELEMENT_TYPE_MASK (0x80)
  1030. #define MPI25_IEEE_SGE_FLAGS_END_OF_LIST (0x40)
  1031. #define MPI2_IEEE32_SGE_FLAGS_SHIFT (24)
  1032. #define MPI2_IEEE32_SGE_LENGTH_MASK (0x00FFFFFF)
  1033. /*Element Type */
  1034. #define MPI2_IEEE_SGE_FLAGS_SIMPLE_ELEMENT (0x00)
  1035. #define MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT (0x80)
  1036. /*Next Segment Format */
  1037. #define MPI26_IEEE_SGE_FLAGS_NSF_MASK (0x1C)
  1038. #define MPI26_IEEE_SGE_FLAGS_NSF_MPI_IEEE (0x00)
  1039. #define MPI26_IEEE_SGE_FLAGS_NSF_NVME_PRP (0x08)
  1040. #define MPI26_IEEE_SGE_FLAGS_NSF_NVME_SGL (0x10)
  1041. /*Data Location Address Space */
  1042. #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK (0x03)
  1043. #define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00)
  1044. #define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01)
  1045. #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR (0x02)
  1046. #define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03)
  1047. #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR (0x03)
  1048. #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR \
  1049. (MPI2_IEEE_SGE_FLAGS_SYSTEMPLBPCI_ADDR)
  1050. #define MPI26_IEEE_SGE_FLAGS_IOCCTL_ADDR (0x02)
  1051. /****************************************************************************
  1052. * IEEE SGE operation Macros
  1053. ****************************************************************************/
  1054. /*SIMPLE FlagsLength manipulations... */
  1055. #define MPI2_IEEE32_SGE_SET_FLAGS(f) ((U32)(f) << MPI2_IEEE32_SGE_FLAGS_SHIFT)
  1056. #define MPI2_IEEE32_SGE_GET_FLAGS(f) (((f) & ~MPI2_IEEE32_SGE_LENGTH_MASK) \
  1057. >> MPI2_IEEE32_SGE_FLAGS_SHIFT)
  1058. #define MPI2_IEEE32_SGE_LENGTH(f) ((f) & MPI2_IEEE32_SGE_LENGTH_MASK)
  1059. #define MPI2_IEEE32_SGE_SET_FLAGS_LENGTH(f, l) (MPI2_IEEE32_SGE_SET_FLAGS(f) |\
  1060. MPI2_IEEE32_SGE_LENGTH(l))
  1061. #define MPI2_IEEE32_pSGE_GET_FLAGS(psg) \
  1062. MPI2_IEEE32_SGE_GET_FLAGS((psg)->FlagsLength)
  1063. #define MPI2_IEEE32_pSGE_GET_LENGTH(psg) \
  1064. MPI2_IEEE32_SGE_LENGTH((psg)->FlagsLength)
  1065. #define MPI2_IEEE32_pSGE_SET_FLAGS_LENGTH(psg, f, l) ((psg)->FlagsLength = \
  1066. MPI2_IEEE32_SGE_SET_FLAGS_LENGTH(f, l))
  1067. /*CAUTION - The following are READ-MODIFY-WRITE! */
  1068. #define MPI2_IEEE32_pSGE_SET_FLAGS(psg, f) ((psg)->FlagsLength |= \
  1069. MPI2_IEEE32_SGE_SET_FLAGS(f))
  1070. #define MPI2_IEEE32_pSGE_SET_LENGTH(psg, l) ((psg)->FlagsLength |= \
  1071. MPI2_IEEE32_SGE_LENGTH(l))
  1072. /*****************************************************************************
  1073. *
  1074. * Fusion-MPT MPI/IEEE Scatter Gather Unions
  1075. *
  1076. *****************************************************************************/
  1077. typedef union _MPI2_SIMPLE_SGE_UNION {
  1078. MPI2_SGE_SIMPLE_UNION MpiSimple;
  1079. MPI2_IEEE_SGE_SIMPLE_UNION IeeeSimple;
  1080. } MPI2_SIMPLE_SGE_UNION, *PTR_MPI2_SIMPLE_SGE_UNION,
  1081. Mpi2SimpleSgeUntion_t, *pMpi2SimpleSgeUntion_t;
  1082. typedef union _MPI2_SGE_IO_UNION {
  1083. MPI2_SGE_SIMPLE_UNION MpiSimple;
  1084. MPI2_SGE_CHAIN_UNION MpiChain;
  1085. MPI2_IEEE_SGE_SIMPLE_UNION IeeeSimple;
  1086. MPI2_IEEE_SGE_CHAIN_UNION IeeeChain;
  1087. } MPI2_SGE_IO_UNION, *PTR_MPI2_SGE_IO_UNION,
  1088. Mpi2SGEIOUnion_t, *pMpi2SGEIOUnion_t;
  1089. /****************************************************************************
  1090. *
  1091. * Values for SGLFlags field, used in many request messages with an SGL
  1092. *
  1093. ****************************************************************************/
  1094. /*values for MPI SGL Data Location Address Space subfield */
  1095. #define MPI2_SGLFLAGS_ADDRESS_SPACE_MASK (0x0C)
  1096. #define MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE (0x00)
  1097. #define MPI2_SGLFLAGS_IOCDDR_ADDRESS_SPACE (0x04)
  1098. #define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08)
  1099. #define MPI26_SGLFLAGS_IOCPLB_ADDRESS_SPACE (0x08)
  1100. #define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE (0x0C)
  1101. /*values for SGL Type subfield */
  1102. #define MPI2_SGLFLAGS_SGL_TYPE_MASK (0x03)
  1103. #define MPI2_SGLFLAGS_SGL_TYPE_MPI (0x00)
  1104. #define MPI2_SGLFLAGS_SGL_TYPE_IEEE32 (0x01)
  1105. #define MPI2_SGLFLAGS_SGL_TYPE_IEEE64 (0x02)
  1106. #endif