mpi_targ.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /*
  2. * Copyright (c) 2000-2008 LSI Corporation.
  3. *
  4. *
  5. * Name: mpi_targ.h
  6. * Title: MPI Target mode messages and structures
  7. * Creation Date: June 22, 2000
  8. *
  9. * mpi_targ.h Version: 01.05.06
  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. * 06-06-00 01.00.01 Update version number for 1.0 release.
  18. * 06-22-00 01.00.02 Added _MSG_TARGET_CMD_BUFFER_POST_REPLY structure.
  19. * Corrected DECSRIPTOR typo to DESCRIPTOR.
  20. * 11-02-00 01.01.01 Original release for post 1.0 work
  21. * Modified target mode to use IoIndex instead of
  22. * HostIndex and IocIndex. Added Alias.
  23. * 01-09-01 01.01.02 Added defines for TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER
  24. * and TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER.
  25. * 02-20-01 01.01.03 Started using MPI_POINTER.
  26. * Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
  27. * MPI_TARGET_FCP_CMD_BUFFER.
  28. * 03-27-01 01.01.04 Added structure offset comments.
  29. * 08-08-01 01.02.01 Original release for v1.2 work.
  30. * 09-28-01 01.02.02 Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.
  31. * Added PriorityReason field to some replies and
  32. * defined more PriorityReason codes.
  33. * Added some defines for to support previous version
  34. * of MPI.
  35. * 10-04-01 01.02.03 Added PriorityReason to MSG_TARGET_ERROR_REPLY.
  36. * 11-01-01 01.02.04 Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
  37. * 03-14-02 01.02.05 Modified MPI_TARGET_FCP_RSP_BUFFER to get the proper
  38. * byte ordering.
  39. * 05-31-02 01.02.06 Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
  40. * one bit.
  41. * Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
  42. * 09-16-02 01.02.07 Added flags for confirmed completion.
  43. * Added PRIORITY_REASON_TARGET_BUSY.
  44. * 11-15-02 01.02.08 Added AliasID field to MPI_TARGET_SCSI_SPI_CMD_BUFFER.
  45. * 04-01-03 01.02.09 Added OptionalOxid field to MPI_TARGET_FCP_CMD_BUFFER.
  46. * 05-11-04 01.03.01 Original release for MPI v1.3.
  47. * 08-19-04 01.05.01 Added new request message structures for
  48. * MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
  49. * MSG_TARGET_CMD_BUF_POST_LIST_REQUEST, and
  50. * MSG_TARGET_ASSIST_EXT_REQUEST.
  51. * Added new structures for SAS SSP Command buffer, SSP
  52. * Task buffer, and SSP Status IU.
  53. * 10-05-04 01.05.02 MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY added.
  54. * 02-22-05 01.05.03 Changed a comment.
  55. * 03-11-05 01.05.04 Removed TargetAssistExtended Request.
  56. * 06-24-05 01.05.05 Added TargetAssistExtended structures and defines.
  57. * 03-27-06 01.05.06 Added a comment.
  58. * --------------------------------------------------------------------------
  59. */
  60. #ifndef MPI_TARG_H
  61. #define MPI_TARG_H
  62. /******************************************************************************
  63. *
  64. * S C S I T a r g e t M e s s a g e s
  65. *
  66. *******************************************************************************/
  67. typedef struct _CMD_BUFFER_DESCRIPTOR
  68. {
  69. U16 IoIndex; /* 00h */
  70. U16 Reserved; /* 02h */
  71. union /* 04h */
  72. {
  73. U32 PhysicalAddress32;
  74. U64 PhysicalAddress64;
  75. } u;
  76. } CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR,
  77. CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t;
  78. /****************************************************************************/
  79. /* Target Command Buffer Post Request */
  80. /****************************************************************************/
  81. typedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST
  82. {
  83. U8 BufferPostFlags; /* 00h */
  84. U8 BufferCount; /* 01h */
  85. U8 ChainOffset; /* 02h */
  86. U8 Function; /* 03h */
  87. U8 BufferLength; /* 04h */
  88. U8 Reserved; /* 05h */
  89. U8 Reserved1; /* 06h */
  90. U8 MsgFlags; /* 07h */
  91. U32 MsgContext; /* 08h */
  92. CMD_BUFFER_DESCRIPTOR Buffer[1]; /* 0Ch */
  93. } MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,
  94. TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;
  95. #define CMD_BUFFER_POST_FLAGS_PORT_MASK (0x01)
  96. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK (0x80)
  97. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32 (0)
  98. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64 (1)
  99. #define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR (0x80)
  100. #define CMD_BUFFER_POST_IO_INDEX_MASK (0x00003FFF)
  101. #define CMD_BUFFER_POST_IO_INDEX_MASK_0100 (0x000003FF) /* obsolete */
  102. typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY
  103. {
  104. U8 BufferPostFlags; /* 00h */
  105. U8 BufferCount; /* 01h */
  106. U8 MsgLength; /* 02h */
  107. U8 Function; /* 03h */
  108. U8 BufferLength; /* 04h */
  109. U8 Reserved; /* 05h */
  110. U8 Reserved1; /* 06h */
  111. U8 MsgFlags; /* 07h */
  112. U32 MsgContext; /* 08h */
  113. U16 Reserved2; /* 0Ch */
  114. U16 IOCStatus; /* 0Eh */
  115. U32 IOCLogInfo; /* 10h */
  116. } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,
  117. TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;
  118. /* the following structure is obsolete as of MPI v1.2 */
  119. typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
  120. {
  121. U16 Reserved; /* 00h */
  122. U8 MsgLength; /* 02h */
  123. U8 Function; /* 03h */
  124. U16 Reserved1; /* 04h */
  125. U8 Reserved2; /* 06h */
  126. U8 MsgFlags; /* 07h */
  127. U32 MsgContext; /* 08h */
  128. U8 PriorityReason; /* 0Ch */
  129. U8 Reserved3; /* 0Dh */
  130. U16 IOCStatus; /* 0Eh */
  131. U32 IOCLogInfo; /* 10h */
  132. U32 ReplyWord; /* 14h */
  133. } MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
  134. PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
  135. typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
  136. {
  137. U16 Reserved; /* 00h */
  138. U8 MsgLength; /* 02h */
  139. U8 Function; /* 03h */
  140. U16 Reserved1; /* 04h */
  141. U8 Reserved2; /* 06h */
  142. U8 MsgFlags; /* 07h */
  143. U32 MsgContext; /* 08h */
  144. U8 PriorityReason; /* 0Ch */
  145. U8 Reserved3; /* 0Dh */
  146. U16 IOCStatus; /* 0Eh */
  147. U32 IOCLogInfo; /* 10h */
  148. U32 ReplyWord; /* 14h */
  149. } MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
  150. MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
  151. TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
  152. #define PRIORITY_REASON_NO_DISCONNECT (0x00)
  153. #define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01)
  154. #define PRIORITY_REASON_CMD_PARITY_ERR (0x02)
  155. #define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03)
  156. #define PRIORITY_REASON_LQ_CRC_ERR (0x04)
  157. #define PRIORITY_REASON_CMD_CRC_ERR (0x05)
  158. #define PRIORITY_REASON_PROTOCOL_ERR (0x06)
  159. #define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07)
  160. #define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08)
  161. #define PRIORITY_REASON_TARGET_BUSY (0x09)
  162. #define PRIORITY_REASON_UNKNOWN (0xFF)
  163. /****************************************************************************/
  164. /* Target Command Buffer Post Base Request */
  165. /****************************************************************************/
  166. typedef struct _MSG_TARGET_CMD_BUF_POST_BASE_REQUEST
  167. {
  168. U8 BufferPostFlags; /* 00h */
  169. U8 PortNumber; /* 01h */
  170. U8 ChainOffset; /* 02h */
  171. U8 Function; /* 03h */
  172. U16 TotalCmdBuffers; /* 04h */
  173. U8 Reserved; /* 06h */
  174. U8 MsgFlags; /* 07h */
  175. U32 MsgContext; /* 08h */
  176. U32 Reserved1; /* 0Ch */
  177. U16 CmdBufferLength; /* 10h */
  178. U16 NextCmdBufferOffset; /* 12h */
  179. U32 BaseAddressLow; /* 14h */
  180. U32 BaseAddressHigh; /* 18h */
  181. } MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
  182. MPI_POINTER PTR__MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
  183. TargetCmdBufferPostBaseRequest_t,
  184. MPI_POINTER pTargetCmdBufferPostBaseRequest_t;
  185. #define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL (0x01)
  186. typedef struct _MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY
  187. {
  188. U16 Reserved; /* 00h */
  189. U8 MsgLength; /* 02h */
  190. U8 Function; /* 03h */
  191. U16 Reserved1; /* 04h */
  192. U8 Reserved2; /* 06h */
  193. U8 MsgFlags; /* 07h */
  194. U32 MsgContext; /* 08h */
  195. U16 Reserved3; /* 0Ch */
  196. U16 IOCStatus; /* 0Eh */
  197. U32 IOCLogInfo; /* 10h */
  198. } MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
  199. MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
  200. TargetCmdBufferPostBaseListReply_t,
  201. MPI_POINTER pTargetCmdBufferPostBaseListReply_t;
  202. /****************************************************************************/
  203. /* Target Command Buffer Post List Request */
  204. /****************************************************************************/
  205. typedef struct _MSG_TARGET_CMD_BUF_POST_LIST_REQUEST
  206. {
  207. U8 Reserved; /* 00h */
  208. U8 PortNumber; /* 01h */
  209. U8 ChainOffset; /* 02h */
  210. U8 Function; /* 03h */
  211. U16 CmdBufferCount; /* 04h */
  212. U8 Reserved1; /* 06h */
  213. U8 MsgFlags; /* 07h */
  214. U32 MsgContext; /* 08h */
  215. U32 Reserved2; /* 0Ch */
  216. U16 IoIndex[2]; /* 10h */
  217. } MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
  218. MPI_POINTER PTR_MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
  219. TargetCmdBufferPostListRequest_t,
  220. MPI_POINTER pTargetCmdBufferPostListRequest_t;
  221. /****************************************************************************/
  222. /* Command Buffer Formats (with 16 byte CDB) */
  223. /****************************************************************************/
  224. typedef struct _MPI_TARGET_FCP_CMD_BUFFER
  225. {
  226. U8 FcpLun[8]; /* 00h */
  227. U8 FcpCntl[4]; /* 08h */
  228. U8 FcpCdb[16]; /* 0Ch */
  229. U32 FcpDl; /* 1Ch */
  230. U8 AliasIndex; /* 20h */
  231. U8 Reserved1; /* 21h */
  232. U16 OptionalOxid; /* 22h */
  233. } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
  234. MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
  235. typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
  236. {
  237. /* SPI L_Q information unit */
  238. U8 L_QType; /* 00h */
  239. U8 Reserved; /* 01h */
  240. U16 Tag; /* 02h */
  241. U8 LogicalUnitNumber[8]; /* 04h */
  242. U32 DataLength; /* 0Ch */
  243. /* SPI command information unit */
  244. U8 ReservedFirstByteOfCommandIU; /* 10h */
  245. U8 TaskAttribute; /* 11h */
  246. U8 TaskManagementFlags; /* 12h */
  247. U8 AdditionalCDBLength; /* 13h */
  248. U8 CDB[16]; /* 14h */
  249. /* Alias ID */
  250. U8 AliasID; /* 24h */
  251. U8 Reserved1; /* 25h */
  252. U16 Reserved2; /* 26h */
  253. } MPI_TARGET_SCSI_SPI_CMD_BUFFER,
  254. MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,
  255. MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
  256. typedef struct _MPI_TARGET_SSP_CMD_BUFFER
  257. {
  258. U8 FrameType; /* 00h */
  259. U8 Reserved1; /* 01h */
  260. U16 Reserved2; /* 02h */
  261. U16 InitiatorTag; /* 04h */
  262. U16 DevHandle; /* 06h */
  263. /* COMMAND information unit starts here */
  264. U8 LogicalUnitNumber[8]; /* 08h */
  265. U8 Reserved3; /* 10h */
  266. U8 TaskAttribute; /* lower 3 bits */ /* 11h */
  267. U8 Reserved4; /* 12h */
  268. U8 AdditionalCDBLength; /* upper 5 bits */ /* 13h */
  269. U8 CDB[16]; /* 14h */
  270. /* Additional CDB bytes extend past the CDB field */
  271. } MPI_TARGET_SSP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_CMD_BUFFER,
  272. MpiTargetSspCmdBuffer, MPI_POINTER pMpiTargetSspCmdBuffer;
  273. typedef struct _MPI_TARGET_SSP_TASK_BUFFER
  274. {
  275. U8 FrameType; /* 00h */
  276. U8 Reserved1; /* 01h */
  277. U16 Reserved2; /* 02h */
  278. U16 InitiatorTag; /* 04h */
  279. U16 DevHandle; /* 06h */
  280. /* TASK information unit starts here */
  281. U8 LogicalUnitNumber[8]; /* 08h */
  282. U8 Reserved3; /* 10h */
  283. U8 Reserved4; /* 11h */
  284. U8 TaskManagementFunction; /* 12h */
  285. U8 Reserved5; /* 13h */
  286. U16 ManagedTaskTag; /* 14h */
  287. U16 Reserved6; /* 16h */
  288. U32 Reserved7; /* 18h */
  289. U32 Reserved8; /* 1Ch */
  290. U32 Reserved9; /* 20h */
  291. } MPI_TARGET_SSP_TASK_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_TASK_BUFFER,
  292. MpiTargetSspTaskBuffer, MPI_POINTER pMpiTargetSspTaskBuffer;
  293. /****************************************************************************/
  294. /* Target Assist Request */
  295. /****************************************************************************/
  296. typedef struct _MSG_TARGET_ASSIST_REQUEST
  297. {
  298. U8 StatusCode; /* 00h */
  299. U8 TargetAssistFlags; /* 01h */
  300. U8 ChainOffset; /* 02h */
  301. U8 Function; /* 03h */
  302. U16 QueueTag; /* 04h */
  303. U8 Reserved; /* 06h */
  304. U8 MsgFlags; /* 07h */
  305. U32 MsgContext; /* 08h */
  306. U32 ReplyWord; /* 0Ch */
  307. U8 LUN[8]; /* 10h */
  308. U32 RelativeOffset; /* 18h */
  309. U32 DataLength; /* 1Ch */
  310. SGE_IO_UNION SGL[1]; /* 20h */
  311. } MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,
  312. TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;
  313. #define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01)
  314. #define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02)
  315. #define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04)
  316. #define TARGET_ASSIST_FLAGS_CONFIRMED (0x08)
  317. #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80)
  318. /* Standard Target Mode Reply message */
  319. typedef struct _MSG_TARGET_ERROR_REPLY
  320. {
  321. U16 Reserved; /* 00h */
  322. U8 MsgLength; /* 02h */
  323. U8 Function; /* 03h */
  324. U16 Reserved1; /* 04h */
  325. U8 Reserved2; /* 06h */
  326. U8 MsgFlags; /* 07h */
  327. U32 MsgContext; /* 08h */
  328. U8 PriorityReason; /* 0Ch */
  329. U8 Reserved3; /* 0Dh */
  330. U16 IOCStatus; /* 0Eh */
  331. U32 IOCLogInfo; /* 10h */
  332. U32 ReplyWord; /* 14h */
  333. U32 TransferCount; /* 18h */
  334. } MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,
  335. TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;
  336. /****************************************************************************/
  337. /* Target Assist Extended Request */
  338. /****************************************************************************/
  339. typedef struct _MSG_TARGET_ASSIST_EXT_REQUEST
  340. {
  341. U8 StatusCode; /* 00h */
  342. U8 TargetAssistFlags; /* 01h */
  343. U8 ChainOffset; /* 02h */
  344. U8 Function; /* 03h */
  345. U16 QueueTag; /* 04h */
  346. U8 Reserved1; /* 06h */
  347. U8 MsgFlags; /* 07h */
  348. U32 MsgContext; /* 08h */
  349. U32 ReplyWord; /* 0Ch */
  350. U8 LUN[8]; /* 10h */
  351. U32 RelativeOffset; /* 18h */
  352. U32 Reserved2; /* 1Ch */
  353. U32 Reserved3; /* 20h */
  354. U32 PrimaryReferenceTag; /* 24h */
  355. U16 PrimaryApplicationTag; /* 28h */
  356. U16 PrimaryApplicationTagMask; /* 2Ah */
  357. U32 Reserved4; /* 2Ch */
  358. U32 DataLength; /* 30h */
  359. U32 BidirectionalDataLength; /* 34h */
  360. U32 SecondaryReferenceTag; /* 38h */
  361. U16 SecondaryApplicationTag; /* 3Ch */
  362. U16 Reserved5; /* 3Eh */
  363. U16 EEDPFlags; /* 40h */
  364. U16 ApplicationTagTranslationMask; /* 42h */
  365. U32 EEDPBlockSize; /* 44h */
  366. U8 SGLOffset0; /* 48h */
  367. U8 SGLOffset1; /* 49h */
  368. U8 SGLOffset2; /* 4Ah */
  369. U8 SGLOffset3; /* 4Bh */
  370. U32 Reserved6; /* 4Ch */
  371. SGE_IO_UNION SGL[1]; /* 50h */
  372. } MSG_TARGET_ASSIST_EXT_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_EXT_REQUEST,
  373. TargetAssistExtRequest_t, MPI_POINTER pTargetAssistExtRequest_t;
  374. /* see the defines after MSG_TARGET_ASSIST_REQUEST for TargetAssistFlags */
  375. /* defines for the MsgFlags field */
  376. #define TARGET_ASSIST_EXT_MSGFLAGS_BIDIRECTIONAL (0x20)
  377. #define TARGET_ASSIST_EXT_MSGFLAGS_MULTICAST (0x10)
  378. #define TARGET_ASSIST_EXT_MSGFLAGS_SGL_OFFSET_CHAINS (0x08)
  379. /* defines for the EEDPFlags field */
  380. #define TARGET_ASSIST_EXT_EEDP_MASK_OP (0x0007)
  381. #define TARGET_ASSIST_EXT_EEDP_NOOP_OP (0x0000)
  382. #define TARGET_ASSIST_EXT_EEDP_CHK_OP (0x0001)
  383. #define TARGET_ASSIST_EXT_EEDP_STRIP_OP (0x0002)
  384. #define TARGET_ASSIST_EXT_EEDP_CHKRM_OP (0x0003)
  385. #define TARGET_ASSIST_EXT_EEDP_INSERT_OP (0x0004)
  386. #define TARGET_ASSIST_EXT_EEDP_REPLACE_OP (0x0006)
  387. #define TARGET_ASSIST_EXT_EEDP_CHKREGEN_OP (0x0007)
  388. #define TARGET_ASSIST_EXT_EEDP_PASS_REF_TAG (0x0008)
  389. #define TARGET_ASSIST_EXT_EEDP_T10_CHK_MASK (0x0700)
  390. #define TARGET_ASSIST_EXT_EEDP_T10_CHK_GUARD (0x0100)
  391. #define TARGET_ASSIST_EXT_EEDP_T10_CHK_APPTAG (0x0200)
  392. #define TARGET_ASSIST_EXT_EEDP_T10_CHK_REFTAG (0x0400)
  393. #define TARGET_ASSIST_EXT_EEDP_T10_CHK_SHIFT (8)
  394. #define TARGET_ASSIST_EXT_EEDP_INC_SEC_APPTAG (0x1000)
  395. #define TARGET_ASSIST_EXT_EEDP_INC_PRI_APPTAG (0x2000)
  396. #define TARGET_ASSIST_EXT_EEDP_INC_SEC_REFTAG (0x4000)
  397. #define TARGET_ASSIST_EXT_EEDP_INC_PRI_REFTAG (0x8000)
  398. /****************************************************************************/
  399. /* Target Status Send Request */
  400. /****************************************************************************/
  401. typedef struct _MSG_TARGET_STATUS_SEND_REQUEST
  402. {
  403. U8 StatusCode; /* 00h */
  404. U8 StatusFlags; /* 01h */
  405. U8 ChainOffset; /* 02h */
  406. U8 Function; /* 03h */
  407. U16 QueueTag; /* 04h */
  408. U8 Reserved; /* 06h */
  409. U8 MsgFlags; /* 07h */
  410. U32 MsgContext; /* 08h */
  411. U32 ReplyWord; /* 0Ch */
  412. U8 LUN[8]; /* 10h */
  413. SGE_SIMPLE_UNION StatusDataSGE; /* 18h */
  414. } MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,
  415. TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t;
  416. #define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01)
  417. #define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04)
  418. #define TARGET_STATUS_SEND_FLAGS_CONFIRMED (0x08)
  419. #define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80)
  420. /*
  421. * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this
  422. * structure properly orders the bytes.
  423. */
  424. typedef struct _MPI_TARGET_FCP_RSP_BUFFER
  425. {
  426. U8 Reserved0[8]; /* 00h */
  427. U8 Reserved1[2]; /* 08h */
  428. U8 FcpFlags; /* 0Ah */
  429. U8 FcpStatus; /* 0Bh */
  430. U32 FcpResid; /* 0Ch */
  431. U32 FcpSenseLength; /* 10h */
  432. U32 FcpResponseLength; /* 14h */
  433. U8 FcpResponseData[8]; /* 18h */
  434. U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */
  435. } MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
  436. MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;
  437. /*
  438. * NOTE: The SPI status IU is big-endian. When used on a little-endian system,
  439. * this structure properly orders the bytes.
  440. */
  441. typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
  442. {
  443. U8 Reserved0; /* 00h */
  444. U8 Reserved1; /* 01h */
  445. U8 Valid; /* 02h */
  446. U8 Status; /* 03h */
  447. U32 SenseDataListLength; /* 04h */
  448. U32 PktFailuresListLength; /* 08h */
  449. U8 SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */
  450. } MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
  451. TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
  452. /*
  453. * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
  454. * this structure properly orders the bytes.
  455. */
  456. typedef struct _MPI_TARGET_SSP_RSP_IU
  457. {
  458. U32 Reserved0[6]; /* reserved for SSP header */ /* 00h */
  459. /* start of RESPONSE information unit */
  460. U32 Reserved1; /* 18h */
  461. U32 Reserved2; /* 1Ch */
  462. U16 Reserved3; /* 20h */
  463. U8 DataPres; /* lower 2 bits */ /* 22h */
  464. U8 Status; /* 23h */
  465. U32 Reserved4; /* 24h */
  466. U32 SenseDataLength; /* 28h */
  467. U32 ResponseDataLength; /* 2Ch */
  468. U8 ResponseSenseData[4]; /* 30h */
  469. } MPI_TARGET_SSP_RSP_IU, MPI_POINTER PTR_MPI_TARGET_SSP_RSP_IU,
  470. MpiTargetSspRspIu_t, MPI_POINTER pMpiTargetSspRspIu_t;
  471. /****************************************************************************/
  472. /* Target Mode Abort Request */
  473. /****************************************************************************/
  474. typedef struct _MSG_TARGET_MODE_ABORT_REQUEST
  475. {
  476. U8 AbortType; /* 00h */
  477. U8 Reserved; /* 01h */
  478. U8 ChainOffset; /* 02h */
  479. U8 Function; /* 03h */
  480. U16 Reserved1; /* 04h */
  481. U8 Reserved2; /* 06h */
  482. U8 MsgFlags; /* 07h */
  483. U32 MsgContext; /* 08h */
  484. U32 ReplyWord; /* 0Ch */
  485. U32 MsgContextToAbort; /* 10h */
  486. } MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,
  487. TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;
  488. #define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS (0x00)
  489. #define TARGET_MODE_ABORT_TYPE_ALL_IO (0x01)
  490. #define TARGET_MODE_ABORT_TYPE_EXACT_IO (0x02)
  491. #define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST (0x03)
  492. /* Target Mode Abort Reply */
  493. typedef struct _MSG_TARGET_MODE_ABORT_REPLY
  494. {
  495. U16 Reserved; /* 00h */
  496. U8 MsgLength; /* 02h */
  497. U8 Function; /* 03h */
  498. U16 Reserved1; /* 04h */
  499. U8 Reserved2; /* 06h */
  500. U8 MsgFlags; /* 07h */
  501. U32 MsgContext; /* 08h */
  502. U16 Reserved3; /* 0Ch */
  503. U16 IOCStatus; /* 0Eh */
  504. U32 IOCLogInfo; /* 10h */
  505. U32 AbortCount; /* 14h */
  506. } MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,
  507. TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;
  508. /****************************************************************************/
  509. /* Target Mode Context Reply */
  510. /****************************************************************************/
  511. #define TARGET_MODE_REPLY_IO_INDEX_MASK (0x00003FFF)
  512. #define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0)
  513. #define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000)
  514. #define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)
  515. #define TARGET_MODE_REPLY_ALIAS_MASK (0x04000000)
  516. #define TARGET_MODE_REPLY_ALIAS_SHIFT (26)
  517. #define TARGET_MODE_REPLY_PORT_MASK (0x10000000)
  518. #define TARGET_MODE_REPLY_PORT_SHIFT (28)
  519. #define GET_IO_INDEX(x) (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK) \
  520. >> TARGET_MODE_REPLY_IO_INDEX_SHIFT)
  521. #define SET_IO_INDEX(t, i) \
  522. ((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) | \
  523. (((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) & \
  524. TARGET_MODE_REPLY_IO_INDEX_MASK))
  525. #define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \
  526. >> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT)
  527. #define SET_INITIATOR_INDEX(t, ii) \
  528. ((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) | \
  529. (((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) & \
  530. TARGET_MODE_REPLY_INITIATOR_INDEX_MASK))
  531. #define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK) \
  532. >> TARGET_MODE_REPLY_ALIAS_SHIFT)
  533. #define SET_ALIAS(t, a) ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) | \
  534. (((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) & \
  535. TARGET_MODE_REPLY_ALIAS_MASK))
  536. #define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK) \
  537. >> TARGET_MODE_REPLY_PORT_SHIFT)
  538. #define SET_PORT(t, p) ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) | \
  539. (((p) << TARGET_MODE_REPLY_PORT_SHIFT) & \
  540. TARGET_MODE_REPLY_PORT_MASK))
  541. /* the following obsolete values are for MPI v1.0 support */
  542. #define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX (0x000003FF)
  543. #define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX (0)
  544. #define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX (0x001FF800)
  545. #define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX (11)
  546. #define TARGET_MODE_REPLY_0100_PORT_MASK (0x00400000)
  547. #define TARGET_MODE_REPLY_0100_PORT_SHIFT (22)
  548. #define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX (0x1F800000)
  549. #define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23)
  550. #define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \
  551. >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX)
  552. #define SET_HOST_INDEX_0100(t, hi) \
  553. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) | \
  554. (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) & \
  555. TARGET_MODE_REPLY_0100_MASK_HOST_INDEX))
  556. #define GET_IOC_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \
  557. >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX)
  558. #define SET_IOC_INDEX_0100(t, ii) \
  559. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) | \
  560. (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) & \
  561. TARGET_MODE_REPLY_0100_MASK_IOC_INDEX))
  562. #define GET_INITIATOR_INDEX_0100(x) \
  563. (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) \
  564. >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX)
  565. #define SET_INITIATOR_INDEX_0100(t, ii) \
  566. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) | \
  567. (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) & \
  568. TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX))
  569. #endif