mpi2_sas.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. /*
  2. * Copyright (c) 2000-2012 LSI Corporation.
  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.07
  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. * --------------------------------------------------------------------------
  34. */
  35. #ifndef MPI2_SAS_H
  36. #define MPI2_SAS_H
  37. /*
  38. *Values for SASStatus.
  39. */
  40. #define MPI2_SASSTATUS_SUCCESS (0x00)
  41. #define MPI2_SASSTATUS_UNKNOWN_ERROR (0x01)
  42. #define MPI2_SASSTATUS_INVALID_FRAME (0x02)
  43. #define MPI2_SASSTATUS_UTC_BAD_DEST (0x03)
  44. #define MPI2_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
  45. #define MPI2_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
  46. #define MPI2_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
  47. #define MPI2_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
  48. #define MPI2_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
  49. #define MPI2_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
  50. #define MPI2_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
  51. #define MPI2_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
  52. #define MPI2_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
  53. #define MPI2_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
  54. #define MPI2_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
  55. #define MPI2_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
  56. #define MPI2_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
  57. #define MPI2_SASSTATUS_DATA_OFFSET_ERROR (0x11)
  58. #define MPI2_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
  59. #define MPI2_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
  60. #define MPI2_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
  61. /*
  62. *Values for the SAS DeviceInfo field used in SAS Device Status Change Event
  63. *data and SAS Configuration pages.
  64. */
  65. #define MPI2_SAS_DEVICE_INFO_SEP (0x00004000)
  66. #define MPI2_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
  67. #define MPI2_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
  68. #define MPI2_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
  69. #define MPI2_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
  70. #define MPI2_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
  71. #define MPI2_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
  72. #define MPI2_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
  73. #define MPI2_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
  74. #define MPI2_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
  75. #define MPI2_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
  76. #define MPI2_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
  77. #define MPI2_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
  78. #define MPI2_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
  79. #define MPI2_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
  80. #define MPI2_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
  81. #define MPI2_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
  82. /*****************************************************************************
  83. *
  84. * SAS Messages
  85. *
  86. *****************************************************************************/
  87. /****************************************************************************
  88. * SMP Passthrough messages
  89. ****************************************************************************/
  90. /*SMP Passthrough Request Message */
  91. typedef struct _MPI2_SMP_PASSTHROUGH_REQUEST {
  92. U8 PassthroughFlags; /*0x00 */
  93. U8 PhysicalPort; /*0x01 */
  94. U8 ChainOffset; /*0x02 */
  95. U8 Function; /*0x03 */
  96. U16 RequestDataLength; /*0x04 */
  97. U8 SGLFlags; /*0x06*//*MPI v2.0 only. Reserved on MPI v2.5*/
  98. U8 MsgFlags; /*0x07 */
  99. U8 VP_ID; /*0x08 */
  100. U8 VF_ID; /*0x09 */
  101. U16 Reserved1; /*0x0A */
  102. U32 Reserved2; /*0x0C */
  103. U64 SASAddress; /*0x10 */
  104. U32 Reserved3; /*0x18 */
  105. U32 Reserved4; /*0x1C */
  106. MPI2_SIMPLE_SGE_UNION SGL;/*0x20 */
  107. } MPI2_SMP_PASSTHROUGH_REQUEST, *PTR_MPI2_SMP_PASSTHROUGH_REQUEST,
  108. Mpi2SmpPassthroughRequest_t, *pMpi2SmpPassthroughRequest_t;
  109. /*values for PassthroughFlags field */
  110. #define MPI2_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80)
  111. /*MPI v2.0: use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
  112. /*SMP Passthrough Reply Message */
  113. typedef struct _MPI2_SMP_PASSTHROUGH_REPLY {
  114. U8 PassthroughFlags; /*0x00 */
  115. U8 PhysicalPort; /*0x01 */
  116. U8 MsgLength; /*0x02 */
  117. U8 Function; /*0x03 */
  118. U16 ResponseDataLength; /*0x04 */
  119. U8 SGLFlags; /*0x06 */
  120. U8 MsgFlags; /*0x07 */
  121. U8 VP_ID; /*0x08 */
  122. U8 VF_ID; /*0x09 */
  123. U16 Reserved1; /*0x0A */
  124. U8 Reserved2; /*0x0C */
  125. U8 SASStatus; /*0x0D */
  126. U16 IOCStatus; /*0x0E */
  127. U32 IOCLogInfo; /*0x10 */
  128. U32 Reserved3; /*0x14 */
  129. U8 ResponseData[4]; /*0x18 */
  130. } MPI2_SMP_PASSTHROUGH_REPLY, *PTR_MPI2_SMP_PASSTHROUGH_REPLY,
  131. Mpi2SmpPassthroughReply_t, *pMpi2SmpPassthroughReply_t;
  132. /*values for PassthroughFlags field */
  133. #define MPI2_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80)
  134. /*values for SASStatus field are at the top of this file */
  135. /****************************************************************************
  136. * SATA Passthrough messages
  137. ****************************************************************************/
  138. typedef union _MPI2_SATA_PT_SGE_UNION {
  139. MPI2_SGE_SIMPLE_UNION MpiSimple; /*MPI v2.0 only */
  140. MPI2_SGE_CHAIN_UNION MpiChain; /*MPI v2.0 only */
  141. MPI2_IEEE_SGE_SIMPLE_UNION IeeeSimple;
  142. MPI2_IEEE_SGE_CHAIN_UNION IeeeChain; /*MPI v2.0 only */
  143. MPI25_IEEE_SGE_CHAIN64 IeeeChain64; /*MPI v2.5 only */
  144. } MPI2_SATA_PT_SGE_UNION, *PTR_MPI2_SATA_PT_SGE_UNION,
  145. Mpi2SataPTSGEUnion_t, *pMpi2SataPTSGEUnion_t;
  146. /*SATA Passthrough Request Message */
  147. typedef struct _MPI2_SATA_PASSTHROUGH_REQUEST {
  148. U16 DevHandle; /*0x00 */
  149. U8 ChainOffset; /*0x02 */
  150. U8 Function; /*0x03 */
  151. U16 PassthroughFlags; /*0x04 */
  152. U8 SGLFlags; /*0x06*//*MPI v2.0 only. Reserved on MPI v2.5*/
  153. U8 MsgFlags; /*0x07 */
  154. U8 VP_ID; /*0x08 */
  155. U8 VF_ID; /*0x09 */
  156. U16 Reserved1; /*0x0A */
  157. U32 Reserved2; /*0x0C */
  158. U32 Reserved3; /*0x10 */
  159. U32 Reserved4; /*0x14 */
  160. U32 DataLength; /*0x18 */
  161. U8 CommandFIS[20]; /*0x1C */
  162. MPI2_SATA_PT_SGE_UNION SGL;/*0x30*//*MPI v2.5: IEEE 64 elements only*/
  163. } MPI2_SATA_PASSTHROUGH_REQUEST, *PTR_MPI2_SATA_PASSTHROUGH_REQUEST,
  164. Mpi2SataPassthroughRequest_t,
  165. *pMpi2SataPassthroughRequest_t;
  166. /*values for PassthroughFlags field */
  167. #define MPI2_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100)
  168. #define MPI2_SATA_PT_REQ_PT_FLAGS_DMA (0x0020)
  169. #define MPI2_SATA_PT_REQ_PT_FLAGS_PIO (0x0010)
  170. #define MPI2_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004)
  171. #define MPI2_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002)
  172. #define MPI2_SATA_PT_REQ_PT_FLAGS_READ (0x0001)
  173. /*MPI v2.0: use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
  174. /*SATA Passthrough Reply Message */
  175. typedef struct _MPI2_SATA_PASSTHROUGH_REPLY {
  176. U16 DevHandle; /*0x00 */
  177. U8 MsgLength; /*0x02 */
  178. U8 Function; /*0x03 */
  179. U16 PassthroughFlags; /*0x04 */
  180. U8 SGLFlags; /*0x06 */
  181. U8 MsgFlags; /*0x07 */
  182. U8 VP_ID; /*0x08 */
  183. U8 VF_ID; /*0x09 */
  184. U16 Reserved1; /*0x0A */
  185. U8 Reserved2; /*0x0C */
  186. U8 SASStatus; /*0x0D */
  187. U16 IOCStatus; /*0x0E */
  188. U32 IOCLogInfo; /*0x10 */
  189. U8 StatusFIS[20]; /*0x14 */
  190. U32 StatusControlRegisters; /*0x28 */
  191. U32 TransferCount; /*0x2C */
  192. } MPI2_SATA_PASSTHROUGH_REPLY, *PTR_MPI2_SATA_PASSTHROUGH_REPLY,
  193. Mpi2SataPassthroughReply_t, *pMpi2SataPassthroughReply_t;
  194. /*values for SASStatus field are at the top of this file */
  195. /****************************************************************************
  196. * SAS IO Unit Control messages
  197. ****************************************************************************/
  198. /*SAS IO Unit Control Request Message */
  199. typedef struct _MPI2_SAS_IOUNIT_CONTROL_REQUEST {
  200. U8 Operation; /*0x00 */
  201. U8 Reserved1; /*0x01 */
  202. U8 ChainOffset; /*0x02 */
  203. U8 Function; /*0x03 */
  204. U16 DevHandle; /*0x04 */
  205. U8 IOCParameter; /*0x06 */
  206. U8 MsgFlags; /*0x07 */
  207. U8 VP_ID; /*0x08 */
  208. U8 VF_ID; /*0x09 */
  209. U16 Reserved3; /*0x0A */
  210. U16 Reserved4; /*0x0C */
  211. U8 PhyNum; /*0x0E */
  212. U8 PrimFlags; /*0x0F */
  213. U32 Primitive; /*0x10 */
  214. U8 LookupMethod; /*0x14 */
  215. U8 Reserved5; /*0x15 */
  216. U16 SlotNumber; /*0x16 */
  217. U64 LookupAddress; /*0x18 */
  218. U32 IOCParameterValue; /*0x20 */
  219. U32 Reserved7; /*0x24 */
  220. U32 Reserved8; /*0x28 */
  221. } MPI2_SAS_IOUNIT_CONTROL_REQUEST,
  222. *PTR_MPI2_SAS_IOUNIT_CONTROL_REQUEST,
  223. Mpi2SasIoUnitControlRequest_t,
  224. *pMpi2SasIoUnitControlRequest_t;
  225. /*values for the Operation field */
  226. #define MPI2_SAS_OP_CLEAR_ALL_PERSISTENT (0x02)
  227. #define MPI2_SAS_OP_PHY_LINK_RESET (0x06)
  228. #define MPI2_SAS_OP_PHY_HARD_RESET (0x07)
  229. #define MPI2_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
  230. #define MPI2_SAS_OP_SEND_PRIMITIVE (0x0A)
  231. #define MPI2_SAS_OP_FORCE_FULL_DISCOVERY (0x0B)
  232. #define MPI2_SAS_OP_TRANSMIT_PORT_SELECT_SIGNAL (0x0C)
  233. #define MPI2_SAS_OP_REMOVE_DEVICE (0x0D)
  234. #define MPI2_SAS_OP_LOOKUP_MAPPING (0x0E)
  235. #define MPI2_SAS_OP_SET_IOC_PARAMETER (0x0F)
  236. #define MPI25_SAS_OP_ENABLE_FP_DEVICE (0x10)
  237. #define MPI25_SAS_OP_DISABLE_FP_DEVICE (0x11)
  238. #define MPI25_SAS_OP_ENABLE_FP_ALL (0x12)
  239. #define MPI25_SAS_OP_DISABLE_FP_ALL (0x13)
  240. #define MPI2_SAS_OP_DEV_ENABLE_NCQ (0x14)
  241. #define MPI2_SAS_OP_DEV_DISABLE_NCQ (0x15)
  242. #define MPI2_SAS_OP_PRODUCT_SPECIFIC_MIN (0x80)
  243. /*values for the PrimFlags field */
  244. #define MPI2_SAS_PRIMFLAGS_SINGLE (0x08)
  245. #define MPI2_SAS_PRIMFLAGS_TRIPLE (0x02)
  246. #define MPI2_SAS_PRIMFLAGS_REDUNDANT (0x01)
  247. /*values for the LookupMethod field */
  248. #define MPI2_SAS_LOOKUP_METHOD_SAS_ADDRESS (0x01)
  249. #define MPI2_SAS_LOOKUP_METHOD_SAS_ENCLOSURE_SLOT (0x02)
  250. #define MPI2_SAS_LOOKUP_METHOD_SAS_DEVICE_NAME (0x03)
  251. /*SAS IO Unit Control Reply Message */
  252. typedef struct _MPI2_SAS_IOUNIT_CONTROL_REPLY {
  253. U8 Operation; /*0x00 */
  254. U8 Reserved1; /*0x01 */
  255. U8 MsgLength; /*0x02 */
  256. U8 Function; /*0x03 */
  257. U16 DevHandle; /*0x04 */
  258. U8 IOCParameter; /*0x06 */
  259. U8 MsgFlags; /*0x07 */
  260. U8 VP_ID; /*0x08 */
  261. U8 VF_ID; /*0x09 */
  262. U16 Reserved3; /*0x0A */
  263. U16 Reserved4; /*0x0C */
  264. U16 IOCStatus; /*0x0E */
  265. U32 IOCLogInfo; /*0x10 */
  266. } MPI2_SAS_IOUNIT_CONTROL_REPLY,
  267. *PTR_MPI2_SAS_IOUNIT_CONTROL_REPLY,
  268. Mpi2SasIoUnitControlReply_t, *pMpi2SasIoUnitControlReply_t;
  269. #endif