mpi_tool.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2001-2008 LSI Corporation.
  4. *
  5. *
  6. * Name: mpi_tool.h
  7. * Title: MPI Toolbox structures and definitions
  8. * Creation Date: July 30, 2001
  9. *
  10. * mpi_tool.h Version: 01.05.03
  11. *
  12. * Version History
  13. * ---------------
  14. *
  15. * Date Version Description
  16. * -------- -------- ------------------------------------------------------
  17. * 08-08-01 01.02.01 Original release.
  18. * 08-29-01 01.02.02 Added DIAG_DATA_UPLOAD_HEADER and related defines.
  19. * 01-16-04 01.02.03 Added defines and structures for new tools
  20. *. MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL and
  21. * MPI_TOOLBOX_FC_MANAGEMENT_TOOL.
  22. * 04-29-04 01.02.04 Added message structures for Diagnostic Buffer Post and
  23. * Diagnostic Release requests and replies.
  24. * 05-11-04 01.03.01 Original release for MPI v1.3.
  25. * 08-19-04 01.05.01 Original release for MPI v1.5.
  26. * 10-06-04 01.05.02 Added define for MPI_DIAG_BUF_TYPE_COUNT.
  27. * 02-09-05 01.05.03 Added frame size option to FC management tool.
  28. * Added Beacon tool to the Toolbox.
  29. * --------------------------------------------------------------------------
  30. */
  31. #ifndef MPI_TOOL_H
  32. #define MPI_TOOL_H
  33. #define MPI_TOOLBOX_CLEAN_TOOL (0x00)
  34. #define MPI_TOOLBOX_MEMORY_MOVE_TOOL (0x01)
  35. #define MPI_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02)
  36. #define MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03)
  37. #define MPI_TOOLBOX_FC_MANAGEMENT_TOOL (0x04)
  38. #define MPI_TOOLBOX_BEACON_TOOL (0x05)
  39. /****************************************************************************/
  40. /* Toolbox reply */
  41. /****************************************************************************/
  42. typedef struct _MSG_TOOLBOX_REPLY
  43. {
  44. U8 Tool; /* 00h */
  45. U8 Reserved; /* 01h */
  46. U8 MsgLength; /* 02h */
  47. U8 Function; /* 03h */
  48. U16 Reserved1; /* 04h */
  49. U8 Reserved2; /* 06h */
  50. U8 MsgFlags; /* 07h */
  51. U32 MsgContext; /* 08h */
  52. U16 Reserved3; /* 0Ch */
  53. U16 IOCStatus; /* 0Eh */
  54. U32 IOCLogInfo; /* 10h */
  55. } MSG_TOOLBOX_REPLY, MPI_POINTER PTR_MSG_TOOLBOX_REPLY,
  56. ToolboxReply_t, MPI_POINTER pToolboxReply_t;
  57. /****************************************************************************/
  58. /* Toolbox Clean Tool request */
  59. /****************************************************************************/
  60. typedef struct _MSG_TOOLBOX_CLEAN_REQUEST
  61. {
  62. U8 Tool; /* 00h */
  63. U8 Reserved; /* 01h */
  64. U8 ChainOffset; /* 02h */
  65. U8 Function; /* 03h */
  66. U16 Reserved1; /* 04h */
  67. U8 Reserved2; /* 06h */
  68. U8 MsgFlags; /* 07h */
  69. U32 MsgContext; /* 08h */
  70. U32 Flags; /* 0Ch */
  71. } MSG_TOOLBOX_CLEAN_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_CLEAN_REQUEST,
  72. ToolboxCleanRequest_t, MPI_POINTER pToolboxCleanRequest_t;
  73. #define MPI_TOOLBOX_CLEAN_NVSRAM (0x00000001)
  74. #define MPI_TOOLBOX_CLEAN_SEEPROM (0x00000002)
  75. #define MPI_TOOLBOX_CLEAN_FLASH (0x00000004)
  76. #define MPI_TOOLBOX_CLEAN_BOOTLOADER (0x04000000)
  77. #define MPI_TOOLBOX_CLEAN_FW_BACKUP (0x08000000)
  78. #define MPI_TOOLBOX_CLEAN_FW_CURRENT (0x10000000)
  79. #define MPI_TOOLBOX_CLEAN_OTHER_PERSIST_PAGES (0x20000000)
  80. #define MPI_TOOLBOX_CLEAN_PERSIST_MANUFACT_PAGES (0x40000000)
  81. #define MPI_TOOLBOX_CLEAN_BOOT_SERVICES (0x80000000)
  82. /****************************************************************************/
  83. /* Toolbox Memory Move request */
  84. /****************************************************************************/
  85. typedef struct _MSG_TOOLBOX_MEM_MOVE_REQUEST
  86. {
  87. U8 Tool; /* 00h */
  88. U8 Reserved; /* 01h */
  89. U8 ChainOffset; /* 02h */
  90. U8 Function; /* 03h */
  91. U16 Reserved1; /* 04h */
  92. U8 Reserved2; /* 06h */
  93. U8 MsgFlags; /* 07h */
  94. U32 MsgContext; /* 08h */
  95. SGE_SIMPLE_UNION SGL; /* 0Ch */
  96. } MSG_TOOLBOX_MEM_MOVE_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_MEM_MOVE_REQUEST,
  97. ToolboxMemMoveRequest_t, MPI_POINTER pToolboxMemMoveRequest_t;
  98. /****************************************************************************/
  99. /* Toolbox Diagnostic Data Upload request */
  100. /****************************************************************************/
  101. typedef struct _MSG_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
  102. {
  103. U8 Tool; /* 00h */
  104. U8 Reserved; /* 01h */
  105. U8 ChainOffset; /* 02h */
  106. U8 Function; /* 03h */
  107. U16 Reserved1; /* 04h */
  108. U8 Reserved2; /* 06h */
  109. U8 MsgFlags; /* 07h */
  110. U32 MsgContext; /* 08h */
  111. U32 Flags; /* 0Ch */
  112. U32 Reserved3; /* 10h */
  113. SGE_SIMPLE_UNION SGL; /* 14h */
  114. } MSG_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST,
  115. ToolboxDiagDataUploadRequest_t, MPI_POINTER pToolboxDiagDataUploadRequest_t;
  116. typedef struct _DIAG_DATA_UPLOAD_HEADER
  117. {
  118. U32 DiagDataLength; /* 00h */
  119. U8 FormatCode; /* 04h */
  120. U8 Reserved; /* 05h */
  121. U16 Reserved1; /* 06h */
  122. } DIAG_DATA_UPLOAD_HEADER, MPI_POINTER PTR_DIAG_DATA_UPLOAD_HEADER,
  123. DiagDataUploadHeader_t, MPI_POINTER pDiagDataUploadHeader_t;
  124. #define MPI_TB_DIAG_FORMAT_SCSI_PRINTF_1 (0x01)
  125. #define MPI_TB_DIAG_FORMAT_SCSI_2 (0x02)
  126. #define MPI_TB_DIAG_FORMAT_SCSI_3 (0x03)
  127. #define MPI_TB_DIAG_FORMAT_FC_TRACE_1 (0x04)
  128. /****************************************************************************/
  129. /* Toolbox ISTWI Read Write request */
  130. /****************************************************************************/
  131. typedef struct _MSG_TOOLBOX_ISTWI_READ_WRITE_REQUEST
  132. {
  133. U8 Tool; /* 00h */
  134. U8 Reserved; /* 01h */
  135. U8 ChainOffset; /* 02h */
  136. U8 Function; /* 03h */
  137. U16 Reserved1; /* 04h */
  138. U8 Reserved2; /* 06h */
  139. U8 MsgFlags; /* 07h */
  140. U32 MsgContext; /* 08h */
  141. U8 Flags; /* 0Ch */
  142. U8 BusNum; /* 0Dh */
  143. U16 Reserved3; /* 0Eh */
  144. U8 NumAddressBytes; /* 10h */
  145. U8 Reserved4; /* 11h */
  146. U16 DataLength; /* 12h */
  147. U8 DeviceAddr; /* 14h */
  148. U8 Addr1; /* 15h */
  149. U8 Addr2; /* 16h */
  150. U8 Addr3; /* 17h */
  151. U32 Reserved5; /* 18h */
  152. SGE_SIMPLE_UNION SGL; /* 1Ch */
  153. } MSG_TOOLBOX_ISTWI_READ_WRITE_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_ISTWI_READ_WRITE_REQUEST,
  154. ToolboxIstwiReadWriteRequest_t, MPI_POINTER pToolboxIstwiReadWriteRequest_t;
  155. #define MPI_TB_ISTWI_FLAGS_WRITE (0x00)
  156. #define MPI_TB_ISTWI_FLAGS_READ (0x01)
  157. /****************************************************************************/
  158. /* Toolbox FC Management request */
  159. /****************************************************************************/
  160. /* ActionInfo for Bus and TargetId */
  161. typedef struct _MPI_TB_FC_MANAGE_BUS_TID_AI
  162. {
  163. U16 Reserved; /* 00h */
  164. U8 Bus; /* 02h */
  165. U8 TargetId; /* 03h */
  166. } MPI_TB_FC_MANAGE_BUS_TID_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_BUS_TID_AI,
  167. MpiTbFcManageBusTidAi_t, MPI_POINTER pMpiTbFcManageBusTidAi_t;
  168. /* ActionInfo for port identifier */
  169. typedef struct _MPI_TB_FC_MANAGE_PID_AI
  170. {
  171. U32 PortIdentifier; /* 00h */
  172. } MPI_TB_FC_MANAGE_PID_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_PID_AI,
  173. MpiTbFcManagePidAi_t, MPI_POINTER pMpiTbFcManagePidAi_t;
  174. /* ActionInfo for set max frame size */
  175. typedef struct _MPI_TB_FC_MANAGE_FRAME_SIZE_AI
  176. {
  177. U16 FrameSize; /* 00h */
  178. U8 PortNum; /* 02h */
  179. U8 Reserved1; /* 03h */
  180. } MPI_TB_FC_MANAGE_FRAME_SIZE_AI, MPI_POINTER PTR_MPI_TB_FC_MANAGE_FRAME_SIZE_AI,
  181. MpiTbFcManageFrameSizeAi_t, MPI_POINTER pMpiTbFcManageFrameSizeAi_t;
  182. /* union of ActionInfo */
  183. typedef union _MPI_TB_FC_MANAGE_AI_UNION
  184. {
  185. MPI_TB_FC_MANAGE_BUS_TID_AI BusTid;
  186. MPI_TB_FC_MANAGE_PID_AI Port;
  187. MPI_TB_FC_MANAGE_FRAME_SIZE_AI FrameSize;
  188. } MPI_TB_FC_MANAGE_AI_UNION, MPI_POINTER PTR_MPI_TB_FC_MANAGE_AI_UNION,
  189. MpiTbFcManageAiUnion_t, MPI_POINTER pMpiTbFcManageAiUnion_t;
  190. typedef struct _MSG_TOOLBOX_FC_MANAGE_REQUEST
  191. {
  192. U8 Tool; /* 00h */
  193. U8 Reserved; /* 01h */
  194. U8 ChainOffset; /* 02h */
  195. U8 Function; /* 03h */
  196. U16 Reserved1; /* 04h */
  197. U8 Reserved2; /* 06h */
  198. U8 MsgFlags; /* 07h */
  199. U32 MsgContext; /* 08h */
  200. U8 Action; /* 0Ch */
  201. U8 Reserved3; /* 0Dh */
  202. U16 Reserved4; /* 0Eh */
  203. MPI_TB_FC_MANAGE_AI_UNION ActionInfo; /* 10h */
  204. } MSG_TOOLBOX_FC_MANAGE_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_FC_MANAGE_REQUEST,
  205. ToolboxFcManageRequest_t, MPI_POINTER pToolboxFcManageRequest_t;
  206. /* defines for the Action field */
  207. #define MPI_TB_FC_MANAGE_ACTION_DISC_ALL (0x00)
  208. #define MPI_TB_FC_MANAGE_ACTION_DISC_PID (0x01)
  209. #define MPI_TB_FC_MANAGE_ACTION_DISC_BUS_TID (0x02)
  210. #define MPI_TB_FC_MANAGE_ACTION_SET_MAX_FRAME_SIZE (0x03)
  211. /****************************************************************************/
  212. /* Toolbox Beacon Tool request */
  213. /****************************************************************************/
  214. typedef struct _MSG_TOOLBOX_BEACON_REQUEST
  215. {
  216. U8 Tool; /* 00h */
  217. U8 Reserved; /* 01h */
  218. U8 ChainOffset; /* 02h */
  219. U8 Function; /* 03h */
  220. U16 Reserved1; /* 04h */
  221. U8 Reserved2; /* 06h */
  222. U8 MsgFlags; /* 07h */
  223. U32 MsgContext; /* 08h */
  224. U8 ConnectNum; /* 0Ch */
  225. U8 PortNum; /* 0Dh */
  226. U8 Reserved3; /* 0Eh */
  227. U8 Flags; /* 0Fh */
  228. } MSG_TOOLBOX_BEACON_REQUEST, MPI_POINTER PTR_MSG_TOOLBOX_BEACON_REQUEST,
  229. ToolboxBeaconRequest_t, MPI_POINTER pToolboxBeaconRequest_t;
  230. #define MPI_TOOLBOX_FLAGS_BEACON_MODE_OFF (0x00)
  231. #define MPI_TOOLBOX_FLAGS_BEACON_MODE_ON (0x01)
  232. /****************************************************************************/
  233. /* Diagnostic Buffer Post request */
  234. /****************************************************************************/
  235. typedef struct _MSG_DIAG_BUFFER_POST_REQUEST
  236. {
  237. U8 TraceLevel; /* 00h */
  238. U8 BufferType; /* 01h */
  239. U8 ChainOffset; /* 02h */
  240. U8 Function; /* 03h */
  241. U16 Reserved1; /* 04h */
  242. U8 Reserved2; /* 06h */
  243. U8 MsgFlags; /* 07h */
  244. U32 MsgContext; /* 08h */
  245. U32 ExtendedType; /* 0Ch */
  246. U32 BufferLength; /* 10h */
  247. U32 ProductSpecific[4]; /* 14h */
  248. U32 Reserved3; /* 24h */
  249. U64 BufferAddress; /* 28h */
  250. } MSG_DIAG_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_DIAG_BUFFER_POST_REQUEST,
  251. DiagBufferPostRequest_t, MPI_POINTER pDiagBufferPostRequest_t;
  252. #define MPI_DIAG_BUF_TYPE_TRACE (0x00)
  253. #define MPI_DIAG_BUF_TYPE_SNAPSHOT (0x01)
  254. #define MPI_DIAG_BUF_TYPE_EXTENDED (0x02)
  255. /* count of the number of buffer types */
  256. #define MPI_DIAG_BUF_TYPE_COUNT (0x03)
  257. #define MPI_DIAG_EXTENDED_QTAG (0x00000001)
  258. /* Diagnostic Buffer Post reply */
  259. typedef struct _MSG_DIAG_BUFFER_POST_REPLY
  260. {
  261. U8 Reserved1; /* 00h */
  262. U8 BufferType; /* 01h */
  263. U8 MsgLength; /* 02h */
  264. U8 Function; /* 03h */
  265. U16 Reserved2; /* 04h */
  266. U8 Reserved3; /* 06h */
  267. U8 MsgFlags; /* 07h */
  268. U32 MsgContext; /* 08h */
  269. U16 Reserved4; /* 0Ch */
  270. U16 IOCStatus; /* 0Eh */
  271. U32 IOCLogInfo; /* 10h */
  272. U32 TransferLength; /* 14h */
  273. } MSG_DIAG_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_DIAG_BUFFER_POST_REPLY,
  274. DiagBufferPostReply_t, MPI_POINTER pDiagBufferPostReply_t;
  275. /****************************************************************************/
  276. /* Diagnostic Release request */
  277. /****************************************************************************/
  278. typedef struct _MSG_DIAG_RELEASE_REQUEST
  279. {
  280. U8 Reserved1; /* 00h */
  281. U8 BufferType; /* 01h */
  282. U8 ChainOffset; /* 02h */
  283. U8 Function; /* 03h */
  284. U16 Reserved2; /* 04h */
  285. U8 Reserved3; /* 06h */
  286. U8 MsgFlags; /* 07h */
  287. U32 MsgContext; /* 08h */
  288. } MSG_DIAG_RELEASE_REQUEST, MPI_POINTER PTR_MSG_DIAG_RELEASE_REQUEST,
  289. DiagReleaseRequest_t, MPI_POINTER pDiagReleaseRequest_t;
  290. /* Diagnostic Release reply */
  291. typedef struct _MSG_DIAG_RELEASE_REPLY
  292. {
  293. U8 Reserved1; /* 00h */
  294. U8 BufferType; /* 01h */
  295. U8 MsgLength; /* 02h */
  296. U8 Function; /* 03h */
  297. U16 Reserved2; /* 04h */
  298. U8 Reserved3; /* 06h */
  299. U8 MsgFlags; /* 07h */
  300. U32 MsgContext; /* 08h */
  301. U16 Reserved4; /* 0Ch */
  302. U16 IOCStatus; /* 0Eh */
  303. U32 IOCLogInfo; /* 10h */
  304. } MSG_DIAG_RELEASE_REPLY, MPI_POINTER PTR_MSG_DIAG_RELEASE_REPLY,
  305. DiagReleaseReply_t, MPI_POINTER pDiagReleaseReply_t;
  306. #endif