mpi2_sas.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. /*
  2. * Copyright 2000-2015 Avago Technologies. All rights reserved.
  3. *
  4. *
  5. * Name: mpi2_sas.h
  6. * Title: MPI Serial Attached SCSI structures and definitions
  7. * Creation Date: February 9, 2007
  8. *
  9. * mpi2_sas.h Version: 02.00.10
  10. *
  11. * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  12. * prefix are for use only on MPI v2.5 products, and must not be used
  13. * with MPI v2.0 products. Unless otherwise noted, names beginning with
  14. * MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products.
  15. *
  16. * Version History
  17. * ---------------
  18. *
  19. * Date Version Description
  20. * -------- -------- ------------------------------------------------------
  21. * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A.
  22. * 06-26-07 02.00.01 Added Clear All Persistent Operation to SAS IO Unit
  23. * Control Request.
  24. * 10-02-08 02.00.02 Added Set IOC Parameter Operation to SAS IO Unit Control
  25. * Request.
  26. * 10-28-09 02.00.03 Changed the type of SGL in MPI2_SATA_PASSTHROUGH_REQUEST
  27. * to MPI2_SGE_IO_UNION since it supports chained SGLs.
  28. * 05-12-10 02.00.04 Modified some comments.
  29. * 08-11-10 02.00.05 Added NCQ operations to SAS IO Unit Control.
  30. * 11-18-11 02.00.06 Incorporating additions for MPI v2.5.
  31. * 07-10-12 02.00.07 Added MPI2_SATA_PT_SGE_UNION for use in the SATA
  32. * Passthrough Request message.
  33. * 08-19-13 02.00.08 Made MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL obsolete
  34. * for anything newer than MPI v2.0.
  35. * 11-18-14 02.00.09 Updated copyright information.
  36. * 03-16-15 02.00.10 Updated for MPI v2.6.
  37. * Added MPI2_SATA_PT_REQ_PT_FLAGS_FPDMA.
  38. * --------------------------------------------------------------------------
  39. */
  40. #ifndef MPI2_SAS_H
  41. #define MPI2_SAS_H
  42. /*
  43. *Values for SASStatus.
  44. */
  45. #define MPI2_SASSTATUS_SUCCESS (0x00)
  46. #define MPI2_SASSTATUS_UNKNOWN_ERROR (0x01)
  47. #define MPI2_SASSTATUS_INVALID_FRAME (0x02)
  48. #define MPI2_SASSTATUS_UTC_BAD_DEST (0x03)
  49. #define MPI2_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
  50. #define MPI2_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
  51. #define MPI2_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
  52. #define MPI2_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
  53. #define MPI2_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
  54. #define MPI2_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
  55. #define MPI2_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
  56. #define MPI2_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
  57. #define MPI2_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
  58. #define MPI2_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
  59. #define MPI2_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
  60. #define MPI2_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
  61. #define MPI2_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
  62. #define MPI2_SASSTATUS_DATA_OFFSET_ERROR (0x11)
  63. #define MPI2_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
  64. #define MPI2_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
  65. #define MPI2_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
  66. /*
  67. *Values for the SAS DeviceInfo field used in SAS Device Status Change Event
  68. *data and SAS Configuration pages.
  69. */
  70. #define MPI2_SAS_DEVICE_INFO_SEP (0x00004000)
  71. #define MPI2_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
  72. #define MPI2_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
  73. #define MPI2_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
  74. #define MPI2_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
  75. #define MPI2_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
  76. #define MPI2_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
  77. #define MPI2_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
  78. #define MPI2_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
  79. #define MPI2_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
  80. #define MPI2_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
  81. #define MPI2_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
  82. #define MPI2_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
  83. #define MPI2_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
  84. #define MPI2_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
  85. #define MPI2_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
  86. #define MPI2_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
  87. /*****************************************************************************
  88. *
  89. * SAS Messages
  90. *
  91. *****************************************************************************/
  92. /****************************************************************************
  93. * SMP Passthrough messages
  94. ****************************************************************************/
  95. /*SMP Passthrough Request Message */
  96. typedef struct _MPI2_SMP_PASSTHROUGH_REQUEST {
  97. U8 PassthroughFlags; /*0x00 */
  98. U8 PhysicalPort; /*0x01 */
  99. U8 ChainOffset; /*0x02 */
  100. U8 Function; /*0x03 */
  101. U16 RequestDataLength; /*0x04 */
  102. U8 SGLFlags; /*0x06*//*MPI v2.0 only. Reserved on MPI v2.5*/
  103. U8 MsgFlags; /*0x07 */
  104. U8 VP_ID; /*0x08 */
  105. U8 VF_ID; /*0x09 */
  106. U16 Reserved1; /*0x0A */
  107. U32 Reserved2; /*0x0C */
  108. U64 SASAddress; /*0x10 */
  109. U32 Reserved3; /*0x18 */
  110. U32 Reserved4; /*0x1C */
  111. MPI2_SIMPLE_SGE_UNION SGL;/*0x20 */
  112. } MPI2_SMP_PASSTHROUGH_REQUEST, *PTR_MPI2_SMP_PASSTHROUGH_REQUEST,
  113. Mpi2SmpPassthroughRequest_t, *pMpi2SmpPassthroughRequest_t;
  114. /*values for PassthroughFlags field */
  115. #define MPI2_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80)
  116. /*MPI v2.0: use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
  117. /*SMP Passthrough Reply Message */
  118. typedef struct _MPI2_SMP_PASSTHROUGH_REPLY {
  119. U8 PassthroughFlags; /*0x00 */
  120. U8 PhysicalPort; /*0x01 */
  121. U8 MsgLength; /*0x02 */
  122. U8 Function; /*0x03 */
  123. U16 ResponseDataLength; /*0x04 */
  124. U8 SGLFlags; /*0x06 */
  125. U8 MsgFlags; /*0x07 */
  126. U8 VP_ID; /*0x08 */
  127. U8 VF_ID; /*0x09 */
  128. U16 Reserved1; /*0x0A */
  129. U8 Reserved2; /*0x0C */
  130. U8 SASStatus; /*0x0D */
  131. U16 IOCStatus; /*0x0E */
  132. U32 IOCLogInfo; /*0x10 */
  133. U32 Reserved3; /*0x14 */
  134. U8 ResponseData[4]; /*0x18 */
  135. } MPI2_SMP_PASSTHROUGH_REPLY, *PTR_MPI2_SMP_PASSTHROUGH_REPLY,
  136. Mpi2SmpPassthroughReply_t, *pMpi2SmpPassthroughReply_t;
  137. /*values for PassthroughFlags field */
  138. #define MPI2_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80)
  139. /*values for SASStatus field are at the top of this file */
  140. /****************************************************************************
  141. * SATA Passthrough messages
  142. ****************************************************************************/
  143. typedef union _MPI2_SATA_PT_SGE_UNION {
  144. MPI2_SGE_SIMPLE_UNION MpiSimple; /*MPI v2.0 only */
  145. MPI2_SGE_CHAIN_UNION MpiChain; /*MPI v2.0 only */
  146. MPI2_IEEE_SGE_SIMPLE_UNION IeeeSimple;
  147. MPI2_IEEE_SGE_CHAIN_UNION IeeeChain; /*MPI v2.0 only */
  148. MPI25_IEEE_SGE_CHAIN64 IeeeChain64; /*MPI v2.5 only */
  149. } MPI2_SATA_PT_SGE_UNION, *PTR_MPI2_SATA_PT_SGE_UNION,
  150. Mpi2SataPTSGEUnion_t, *pMpi2SataPTSGEUnion_t;
  151. /*SATA Passthrough Request Message */
  152. typedef struct _MPI2_SATA_PASSTHROUGH_REQUEST {
  153. U16 DevHandle; /*0x00 */
  154. U8 ChainOffset; /*0x02 */
  155. U8 Function; /*0x03 */
  156. U16 PassthroughFlags; /*0x04 */
  157. U8 SGLFlags; /*0x06*//*MPI v2.0 only. Reserved on MPI v2.5*/
  158. U8 MsgFlags; /*0x07 */
  159. U8 VP_ID; /*0x08 */
  160. U8 VF_ID; /*0x09 */
  161. U16 Reserved1; /*0x0A */
  162. U32 Reserved2; /*0x0C */
  163. U32 Reserved3; /*0x10 */
  164. U32 Reserved4; /*0x14 */
  165. U32 DataLength; /*0x18 */
  166. U8 CommandFIS[20]; /*0x1C */
  167. MPI2_SATA_PT_SGE_UNION SGL;/*0x30*//*MPI v2.5: IEEE 64 elements only*/
  168. } MPI2_SATA_PASSTHROUGH_REQUEST, *PTR_MPI2_SATA_PASSTHROUGH_REQUEST,
  169. Mpi2SataPassthroughRequest_t,
  170. *pMpi2SataPassthroughRequest_t;
  171. /*values for PassthroughFlags field */
  172. #define MPI2_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100)
  173. #define MPI2_SATA_PT_REQ_PT_FLAGS_FPDMA (0x0040)
  174. #define MPI2_SATA_PT_REQ_PT_FLAGS_DMA (0x0020)
  175. #define MPI2_SATA_PT_REQ_PT_FLAGS_PIO (0x0010)
  176. #define MPI2_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004)
  177. #define MPI2_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002)
  178. #define MPI2_SATA_PT_REQ_PT_FLAGS_READ (0x0001)
  179. /*MPI v2.0: use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
  180. /*SATA Passthrough Reply Message */
  181. typedef struct _MPI2_SATA_PASSTHROUGH_REPLY {
  182. U16 DevHandle; /*0x00 */
  183. U8 MsgLength; /*0x02 */
  184. U8 Function; /*0x03 */
  185. U16 PassthroughFlags; /*0x04 */
  186. U8 SGLFlags; /*0x06 */
  187. U8 MsgFlags; /*0x07 */
  188. U8 VP_ID; /*0x08 */
  189. U8 VF_ID; /*0x09 */
  190. U16 Reserved1; /*0x0A */
  191. U8 Reserved2; /*0x0C */
  192. U8 SASStatus; /*0x0D */
  193. U16 IOCStatus; /*0x0E */
  194. U32 IOCLogInfo; /*0x10 */
  195. U8 StatusFIS[20]; /*0x14 */
  196. U32 StatusControlRegisters; /*0x28 */
  197. U32 TransferCount; /*0x2C */
  198. } MPI2_SATA_PASSTHROUGH_REPLY, *PTR_MPI2_SATA_PASSTHROUGH_REPLY,
  199. Mpi2SataPassthroughReply_t, *pMpi2SataPassthroughReply_t;
  200. /*values for SASStatus field are at the top of this file */
  201. /****************************************************************************
  202. * SAS IO Unit Control messages
  203. * (MPI v2.5 and earlier only.
  204. * Replaced by IO Unit Control messages in MPI v2.6 and later.)
  205. ****************************************************************************/
  206. /*SAS IO Unit Control Request Message */
  207. typedef struct _MPI2_SAS_IOUNIT_CONTROL_REQUEST {
  208. U8 Operation; /*0x00 */
  209. U8 Reserved1; /*0x01 */
  210. U8 ChainOffset; /*0x02 */
  211. U8 Function; /*0x03 */
  212. U16 DevHandle; /*0x04 */
  213. U8 IOCParameter; /*0x06 */
  214. U8 MsgFlags; /*0x07 */
  215. U8 VP_ID; /*0x08 */
  216. U8 VF_ID; /*0x09 */
  217. U16 Reserved3; /*0x0A */
  218. U16 Reserved4; /*0x0C */
  219. U8 PhyNum; /*0x0E */
  220. U8 PrimFlags; /*0x0F */
  221. U32 Primitive; /*0x10 */
  222. U8 LookupMethod; /*0x14 */
  223. U8 Reserved5; /*0x15 */
  224. U16 SlotNumber; /*0x16 */
  225. U64 LookupAddress; /*0x18 */
  226. U32 IOCParameterValue; /*0x20 */
  227. U32 Reserved7; /*0x24 */
  228. U32 Reserved8; /*0x28 */
  229. } MPI2_SAS_IOUNIT_CONTROL_REQUEST,
  230. *PTR_MPI2_SAS_IOUNIT_CONTROL_REQUEST,
  231. Mpi2SasIoUnitControlRequest_t,
  232. *pMpi2SasIoUnitControlRequest_t;
  233. /*values for the Operation field */
  234. #define MPI2_SAS_OP_CLEAR_ALL_PERSISTENT (0x02)
  235. #define MPI2_SAS_OP_PHY_LINK_RESET (0x06)
  236. #define MPI2_SAS_OP_PHY_HARD_RESET (0x07)
  237. #define MPI2_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
  238. #define MPI2_SAS_OP_SEND_PRIMITIVE (0x0A)
  239. #define MPI2_SAS_OP_FORCE_FULL_DISCOVERY (0x0B)
  240. #define MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C) /* MPI v2.0 only */
  241. #define MPI2_SAS_OP_REMOVE_DEVICE (0x0D)
  242. #define MPI2_SAS_OP_LOOKUP_MAPPING (0x0E)
  243. #define MPI2_SAS_OP_SET_IOC_PARAMETER (0x0F)
  244. #define MPI25_SAS_OP_ENABLE_FP_DEVICE (0x10)
  245. #define MPI25_SAS_OP_DISABLE_FP_DEVICE (0x11)
  246. #define MPI25_SAS_OP_ENABLE_FP_ALL (0x12)
  247. #define MPI25_SAS_OP_DISABLE_FP_ALL (0x13)
  248. #define MPI2_SAS_OP_DEV_ENABLE_NCQ (0x14)
  249. #define MPI2_SAS_OP_DEV_DISABLE_NCQ (0x15)
  250. #define MPI2_SAS_OP_PRODUCT_SPECIFIC_MIN (0x80)
  251. /*values for the PrimFlags field */
  252. #define MPI2_SAS_PRIMFLAGS_SINGLE (0x08)
  253. #define MPI2_SAS_PRIMFLAGS_TRIPLE (0x02)
  254. #define MPI2_SAS_PRIMFLAGS_REDUNDANT (0x01)
  255. /*values for the LookupMethod field */
  256. #define MPI2_SAS_LOOKUP_METHOD_SAS_ADDRESS (0x01)
  257. #define MPI2_SAS_LOOKUP_METHOD_SAS_ENCLOSURE_SLOT (0x02)
  258. #define MPI2_SAS_LOOKUP_METHOD_SAS_DEVICE_NAME (0x03)
  259. /*SAS IO Unit Control Reply Message */
  260. typedef struct _MPI2_SAS_IOUNIT_CONTROL_REPLY {
  261. U8 Operation; /*0x00 */
  262. U8 Reserved1; /*0x01 */
  263. U8 MsgLength; /*0x02 */
  264. U8 Function; /*0x03 */
  265. U16 DevHandle; /*0x04 */
  266. U8 IOCParameter; /*0x06 */
  267. U8 MsgFlags; /*0x07 */
  268. U8 VP_ID; /*0x08 */
  269. U8 VF_ID; /*0x09 */
  270. U16 Reserved3; /*0x0A */
  271. U16 Reserved4; /*0x0C */
  272. U16 IOCStatus; /*0x0E */
  273. U32 IOCLogInfo; /*0x10 */
  274. } MPI2_SAS_IOUNIT_CONTROL_REPLY,
  275. *PTR_MPI2_SAS_IOUNIT_CONTROL_REPLY,
  276. Mpi2SasIoUnitControlReply_t, *pMpi2SasIoUnitControlReply_t;
  277. #endif