xref: /freebsd/sys/dev/mpi3mr/mpi/mpi30_tool.h (revision 92f340d137ba5d6db7610ba1dae35842e2c9c8ea)
1 /*
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2016-2025, Broadcom Inc. All rights reserved.
5  * Support: <fbsd-storage-driver.pdl@broadcom.com>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  *    this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  *    this list of conditions and the following disclaimer in the documentation and/or other
15  *    materials provided with the distribution.
16  * 3. Neither the name of the Broadcom Inc. nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software without
18  *    specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * The views and conclusions contained in the software and documentation are
33  * those of the authors and should not be interpreted as representing
34  * official policies,either expressed or implied, of the FreeBSD Project.
35  *
36  * Mail to: Broadcom Inc 1320 Ridder Park Dr, San Jose, CA 95131
37  *
38  * Broadcom Inc. (Broadcom) MPI3MR Adapter FreeBSD
39  *
40  */
41 
42 #ifndef MPI30_TOOL_H
43 #define MPI30_TOOL_H     1
44 
45 /*****************************************************************************
46  *                     Toolbox Messages                                      *
47  *****************************************************************************/
48 
49 /*****************************************************************************
50  *                     Clean Tool Request Message                            *
51  *****************************************************************************/
52 typedef struct _MPI3_TOOL_CLEAN_REQUEST
53 {
54     U16                     HostTag;                        /* 0x00 */
55     U8                      IOCUseOnly02;                   /* 0x02 */
56     U8                      Function;                       /* 0x03 */
57     U16                     IOCUseOnly04;                   /* 0x04 */
58     U8                      IOCUseOnly06;                   /* 0x06 */
59     U8                      MsgFlags;                       /* 0x07 */
60     U16                     ChangeCount;                    /* 0x08 */
61     U8                      Tool;                           /* 0x0A */
62     U8                      Reserved0B;                     /* 0x0B */
63     U32                     Area;                           /* 0x0C */
64 } MPI3_TOOL_CLEAN_REQUEST, MPI3_POINTER PTR_MPI3_TOOL_CLEAN_REQUEST,
65   Mpi3ToolCleanRequest_t, MPI3_POINTER pMpi3ToolCleanRequest_t;
66 
67 /**** Defines for the Tool field ****/
68 #define MPI3_TOOLBOX_TOOL_CLEAN                             (0x01)
69 #define MPI3_TOOLBOX_TOOL_ISTWI_READ_WRITE                  (0x02)
70 #define MPI3_TOOLBOX_TOOL_DIAGNOSTIC_CLI                    (0x03)
71 #define MPI3_TOOLBOX_TOOL_LANE_MARGINING                    (0x04)
72 #define MPI3_TOOLBOX_TOOL_RECOVER_DEVICE                    (0x05)
73 #define MPI3_TOOLBOX_TOOL_LOOPBACK                          (0x06)
74 
75 /**** Bitfield definitions for Area field ****/
76 #define MPI3_TOOLBOX_CLEAN_AREA_BIOS_BOOT_SERVICES          (0x00000008)
77 #define MPI3_TOOLBOX_CLEAN_AREA_ALL_BUT_MFG                 (0x00000002)
78 #define MPI3_TOOLBOX_CLEAN_AREA_NVSTORE                     (0x00000001)
79 
80 
81 /*****************************************************************************
82  *                ISTWI Read Write Tool Request Message                      *
83  *****************************************************************************/
84 typedef struct _MPI3_TOOL_ISTWI_READ_WRITE_REQUEST
85 {
86     U16                               HostTag;               /* 0x00 */
87     U8                                IOCUseOnly02;          /* 0x02 */
88     U8                                Function;              /* 0x03 */
89     U16                               IOCUseOnly04;          /* 0x04 */
90     U8                                IOCUseOnly06;          /* 0x06 */
91     U8                                MsgFlags;              /* 0x07 */
92     U16                               ChangeCount;           /* 0x08 */
93     U8                                Tool;                  /* 0x0A */
94     U8                                Flags;                 /* 0x0B */
95     U8                                DevIndex;              /* 0x0C */
96     U8                                Action;                /* 0x0D */
97     U16                               Reserved0E;            /* 0x0E */
98     U16                               TxDataLength;          /* 0x10 */
99     U16                               RxDataLength;          /* 0x12 */
100     U32                               Reserved14[3];         /* 0x14 */
101     MPI3_MAN11_ISTWI_DEVICE_FORMAT    IstwiDevice;           /* 0x20 */
102     MPI3_SGE_UNION                    SGL;                   /* 0x30 */
103 } MPI3_TOOL_ISTWI_READ_WRITE_REQUEST, MPI3_POINTER PTR_MPI3_TOOL_ISTWI_READ_WRITE_REQUEST,
104   Mpi3ToolIstwiReadWriteRequest_t, MPI3_POINTER pMpi3ToolIstwiReadWRiteRequest_t;
105 
106 /**** Bitfield definitions for Flags field ****/
107 #define MPI3_TOOLBOX_ISTWI_FLAGS_AUTO_RESERVE_RELEASE       (0x80)
108 #define MPI3_TOOLBOX_ISTWI_FLAGS_ADDRESS_MODE_MASK          (0x04)
109 #define MPI3_TOOLBOX_ISTWI_FLAGS_ADDRESS_MODE_SHIFT         (2)
110 #define MPI3_TOOLBOX_ISTWI_FLAGS_ADDRESS_MODE_DEVINDEX      (0x00)
111 #define MPI3_TOOLBOX_ISTWI_FLAGS_ADDRESS_MODE_DEVICE_FIELD  (0x04)
112 #define MPI3_TOOLBOX_ISTWI_FLAGS_PAGE_ADDRESS_MASK          (0x03)
113 #define MPI3_TOOLBOX_ISTWI_FLAGS_PAGE_ADDRESS_SHIFT         (0)
114 
115 /**** Definitions for the Action field ****/
116 #define MPI3_TOOLBOX_ISTWI_ACTION_RESERVE_BUS               (0x00)
117 #define MPI3_TOOLBOX_ISTWI_ACTION_RELEASE_BUS               (0x01)
118 #define MPI3_TOOLBOX_ISTWI_ACTION_RESET                     (0x02)
119 #define MPI3_TOOLBOX_ISTWI_ACTION_READ_DATA                 (0x03)
120 #define MPI3_TOOLBOX_ISTWI_ACTION_WRITE_DATA                (0x04)
121 #define MPI3_TOOLBOX_ISTWI_ACTION_SEQUENCE                  (0x05)
122 
123 
124 /**** Defines for the IstwiDevice field - refer to struct definition in mpi30_cnfg.h ****/
125 
126 
127 /*****************************************************************************
128  *                ISTWI Read Write Tool Reply Message                        *
129  *****************************************************************************/
130 typedef struct _MPI3_TOOL_ISTWI_READ_WRITE_REPLY
131 {
132     U16                     HostTag;                        /* 0x00 */
133     U8                      IOCUseOnly02;                   /* 0x02 */
134     U8                      Function;                       /* 0x03 */
135     U16                     IOCUseOnly04;                   /* 0x04 */
136     U8                      IOCUseOnly06;                   /* 0x06 */
137     U8                      MsgFlags;                       /* 0x07 */
138     U16                     IOCUseOnly08;                   /* 0x08 */
139     U16                     IOCStatus;                      /* 0x0A */
140     U32                     IOCLogInfo;                     /* 0x0C */
141     U16                     IstwiStatus;                    /* 0x10 */
142     U16                     Reserved12;                     /* 0x12 */
143     U16                     TxDataCount;                    /* 0x14 */
144     U16                     RxDataCount;                    /* 0x16 */
145 } MPI3_TOOL_ISTWI_READ_WRITE_REPLY, MPI3_POINTER PTR_MPI3_TOOL_ISTWI_READ_WRITE_REPLY,
146   Mpi3ToolIstwiReadWriteReply_t, MPI3_POINTER pMpi3ToolIstwiReadWRiteReply_t;
147 
148 
149 
150 /*****************************************************************************
151  *               Diagnostic CLI Tool Request Message                         *
152  *****************************************************************************/
153 typedef struct _MPI3_TOOL_DIAGNOSTIC_CLI_REQUEST
154 {
155     U16                     HostTag;                        /* 0x00 */
156     U8                      IOCUseOnly02;                   /* 0x02 */
157     U8                      Function;                       /* 0x03 */
158     U16                     IOCUseOnly04;                   /* 0x04 */
159     U8                      IOCUseOnly06;                   /* 0x06 */
160     U8                      MsgFlags;                       /* 0x07 */
161     U16                     ChangeCount;                    /* 0x08 */
162     U8                      Tool;                           /* 0x0A */
163     U8                      Reserved0B;                     /* 0x0B */
164     U32                     CommandDataLength;              /* 0x0C */
165     U32                     ResponseDataLength;             /* 0x10 */
166     U32                     Reserved14[3];                  /* 0x14 */
167     MPI3_SGE_UNION          SGL;                            /* 0x20 */
168 } MPI3_TOOL_DIAGNOSTIC_CLI_REQUEST, MPI3_POINTER PTR_MPI3_TOOL_DIAGNOSTIC_CLI_REQUEST,
169   Mpi3ToolDiagnosticCliRequest_t, MPI3_POINTER pMpi3ToolDiagnosticCliRequest_t;
170 
171 
172 /*****************************************************************************
173  *               Diagnostic CLI Tool Reply Message                           *
174  *****************************************************************************/
175 typedef struct _MPI3_TOOL_DIAGNOSTIC_CLI_REPLY
176 {
177     U16                     HostTag;                        /* 0x00 */
178     U8                      IOCUseOnly02;                   /* 0x02 */
179     U8                      Function;                       /* 0x03 */
180     U16                     IOCUseOnly04;                   /* 0x04 */
181     U8                      IOCUseOnly06;                   /* 0x06 */
182     U8                      MsgFlags;                       /* 0x07 */
183     U16                     IOCUseOnly08;                   /* 0x08 */
184     U16                     IOCStatus;                      /* 0x0A */
185     U32                     IOCLogInfo;                     /* 0x0C */
186     U32                     ReturnedDataLength;             /* 0x10 */
187 } MPI3_TOOL_DIAGNOSTIC_CLI_REPLY, MPI3_POINTER PTR_MPI3_TOOL_DIAGNOSTIC_CLI_REPLY,
188   Mpi3ToolDiagnosticCliReply_t, MPI3_POINTER pMpi3ToolDiagnosticCliReply_t;
189 
190 
191 /*****************************************************************************
192  *                Lane Margining Tool Request Message                        *
193  *****************************************************************************/
194 typedef struct _MPI3_TOOL_LANE_MARGIN_REQUEST
195 {
196     U16                               HostTag;               /* 0x00 */
197     U8                                IOCUseOnly02;          /* 0x02 */
198     U8                                Function;              /* 0x03 */
199     U16                               IOCUseOnly04;          /* 0x04 */
200     U8                                IOCUseOnly06;          /* 0x06 */
201     U8                                MsgFlags;              /* 0x07 */
202     U16                               ChangeCount;           /* 0x08 */
203     U8                                Tool;                  /* 0x0A */
204     U8                                Reserved0B;            /* 0x0B */
205     U8                                Action;                /* 0x0C */
206     U8                                SwitchPort;            /* 0x0D */
207     U16                               DevHandle;             /* 0x0E */
208     U8                                StartLane;             /* 0x10 */
209     U8                                NumLanes;              /* 0x11 */
210     U16                               Reserved12;            /* 0x12 */
211     U32                               Reserved14[3];         /* 0x14 */
212     MPI3_SGE_UNION                    SGL;                   /* 0x20 */
213 } MPI3_TOOL_LANE_MARGIN_REQUEST, MPI3_POINTER PTR_MPI3_TOOL_LANE_MARGIN_REQUEST,
214   Mpi3ToolIstwiLaneMarginRequest_t, MPI3_POINTER pMpi3ToolLaneMarginRequest_t;
215 
216 /**** Definitions for the Action field ****/
217 #define MPI3_TOOLBOX_LM_ACTION_ENTER                         (0x00)
218 #define MPI3_TOOLBOX_LM_ACTION_EXIT                          (0x01)
219 #define MPI3_TOOLBOX_LM_ACTION_READ                          (0x02)
220 #define MPI3_TOOLBOX_LM_ACTION_WRITE                         (0x03)
221 
222 typedef struct _MPI3_LANE_MARGIN_ELEMENT
223 {
224     U16                               Control;                /* 0x00 */
225     U16                               Status;                 /* 0x02 */
226 } MPI3_LANE_MARGIN_ELEMENT, MPI3_POINTER PTR_MPI3_LANE_MARGIN_ELEMENT,
227   Mpi3LaneMarginElement_t, MPI3_POINTER pMpi3LaneMarginElement_t;
228 
229 /*****************************************************************************
230  *                Lane Margining Tool Reply Message                          *
231  *****************************************************************************/
232 typedef struct _MPI3_TOOL_LANE_MARGIN_REPLY
233 {
234     U16                               HostTag;               /* 0x00 */
235     U8                                IOCUseOnly02;          /* 0x02 */
236     U8                                Function;              /* 0x03 */
237     U16                               IOCUseOnly04;          /* 0x04 */
238     U8                                IOCUseOnly06;          /* 0x06 */
239     U8                                MsgFlags;              /* 0x07 */
240     U16                               IOCUseOnly08;          /* 0x08 */
241     U16                               IOCStatus;             /* 0x0A */
242     U32                               IOCLogInfo;            /* 0x0C */
243     U32                               ReturnedDataLength;    /* 0x10 */
244 } MPI3_TOOL_LANE_MARGIN_REPLY, MPI3_POINTER PTR_MPI3_TOOL_LANE_MARGIN_REPLY,
245   Mpi3ToolLaneMarginReply_t, MPI3_POINTER pMpi3ToolLaneMarginReply_t;
246 
247 /*****************************************************************************
248  *               Recover Device Request Message                              *
249  *****************************************************************************/
250 typedef struct _MPI3_TOOL_RECOVER_DEVICE_REQUEST
251 {
252     U16                               HostTag;               /* 0x00 */
253     U8                                IOCUseOnly02;          /* 0x02 */
254     U8                                Function;              /* 0x03 */
255     U16                               IOCUseOnly04;          /* 0x04 */
256     U8                                IOCUseOnly06;          /* 0x06 */
257     U8                                MsgFlags;              /* 0x07 */
258     U16                               ChangeCount;           /* 0x08 */
259     U8                                Tool;                  /* 0x0A */
260     U8                                Reserved0B;            /* 0x0B */
261     U8                                Action;                /* 0x0C */
262     U8                                Reserved0D;            /* 0x0D */
263     U16                               DevHandle;             /* 0x0E */
264 } MPI3_TOOL_RECOVER_DEVICE_REQUEST, MPI3_POINTER PTR_MPI3_TOOL_RECOVER_DEVICE_REQUEST,
265   Mpi3ToolRecoverDeviceRequest_t, MPI3_POINTER pMpi3ToolRecoverDeviceRequest_t;
266 
267 /**** Bitfield definitions for the Action field ****/
268 #define MPI3_TOOLBOX_RD_ACTION_START                        (0x01)
269 #define MPI3_TOOLBOX_RD_ACTION_GET_STATUS                   (0x02)
270 #define MPI3_TOOLBOX_RD_ACTION_ABORT                        (0x03)
271 
272 /*****************************************************************************
273  *               Recover Device Reply Message                                *
274  *****************************************************************************/
275 typedef struct _MPI3_TOOL_RECOVER_DEVICE_REPLY
276 {
277     U16                     HostTag;                        /* 0x00 */
278     U8                      IOCUseOnly02;                   /* 0x02 */
279     U8                      Function;                       /* 0x03 */
280     U16                     IOCUseOnly04;                   /* 0x04 */
281     U8                      IOCUseOnly06;                   /* 0x06 */
282     U8                      MsgFlags;                       /* 0x07 */
283     U16                     IOCUseOnly08;                   /* 0x08 */
284     U16                     IOCStatus;                      /* 0x0A */
285     U32                     IOCLogInfo;                     /* 0x0C */
286     U8                      Status;                         /* 0x10 */
287     U8                      Reserved11;                     /* 0x11 */
288     U16                     Reserved1C;                     /* 0x12 */
289 } MPI3_TOOL_RECOVER_DEVICE_REPLY, MPI3_POINTER PTR_MPI3_TOOL_RECOVER_DEVICE_REPLY,
290   Mpi3ToolRecoverDeviceReply_t, MPI3_POINTER pMpi3ToolRecoverDeviceReply_t;
291 
292 /**** Bitfield definitions for the Status field ****/
293 #define MPI3_TOOLBOX_RD_STATUS_NOT_NEEDED                   (0x01)
294 #define MPI3_TOOLBOX_RD_STATUS_NEEDED                       (0x02)
295 #define MPI3_TOOLBOX_RD_STATUS_IN_PROGRESS                  (0x03)
296 #define MPI3_TOOLBOX_RD_STATUS_ABORTING                     (0x04)
297 
298 /*****************************************************************************
299  *               Loopback Tool Request Message                               *
300  *****************************************************************************/
301 typedef struct _MPI3_TOOL_LOOPBACK_REQUEST
302 {
303     U16                               HostTag;               /* 0x00 */
304     U8                                IOCUseOnly02;          /* 0x02 */
305     U8                                Function;              /* 0x03 */
306     U16                               IOCUseOnly04;          /* 0x04 */
307     U8                                IOCUseOnly06;          /* 0x06 */
308     U8                                MsgFlags;              /* 0x07 */
309     U16                               ChangeCount;           /* 0x08 */
310     U8                                Tool;                  /* 0x0A */
311     U8                                Reserved0B;            /* 0x0B */
312     U32                               Reserved0C;            /* 0x0C */
313     U64                               Phys;                  /* 0x10 */
314 } MPI3_TOOL_LOOPBACK_REQUEST, MPI3_POINTER PTR_MPI3_TOOL_LOOPBACK_REQUEST,
315   Mpi3ToolLoopbackRequest_t, MPI3_POINTER pMpi3ToolLoopbackRequest_t;
316 
317 /*****************************************************************************
318  *               Loopback Tool Reply Message                                 *
319  *****************************************************************************/
320 typedef struct _MPI3_TOOL_LOOPBACK_REPLY
321 {
322     U16                               HostTag;               /* 0x00 */
323     U8                                IOCUseOnly02;          /* 0x02 */
324     U8                                Function;              /* 0x03 */
325     U16                               IOCUseOnly04;          /* 0x04 */
326     U8                                IOCUseOnly06;          /* 0x06 */
327     U8                                MsgFlags;              /* 0x07 */
328     U16                               IOCUseOnly08;          /* 0x08 */
329     U16                               IOCStatus;             /* 0x0A */
330     U32                               IOCLogInfo;            /* 0x0C */
331     U64                               TestedPhys;            /* 0x10 */
332     U64                               FailedPhys;            /* 0x18 */
333 } MPI3_TOOL_LOOPBACK_REPLY, MPI3_POINTER PTR_MPI3_TOOL_LOOPBACK_REPLY,
334   Mpi3ToolLoopbackReply_t, MPI3_POINTER pMpi3ToolLoopbackReply_t;
335 
336 
337 /*****************************************************************************
338  *                     Diagnostic Buffer Messages                            *
339  *****************************************************************************/
340 
341 /*****************************************************************************
342  *               Diagnostic Buffer Post Request Message                      *
343  *****************************************************************************/
344 typedef struct _MPI3_DIAG_BUFFER_POST_REQUEST
345 {
346     U16                     HostTag;                        /* 0x00 */
347     U8                      IOCUseOnly02;                   /* 0x02 */
348     U8                      Function;                       /* 0x03 */
349     U16                     IOCUseOnly04;                   /* 0x04 */
350     U8                      IOCUseOnly06;                   /* 0x06 */
351     U8                      MsgFlags;                       /* 0x07 */
352     U16                     ChangeCount;                    /* 0x08 */
353     U16                     Reserved0A;                     /* 0x0A */
354     U8                      Type;                           /* 0x0C */
355     U8                      Reserved0D;                     /* 0x0D */
356     U16                     Reserved0E;                     /* 0x0E */
357     U64                     Address;                        /* 0x10 */
358     U32                     Length;                         /* 0x18 */
359     U32                     Reserved1C;                     /* 0x1C */
360 } MPI3_DIAG_BUFFER_POST_REQUEST, MPI3_POINTER PTR_MPI3_DIAG_BUFFER_POST_REQUEST,
361   Mpi3DiagBufferPostRequest_t, MPI3_POINTER pMpi3DiagBufferPostRequest_t;
362 
363 /**** Defines for the MsgFlags field ****/
364 #define MPI3_DIAG_BUFFER_POST_MSGFLAGS_SEGMENTED            (0x01)
365 
366 /**** Defines for the Type field ****/
367 #define MPI3_DIAG_BUFFER_TYPE_TRACE                         (0x01)
368 #define MPI3_DIAG_BUFFER_TYPE_FW                            (0x02)
369 #define MPI3_DIAG_BUFFER_TYPE_DRIVER                        (0x10)
370 #define MPI3_DIAG_BUFFER_TYPE_FDL                           (0x20)
371 #define MPI3_DIAG_BUFFER_TYPE_TTY                           (0x30)
372 #define MPI3_DIAG_BUFFER_MIN_PRODUCT_SPECIFIC               (0xF0)
373 #define MPI3_DIAG_BUFFER_MAX_PRODUCT_SPECIFIC               (0xFF)
374 
375 
376 /*****************************************************************************
377  *                 DRIVER DIAGNOSTIC Buffer                                  *
378  *****************************************************************************/
379 typedef struct _MPI3_DRIVER_BUFFER_HEADER
380 {
381     U32                     Signature;                      /* 0x00 */
382     U16                     HeaderSize;                     /* 0x04 */
383     U16                     RTTFileHeaderOffset;            /* 0x06 */
384     U32                     Flags;                          /* 0x08 */
385     U32                     CircularBufferSize;             /* 0x0C */
386     U32                     LogicalBufferEnd;               /* 0x10 */
387     U32                     LogicalBufferStart;             /* 0x14 */
388     U32                     IOCUseOnly18[2];                /* 0x18 */
389     U32                     Reserved20[760];                /* 0x20  - 0xBFC */
390     U32                     ReservedRTTRACE[256];           /* 0xC00 - 0xFFC */
391 } MPI3_DRIVER_BUFFER_HEADER, MPI3_POINTER PTR_MPI3_DRIVER_BUFFER_HEADER,
392   Mpi3DriverBufferHeader_t, MPI3_POINTER pMpi3DriverBufferHeader_t;
393 
394 /**** Defines for the Signature field ****/
395 #define MPI3_DRIVER_DIAG_BUFFER_HEADER_SIGNATURE_CIRCULAR                (0x43495243)
396 
397 /**** Defines for the Flags field ****/
398 #define MPI3_DRIVER_DIAG_BUFFER_HEADER_FLAGS_CIRCULAR_BUF_FORMAT_MASK    (0x00000003)
399 #define MPI3_DRIVER_DIAG_BUFFER_HEADER_FLAGS_CIRCULAR_BUF_FORMAT_SHIFT   (0)
400 #define MPI3_DRIVER_DIAG_BUFFER_HEADER_FLAGS_CIRCULAR_BUF_FORMAT_ASCII   (0x00000000)
401 #define MPI3_DRIVER_DIAG_BUFFER_HEADER_FLAGS_CIRCULAR_BUF_FORMAT_RTTRACE (0x00000001)
402 
403 /*****************************************************************************
404  *               Diagnostic Buffer Manage Request Message                      *
405  *****************************************************************************/
406 typedef struct _MPI3_DIAG_BUFFER_MANAGE_REQUEST
407 {
408     U16                     HostTag;                        /* 0x00 */
409     U8                      IOCUseOnly02;                   /* 0x02 */
410     U8                      Function;                       /* 0x03 */
411     U16                     IOCUseOnly04;                   /* 0x04 */
412     U8                      IOCUseOnly06;                   /* 0x06 */
413     U8                      MsgFlags;                       /* 0x07 */
414     U16                     ChangeCount;                    /* 0x08 */
415     U16                     Reserved0A;                     /* 0x0A */
416     U8                      Type;                           /* 0x0C */
417     U8                      Action;                         /* 0x0D */
418     U16                     Reserved0E;                     /* 0x0E */
419 } MPI3_DIAG_BUFFER_MANAGE_REQUEST, MPI3_POINTER PTR_MPI3_DIAG_BUFFER_MANAGE_REQUEST,
420   Mpi3DiagBufferManageRequest_t, MPI3_POINTER pMpi3DiagBufferManageRequest_t;
421 
422 /**** Defines for the Type field - use MPI3_DIAG_BUFFER_TYPE_ values ****/
423 
424 /**** Defined for the Action field ****/
425 #define MPI3_DIAG_BUFFER_ACTION_RELEASE                     (0x01)
426 #define MPI3_DIAG_BUFFER_ACTION_PAUSE                       (0x02)
427 #define MPI3_DIAG_BUFFER_ACTION_RESUME                      (0x03)
428 
429 /*****************************************************************************
430  *               Diagnostic Buffer Upload Request Message                    *
431  *****************************************************************************/
432 typedef struct _MPI3_DIAG_BUFFER_UPLOAD_REQUEST
433 {
434     U16                     HostTag;                        /* 0x00 */
435     U8                      IOCUseOnly02;                   /* 0x02 */
436     U8                      Function;                       /* 0x03 */
437     U16                     IOCUseOnly04;                   /* 0x04 */
438     U8                      IOCUseOnly06;                   /* 0x06 */
439     U8                      MsgFlags;                       /* 0x07 */
440     U16                     ChangeCount;                    /* 0x08 */
441     U16                     Reserved0A;                     /* 0x0A */
442     U8                      Type;                           /* 0x0C */
443     U8                      Flags;                          /* 0x0D */
444     U16                     Reserved0E;                     /* 0x0E */
445     U64                     Context;                        /* 0x10 */
446     U32                     Reserved18;                     /* 0x18 */
447     U32                     Reserved1C;                     /* 0x1C */
448     MPI3_SGE_UNION          SGL;                            /* 0x20 */
449 } MPI3_DIAG_BUFFER_UPLOAD_REQUEST, MPI3_POINTER PTR_MPI3_DIAG_BUFFER_UPLOAD_REQUEST,
450   Mpi3DiagBufferUploadRequest_t, MPI3_POINTER pMpi3DiagBufferUploadRequest_t;
451 
452 /**** Defines for the Type field - use MPI3_DIAG_BUFFER_TYPE_ values ****/
453 
454 /**** Defined for the Flags field ****/
455 #define MPI3_DIAG_BUFFER_UPLOAD_FLAGS_FORMAT_MASK           (0x01)
456 #define MPI3_DIAG_BUFFER_UPLOAD_FLAGS_FORMAT_SHIFT          (0)
457 #define MPI3_DIAG_BUFFER_UPLOAD_FLAGS_FORMAT_DECODED        (0x00)
458 #define MPI3_DIAG_BUFFER_UPLOAD_FLAGS_FORMAT_ENCODED        (0x01)
459 
460 /*****************************************************************************
461  *               Diagnostic Buffer Upload Reply Message                      *
462  *****************************************************************************/
463 typedef struct _MPI3_DIAG_BUFFER_UPLOAD_REPLY
464 {
465     U16                     HostTag;                        /* 0x00 */
466     U8                      IOCUseOnly02;                   /* 0x02 */
467     U8                      Function;                       /* 0x03 */
468     U16                     IOCUseOnly04;                   /* 0x04 */
469     U8                      IOCUseOnly06;                   /* 0x06 */
470     U8                      MsgFlags;                       /* 0x07 */
471     U16                     IOCUseOnly08;                   /* 0x08 */
472     U16                     IOCStatus;                      /* 0x0A */
473     U32                     IOCLogInfo;                     /* 0x0C */
474     U64                     Context;                        /* 0x10 */
475     U32                     ReturnedDataLength;             /* 0x18 */
476     U32                     Reserved1C;                     /* 0x1C */
477 } MPI3_DIAG_BUFFER_UPLOAD_REPLY, MPI3_POINTER PTR_MPI3_DIAG_BUFFER_UPLOAD_REPLY,
478   Mpi3DiagBufferUploadReply_t, MPI3_POINTER pMpi3DiagBufferUploadReply_t;
479 
480 #endif /* MPI30_TOOL_H */
481 
482