mpi_targ.h 34 KB

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