mpi_sas.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. /*
  2. * Copyright (c) 2004 LSI Logic Corporation.
  3. *
  4. *
  5. * Name: mpi_sas.h
  6. * Title: MPI Serial Attached SCSI structures and definitions
  7. * Creation Date: August 19, 2004
  8. *
  9. * mpi_sas.h Version: 01.05.01
  10. *
  11. * Version History
  12. * ---------------
  13. *
  14. * Date Version Description
  15. * -------- -------- ------------------------------------------------------
  16. * 08-19-04 01.05.01 Original release.
  17. * --------------------------------------------------------------------------
  18. */
  19. #ifndef MPI_SAS_H
  20. #define MPI_SAS_H
  21. /*
  22. * Values for SASStatus.
  23. */
  24. #define MPI_SASSTATUS_SUCCESS (0x00)
  25. #define MPI_SASSTATUS_UNKNOWN_ERROR (0x01)
  26. #define MPI_SASSTATUS_INVALID_FRAME (0x02)
  27. #define MPI_SASSTATUS_UTC_BAD_DEST (0x03)
  28. #define MPI_SASSTATUS_UTC_BREAK_RECEIVED (0x04)
  29. #define MPI_SASSTATUS_UTC_CONNECT_RATE_NOT_SUPPORTED (0x05)
  30. #define MPI_SASSTATUS_UTC_PORT_LAYER_REQUEST (0x06)
  31. #define MPI_SASSTATUS_UTC_PROTOCOL_NOT_SUPPORTED (0x07)
  32. #define MPI_SASSTATUS_UTC_STP_RESOURCES_BUSY (0x08)
  33. #define MPI_SASSTATUS_UTC_WRONG_DESTINATION (0x09)
  34. #define MPI_SASSTATUS_SHORT_INFORMATION_UNIT (0x0A)
  35. #define MPI_SASSTATUS_LONG_INFORMATION_UNIT (0x0B)
  36. #define MPI_SASSTATUS_XFER_RDY_INCORRECT_WRITE_DATA (0x0C)
  37. #define MPI_SASSTATUS_XFER_RDY_REQUEST_OFFSET_ERROR (0x0D)
  38. #define MPI_SASSTATUS_XFER_RDY_NOT_EXPECTED (0x0E)
  39. #define MPI_SASSTATUS_DATA_INCORRECT_DATA_LENGTH (0x0F)
  40. #define MPI_SASSTATUS_DATA_TOO_MUCH_READ_DATA (0x10)
  41. #define MPI_SASSTATUS_DATA_OFFSET_ERROR (0x11)
  42. #define MPI_SASSTATUS_SDSF_NAK_RECEIVED (0x12)
  43. #define MPI_SASSTATUS_SDSF_CONNECTION_FAILED (0x13)
  44. #define MPI_SASSTATUS_INITIATOR_RESPONSE_TIMEOUT (0x14)
  45. /*
  46. * Values for the SAS DeviceInfo field used in SAS Device Status Change Event
  47. * data and SAS IO Unit Configuration pages.
  48. */
  49. #define MPI_SAS_DEVICE_INFO_ATAPI_DEVICE (0x00002000)
  50. #define MPI_SAS_DEVICE_INFO_LSI_DEVICE (0x00001000)
  51. #define MPI_SAS_DEVICE_INFO_DIRECT_ATTACH (0x00000800)
  52. #define MPI_SAS_DEVICE_INFO_SSP_TARGET (0x00000400)
  53. #define MPI_SAS_DEVICE_INFO_STP_TARGET (0x00000200)
  54. #define MPI_SAS_DEVICE_INFO_SMP_TARGET (0x00000100)
  55. #define MPI_SAS_DEVICE_INFO_SATA_DEVICE (0x00000080)
  56. #define MPI_SAS_DEVICE_INFO_SSP_INITIATOR (0x00000040)
  57. #define MPI_SAS_DEVICE_INFO_STP_INITIATOR (0x00000020)
  58. #define MPI_SAS_DEVICE_INFO_SMP_INITIATOR (0x00000010)
  59. #define MPI_SAS_DEVICE_INFO_SATA_HOST (0x00000008)
  60. #define MPI_SAS_DEVICE_INFO_MASK_DEVICE_TYPE (0x00000007)
  61. #define MPI_SAS_DEVICE_INFO_NO_DEVICE (0x00000000)
  62. #define MPI_SAS_DEVICE_INFO_END_DEVICE (0x00000001)
  63. #define MPI_SAS_DEVICE_INFO_EDGE_EXPANDER (0x00000002)
  64. #define MPI_SAS_DEVICE_INFO_FANOUT_EXPANDER (0x00000003)
  65. /*****************************************************************************
  66. *
  67. * S e r i a l A t t a c h e d S C S I M e s s a g e s
  68. *
  69. *****************************************************************************/
  70. /****************************************************************************/
  71. /* Serial Management Protocol Passthrough Request */
  72. /****************************************************************************/
  73. typedef struct _MSG_SMP_PASSTHROUGH_REQUEST
  74. {
  75. U8 PassthroughFlags; /* 00h */
  76. U8 PhysicalPort; /* 01h */
  77. U8 ChainOffset; /* 02h */
  78. U8 Function; /* 03h */
  79. U16 RequestDataLength; /* 04h */
  80. U8 ConnectionRate; /* 06h */
  81. U8 MsgFlags; /* 07h */
  82. U32 MsgContext; /* 08h */
  83. U32 Reserved1; /* 0Ch */
  84. U64 SASAddress; /* 10h */
  85. U32 Reserved2; /* 18h */
  86. U32 Reserved3; /* 1Ch */
  87. SGE_SIMPLE_UNION SGL; /* 20h */
  88. } MSG_SMP_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REQUEST,
  89. SmpPassthroughRequest_t, MPI_POINTER pSmpPassthroughRequest_t;
  90. /* values for PassthroughFlags field */
  91. #define MPI_SMP_PT_REQ_PT_FLAGS_IMMEDIATE (0x80)
  92. /* values for ConnectionRate field */
  93. #define MPI_SMP_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
  94. #define MPI_SMP_PT_REQ_CONNECT_RATE_1_5 (0x08)
  95. #define MPI_SMP_PT_REQ_CONNECT_RATE_3_0 (0x09)
  96. /* Serial Management Protocol Passthrough Reply */
  97. typedef struct _MSG_SMP_PASSTHROUGH_REPLY
  98. {
  99. U8 PassthroughFlags; /* 00h */
  100. U8 PhysicalPort; /* 01h */
  101. U8 MsgLength; /* 02h */
  102. U8 Function; /* 03h */
  103. U16 ResponseDataLength; /* 04h */
  104. U8 Reserved1; /* 06h */
  105. U8 MsgFlags; /* 07h */
  106. U32 MsgContext; /* 08h */
  107. U8 Reserved2; /* 0Ch */
  108. U8 SASStatus; /* 0Dh */
  109. U16 IOCStatus; /* 0Eh */
  110. U32 IOCLogInfo; /* 10h */
  111. U32 Reserved3; /* 14h */
  112. U8 ResponseData[4]; /* 18h */
  113. } MSG_SMP_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SMP_PASSTHROUGH_REPLY,
  114. SmpPassthroughReply_t, MPI_POINTER pSmpPassthroughReply_t;
  115. #define MPI_SMP_PT_REPLY_PT_FLAGS_IMMEDIATE (0x80)
  116. /****************************************************************************/
  117. /* SATA Passthrough Request */
  118. /****************************************************************************/
  119. typedef struct _MSG_SATA_PASSTHROUGH_REQUEST
  120. {
  121. U8 TargetID; /* 00h */
  122. U8 Bus; /* 01h */
  123. U8 ChainOffset; /* 02h */
  124. U8 Function; /* 03h */
  125. U16 PassthroughFlags; /* 04h */
  126. U8 ConnectionRate; /* 06h */
  127. U8 MsgFlags; /* 07h */
  128. U32 MsgContext; /* 08h */
  129. U32 Reserved1; /* 0Ch */
  130. U32 Reserved2; /* 10h */
  131. U32 Reserved3; /* 14h */
  132. U32 DataLength; /* 18h */
  133. U8 CommandFIS[20]; /* 1Ch */
  134. SGE_SIMPLE_UNION SGL; /* 30h */
  135. } MSG_SATA_PASSTHROUGH_REQUEST, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REQUEST,
  136. SataPassthroughRequest_t, MPI_POINTER pSataPassthroughRequest_t;
  137. /* values for PassthroughFlags field */
  138. #define MPI_SATA_PT_REQ_PT_FLAGS_RESET_DEVICE (0x0200)
  139. #define MPI_SATA_PT_REQ_PT_FLAGS_EXECUTE_DIAG (0x0100)
  140. #define MPI_SATA_PT_REQ_PT_FLAGS_DMA_QUEUED (0x0080)
  141. #define MPI_SATA_PT_REQ_PT_FLAGS_PACKET_COMMAND (0x0040)
  142. #define MPI_SATA_PT_REQ_PT_FLAGS_DMA (0x0020)
  143. #define MPI_SATA_PT_REQ_PT_FLAGS_PIO (0x0010)
  144. #define MPI_SATA_PT_REQ_PT_FLAGS_UNSPECIFIED_VU (0x0004)
  145. #define MPI_SATA_PT_REQ_PT_FLAGS_WRITE (0x0002)
  146. #define MPI_SATA_PT_REQ_PT_FLAGS_READ (0x0001)
  147. /* values for ConnectionRate field */
  148. #define MPI_SATA_PT_REQ_CONNECT_RATE_NEGOTIATED (0x00)
  149. #define MPI_SATA_PT_REQ_CONNECT_RATE_1_5 (0x08)
  150. #define MPI_SATA_PT_REQ_CONNECT_RATE_3_0 (0x09)
  151. /* SATA Passthrough Reply */
  152. typedef struct _MSG_SATA_PASSTHROUGH_REPLY
  153. {
  154. U8 TargetID; /* 00h */
  155. U8 Bus; /* 01h */
  156. U8 MsgLength; /* 02h */
  157. U8 Function; /* 03h */
  158. U16 PassthroughFlags; /* 04h */
  159. U8 Reserved1; /* 06h */
  160. U8 MsgFlags; /* 07h */
  161. U32 MsgContext; /* 08h */
  162. U8 Reserved2; /* 0Ch */
  163. U8 SASStatus; /* 0Dh */
  164. U16 IOCStatus; /* 0Eh */
  165. U32 IOCLogInfo; /* 10h */
  166. U8 StatusFIS[20]; /* 14h */
  167. U32 StatusControlRegisters; /* 28h */
  168. U32 TransferCount; /* 2Ch */
  169. } MSG_SATA_PASSTHROUGH_REPLY, MPI_POINTER PTR_MSG_SATA_PASSTHROUGH_REPLY,
  170. SataPassthroughReply_t, MPI_POINTER pSataPassthroughReply_t;
  171. /****************************************************************************/
  172. /* SAS IO Unit Control Request */
  173. /****************************************************************************/
  174. typedef struct _MSG_SAS_IOUNIT_CONTROL_REQUEST
  175. {
  176. U8 Operation; /* 00h */
  177. U8 Reserved1; /* 01h */
  178. U8 ChainOffset; /* 02h */
  179. U8 Function; /* 03h */
  180. U16 Reserved2; /* 04h */
  181. U8 Reserved3; /* 06h */
  182. U8 MsgFlags; /* 07h */
  183. U32 MsgContext; /* 08h */
  184. U8 TargetID; /* 0Ch */
  185. U8 Bus; /* 0Dh */
  186. U8 PhyNum; /* 0Eh */
  187. U8 Reserved4; /* 0Fh */
  188. U32 Reserved5; /* 10h */
  189. U64 SASAddress; /* 14h */
  190. U32 Reserved6; /* 1Ch */
  191. } MSG_SAS_IOUNIT_CONTROL_REQUEST, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REQUEST,
  192. SasIoUnitControlRequest_t, MPI_POINTER pSasIoUnitControlRequest_t;
  193. /* values for the Operation field */
  194. #define MPI_SAS_OP_CLEAR_NOT_PRESENT (0x01)
  195. #define MPI_SAS_OP_CLEAR_ALL_PERSISTENT (0x02)
  196. #define MPI_SAS_OP_PHY_LINK_RESET (0x06)
  197. #define MPI_SAS_OP_PHY_HARD_RESET (0x07)
  198. #define MPI_SAS_OP_PHY_CLEAR_ERROR_LOG (0x08)
  199. #define MPI_SAS_OP_MAP_CURRENT (0x09)
  200. /* SAS IO Unit Control Reply */
  201. typedef struct _MSG_SAS_IOUNIT_CONTROL_REPLY
  202. {
  203. U8 Operation; /* 00h */
  204. U8 Reserved1; /* 01h */
  205. U8 MsgLength; /* 02h */
  206. U8 Function; /* 03h */
  207. U16 Reserved2; /* 04h */
  208. U8 Reserved3; /* 06h */
  209. U8 MsgFlags; /* 07h */
  210. U32 MsgContext; /* 08h */
  211. U16 Reserved4; /* 0Ch */
  212. U16 IOCStatus; /* 0Eh */
  213. U32 IOCLogInfo; /* 10h */
  214. } MSG_SAS_IOUNIT_CONTROL_REPLY, MPI_POINTER PTR_MSG_SAS_IOUNIT_CONTROL_REPLY,
  215. SasIoUnitControlReply_t, MPI_POINTER pSasIoUnitControlReply_t;
  216. #endif