1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright 2000-2014 Avago Technologies. All rights reserved.
7 * Title: MPI diagnostic tool structures and definitions
8 * Creation Date: March 26, 2007
10 * mpi2_tool.h Version: 02.00.13
15 * Date Version Description
16 * -------- -------- ------------------------------------------------------
17 * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A.
18 * 12-18-07 02.00.01 Added Diagnostic Buffer Post and Diagnostic Release
19 * structures and defines.
20 * 02-29-08 02.00.02 Modified various names to make them 32-character unique.
21 * 05-06-09 02.00.03 Added ISTWI Read Write Tool and Diagnostic CLI Tool.
22 * 07-30-09 02.00.04 Added ExtendedType field to DiagnosticBufferPost request
24 * Added MPI2_DIAG_BUF_TYPE_EXTENDED.
25 * Incremented MPI2_DIAG_BUF_TYPE_COUNT.
26 * 05-12-10 02.00.05 Added Diagnostic Data Upload tool.
27 * 08-11-10 02.00.06 Added defines that were missing for Diagnostic Buffer
29 * 05-25-11 02.00.07 Added Flags field and related defines to
30 * MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST.
31 * 11-18-11 02.00.08 Incorporating additions for MPI v2.5.
32 * 07-10-12 02.00.09 Add MPI v2.5 Toolbox Diagnostic CLI Tool Request
34 * 07-26-12 02.00.10 Modified MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST so that
35 * it uses MPI Chain SGE as well as MPI Simple SGE.
36 * 08-19-13 02.00.11 Added MPI2_TOOLBOX_TEXT_DISPLAY_TOOL and related info.
37 * 01-08-14 02.00.12 Added MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC.
38 * 11-18-14 02.00.13 Updated copyright information.
39 * --------------------------------------------------------------------------
45 /*****************************************************************************
49 *****************************************************************************/
51 /*defines for the Tools */
52 #define MPI2_TOOLBOX_CLEAN_TOOL (0x00)
53 #define MPI2_TOOLBOX_MEMORY_MOVE_TOOL (0x01)
54 #define MPI2_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02)
55 #define MPI2_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03)
56 #define MPI2_TOOLBOX_BEACON_TOOL (0x05)
57 #define MPI2_TOOLBOX_DIAGNOSTIC_CLI_TOOL (0x06)
58 #define MPI2_TOOLBOX_TEXT_DISPLAY_TOOL (0x07)
60 /****************************************************************************
62 ****************************************************************************/
64 typedef struct _MPI2_TOOLBOX_REPLY
{
66 U8 Reserved1
; /*0x01 */
67 U8 MsgLength
; /*0x02 */
68 U8 Function
; /*0x03 */
69 U16 Reserved2
; /*0x04 */
70 U8 Reserved3
; /*0x06 */
71 U8 MsgFlags
; /*0x07 */
74 U16 Reserved4
; /*0x0A */
75 U16 Reserved5
; /*0x0C */
76 U16 IOCStatus
; /*0x0E */
77 U32 IOCLogInfo
; /*0x10 */
78 } MPI2_TOOLBOX_REPLY
, *PTR_MPI2_TOOLBOX_REPLY
,
79 Mpi2ToolboxReply_t
, *pMpi2ToolboxReply_t
;
81 /****************************************************************************
82 * Toolbox Clean Tool request
83 ****************************************************************************/
85 typedef struct _MPI2_TOOLBOX_CLEAN_REQUEST
{
87 U8 Reserved1
; /*0x01 */
88 U8 ChainOffset
; /*0x02 */
89 U8 Function
; /*0x03 */
90 U16 Reserved2
; /*0x04 */
91 U8 Reserved3
; /*0x06 */
92 U8 MsgFlags
; /*0x07 */
95 U16 Reserved4
; /*0x0A */
97 } MPI2_TOOLBOX_CLEAN_REQUEST
, *PTR_MPI2_TOOLBOX_CLEAN_REQUEST
,
98 Mpi2ToolboxCleanRequest_t
, *pMpi2ToolboxCleanRequest_t
;
100 /*values for the Flags field */
101 #define MPI2_TOOLBOX_CLEAN_BOOT_SERVICES (0x80000000)
102 #define MPI2_TOOLBOX_CLEAN_PERSIST_MANUFACT_PAGES (0x40000000)
103 #define MPI2_TOOLBOX_CLEAN_OTHER_PERSIST_PAGES (0x20000000)
104 #define MPI2_TOOLBOX_CLEAN_FW_CURRENT (0x10000000)
105 #define MPI2_TOOLBOX_CLEAN_FW_BACKUP (0x08000000)
106 #define MPI2_TOOLBOX_CLEAN_BIT26_PRODUCT_SPECIFIC (0x04000000)
107 #define MPI2_TOOLBOX_CLEAN_MEGARAID (0x02000000)
108 #define MPI2_TOOLBOX_CLEAN_INITIALIZATION (0x01000000)
109 #define MPI2_TOOLBOX_CLEAN_FLASH (0x00000004)
110 #define MPI2_TOOLBOX_CLEAN_SEEPROM (0x00000002)
111 #define MPI2_TOOLBOX_CLEAN_NVSRAM (0x00000001)
113 /****************************************************************************
114 * Toolbox Memory Move request
115 ****************************************************************************/
117 typedef struct _MPI2_TOOLBOX_MEM_MOVE_REQUEST
{
119 U8 Reserved1
; /*0x01 */
120 U8 ChainOffset
; /*0x02 */
121 U8 Function
; /*0x03 */
122 U16 Reserved2
; /*0x04 */
123 U8 Reserved3
; /*0x06 */
124 U8 MsgFlags
; /*0x07 */
127 U16 Reserved4
; /*0x0A */
128 MPI2_SGE_SIMPLE_UNION SGL
; /*0x0C */
129 } MPI2_TOOLBOX_MEM_MOVE_REQUEST
, *PTR_MPI2_TOOLBOX_MEM_MOVE_REQUEST
,
130 Mpi2ToolboxMemMoveRequest_t
, *pMpi2ToolboxMemMoveRequest_t
;
132 /****************************************************************************
133 * Toolbox Diagnostic Data Upload request
134 ****************************************************************************/
136 typedef struct _MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
{
138 U8 Reserved1
; /*0x01 */
139 U8 ChainOffset
; /*0x02 */
140 U8 Function
; /*0x03 */
141 U16 Reserved2
; /*0x04 */
142 U8 Reserved3
; /*0x06 */
143 U8 MsgFlags
; /*0x07 */
146 U16 Reserved4
; /*0x0A */
147 U8 SGLFlags
; /*0x0C */
148 U8 Reserved5
; /*0x0D */
149 U16 Reserved6
; /*0x0E */
151 U32 DataLength
; /*0x14 */
152 MPI2_SGE_SIMPLE_UNION SGL
; /*0x18 */
153 } MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
,
154 *PTR_MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
,
155 Mpi2ToolboxDiagDataUploadRequest_t
,
156 *pMpi2ToolboxDiagDataUploadRequest_t
;
158 /*use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
160 typedef struct _MPI2_DIAG_DATA_UPLOAD_HEADER
{
161 U32 DiagDataLength
; /*00h */
162 U8 FormatCode
; /*04h */
163 U8 Reserved1
; /*05h */
164 U16 Reserved2
; /*06h */
165 } MPI2_DIAG_DATA_UPLOAD_HEADER
, *PTR_MPI2_DIAG_DATA_UPLOAD_HEADER
,
166 Mpi2DiagDataUploadHeader_t
, *pMpi2DiagDataUploadHeader_t
;
168 /****************************************************************************
169 * Toolbox ISTWI Read Write Tool
170 ****************************************************************************/
172 /*Toolbox ISTWI Read Write Tool request message */
173 typedef struct _MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
{
175 U8 Reserved1
; /*0x01 */
176 U8 ChainOffset
; /*0x02 */
177 U8 Function
; /*0x03 */
178 U16 Reserved2
; /*0x04 */
179 U8 Reserved3
; /*0x06 */
180 U8 MsgFlags
; /*0x07 */
183 U16 Reserved4
; /*0x0A */
184 U32 Reserved5
; /*0x0C */
185 U32 Reserved6
; /*0x10 */
186 U8 DevIndex
; /*0x14 */
188 U8 SGLFlags
; /*0x16 */
190 U16 TxDataLength
; /*0x18 */
191 U16 RxDataLength
; /*0x1A */
192 U32 Reserved8
; /*0x1C */
193 U32 Reserved9
; /*0x20 */
194 U32 Reserved10
; /*0x24 */
195 U32 Reserved11
; /*0x28 */
196 U32 Reserved12
; /*0x2C */
197 MPI2_SGE_SIMPLE_UNION SGL
; /*0x30 */
198 } MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
,
199 *PTR_MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
,
200 Mpi2ToolboxIstwiReadWriteRequest_t
,
201 *pMpi2ToolboxIstwiReadWriteRequest_t
;
203 /*values for the Action field */
204 #define MPI2_TOOL_ISTWI_ACTION_READ_DATA (0x01)
205 #define MPI2_TOOL_ISTWI_ACTION_WRITE_DATA (0x02)
206 #define MPI2_TOOL_ISTWI_ACTION_SEQUENCE (0x03)
207 #define MPI2_TOOL_ISTWI_ACTION_RESERVE_BUS (0x10)
208 #define MPI2_TOOL_ISTWI_ACTION_RELEASE_BUS (0x11)
209 #define MPI2_TOOL_ISTWI_ACTION_RESET (0x12)
211 /*use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
213 /*values for the Flags field */
214 #define MPI2_TOOL_ISTWI_FLAG_AUTO_RESERVE_RELEASE (0x80)
215 #define MPI2_TOOL_ISTWI_FLAG_PAGE_ADDR_MASK (0x07)
217 /*Toolbox ISTWI Read Write Tool reply message */
218 typedef struct _MPI2_TOOLBOX_ISTWI_REPLY
{
220 U8 Reserved1
; /*0x01 */
221 U8 MsgLength
; /*0x02 */
222 U8 Function
; /*0x03 */
223 U16 Reserved2
; /*0x04 */
224 U8 Reserved3
; /*0x06 */
225 U8 MsgFlags
; /*0x07 */
228 U16 Reserved4
; /*0x0A */
229 U16 Reserved5
; /*0x0C */
230 U16 IOCStatus
; /*0x0E */
231 U32 IOCLogInfo
; /*0x10 */
232 U8 DevIndex
; /*0x14 */
234 U8 IstwiStatus
; /*0x16 */
235 U8 Reserved6
; /*0x17 */
236 U16 TxDataCount
; /*0x18 */
237 U16 RxDataCount
; /*0x1A */
238 } MPI2_TOOLBOX_ISTWI_REPLY
, *PTR_MPI2_TOOLBOX_ISTWI_REPLY
,
239 Mpi2ToolboxIstwiReply_t
, *pMpi2ToolboxIstwiReply_t
;
241 /****************************************************************************
242 * Toolbox Beacon Tool request
243 ****************************************************************************/
245 typedef struct _MPI2_TOOLBOX_BEACON_REQUEST
{
247 U8 Reserved1
; /*0x01 */
248 U8 ChainOffset
; /*0x02 */
249 U8 Function
; /*0x03 */
250 U16 Reserved2
; /*0x04 */
251 U8 Reserved3
; /*0x06 */
252 U8 MsgFlags
; /*0x07 */
255 U16 Reserved4
; /*0x0A */
256 U8 Reserved5
; /*0x0C */
257 U8 PhysicalPort
; /*0x0D */
258 U8 Reserved6
; /*0x0E */
260 } MPI2_TOOLBOX_BEACON_REQUEST
, *PTR_MPI2_TOOLBOX_BEACON_REQUEST
,
261 Mpi2ToolboxBeaconRequest_t
, *pMpi2ToolboxBeaconRequest_t
;
263 /*values for the Flags field */
264 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_OFF (0x00)
265 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_ON (0x01)
267 /****************************************************************************
268 * Toolbox Diagnostic CLI Tool
269 ****************************************************************************/
271 #define MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH (0x5C)
273 /*MPI v2.0 Toolbox Diagnostic CLI Tool request message */
274 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
{
276 U8 Reserved1
; /*0x01 */
277 U8 ChainOffset
; /*0x02 */
278 U8 Function
; /*0x03 */
279 U16 Reserved2
; /*0x04 */
280 U8 Reserved3
; /*0x06 */
281 U8 MsgFlags
; /*0x07 */
284 U16 Reserved4
; /*0x0A */
285 U8 SGLFlags
; /*0x0C */
286 U8 Reserved5
; /*0x0D */
287 U16 Reserved6
; /*0x0E */
288 U32 DataLength
; /*0x10 */
289 U8 DiagnosticCliCommand
[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH
];/*0x14 */
290 MPI2_MPI_SGE_IO_UNION SGL
; /*0x70 */
291 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
292 *PTR_MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
293 Mpi2ToolboxDiagnosticCliRequest_t
,
294 *pMpi2ToolboxDiagnosticCliRequest_t
;
296 /*use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
298 /*MPI v2.5 Toolbox Diagnostic CLI Tool request message */
299 typedef struct _MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
{
301 U8 Reserved1
; /*0x01 */
302 U8 ChainOffset
; /*0x02 */
303 U8 Function
; /*0x03 */
304 U16 Reserved2
; /*0x04 */
305 U8 Reserved3
; /*0x06 */
306 U8 MsgFlags
; /*0x07 */
309 U16 Reserved4
; /*0x0A */
310 U32 Reserved5
; /*0x0C */
311 U32 DataLength
; /*0x10 */
312 U8 DiagnosticCliCommand
[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH
];/*0x14 */
313 MPI25_SGE_IO_UNION SGL
; /* 0x70 */
314 } MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
315 *PTR_MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
,
316 Mpi25ToolboxDiagnosticCliRequest_t
,
317 *pMpi25ToolboxDiagnosticCliRequest_t
;
319 /*Toolbox Diagnostic CLI Tool reply message */
320 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY
{
322 U8 Reserved1
; /*0x01 */
323 U8 MsgLength
; /*0x02 */
324 U8 Function
; /*0x03 */
325 U16 Reserved2
; /*0x04 */
326 U8 Reserved3
; /*0x06 */
327 U8 MsgFlags
; /*0x07 */
330 U16 Reserved4
; /*0x0A */
331 U16 Reserved5
; /*0x0C */
332 U16 IOCStatus
; /*0x0E */
333 U32 IOCLogInfo
; /*0x10 */
334 U32 ReturnedDataLength
; /*0x14 */
335 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY
,
336 *PTR_MPI2_TOOLBOX_DIAG_CLI_REPLY
,
337 Mpi2ToolboxDiagnosticCliReply_t
,
338 *pMpi2ToolboxDiagnosticCliReply_t
;
341 /****************************************************************************
342 * Toolbox Console Text Display Tool
343 ****************************************************************************/
345 /* Toolbox Console Text Display Tool request message */
346 typedef struct _MPI2_TOOLBOX_TEXT_DISPLAY_REQUEST
{
348 U8 Reserved1
; /* 0x01 */
349 U8 ChainOffset
; /* 0x02 */
350 U8 Function
; /* 0x03 */
351 U16 Reserved2
; /* 0x04 */
352 U8 Reserved3
; /* 0x06 */
353 U8 MsgFlags
; /* 0x07 */
356 U16 Reserved4
; /* 0x0A */
357 U8 Console
; /* 0x0C */
359 U16 Reserved6
; /* 0x0E */
360 U8 TextToDisplay
[4]; /* 0x10 */
361 } MPI2_TOOLBOX_TEXT_DISPLAY_REQUEST
,
362 *PTR_MPI2_TOOLBOX_TEXT_DISPLAY_REQUEST
,
363 Mpi2ToolboxTextDisplayRequest_t
,
364 *pMpi2ToolboxTextDisplayRequest_t
;
366 /* defines for the Console field */
367 #define MPI2_TOOLBOX_CONSOLE_TYPE_MASK (0xF0)
368 #define MPI2_TOOLBOX_CONSOLE_TYPE_DEFAULT (0x00)
369 #define MPI2_TOOLBOX_CONSOLE_TYPE_UART (0x10)
370 #define MPI2_TOOLBOX_CONSOLE_TYPE_ETHERNET (0x20)
372 #define MPI2_TOOLBOX_CONSOLE_NUMBER_MASK (0x0F)
374 /* defines for the Flags field */
375 #define MPI2_TOOLBOX_CONSOLE_FLAG_TIMESTAMP (0x01)
379 /*****************************************************************************
381 * Diagnostic Buffer Messages
383 *****************************************************************************/
385 /****************************************************************************
386 * Diagnostic Buffer Post request
387 ****************************************************************************/
389 typedef struct _MPI2_DIAG_BUFFER_POST_REQUEST
{
390 U8 ExtendedType
; /*0x00 */
391 U8 BufferType
; /*0x01 */
392 U8 ChainOffset
; /*0x02 */
393 U8 Function
; /*0x03 */
394 U16 Reserved2
; /*0x04 */
395 U8 Reserved3
; /*0x06 */
396 U8 MsgFlags
; /*0x07 */
399 U16 Reserved4
; /*0x0A */
400 U64 BufferAddress
; /*0x0C */
401 U32 BufferLength
; /*0x14 */
402 U32 Reserved5
; /*0x18 */
403 U32 Reserved6
; /*0x1C */
405 U32 ProductSpecific
[23]; /*0x24 */
406 } MPI2_DIAG_BUFFER_POST_REQUEST
, *PTR_MPI2_DIAG_BUFFER_POST_REQUEST
,
407 Mpi2DiagBufferPostRequest_t
, *pMpi2DiagBufferPostRequest_t
;
409 /*values for the ExtendedType field */
410 #define MPI2_DIAG_EXTENDED_TYPE_UTILIZATION (0x02)
412 /*values for the BufferType field */
413 #define MPI2_DIAG_BUF_TYPE_TRACE (0x00)
414 #define MPI2_DIAG_BUF_TYPE_SNAPSHOT (0x01)
415 #define MPI2_DIAG_BUF_TYPE_EXTENDED (0x02)
416 /*count of the number of buffer types */
417 #define MPI2_DIAG_BUF_TYPE_COUNT (0x03)
419 /*values for the Flags field */
420 #define MPI2_DIAG_BUF_FLAG_RELEASE_ON_FULL (0x00000002)
421 #define MPI2_DIAG_BUF_FLAG_IMMEDIATE_RELEASE (0x00000001)
423 /****************************************************************************
424 * Diagnostic Buffer Post reply
425 ****************************************************************************/
427 typedef struct _MPI2_DIAG_BUFFER_POST_REPLY
{
428 U8 ExtendedType
; /*0x00 */
429 U8 BufferType
; /*0x01 */
430 U8 MsgLength
; /*0x02 */
431 U8 Function
; /*0x03 */
432 U16 Reserved2
; /*0x04 */
433 U8 Reserved3
; /*0x06 */
434 U8 MsgFlags
; /*0x07 */
437 U16 Reserved4
; /*0x0A */
438 U16 Reserved5
; /*0x0C */
439 U16 IOCStatus
; /*0x0E */
440 U32 IOCLogInfo
; /*0x10 */
441 U32 TransferLength
; /*0x14 */
442 } MPI2_DIAG_BUFFER_POST_REPLY
, *PTR_MPI2_DIAG_BUFFER_POST_REPLY
,
443 Mpi2DiagBufferPostReply_t
, *pMpi2DiagBufferPostReply_t
;
445 /****************************************************************************
446 * Diagnostic Release request
447 ****************************************************************************/
449 typedef struct _MPI2_DIAG_RELEASE_REQUEST
{
450 U8 Reserved1
; /*0x00 */
451 U8 BufferType
; /*0x01 */
452 U8 ChainOffset
; /*0x02 */
453 U8 Function
; /*0x03 */
454 U16 Reserved2
; /*0x04 */
455 U8 Reserved3
; /*0x06 */
456 U8 MsgFlags
; /*0x07 */
459 U16 Reserved4
; /*0x0A */
460 } MPI2_DIAG_RELEASE_REQUEST
, *PTR_MPI2_DIAG_RELEASE_REQUEST
,
461 Mpi2DiagReleaseRequest_t
, *pMpi2DiagReleaseRequest_t
;
463 /****************************************************************************
464 * Diagnostic Buffer Post reply
465 ****************************************************************************/
467 typedef struct _MPI2_DIAG_RELEASE_REPLY
{
468 U8 Reserved1
; /*0x00 */
469 U8 BufferType
; /*0x01 */
470 U8 MsgLength
; /*0x02 */
471 U8 Function
; /*0x03 */
472 U16 Reserved2
; /*0x04 */
473 U8 Reserved3
; /*0x06 */
474 U8 MsgFlags
; /*0x07 */
477 U16 Reserved4
; /*0x0A */
478 U16 Reserved5
; /*0x0C */
479 U16 IOCStatus
; /*0x0E */
480 U32 IOCLogInfo
; /*0x10 */
481 } MPI2_DIAG_RELEASE_REPLY
, *PTR_MPI2_DIAG_RELEASE_REPLY
,
482 Mpi2DiagReleaseReply_t
, *pMpi2DiagReleaseReply_t
;