mpi_init.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. /*
  2. * Copyright (c) 2000-2005 LSI Logic Corporation.
  3. *
  4. *
  5. * Name: mpi_init.h
  6. * Title: MPI initiator mode messages and structures
  7. * Creation Date: June 8, 2000
  8. *
  9. * mpi_init.h Version: 01.05.04
  10. *
  11. * Version History
  12. * ---------------
  13. *
  14. * Date Version Description
  15. * -------- -------- ------------------------------------------------------
  16. * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000.
  17. * 05-24-00 00.10.02 Added SenseBufferLength to _MSG_SCSI_IO_REPLY.
  18. * 06-06-00 01.00.01 Update version number for 1.0 release.
  19. * 06-08-00 01.00.02 Added MPI_SCSI_RSP_INFO_ definitions.
  20. * 11-02-00 01.01.01 Original release for post 1.0 work.
  21. * 12-04-00 01.01.02 Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
  22. * 02-20-01 01.01.03 Started using MPI_POINTER.
  23. * 03-27-01 01.01.04 Added structure offset comments.
  24. * 04-10-01 01.01.05 Added new MsgFlag for MSG_SCSI_TASK_MGMT.
  25. * 08-08-01 01.02.01 Original release for v1.2 work.
  26. * 08-29-01 01.02.02 Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
  27. * Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
  28. * MSG_SCSI_IO_REPLY.
  29. * 09-28-01 01.02.03 Added structures and defines for SCSI Enclosure
  30. * Processor messages.
  31. * 10-04-01 01.02.04 Added defines for SEP request Action field.
  32. * 05-31-02 01.02.05 Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
  33. * for SCSI IO requests.
  34. * 11-15-02 01.02.06 Added special extended SCSI Status defines for FCP.
  35. * 06-26-03 01.02.07 Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
  36. * 05-11-04 01.03.01 Original release for MPI v1.3.
  37. * 08-19-04 01.05.01 Added MsgFlags defines for EEDP to SCSI IO request.
  38. * Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
  39. * and a reserved U16.
  40. * Added new MSG_SCSI_IO32_REQUEST structure.
  41. * Added a TaskType of Clear Task Set to SCSI
  42. * Task Management request.
  43. * 12-07-04 01.05.02 Added support for Task Management Query Task.
  44. * 01-15-05 01.05.03 Modified SCSI Enclosure Processor Request to support
  45. * WWID addressing.
  46. * 03-11-05 01.05.04 Removed EEDP flags from SCSI IO Request.
  47. * Removed SCSI IO 32 Request.
  48. * Modified SCSI Enclosure Processor Request and Reply to
  49. * support Enclosure/Slot addressing rather than WWID
  50. * addressing.
  51. * --------------------------------------------------------------------------
  52. */
  53. #ifndef MPI_INIT_H
  54. #define MPI_INIT_H
  55. /*****************************************************************************
  56. *
  57. * S C S I I n i t i a t o r M e s s a g e s
  58. *
  59. *****************************************************************************/
  60. /****************************************************************************/
  61. /* SCSI IO messages and associated structures */
  62. /****************************************************************************/
  63. typedef struct _MSG_SCSI_IO_REQUEST
  64. {
  65. U8 TargetID; /* 00h */
  66. U8 Bus; /* 01h */
  67. U8 ChainOffset; /* 02h */
  68. U8 Function; /* 03h */
  69. U8 CDBLength; /* 04h */
  70. U8 SenseBufferLength; /* 05h */
  71. U8 Reserved; /* 06h */
  72. U8 MsgFlags; /* 07h */
  73. U32 MsgContext; /* 08h */
  74. U8 LUN[8]; /* 0Ch */
  75. U32 Control; /* 14h */
  76. U8 CDB[16]; /* 18h */
  77. U32 DataLength; /* 28h */
  78. U32 SenseBufferLowAddr; /* 2Ch */
  79. SGE_IO_UNION SGL; /* 30h */
  80. } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
  81. SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
  82. /* SCSI IO MsgFlags bits */
  83. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01)
  84. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
  85. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
  86. #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
  87. #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
  88. #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02)
  89. #define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
  90. /* SCSI IO LUN fields */
  91. #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING (0x0000FFFF)
  92. #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000)
  93. #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING (0x0000FFFF)
  94. #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING (0xFFFF0000)
  95. #define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00)
  96. #define MPI_SCSIIO_LUN_LEVEL_1_DWORD (0x0000FF00)
  97. /* SCSI IO Control bits */
  98. #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK (0x03000000)
  99. #define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000)
  100. #define MPI_SCSIIO_CONTROL_WRITE (0x01000000)
  101. #define MPI_SCSIIO_CONTROL_READ (0x02000000)
  102. #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK (0x3C000000)
  103. #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT (26)
  104. #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK (0x00000700)
  105. #define MPI_SCSIIO_CONTROL_SIMPLEQ (0x00000000)
  106. #define MPI_SCSIIO_CONTROL_HEADOFQ (0x00000100)
  107. #define MPI_SCSIIO_CONTROL_ORDEREDQ (0x00000200)
  108. #define MPI_SCSIIO_CONTROL_ACAQ (0x00000400)
  109. #define MPI_SCSIIO_CONTROL_UNTAGGED (0x00000500)
  110. #define MPI_SCSIIO_CONTROL_NO_DISCONNECT (0x00000700)
  111. #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK (0x00FF0000)
  112. #define MPI_SCSIIO_CONTROL_OBSOLETE (0x00800000)
  113. #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV (0x00400000)
  114. #define MPI_SCSIIO_CONTROL_TARGET_RESET (0x00200000)
  115. #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV (0x00100000)
  116. #define MPI_SCSIIO_CONTROL_RESERVED (0x00080000)
  117. #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV (0x00040000)
  118. #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET (0x00020000)
  119. #define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000)
  120. /* SCSI IO reply structure */
  121. typedef struct _MSG_SCSI_IO_REPLY
  122. {
  123. U8 TargetID; /* 00h */
  124. U8 Bus; /* 01h */
  125. U8 MsgLength; /* 02h */
  126. U8 Function; /* 03h */
  127. U8 CDBLength; /* 04h */
  128. U8 SenseBufferLength; /* 05h */
  129. U8 Reserved; /* 06h */
  130. U8 MsgFlags; /* 07h */
  131. U32 MsgContext; /* 08h */
  132. U8 SCSIStatus; /* 0Ch */
  133. U8 SCSIState; /* 0Dh */
  134. U16 IOCStatus; /* 0Eh */
  135. U32 IOCLogInfo; /* 10h */
  136. U32 TransferCount; /* 14h */
  137. U32 SenseCount; /* 18h */
  138. U32 ResponseInfo; /* 1Ch */
  139. U16 TaskTag; /* 20h */
  140. U16 Reserved1; /* 22h */
  141. } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
  142. SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
  143. /* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */
  144. #define MPI_SCSI_STATUS_SUCCESS (0x00)
  145. #define MPI_SCSI_STATUS_CHECK_CONDITION (0x02)
  146. #define MPI_SCSI_STATUS_CONDITION_MET (0x04)
  147. #define MPI_SCSI_STATUS_BUSY (0x08)
  148. #define MPI_SCSI_STATUS_INTERMEDIATE (0x10)
  149. #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET (0x14)
  150. #define MPI_SCSI_STATUS_RESERVATION_CONFLICT (0x18)
  151. #define MPI_SCSI_STATUS_COMMAND_TERMINATED (0x22)
  152. #define MPI_SCSI_STATUS_TASK_SET_FULL (0x28)
  153. #define MPI_SCSI_STATUS_ACA_ACTIVE (0x30)
  154. #define MPI_SCSI_STATUS_FCPEXT_DEVICE_LOGGED_OUT (0x80)
  155. #define MPI_SCSI_STATUS_FCPEXT_NO_LINK (0x81)
  156. #define MPI_SCSI_STATUS_FCPEXT_UNASSIGNED (0x82)
  157. /* SCSI IO Reply SCSIState values */
  158. #define MPI_SCSI_STATE_AUTOSENSE_VALID (0x01)
  159. #define MPI_SCSI_STATE_AUTOSENSE_FAILED (0x02)
  160. #define MPI_SCSI_STATE_NO_SCSI_STATUS (0x04)
  161. #define MPI_SCSI_STATE_TERMINATED (0x08)
  162. #define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10)
  163. #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED (0x20)
  164. /* SCSI IO Reply ResponseInfo values */
  165. /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
  166. #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE (0x00000000)
  167. #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR (0x01000000)
  168. #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID (0x02000000)
  169. #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR (0x03000000)
  170. #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000)
  171. #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000)
  172. #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000)
  173. #define MPI_SCSI_TASKTAG_UNKNOWN (0xFFFF)
  174. /****************************************************************************/
  175. /* SCSI Task Management messages */
  176. /****************************************************************************/
  177. typedef struct _MSG_SCSI_TASK_MGMT
  178. {
  179. U8 TargetID; /* 00h */
  180. U8 Bus; /* 01h */
  181. U8 ChainOffset; /* 02h */
  182. U8 Function; /* 03h */
  183. U8 Reserved; /* 04h */
  184. U8 TaskType; /* 05h */
  185. U8 Reserved1; /* 06h */
  186. U8 MsgFlags; /* 07h */
  187. U32 MsgContext; /* 08h */
  188. U8 LUN[8]; /* 0Ch */
  189. U32 Reserved2[7]; /* 14h */
  190. U32 TaskMsgContext; /* 30h */
  191. } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
  192. SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
  193. /* TaskType values */
  194. #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01)
  195. #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02)
  196. #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03)
  197. #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04)
  198. #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05)
  199. #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06)
  200. #define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07)
  201. /* MsgFlags bits */
  202. #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00)
  203. #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION (0x02)
  204. #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
  205. /* SCSI Task Management Reply */
  206. typedef struct _MSG_SCSI_TASK_MGMT_REPLY
  207. {
  208. U8 TargetID; /* 00h */
  209. U8 Bus; /* 01h */
  210. U8 MsgLength; /* 02h */
  211. U8 Function; /* 03h */
  212. U8 ResponseCode; /* 04h */
  213. U8 TaskType; /* 05h */
  214. U8 Reserved1; /* 06h */
  215. U8 MsgFlags; /* 07h */
  216. U32 MsgContext; /* 08h */
  217. U8 Reserved2[2]; /* 0Ch */
  218. U16 IOCStatus; /* 0Eh */
  219. U32 IOCLogInfo; /* 10h */
  220. U32 TerminationCount; /* 14h */
  221. } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
  222. SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
  223. /* ResponseCode values */
  224. #define MPI_SCSITASKMGMT_RSP_TM_COMPLETE (0x00)
  225. #define MPI_SCSITASKMGMT_RSP_INVALID_FRAME (0x02)
  226. #define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04)
  227. #define MPI_SCSITASKMGMT_RSP_TM_FAILED (0x05)
  228. #define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08)
  229. #define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09)
  230. #define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80)
  231. /****************************************************************************/
  232. /* SCSI Enclosure Processor messages */
  233. /****************************************************************************/
  234. typedef struct _MSG_SEP_REQUEST
  235. {
  236. U8 TargetID; /* 00h */
  237. U8 Bus; /* 01h */
  238. U8 ChainOffset; /* 02h */
  239. U8 Function; /* 03h */
  240. U8 Action; /* 04h */
  241. U8 Flags; /* 05h */
  242. U8 Reserved1; /* 06h */
  243. U8 MsgFlags; /* 07h */
  244. U32 MsgContext; /* 08h */
  245. U32 SlotStatus; /* 0Ch */
  246. U32 Reserved2; /* 10h */
  247. U32 Reserved3; /* 14h */
  248. U32 Reserved4; /* 18h */
  249. U16 Slot; /* 1Ch */
  250. U16 EnclosureHandle; /* 1Eh */
  251. } MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
  252. SEPRequest_t, MPI_POINTER pSEPRequest_t;
  253. /* Action defines */
  254. #define MPI_SEP_REQ_ACTION_WRITE_STATUS (0x00)
  255. #define MPI_SEP_REQ_ACTION_READ_STATUS (0x01)
  256. /* Flags defines */
  257. #define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01)
  258. #define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS (0x00)
  259. /* SlotStatus bits for MSG_SEP_REQUEST */
  260. #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001)
  261. #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002)
  262. #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004)
  263. #define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008)
  264. #define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010)
  265. #define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK (0x00000020)
  266. #define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040)
  267. #define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080)
  268. #define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100)
  269. #define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200)
  270. #define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000)
  271. #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000)
  272. #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT (0x00080000)
  273. #define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE (0x00400000)
  274. #define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000)
  275. #define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000)
  276. #define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF (0x10000000)
  277. #define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET (0x80000000)
  278. typedef struct _MSG_SEP_REPLY
  279. {
  280. U8 TargetID; /* 00h */
  281. U8 Bus; /* 01h */
  282. U8 MsgLength; /* 02h */
  283. U8 Function; /* 03h */
  284. U8 Action; /* 04h */
  285. U8 Reserved1; /* 05h */
  286. U8 Reserved2; /* 06h */
  287. U8 MsgFlags; /* 07h */
  288. U32 MsgContext; /* 08h */
  289. U16 Reserved3; /* 0Ch */
  290. U16 IOCStatus; /* 0Eh */
  291. U32 IOCLogInfo; /* 10h */
  292. U32 SlotStatus; /* 14h */
  293. U32 Reserved4; /* 18h */
  294. U16 Slot; /* 1Ch */
  295. U16 EnclosureHandle; /* 1Eh */
  296. } MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
  297. SEPReply_t, MPI_POINTER pSEPReply_t;
  298. /* SlotStatus bits for MSG_SEP_REPLY */
  299. #define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001)
  300. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002)
  301. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004)
  302. #define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008)
  303. #define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010)
  304. #define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK (0x00000020)
  305. #define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040)
  306. #define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080)
  307. #define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100)
  308. #define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200)
  309. #define MPI_SEP_REPLY_SLOTSTATUS_REPORT (0x00010000)
  310. #define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000)
  311. #define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000)
  312. #define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY (0x00080000)
  313. #define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE (0x00400000)
  314. #define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED (0x01000000)
  315. #define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED (0x02000000)
  316. #define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000)
  317. #define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000)
  318. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x10000000)
  319. #define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED (0x40000000)
  320. #define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED (0x80000000)
  321. #endif