mpi_init.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. /*
  2. * Copyright (c) 2000-2003 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.xx
  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. * --------------------------------------------------------------------------
  37. */
  38. #ifndef MPI_INIT_H
  39. #define MPI_INIT_H
  40. /*****************************************************************************
  41. *
  42. * S C S I I n i t i a t o r M e s s a g e s
  43. *
  44. *****************************************************************************/
  45. /****************************************************************************/
  46. /* SCSI IO messages and associated structures */
  47. /****************************************************************************/
  48. typedef struct _MSG_SCSI_IO_REQUEST
  49. {
  50. U8 TargetID; /* 00h */
  51. U8 Bus; /* 01h */
  52. U8 ChainOffset; /* 02h */
  53. U8 Function; /* 03h */
  54. U8 CDBLength; /* 04h */
  55. U8 SenseBufferLength; /* 05h */
  56. U8 Reserved; /* 06h */
  57. U8 MsgFlags; /* 07h */
  58. U32 MsgContext; /* 08h */
  59. U8 LUN[8]; /* 0Ch */
  60. U32 Control; /* 14h */
  61. U8 CDB[16]; /* 18h */
  62. U32 DataLength; /* 28h */
  63. U32 SenseBufferLowAddr; /* 2Ch */
  64. SGE_IO_UNION SGL; /* 30h */
  65. } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
  66. SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
  67. /* SCSI IO MsgFlags bits */
  68. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH (0x01)
  69. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 (0x00)
  70. #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 (0x01)
  71. #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION (0x02)
  72. #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST (0x00)
  73. #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC (0x02)
  74. #define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR (0x04)
  75. #define MPI_SCSIIO_MSGFLGS_EEDP_TYPE_MASK (0xE0)
  76. #define MPI_SCSIIO_MSGFLGS_EEDP_NONE (0x00)
  77. #define MPI_SCSIIO_MSGFLGS_EEDP_RDPROTECT_T10 (0x20)
  78. #define MPI_SCSIIO_MSGFLGS_EEDP_VRPROTECT_T10 (0x40)
  79. #define MPI_SCSIIO_MSGFLGS_EEDP_WRPROTECT_T10 (0x60)
  80. #define MPI_SCSIIO_MSGFLGS_EEDP_520_READ_MODE1 (0x20)
  81. #define MPI_SCSIIO_MSGFLGS_EEDP_520_WRITE_MODE1 (0x40)
  82. #define MPI_SCSIIO_MSGFLGS_EEDP_8_9_READ_MODE1 (0x60)
  83. #define MPI_SCSIIO_MSGFLGS_EEDP_8_9_WRITE_MODE1 (0x80)
  84. /* SCSI IO LUN fields */
  85. #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING (0x0000FFFF)
  86. #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING (0xFFFF0000)
  87. #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING (0x0000FFFF)
  88. #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING (0xFFFF0000)
  89. #define MPI_SCSIIO_LUN_LEVEL_1_WORD (0xFF00)
  90. #define MPI_SCSIIO_LUN_LEVEL_1_DWORD (0x0000FF00)
  91. /* SCSI IO Control bits */
  92. #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK (0x03000000)
  93. #define MPI_SCSIIO_CONTROL_NODATATRANSFER (0x00000000)
  94. #define MPI_SCSIIO_CONTROL_WRITE (0x01000000)
  95. #define MPI_SCSIIO_CONTROL_READ (0x02000000)
  96. #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK (0x3C000000)
  97. #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT (26)
  98. #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK (0x00000700)
  99. #define MPI_SCSIIO_CONTROL_SIMPLEQ (0x00000000)
  100. #define MPI_SCSIIO_CONTROL_HEADOFQ (0x00000100)
  101. #define MPI_SCSIIO_CONTROL_ORDEREDQ (0x00000200)
  102. #define MPI_SCSIIO_CONTROL_ACAQ (0x00000400)
  103. #define MPI_SCSIIO_CONTROL_UNTAGGED (0x00000500)
  104. #define MPI_SCSIIO_CONTROL_NO_DISCONNECT (0x00000700)
  105. #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK (0x00FF0000)
  106. #define MPI_SCSIIO_CONTROL_OBSOLETE (0x00800000)
  107. #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV (0x00400000)
  108. #define MPI_SCSIIO_CONTROL_TARGET_RESET (0x00200000)
  109. #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV (0x00100000)
  110. #define MPI_SCSIIO_CONTROL_RESERVED (0x00080000)
  111. #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV (0x00040000)
  112. #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET (0x00020000)
  113. #define MPI_SCSIIO_CONTROL_RESERVED2 (0x00010000)
  114. /* SCSI IO reply structure */
  115. typedef struct _MSG_SCSI_IO_REPLY
  116. {
  117. U8 TargetID; /* 00h */
  118. U8 Bus; /* 01h */
  119. U8 MsgLength; /* 02h */
  120. U8 Function; /* 03h */
  121. U8 CDBLength; /* 04h */
  122. U8 SenseBufferLength; /* 05h */
  123. U8 Reserved; /* 06h */
  124. U8 MsgFlags; /* 07h */
  125. U32 MsgContext; /* 08h */
  126. U8 SCSIStatus; /* 0Ch */
  127. U8 SCSIState; /* 0Dh */
  128. U16 IOCStatus; /* 0Eh */
  129. U32 IOCLogInfo; /* 10h */
  130. U32 TransferCount; /* 14h */
  131. U32 SenseCount; /* 18h */
  132. U32 ResponseInfo; /* 1Ch */
  133. } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
  134. SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
  135. /* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */
  136. #define MPI_SCSI_STATUS_SUCCESS (0x00)
  137. #define MPI_SCSI_STATUS_CHECK_CONDITION (0x02)
  138. #define MPI_SCSI_STATUS_CONDITION_MET (0x04)
  139. #define MPI_SCSI_STATUS_BUSY (0x08)
  140. #define MPI_SCSI_STATUS_INTERMEDIATE (0x10)
  141. #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET (0x14)
  142. #define MPI_SCSI_STATUS_RESERVATION_CONFLICT (0x18)
  143. #define MPI_SCSI_STATUS_COMMAND_TERMINATED (0x22)
  144. #define MPI_SCSI_STATUS_TASK_SET_FULL (0x28)
  145. #define MPI_SCSI_STATUS_ACA_ACTIVE (0x30)
  146. #define MPI_SCSI_STATUS_FCPEXT_DEVICE_LOGGED_OUT (0x80)
  147. #define MPI_SCSI_STATUS_FCPEXT_NO_LINK (0x81)
  148. #define MPI_SCSI_STATUS_FCPEXT_UNASSIGNED (0x82)
  149. /* SCSI IO Reply SCSIState values */
  150. #define MPI_SCSI_STATE_AUTOSENSE_VALID (0x01)
  151. #define MPI_SCSI_STATE_AUTOSENSE_FAILED (0x02)
  152. #define MPI_SCSI_STATE_NO_SCSI_STATUS (0x04)
  153. #define MPI_SCSI_STATE_TERMINATED (0x08)
  154. #define MPI_SCSI_STATE_RESPONSE_INFO_VALID (0x10)
  155. #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED (0x20)
  156. /* SCSI IO Reply ResponseInfo values */
  157. /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
  158. #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE (0x00000000)
  159. #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR (0x01000000)
  160. #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID (0x02000000)
  161. #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR (0x03000000)
  162. #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000)
  163. #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED (0x05000000)
  164. #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE (0x06000000)
  165. /****************************************************************************/
  166. /* SCSI IO 32 Request message structure */
  167. /****************************************************************************/
  168. typedef struct _MSG_SCSI_IO32_REQUEST
  169. {
  170. U8 TargetID; /* 00h */
  171. U8 Bus; /* 01h */
  172. U8 ChainOffset; /* 02h */
  173. U8 Function; /* 03h */
  174. U8 CDBLength; /* 04h */
  175. U8 SenseBufferLength; /* 05h */
  176. U8 Reserved; /* 06h */
  177. U8 MsgFlags; /* 07h */
  178. U32 MsgContext; /* 08h */
  179. U8 LUN[8]; /* 0Ch */
  180. U32 Control; /* 14h */
  181. U8 CDB[32]; /* 18h */
  182. U32 DataLength; /* 38h */
  183. U32 SenseBufferLowAddr; /* 3Ch */
  184. SGE_IO_UNION SGL; /* 40h */
  185. } MSG_SCSI_IO32_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO32_REQUEST,
  186. SCSIIO32Request_t, MPI_POINTER pSCSIIO32Request_t;
  187. /* SCSI IO 32 uses the same defines as above for SCSI IO */
  188. /****************************************************************************/
  189. /* SCSI Task Management messages */
  190. /****************************************************************************/
  191. typedef struct _MSG_SCSI_TASK_MGMT
  192. {
  193. U8 TargetID; /* 00h */
  194. U8 Bus; /* 01h */
  195. U8 ChainOffset; /* 02h */
  196. U8 Function; /* 03h */
  197. U8 Reserved; /* 04h */
  198. U8 TaskType; /* 05h */
  199. U8 Reserved1; /* 06h */
  200. U8 MsgFlags; /* 07h */
  201. U32 MsgContext; /* 08h */
  202. U8 LUN[8]; /* 0Ch */
  203. U32 Reserved2[7]; /* 14h */
  204. U32 TaskMsgContext; /* 30h */
  205. } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
  206. SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
  207. /* TaskType values */
  208. #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01)
  209. #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02)
  210. #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03)
  211. #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS (0x04)
  212. #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05)
  213. #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06)
  214. /* MsgFlags bits */
  215. #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION (0x00)
  216. #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION (0x02)
  217. #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
  218. /* SCSI Task Management Reply */
  219. typedef struct _MSG_SCSI_TASK_MGMT_REPLY
  220. {
  221. U8 TargetID; /* 00h */
  222. U8 Bus; /* 01h */
  223. U8 MsgLength; /* 02h */
  224. U8 Function; /* 03h */
  225. U8 Reserved; /* 04h */
  226. U8 TaskType; /* 05h */
  227. U8 Reserved1; /* 06h */
  228. U8 MsgFlags; /* 07h */
  229. U32 MsgContext; /* 08h */
  230. U8 Reserved2[2]; /* 0Ch */
  231. U16 IOCStatus; /* 0Eh */
  232. U32 IOCLogInfo; /* 10h */
  233. U32 TerminationCount; /* 14h */
  234. } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
  235. SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
  236. /****************************************************************************/
  237. /* SCSI Enclosure Processor messages */
  238. /****************************************************************************/
  239. typedef struct _MSG_SEP_REQUEST
  240. {
  241. U8 TargetID; /* 00h */
  242. U8 Bus; /* 01h */
  243. U8 ChainOffset; /* 02h */
  244. U8 Function; /* 03h */
  245. U8 Action; /* 04h */
  246. U8 Reserved1; /* 05h */
  247. U8 Reserved2; /* 06h */
  248. U8 MsgFlags; /* 07h */
  249. U32 MsgContext; /* 08h */
  250. U32 SlotStatus; /* 0Ch */
  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. /* SlotStatus bits for MSG_SEP_REQUEST */
  257. #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001)
  258. #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002)
  259. #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004)
  260. #define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008)
  261. #define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010)
  262. #define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK (0x00000020)
  263. #define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040)
  264. #define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080)
  265. #define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100)
  266. #define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200)
  267. #define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000)
  268. #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000)
  269. #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT (0x00080000)
  270. #define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE (0x00400000)
  271. #define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000)
  272. #define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000)
  273. #define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF (0x10000000)
  274. #define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET (0x80000000)
  275. typedef struct _MSG_SEP_REPLY
  276. {
  277. U8 TargetID; /* 00h */
  278. U8 Bus; /* 01h */
  279. U8 MsgLength; /* 02h */
  280. U8 Function; /* 03h */
  281. U8 Action; /* 04h */
  282. U8 Reserved1; /* 05h */
  283. U8 Reserved2; /* 06h */
  284. U8 MsgFlags; /* 07h */
  285. U32 MsgContext; /* 08h */
  286. U16 Reserved3; /* 0Ch */
  287. U16 IOCStatus; /* 0Eh */
  288. U32 IOCLogInfo; /* 10h */
  289. U32 SlotStatus; /* 14h */
  290. } MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
  291. SEPReply_t, MPI_POINTER pSEPReply_t;
  292. /* SlotStatus bits for MSG_SEP_REPLY */
  293. #define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001)
  294. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002)
  295. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004)
  296. #define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008)
  297. #define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010)
  298. #define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK (0x00000020)
  299. #define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040)
  300. #define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080)
  301. #define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100)
  302. #define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200)
  303. #define MPI_SEP_REPLY_SLOTSTATUS_REPORT (0x00010000)
  304. #define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000)
  305. #define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000)
  306. #define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY (0x00080000)
  307. #define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE (0x00400000)
  308. #define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED (0x01000000)
  309. #define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED (0x02000000)
  310. #define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS (0x04000000)
  311. #define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS (0x08000000)
  312. #define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x10000000)
  313. #define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED (0x40000000)
  314. #define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED (0x80000000)
  315. #endif