mpi_lan.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2000-2008 LSI Corporation.
  4. *
  5. *
  6. * Name: mpi_lan.h
  7. * Title: MPI LAN messages and structures
  8. * Creation Date: June 30, 2000
  9. *
  10. * mpi_lan.h Version: 01.05.01
  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. * 05-24-00 00.10.02 Added LANStatus field to _MSG_LAN_SEND_REPLY.
  19. * Added LANStatus field to _MSG_LAN_RECEIVE_POST_REPLY.
  20. * Moved ListCount field in _MSG_LAN_RECEIVE_POST_REPLY.
  21. * 06-06-00 01.00.01 Update version number for 1.0 release.
  22. * 06-12-00 01.00.02 Added MPI_ to BUCKETSTATUS_ definitions.
  23. * 06-22-00 01.00.03 Major changes to match new LAN definition in 1.0 spec.
  24. * 06-30-00 01.00.04 Added Context Reply definitions per revised proposal.
  25. * Changed transaction context usage to bucket/buffer.
  26. * 07-05-00 01.00.05 Removed LAN_RECEIVE_POST_BUCKET_CONTEXT_MASK definition
  27. * to lan private header file
  28. * 11-02-00 01.01.01 Original release for post 1.0 work
  29. * 02-20-01 01.01.02 Started using MPI_POINTER.
  30. * 03-27-01 01.01.03 Added structure offset comments.
  31. * 08-08-01 01.02.01 Original release for v1.2 work.
  32. * 05-11-04 01.03.01 Original release for MPI v1.3.
  33. * 08-19-04 01.05.01 Original release for MPI v1.5.
  34. * --------------------------------------------------------------------------
  35. */
  36. #ifndef MPI_LAN_H
  37. #define MPI_LAN_H
  38. /******************************************************************************
  39. *
  40. * L A N M e s s a g e s
  41. *
  42. *******************************************************************************/
  43. /* LANSend messages */
  44. typedef struct _MSG_LAN_SEND_REQUEST
  45. {
  46. U16 Reserved; /* 00h */
  47. U8 ChainOffset; /* 02h */
  48. U8 Function; /* 03h */
  49. U16 Reserved2; /* 04h */
  50. U8 PortNumber; /* 06h */
  51. U8 MsgFlags; /* 07h */
  52. U32 MsgContext; /* 08h */
  53. SGE_MPI_UNION SG_List[1]; /* 0Ch */
  54. } MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST,
  55. LANSendRequest_t, MPI_POINTER pLANSendRequest_t;
  56. typedef struct _MSG_LAN_SEND_REPLY
  57. {
  58. U16 Reserved; /* 00h */
  59. U8 MsgLength; /* 02h */
  60. U8 Function; /* 03h */
  61. U8 Reserved2; /* 04h */
  62. U8 NumberOfContexts; /* 05h */
  63. U8 PortNumber; /* 06h */
  64. U8 MsgFlags; /* 07h */
  65. U32 MsgContext; /* 08h */
  66. U16 Reserved3; /* 0Ch */
  67. U16 IOCStatus; /* 0Eh */
  68. U32 IOCLogInfo; /* 10h */
  69. U32 BufferContext; /* 14h */
  70. } MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY,
  71. LANSendReply_t, MPI_POINTER pLANSendReply_t;
  72. /* LANReceivePost */
  73. typedef struct _MSG_LAN_RECEIVE_POST_REQUEST
  74. {
  75. U16 Reserved; /* 00h */
  76. U8 ChainOffset; /* 02h */
  77. U8 Function; /* 03h */
  78. U16 Reserved2; /* 04h */
  79. U8 PortNumber; /* 06h */
  80. U8 MsgFlags; /* 07h */
  81. U32 MsgContext; /* 08h */
  82. U32 BucketCount; /* 0Ch */
  83. SGE_MPI_UNION SG_List[1]; /* 10h */
  84. } MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST,
  85. LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t;
  86. typedef struct _MSG_LAN_RECEIVE_POST_REPLY
  87. {
  88. U16 Reserved; /* 00h */
  89. U8 MsgLength; /* 02h */
  90. U8 Function; /* 03h */
  91. U8 Reserved2; /* 04h */
  92. U8 NumberOfContexts; /* 05h */
  93. U8 PortNumber; /* 06h */
  94. U8 MsgFlags; /* 07h */
  95. U32 MsgContext; /* 08h */
  96. U16 Reserved3; /* 0Ch */
  97. U16 IOCStatus; /* 0Eh */
  98. U32 IOCLogInfo; /* 10h */
  99. U32 BucketsRemaining; /* 14h */
  100. U32 PacketOffset; /* 18h */
  101. U32 PacketLength; /* 1Ch */
  102. U32 BucketContext[1]; /* 20h */
  103. } MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY,
  104. LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t;
  105. /* LANReset */
  106. typedef struct _MSG_LAN_RESET_REQUEST
  107. {
  108. U16 Reserved; /* 00h */
  109. U8 ChainOffset; /* 02h */
  110. U8 Function; /* 03h */
  111. U16 Reserved2; /* 04h */
  112. U8 PortNumber; /* 05h */
  113. U8 MsgFlags; /* 07h */
  114. U32 MsgContext; /* 08h */
  115. } MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST,
  116. LANResetRequest_t, MPI_POINTER pLANResetRequest_t;
  117. typedef struct _MSG_LAN_RESET_REPLY
  118. {
  119. U16 Reserved; /* 00h */
  120. U8 MsgLength; /* 02h */
  121. U8 Function; /* 03h */
  122. U16 Reserved2; /* 04h */
  123. U8 PortNumber; /* 06h */
  124. U8 MsgFlags; /* 07h */
  125. U32 MsgContext; /* 08h */
  126. U16 Reserved3; /* 0Ch */
  127. U16 IOCStatus; /* 0Eh */
  128. U32 IOCLogInfo; /* 10h */
  129. } MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY,
  130. LANResetReply_t, MPI_POINTER pLANResetReply_t;
  131. /****************************************************************************/
  132. /* LAN Context Reply defines and macros */
  133. /****************************************************************************/
  134. #define LAN_REPLY_PACKET_LENGTH_MASK (0x0000FFFF)
  135. #define LAN_REPLY_PACKET_LENGTH_SHIFT (0)
  136. #define LAN_REPLY_BUCKET_CONTEXT_MASK (0x07FF0000)
  137. #define LAN_REPLY_BUCKET_CONTEXT_SHIFT (16)
  138. #define LAN_REPLY_BUFFER_CONTEXT_MASK (0x07FFFFFF)
  139. #define LAN_REPLY_BUFFER_CONTEXT_SHIFT (0)
  140. #define LAN_REPLY_FORM_MASK (0x18000000)
  141. #define LAN_REPLY_FORM_RECEIVE_SINGLE (0x00)
  142. #define LAN_REPLY_FORM_RECEIVE_MULTIPLE (0x01)
  143. #define LAN_REPLY_FORM_SEND_SINGLE (0x02)
  144. #define LAN_REPLY_FORM_MESSAGE_CONTEXT (0x03)
  145. #define LAN_REPLY_FORM_SHIFT (27)
  146. #define GET_LAN_PACKET_LENGTH(x) (((x) & LAN_REPLY_PACKET_LENGTH_MASK) \
  147. >> LAN_REPLY_PACKET_LENGTH_SHIFT)
  148. #define SET_LAN_PACKET_LENGTH(x, lth) \
  149. ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) | \
  150. (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) & \
  151. LAN_REPLY_PACKET_LENGTH_MASK))
  152. #define GET_LAN_BUCKET_CONTEXT(x) (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK) \
  153. >> LAN_REPLY_BUCKET_CONTEXT_SHIFT)
  154. #define SET_LAN_BUCKET_CONTEXT(x, ctx) \
  155. ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) | \
  156. (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) & \
  157. LAN_REPLY_BUCKET_CONTEXT_MASK))
  158. #define GET_LAN_BUFFER_CONTEXT(x) (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK) \
  159. >> LAN_REPLY_BUFFER_CONTEXT_SHIFT)
  160. #define SET_LAN_BUFFER_CONTEXT(x, ctx) \
  161. ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) | \
  162. (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) & \
  163. LAN_REPLY_BUFFER_CONTEXT_MASK))
  164. #define GET_LAN_FORM(x) (((x) & LAN_REPLY_FORM_MASK) \
  165. >> LAN_REPLY_FORM_SHIFT)
  166. #define SET_LAN_FORM(x, frm) \
  167. ((x) = ((x) & ~LAN_REPLY_FORM_MASK) | \
  168. (((frm) << LAN_REPLY_FORM_SHIFT) & \
  169. LAN_REPLY_FORM_MASK))
  170. /****************************************************************************/
  171. /* LAN Current Device State defines */
  172. /****************************************************************************/
  173. #define MPI_LAN_DEVICE_STATE_RESET (0x00)
  174. #define MPI_LAN_DEVICE_STATE_OPERATIONAL (0x01)
  175. /****************************************************************************/
  176. /* LAN Loopback defines */
  177. /****************************************************************************/
  178. #define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION (0x01)
  179. #endif