mpi_targ.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. /*
  2. * Copyright (c) 2000-2003 LSI Logic 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.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. * 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. * --------------------------------------------------------------------------
  47. */
  48. #ifndef MPI_TARG_H
  49. #define MPI_TARG_H
  50. /******************************************************************************
  51. *
  52. * S C S I T a r g e t M e s s a g e s
  53. *
  54. *******************************************************************************/
  55. typedef struct _CMD_BUFFER_DESCRIPTOR
  56. {
  57. U16 IoIndex; /* 00h */
  58. U16 Reserved; /* 02h */
  59. union /* 04h */
  60. {
  61. U32 PhysicalAddress32;
  62. U64 PhysicalAddress64;
  63. } u;
  64. } CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR,
  65. CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t;
  66. /****************************************************************************/
  67. /* Target Command Buffer Post Request */
  68. /****************************************************************************/
  69. typedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST
  70. {
  71. U8 BufferPostFlags; /* 00h */
  72. U8 BufferCount; /* 01h */
  73. U8 ChainOffset; /* 02h */
  74. U8 Function; /* 03h */
  75. U8 BufferLength; /* 04h */
  76. U8 Reserved; /* 05h */
  77. U8 Reserved1; /* 06h */
  78. U8 MsgFlags; /* 07h */
  79. U32 MsgContext; /* 08h */
  80. CMD_BUFFER_DESCRIPTOR Buffer[1]; /* 0Ch */
  81. } MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,
  82. TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;
  83. #define CMD_BUFFER_POST_FLAGS_PORT_MASK (0x01)
  84. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK (0x80)
  85. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32 (0)
  86. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64 (1)
  87. #define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR (0x80)
  88. #define CMD_BUFFER_POST_IO_INDEX_MASK (0x00003FFF)
  89. #define CMD_BUFFER_POST_IO_INDEX_MASK_0100 (0x000003FF) /* obsolete */
  90. typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY
  91. {
  92. U8 BufferPostFlags; /* 00h */
  93. U8 BufferCount; /* 01h */
  94. U8 MsgLength; /* 02h */
  95. U8 Function; /* 03h */
  96. U8 BufferLength; /* 04h */
  97. U8 Reserved; /* 05h */
  98. U8 Reserved1; /* 06h */
  99. U8 MsgFlags; /* 07h */
  100. U32 MsgContext; /* 08h */
  101. U16 Reserved2; /* 0Ch */
  102. U16 IOCStatus; /* 0Eh */
  103. U32 IOCLogInfo; /* 10h */
  104. } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,
  105. TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;
  106. /* the following structure is obsolete as of MPI v1.2 */
  107. typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
  108. {
  109. U16 Reserved; /* 00h */
  110. U8 MsgLength; /* 02h */
  111. U8 Function; /* 03h */
  112. U16 Reserved1; /* 04h */
  113. U8 Reserved2; /* 06h */
  114. U8 MsgFlags; /* 07h */
  115. U32 MsgContext; /* 08h */
  116. U8 PriorityReason; /* 0Ch */
  117. U8 Reserved3; /* 0Dh */
  118. U16 IOCStatus; /* 0Eh */
  119. U32 IOCLogInfo; /* 10h */
  120. U32 ReplyWord; /* 14h */
  121. } MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
  122. PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
  123. #define PRIORITY_REASON_NO_DISCONNECT (0x00)
  124. #define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01)
  125. #define PRIORITY_REASON_CMD_PARITY_ERR (0x02)
  126. #define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03)
  127. #define PRIORITY_REASON_LQ_CRC_ERR (0x04)
  128. #define PRIORITY_REASON_CMD_CRC_ERR (0x05)
  129. #define PRIORITY_REASON_PROTOCOL_ERR (0x06)
  130. #define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07)
  131. #define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08)
  132. #define PRIORITY_REASON_TARGET_BUSY (0x09)
  133. #define PRIORITY_REASON_UNKNOWN (0xFF)
  134. typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
  135. {
  136. U16 Reserved; /* 00h */
  137. U8 MsgLength; /* 02h */
  138. U8 Function; /* 03h */
  139. U16 Reserved1; /* 04h */
  140. U8 Reserved2; /* 06h */
  141. U8 MsgFlags; /* 07h */
  142. U32 MsgContext; /* 08h */
  143. U8 PriorityReason; /* 0Ch */
  144. U8 Reserved3; /* 0Dh */
  145. U16 IOCStatus; /* 0Eh */
  146. U32 IOCLogInfo; /* 10h */
  147. U32 ReplyWord; /* 14h */
  148. } MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
  149. MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
  150. TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
  151. typedef struct _MPI_TARGET_FCP_CMD_BUFFER
  152. {
  153. U8 FcpLun[8]; /* 00h */
  154. U8 FcpCntl[4]; /* 08h */
  155. U8 FcpCdb[16]; /* 0Ch */
  156. U32 FcpDl; /* 1Ch */
  157. U8 AliasIndex; /* 20h */
  158. U8 Reserved1; /* 21h */
  159. U16 OptionalOxid; /* 22h */
  160. } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
  161. MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
  162. typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
  163. {
  164. /* SPI L_Q information unit */
  165. U8 L_QType; /* 00h */
  166. U8 Reserved; /* 01h */
  167. U16 Tag; /* 02h */
  168. U8 LogicalUnitNumber[8]; /* 04h */
  169. U32 DataLength; /* 0Ch */
  170. /* SPI command information unit */
  171. U8 ReservedFirstByteOfCommandIU; /* 10h */
  172. U8 TaskAttribute; /* 11h */
  173. U8 TaskManagementFlags; /* 12h */
  174. U8 AdditionalCDBLength; /* 13h */
  175. U8 CDB[16]; /* 14h */
  176. /* Alias ID */
  177. U8 AliasID; /* 24h */
  178. U8 Reserved1; /* 25h */
  179. U16 Reserved2; /* 26h */
  180. } MPI_TARGET_SCSI_SPI_CMD_BUFFER,
  181. MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,
  182. MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
  183. /****************************************************************************/
  184. /* Target Assist Request */
  185. /****************************************************************************/
  186. typedef struct _MSG_TARGET_ASSIST_REQUEST
  187. {
  188. U8 StatusCode; /* 00h */
  189. U8 TargetAssistFlags; /* 01h */
  190. U8 ChainOffset; /* 02h */
  191. U8 Function; /* 03h */
  192. U16 QueueTag; /* 04h */
  193. U8 Reserved; /* 06h */
  194. U8 MsgFlags; /* 07h */
  195. U32 MsgContext; /* 08h */
  196. U32 ReplyWord; /* 0Ch */
  197. U8 LUN[8]; /* 10h */
  198. U32 RelativeOffset; /* 18h */
  199. U32 DataLength; /* 1Ch */
  200. SGE_IO_UNION SGL[1]; /* 20h */
  201. } MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,
  202. TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;
  203. #define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01)
  204. #define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02)
  205. #define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04)
  206. #define TARGET_ASSIST_FLAGS_CONFIRMED (0x08)
  207. #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80)
  208. typedef struct _MSG_TARGET_ERROR_REPLY
  209. {
  210. U16 Reserved; /* 00h */
  211. U8 MsgLength; /* 02h */
  212. U8 Function; /* 03h */
  213. U16 Reserved1; /* 04h */
  214. U8 Reserved2; /* 06h */
  215. U8 MsgFlags; /* 07h */
  216. U32 MsgContext; /* 08h */
  217. U8 PriorityReason; /* 0Ch */
  218. U8 Reserved3; /* 0Dh */
  219. U16 IOCStatus; /* 0Eh */
  220. U32 IOCLogInfo; /* 10h */
  221. U32 ReplyWord; /* 14h */
  222. U32 TransferCount; /* 18h */
  223. } MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,
  224. TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;
  225. /****************************************************************************/
  226. /* Target Status Send Request */
  227. /****************************************************************************/
  228. typedef struct _MSG_TARGET_STATUS_SEND_REQUEST
  229. {
  230. U8 StatusCode; /* 00h */
  231. U8 StatusFlags; /* 01h */
  232. U8 ChainOffset; /* 02h */
  233. U8 Function; /* 03h */
  234. U16 QueueTag; /* 04h */
  235. U8 Reserved; /* 06h */
  236. U8 MsgFlags; /* 07h */
  237. U32 MsgContext; /* 08h */
  238. U32 ReplyWord; /* 0Ch */
  239. U8 LUN[8]; /* 10h */
  240. SGE_SIMPLE_UNION StatusDataSGE; /* 18h */
  241. } MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,
  242. TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t;
  243. #define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01)
  244. #define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04)
  245. #define TARGET_STATUS_SEND_FLAGS_CONFIRMED (0x08)
  246. #define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80)
  247. /*
  248. * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this
  249. * structure properly orders the bytes.
  250. */
  251. typedef struct _MPI_TARGET_FCP_RSP_BUFFER
  252. {
  253. U8 Reserved0[8]; /* 00h */
  254. U8 Reserved1[2]; /* 08h */
  255. U8 FcpFlags; /* 0Ah */
  256. U8 FcpStatus; /* 0Bh */
  257. U32 FcpResid; /* 0Ch */
  258. U32 FcpSenseLength; /* 10h */
  259. U32 FcpResponseLength; /* 14h */
  260. U8 FcpResponseData[8]; /* 18h */
  261. U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */
  262. } MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
  263. MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;
  264. /*
  265. * NOTE: The SPI status IU is big-endian. When used on a little-endian system,
  266. * this structure properly orders the bytes.
  267. */
  268. typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
  269. {
  270. U8 Reserved0; /* 00h */
  271. U8 Reserved1; /* 01h */
  272. U8 Valid; /* 02h */
  273. U8 Status; /* 03h */
  274. U32 SenseDataListLength; /* 04h */
  275. U32 PktFailuresListLength; /* 08h */
  276. U8 SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */
  277. } MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
  278. TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
  279. /****************************************************************************/
  280. /* Target Mode Abort Request */
  281. /****************************************************************************/
  282. typedef struct _MSG_TARGET_MODE_ABORT_REQUEST
  283. {
  284. U8 AbortType; /* 00h */
  285. U8 Reserved; /* 01h */
  286. U8 ChainOffset; /* 02h */
  287. U8 Function; /* 03h */
  288. U16 Reserved1; /* 04h */
  289. U8 Reserved2; /* 06h */
  290. U8 MsgFlags; /* 07h */
  291. U32 MsgContext; /* 08h */
  292. U32 ReplyWord; /* 0Ch */
  293. U32 MsgContextToAbort; /* 10h */
  294. } MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,
  295. TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;
  296. #define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS (0x00)
  297. #define TARGET_MODE_ABORT_TYPE_ALL_IO (0x01)
  298. #define TARGET_MODE_ABORT_TYPE_EXACT_IO (0x02)
  299. #define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST (0x03)
  300. /* Target Mode Abort Reply */
  301. typedef struct _MSG_TARGET_MODE_ABORT_REPLY
  302. {
  303. U16 Reserved; /* 00h */
  304. U8 MsgLength; /* 02h */
  305. U8 Function; /* 03h */
  306. U16 Reserved1; /* 04h */
  307. U8 Reserved2; /* 06h */
  308. U8 MsgFlags; /* 07h */
  309. U32 MsgContext; /* 08h */
  310. U16 Reserved3; /* 0Ch */
  311. U16 IOCStatus; /* 0Eh */
  312. U32 IOCLogInfo; /* 10h */
  313. U32 AbortCount; /* 14h */
  314. } MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,
  315. TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;
  316. /****************************************************************************/
  317. /* Target Mode Context Reply */
  318. /****************************************************************************/
  319. #define TARGET_MODE_REPLY_IO_INDEX_MASK (0x00003FFF)
  320. #define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0)
  321. #define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000)
  322. #define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)
  323. #define TARGET_MODE_REPLY_ALIAS_MASK (0x04000000)
  324. #define TARGET_MODE_REPLY_ALIAS_SHIFT (26)
  325. #define TARGET_MODE_REPLY_PORT_MASK (0x10000000)
  326. #define TARGET_MODE_REPLY_PORT_SHIFT (28)
  327. #define GET_IO_INDEX(x) (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK) \
  328. >> TARGET_MODE_REPLY_IO_INDEX_SHIFT)
  329. #define SET_IO_INDEX(t, i) \
  330. ((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) | \
  331. (((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) & \
  332. TARGET_MODE_REPLY_IO_INDEX_MASK))
  333. #define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \
  334. >> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT)
  335. #define SET_INITIATOR_INDEX(t, ii) \
  336. ((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) | \
  337. (((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) & \
  338. TARGET_MODE_REPLY_INITIATOR_INDEX_MASK))
  339. #define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK) \
  340. >> TARGET_MODE_REPLY_ALIAS_SHIFT)
  341. #define SET_ALIAS(t, a) ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) | \
  342. (((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) & \
  343. TARGET_MODE_REPLY_ALIAS_MASK))
  344. #define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK) \
  345. >> TARGET_MODE_REPLY_PORT_SHIFT)
  346. #define SET_PORT(t, p) ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) | \
  347. (((p) << TARGET_MODE_REPLY_PORT_SHIFT) & \
  348. TARGET_MODE_REPLY_PORT_MASK))
  349. /* the following obsolete values are for MPI v1.0 support */
  350. #define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX (0x000003FF)
  351. #define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX (0)
  352. #define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX (0x001FF800)
  353. #define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX (11)
  354. #define TARGET_MODE_REPLY_0100_PORT_MASK (0x00400000)
  355. #define TARGET_MODE_REPLY_0100_PORT_SHIFT (22)
  356. #define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX (0x1F800000)
  357. #define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23)
  358. #define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \
  359. >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX)
  360. #define SET_HOST_INDEX_0100(t, hi) \
  361. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) | \
  362. (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) & \
  363. TARGET_MODE_REPLY_0100_MASK_HOST_INDEX))
  364. #define GET_IOC_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \
  365. >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX)
  366. #define SET_IOC_INDEX_0100(t, ii) \
  367. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) | \
  368. (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) & \
  369. TARGET_MODE_REPLY_0100_MASK_IOC_INDEX))
  370. #define GET_INITIATOR_INDEX_0100(x) \
  371. (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) \
  372. >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX)
  373. #define SET_INITIATOR_INDEX_0100(t, ii) \
  374. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) | \
  375. (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) & \
  376. TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX))
  377. #endif