mpi_targ.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. /*
  2. * Copyright (c) 2000-2004 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.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. * 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. * --------------------------------------------------------------------------
  57. */
  58. #ifndef MPI_TARG_H
  59. #define MPI_TARG_H
  60. /******************************************************************************
  61. *
  62. * S C S I T a r g e t M e s s a g e s
  63. *
  64. *******************************************************************************/
  65. typedef struct _CMD_BUFFER_DESCRIPTOR
  66. {
  67. U16 IoIndex; /* 00h */
  68. U16 Reserved; /* 02h */
  69. union /* 04h */
  70. {
  71. U32 PhysicalAddress32;
  72. U64 PhysicalAddress64;
  73. } u;
  74. } CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR,
  75. CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t;
  76. /****************************************************************************/
  77. /* Target Command Buffer Post Request */
  78. /****************************************************************************/
  79. typedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST
  80. {
  81. U8 BufferPostFlags; /* 00h */
  82. U8 BufferCount; /* 01h */
  83. U8 ChainOffset; /* 02h */
  84. U8 Function; /* 03h */
  85. U8 BufferLength; /* 04h */
  86. U8 Reserved; /* 05h */
  87. U8 Reserved1; /* 06h */
  88. U8 MsgFlags; /* 07h */
  89. U32 MsgContext; /* 08h */
  90. CMD_BUFFER_DESCRIPTOR Buffer[1]; /* 0Ch */
  91. } MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,
  92. TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;
  93. #define CMD_BUFFER_POST_FLAGS_PORT_MASK (0x01)
  94. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK (0x80)
  95. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32 (0)
  96. #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64 (1)
  97. #define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR (0x80)
  98. #define CMD_BUFFER_POST_IO_INDEX_MASK (0x00003FFF)
  99. #define CMD_BUFFER_POST_IO_INDEX_MASK_0100 (0x000003FF) /* obsolete */
  100. typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY
  101. {
  102. U8 BufferPostFlags; /* 00h */
  103. U8 BufferCount; /* 01h */
  104. U8 MsgLength; /* 02h */
  105. U8 Function; /* 03h */
  106. U8 BufferLength; /* 04h */
  107. U8 Reserved; /* 05h */
  108. U8 Reserved1; /* 06h */
  109. U8 MsgFlags; /* 07h */
  110. U32 MsgContext; /* 08h */
  111. U16 Reserved2; /* 0Ch */
  112. U16 IOCStatus; /* 0Eh */
  113. U32 IOCLogInfo; /* 10h */
  114. } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,
  115. TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;
  116. /* the following structure is obsolete as of MPI v1.2 */
  117. typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
  118. {
  119. U16 Reserved; /* 00h */
  120. U8 MsgLength; /* 02h */
  121. U8 Function; /* 03h */
  122. U16 Reserved1; /* 04h */
  123. U8 Reserved2; /* 06h */
  124. U8 MsgFlags; /* 07h */
  125. U32 MsgContext; /* 08h */
  126. U8 PriorityReason; /* 0Ch */
  127. U8 Reserved3; /* 0Dh */
  128. U16 IOCStatus; /* 0Eh */
  129. U32 IOCLogInfo; /* 10h */
  130. U32 ReplyWord; /* 14h */
  131. } MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
  132. PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
  133. typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
  134. {
  135. U16 Reserved; /* 00h */
  136. U8 MsgLength; /* 02h */
  137. U8 Function; /* 03h */
  138. U16 Reserved1; /* 04h */
  139. U8 Reserved2; /* 06h */
  140. U8 MsgFlags; /* 07h */
  141. U32 MsgContext; /* 08h */
  142. U8 PriorityReason; /* 0Ch */
  143. U8 Reserved3; /* 0Dh */
  144. U16 IOCStatus; /* 0Eh */
  145. U32 IOCLogInfo; /* 10h */
  146. U32 ReplyWord; /* 14h */
  147. } MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
  148. MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
  149. TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
  150. #define PRIORITY_REASON_NO_DISCONNECT (0x00)
  151. #define PRIORITY_REASON_SCSI_TASK_MANAGEMENT (0x01)
  152. #define PRIORITY_REASON_CMD_PARITY_ERR (0x02)
  153. #define PRIORITY_REASON_MSG_OUT_PARITY_ERR (0x03)
  154. #define PRIORITY_REASON_LQ_CRC_ERR (0x04)
  155. #define PRIORITY_REASON_CMD_CRC_ERR (0x05)
  156. #define PRIORITY_REASON_PROTOCOL_ERR (0x06)
  157. #define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07)
  158. #define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08)
  159. #define PRIORITY_REASON_TARGET_BUSY (0x09)
  160. #define PRIORITY_REASON_UNKNOWN (0xFF)
  161. /****************************************************************************/
  162. /* Target Command Buffer Post Base Request */
  163. /****************************************************************************/
  164. typedef struct _MSG_TARGET_CMD_BUF_POST_BASE_REQUEST
  165. {
  166. U8 BufferPostFlags; /* 00h */
  167. U8 PortNumber; /* 01h */
  168. U8 ChainOffset; /* 02h */
  169. U8 Function; /* 03h */
  170. U16 TotalCmdBuffers; /* 04h */
  171. U8 Reserved; /* 06h */
  172. U8 MsgFlags; /* 07h */
  173. U32 MsgContext; /* 08h */
  174. U32 Reserved1; /* 0Ch */
  175. U16 CmdBufferLength; /* 10h */
  176. U16 NextCmdBufferOffset; /* 12h */
  177. U32 BaseAddressLow; /* 14h */
  178. U32 BaseAddressHigh; /* 18h */
  179. } MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
  180. MPI_POINTER PTR__MSG_TARGET_CMD_BUF_POST_BASE_REQUEST,
  181. TargetCmdBufferPostBaseRequest_t,
  182. MPI_POINTER pTargetCmdBufferPostBaseRequest_t;
  183. #define CMD_BUFFER_POST_BASE_FLAGS_AUTO_POST_ALL (0x01)
  184. typedef struct _MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY
  185. {
  186. U16 Reserved; /* 00h */
  187. U8 MsgLength; /* 02h */
  188. U8 Function; /* 03h */
  189. U16 Reserved1; /* 04h */
  190. U8 Reserved2; /* 06h */
  191. U8 MsgFlags; /* 07h */
  192. U32 MsgContext; /* 08h */
  193. U16 Reserved3; /* 0Ch */
  194. U16 IOCStatus; /* 0Eh */
  195. U32 IOCLogInfo; /* 10h */
  196. } MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
  197. MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_BASE_LIST_REPLY,
  198. TargetCmdBufferPostBaseListReply_t,
  199. MPI_POINTER pTargetCmdBufferPostBaseListReply_t;
  200. /****************************************************************************/
  201. /* Target Command Buffer Post List Request */
  202. /****************************************************************************/
  203. typedef struct _MSG_TARGET_CMD_BUF_POST_LIST_REQUEST
  204. {
  205. U8 Reserved; /* 00h */
  206. U8 PortNumber; /* 01h */
  207. U8 ChainOffset; /* 02h */
  208. U8 Function; /* 03h */
  209. U16 CmdBufferCount; /* 04h */
  210. U8 Reserved1; /* 06h */
  211. U8 MsgFlags; /* 07h */
  212. U32 MsgContext; /* 08h */
  213. U32 Reserved2; /* 0Ch */
  214. U16 IoIndex[2]; /* 10h */
  215. } MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
  216. MPI_POINTER PTR_MSG_TARGET_CMD_BUF_POST_LIST_REQUEST,
  217. TargetCmdBufferPostListRequest_t,
  218. MPI_POINTER pTargetCmdBufferPostListRequest_t;
  219. /****************************************************************************/
  220. /* Command Buffer Formats (with 16 byte CDB) */
  221. /****************************************************************************/
  222. typedef struct _MPI_TARGET_FCP_CMD_BUFFER
  223. {
  224. U8 FcpLun[8]; /* 00h */
  225. U8 FcpCntl[4]; /* 08h */
  226. U8 FcpCdb[16]; /* 0Ch */
  227. U32 FcpDl; /* 1Ch */
  228. U8 AliasIndex; /* 20h */
  229. U8 Reserved1; /* 21h */
  230. U16 OptionalOxid; /* 22h */
  231. } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
  232. MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
  233. typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
  234. {
  235. /* SPI L_Q information unit */
  236. U8 L_QType; /* 00h */
  237. U8 Reserved; /* 01h */
  238. U16 Tag; /* 02h */
  239. U8 LogicalUnitNumber[8]; /* 04h */
  240. U32 DataLength; /* 0Ch */
  241. /* SPI command information unit */
  242. U8 ReservedFirstByteOfCommandIU; /* 10h */
  243. U8 TaskAttribute; /* 11h */
  244. U8 TaskManagementFlags; /* 12h */
  245. U8 AdditionalCDBLength; /* 13h */
  246. U8 CDB[16]; /* 14h */
  247. /* Alias ID */
  248. U8 AliasID; /* 24h */
  249. U8 Reserved1; /* 25h */
  250. U16 Reserved2; /* 26h */
  251. } MPI_TARGET_SCSI_SPI_CMD_BUFFER,
  252. MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,
  253. MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
  254. typedef struct _MPI_TARGET_SSP_CMD_BUFFER
  255. {
  256. U8 FrameType; /* 00h */
  257. U8 Reserved1; /* 01h */
  258. U16 Reserved2; /* 02h */
  259. U16 InitiatorTag; /* 04h */
  260. U16 DevHandle; /* 06h */
  261. /* COMMAND information unit starts here */
  262. U8 LogicalUnitNumber[8]; /* 08h */
  263. U8 Reserved3; /* 10h */
  264. U8 TaskAttribute; /* lower 3 bits */ /* 11h */
  265. U8 Reserved4; /* 12h */
  266. U8 AdditionalCDBLength; /* upper 5 bits */ /* 13h */
  267. U8 CDB[16]; /* 14h */
  268. /* Additional CDB bytes extend past the CDB field */
  269. } MPI_TARGET_SSP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_CMD_BUFFER,
  270. MpiTargetSspCmdBuffer, MPI_POINTER pMpiTargetSspCmdBuffer;
  271. typedef struct _MPI_TARGET_SSP_TASK_BUFFER
  272. {
  273. U8 FrameType; /* 00h */
  274. U8 Reserved1; /* 01h */
  275. U16 Reserved2; /* 02h */
  276. U16 InitiatorTag; /* 04h */
  277. U16 DevHandle; /* 06h */
  278. /* TASK information unit starts here */
  279. U8 LogicalUnitNumber[8]; /* 08h */
  280. U8 Reserved3; /* 10h */
  281. U8 Reserved4; /* 11h */
  282. U8 TaskManagementFunction; /* 12h */
  283. U8 Reserved5; /* 13h */
  284. U16 ManagedTaskTag; /* 14h */
  285. U16 Reserved6; /* 16h */
  286. U32 Reserved7; /* 18h */
  287. U32 Reserved8; /* 1Ch */
  288. U32 Reserved9; /* 20h */
  289. } MPI_TARGET_SSP_TASK_BUFFER, MPI_POINTER PTR_MPI_TARGET_SSP_TASK_BUFFER,
  290. MpiTargetSspTaskBuffer, MPI_POINTER pMpiTargetSspTaskBuffer;
  291. /****************************************************************************/
  292. /* Target Assist Request */
  293. /****************************************************************************/
  294. typedef struct _MSG_TARGET_ASSIST_REQUEST
  295. {
  296. U8 StatusCode; /* 00h */
  297. U8 TargetAssistFlags; /* 01h */
  298. U8 ChainOffset; /* 02h */
  299. U8 Function; /* 03h */
  300. U16 QueueTag; /* 04h */
  301. U8 Reserved; /* 06h */
  302. U8 MsgFlags; /* 07h */
  303. U32 MsgContext; /* 08h */
  304. U32 ReplyWord; /* 0Ch */
  305. U8 LUN[8]; /* 10h */
  306. U32 RelativeOffset; /* 18h */
  307. U32 DataLength; /* 1Ch */
  308. SGE_IO_UNION SGL[1]; /* 20h */
  309. } MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,
  310. TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;
  311. #define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01)
  312. #define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02)
  313. #define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04)
  314. #define TARGET_ASSIST_FLAGS_CONFIRMED (0x08)
  315. #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80)
  316. typedef struct _MSG_TARGET_ERROR_REPLY
  317. {
  318. U16 Reserved; /* 00h */
  319. U8 MsgLength; /* 02h */
  320. U8 Function; /* 03h */
  321. U16 Reserved1; /* 04h */
  322. U8 Reserved2; /* 06h */
  323. U8 MsgFlags; /* 07h */
  324. U32 MsgContext; /* 08h */
  325. U8 PriorityReason; /* 0Ch */
  326. U8 Reserved3; /* 0Dh */
  327. U16 IOCStatus; /* 0Eh */
  328. U32 IOCLogInfo; /* 10h */
  329. U32 ReplyWord; /* 14h */
  330. U32 TransferCount; /* 18h */
  331. } MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,
  332. TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;
  333. /****************************************************************************/
  334. /* Target Status Send Request */
  335. /****************************************************************************/
  336. typedef struct _MSG_TARGET_STATUS_SEND_REQUEST
  337. {
  338. U8 StatusCode; /* 00h */
  339. U8 StatusFlags; /* 01h */
  340. U8 ChainOffset; /* 02h */
  341. U8 Function; /* 03h */
  342. U16 QueueTag; /* 04h */
  343. U8 Reserved; /* 06h */
  344. U8 MsgFlags; /* 07h */
  345. U32 MsgContext; /* 08h */
  346. U32 ReplyWord; /* 0Ch */
  347. U8 LUN[8]; /* 10h */
  348. SGE_SIMPLE_UNION StatusDataSGE; /* 18h */
  349. } MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,
  350. TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t;
  351. #define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01)
  352. #define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04)
  353. #define TARGET_STATUS_SEND_FLAGS_CONFIRMED (0x08)
  354. #define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80)
  355. /*
  356. * NOTE: FCP_RSP data is big-endian. When used on a little-endian system, this
  357. * structure properly orders the bytes.
  358. */
  359. typedef struct _MPI_TARGET_FCP_RSP_BUFFER
  360. {
  361. U8 Reserved0[8]; /* 00h */
  362. U8 Reserved1[2]; /* 08h */
  363. U8 FcpFlags; /* 0Ah */
  364. U8 FcpStatus; /* 0Bh */
  365. U32 FcpResid; /* 0Ch */
  366. U32 FcpSenseLength; /* 10h */
  367. U32 FcpResponseLength; /* 14h */
  368. U8 FcpResponseData[8]; /* 18h */
  369. U8 FcpSenseData[32]; /* Pad to 64 bytes */ /* 20h */
  370. } MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
  371. MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;
  372. /*
  373. * NOTE: The SPI status IU is big-endian. When used on a little-endian system,
  374. * this structure properly orders the bytes.
  375. */
  376. typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
  377. {
  378. U8 Reserved0; /* 00h */
  379. U8 Reserved1; /* 01h */
  380. U8 Valid; /* 02h */
  381. U8 Status; /* 03h */
  382. U32 SenseDataListLength; /* 04h */
  383. U32 PktFailuresListLength; /* 08h */
  384. U8 SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */
  385. } MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
  386. TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
  387. /*
  388. * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
  389. * this structure properly orders the bytes.
  390. */
  391. typedef struct _MPI_TARGET_SSP_RSP_IU
  392. {
  393. U32 Reserved0[6]; /* reserved for SSP header */ /* 00h */
  394. /* start of RESPONSE information unit */
  395. U32 Reserved1; /* 18h */
  396. U32 Reserved2; /* 1Ch */
  397. U16 Reserved3; /* 20h */
  398. U8 DataPres; /* lower 2 bits */ /* 22h */
  399. U8 Status; /* 23h */
  400. U32 Reserved4; /* 24h */
  401. U32 SenseDataLength; /* 28h */
  402. U32 ResponseDataLength; /* 2Ch */
  403. U8 ResponseSenseData[4]; /* 30h */
  404. } MPI_TARGET_SSP_RSP_IU, MPI_POINTER PTR_MPI_TARGET_SSP_RSP_IU,
  405. MpiTargetSspRspIu_t, MPI_POINTER pMpiTargetSspRspIu_t;
  406. /****************************************************************************/
  407. /* Target Mode Abort Request */
  408. /****************************************************************************/
  409. typedef struct _MSG_TARGET_MODE_ABORT_REQUEST
  410. {
  411. U8 AbortType; /* 00h */
  412. U8 Reserved; /* 01h */
  413. U8 ChainOffset; /* 02h */
  414. U8 Function; /* 03h */
  415. U16 Reserved1; /* 04h */
  416. U8 Reserved2; /* 06h */
  417. U8 MsgFlags; /* 07h */
  418. U32 MsgContext; /* 08h */
  419. U32 ReplyWord; /* 0Ch */
  420. U32 MsgContextToAbort; /* 10h */
  421. } MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,
  422. TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;
  423. #define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS (0x00)
  424. #define TARGET_MODE_ABORT_TYPE_ALL_IO (0x01)
  425. #define TARGET_MODE_ABORT_TYPE_EXACT_IO (0x02)
  426. #define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST (0x03)
  427. /* Target Mode Abort Reply */
  428. typedef struct _MSG_TARGET_MODE_ABORT_REPLY
  429. {
  430. U16 Reserved; /* 00h */
  431. U8 MsgLength; /* 02h */
  432. U8 Function; /* 03h */
  433. U16 Reserved1; /* 04h */
  434. U8 Reserved2; /* 06h */
  435. U8 MsgFlags; /* 07h */
  436. U32 MsgContext; /* 08h */
  437. U16 Reserved3; /* 0Ch */
  438. U16 IOCStatus; /* 0Eh */
  439. U32 IOCLogInfo; /* 10h */
  440. U32 AbortCount; /* 14h */
  441. } MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,
  442. TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;
  443. /****************************************************************************/
  444. /* Target Mode Context Reply */
  445. /****************************************************************************/
  446. #define TARGET_MODE_REPLY_IO_INDEX_MASK (0x00003FFF)
  447. #define TARGET_MODE_REPLY_IO_INDEX_SHIFT (0)
  448. #define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK (0x03FFC000)
  449. #define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)
  450. #define TARGET_MODE_REPLY_ALIAS_MASK (0x04000000)
  451. #define TARGET_MODE_REPLY_ALIAS_SHIFT (26)
  452. #define TARGET_MODE_REPLY_PORT_MASK (0x10000000)
  453. #define TARGET_MODE_REPLY_PORT_SHIFT (28)
  454. #define GET_IO_INDEX(x) (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK) \
  455. >> TARGET_MODE_REPLY_IO_INDEX_SHIFT)
  456. #define SET_IO_INDEX(t, i) \
  457. ((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) | \
  458. (((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) & \
  459. TARGET_MODE_REPLY_IO_INDEX_MASK))
  460. #define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \
  461. >> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT)
  462. #define SET_INITIATOR_INDEX(t, ii) \
  463. ((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) | \
  464. (((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) & \
  465. TARGET_MODE_REPLY_INITIATOR_INDEX_MASK))
  466. #define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK) \
  467. >> TARGET_MODE_REPLY_ALIAS_SHIFT)
  468. #define SET_ALIAS(t, a) ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) | \
  469. (((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) & \
  470. TARGET_MODE_REPLY_ALIAS_MASK))
  471. #define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK) \
  472. >> TARGET_MODE_REPLY_PORT_SHIFT)
  473. #define SET_PORT(t, p) ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) | \
  474. (((p) << TARGET_MODE_REPLY_PORT_SHIFT) & \
  475. TARGET_MODE_REPLY_PORT_MASK))
  476. /* the following obsolete values are for MPI v1.0 support */
  477. #define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX (0x000003FF)
  478. #define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX (0)
  479. #define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX (0x001FF800)
  480. #define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX (11)
  481. #define TARGET_MODE_REPLY_0100_PORT_MASK (0x00400000)
  482. #define TARGET_MODE_REPLY_0100_PORT_SHIFT (22)
  483. #define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX (0x1F800000)
  484. #define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23)
  485. #define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \
  486. >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX)
  487. #define SET_HOST_INDEX_0100(t, hi) \
  488. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) | \
  489. (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) & \
  490. TARGET_MODE_REPLY_0100_MASK_HOST_INDEX))
  491. #define GET_IOC_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \
  492. >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX)
  493. #define SET_IOC_INDEX_0100(t, ii) \
  494. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) | \
  495. (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) & \
  496. TARGET_MODE_REPLY_0100_MASK_IOC_INDEX))
  497. #define GET_INITIATOR_INDEX_0100(x) \
  498. (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) \
  499. >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX)
  500. #define SET_INITIATOR_INDEX_0100(t, ii) \
  501. ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) | \
  502. (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) & \
  503. TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX))
  504. #endif