1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2007-2015 LSI Corp.
5 * Copyright (c) 2013-2015 Avago Technologies
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
30 *
31 * $FreeBSD$
32 */
33
34 /*
35 * Copyright (c) 2007-2015 LSI Corporation.
36 * Copyright (c) 2013-2015 Avago Technologies
37 *
38 *
39 * Name: mpi2_tool.h
40 * Title: MPI diagnostic tool structures and definitions
41 * Creation Date: March 26, 2007
42 *
43 * mpi2_tool.h Version: 02.00.06
44 *
45 * Version History
46 * ---------------
47 *
48 * Date Version Description
49 * -------- -------- ------------------------------------------------------
50 * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A.
51 * 12-18-07 02.00.01 Added Diagnostic Buffer Post and Diagnostic Release
52 * structures and defines.
53 * 02-29-08 02.00.02 Modified various names to make them 32-character unique.
54 * 05-06-09 02.00.03 Added ISTWI Read Write Tool and Diagnostic CLI Tool.
55 * 07-30-09 02.00.04 Added ExtendedType field to DiagnosticBufferPost request
56 * and reply messages.
57 * Added MPI2_DIAG_BUF_TYPE_EXTENDED.
58 * Incremented MPI2_DIAG_BUF_TYPE_COUNT.
59 * 05-12-10 02.00.05 Added Diagnostic Data Upload tool.
60 * 08-11-10 02.00.06 Added defines that were missing for Diagnostic Buffer
61 * Post Request.
62 * --------------------------------------------------------------------------
63 */
64
65 #ifndef MPI2_TOOL_H
66 #define MPI2_TOOL_H
67
68 /*****************************************************************************
69 *
70 * Toolbox Messages
71 *
72 *****************************************************************************/
73
74 /* defines for the Tools */
75 #define MPI2_TOOLBOX_CLEAN_TOOL (0x00)
76 #define MPI2_TOOLBOX_MEMORY_MOVE_TOOL (0x01)
77 #define MPI2_TOOLBOX_DIAG_DATA_UPLOAD_TOOL (0x02)
78 #define MPI2_TOOLBOX_ISTWI_READ_WRITE_TOOL (0x03)
79 #define MPI2_TOOLBOX_BEACON_TOOL (0x05)
80 #define MPI2_TOOLBOX_DIAGNOSTIC_CLI_TOOL (0x06)
81
82 /****************************************************************************
83 * Toolbox reply
84 ****************************************************************************/
85
86 typedef struct _MPI2_TOOLBOX_REPLY
87 {
88 U8 Tool; /* 0x00 */
89 U8 Reserved1; /* 0x01 */
90 U8 MsgLength; /* 0x02 */
91 U8 Function; /* 0x03 */
92 U16 Reserved2; /* 0x04 */
93 U8 Reserved3; /* 0x06 */
94 U8 MsgFlags; /* 0x07 */
95 U8 VP_ID; /* 0x08 */
96 U8 VF_ID; /* 0x09 */
97 U16 Reserved4; /* 0x0A */
98 U16 Reserved5; /* 0x0C */
99 U16 IOCStatus; /* 0x0E */
100 U32 IOCLogInfo; /* 0x10 */
101 } MPI2_TOOLBOX_REPLY, MPI2_POINTER PTR_MPI2_TOOLBOX_REPLY,
102 Mpi2ToolboxReply_t, MPI2_POINTER pMpi2ToolboxReply_t;
103
104 /****************************************************************************
105 * Toolbox Clean Tool request
106 ****************************************************************************/
107
108 typedef struct _MPI2_TOOLBOX_CLEAN_REQUEST
109 {
110 U8 Tool; /* 0x00 */
111 U8 Reserved1; /* 0x01 */
112 U8 ChainOffset; /* 0x02 */
113 U8 Function; /* 0x03 */
114 U16 Reserved2; /* 0x04 */
115 U8 Reserved3; /* 0x06 */
116 U8 MsgFlags; /* 0x07 */
117 U8 VP_ID; /* 0x08 */
118 U8 VF_ID; /* 0x09 */
119 U16 Reserved4; /* 0x0A */
120 U32 Flags; /* 0x0C */
121 } MPI2_TOOLBOX_CLEAN_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_CLEAN_REQUEST,
122 Mpi2ToolboxCleanRequest_t, MPI2_POINTER pMpi2ToolboxCleanRequest_t;
123
124 /* values for the Flags field */
125 #define MPI2_TOOLBOX_CLEAN_BOOT_SERVICES (0x80000000)
126 #define MPI2_TOOLBOX_CLEAN_PERSIST_MANUFACT_PAGES (0x40000000)
127 #define MPI2_TOOLBOX_CLEAN_OTHER_PERSIST_PAGES (0x20000000)
128 #define MPI2_TOOLBOX_CLEAN_FW_CURRENT (0x10000000)
129 #define MPI2_TOOLBOX_CLEAN_FW_BACKUP (0x08000000)
130 #define MPI2_TOOLBOX_CLEAN_MEGARAID (0x02000000)
131 #define MPI2_TOOLBOX_CLEAN_INITIALIZATION (0x01000000)
132 #define MPI2_TOOLBOX_CLEAN_FLASH (0x00000004)
133 #define MPI2_TOOLBOX_CLEAN_SEEPROM (0x00000002)
134 #define MPI2_TOOLBOX_CLEAN_NVSRAM (0x00000001)
135
136 /****************************************************************************
137 * Toolbox Memory Move request
138 ****************************************************************************/
139
140 typedef struct _MPI2_TOOLBOX_MEM_MOVE_REQUEST
141 {
142 U8 Tool; /* 0x00 */
143 U8 Reserved1; /* 0x01 */
144 U8 ChainOffset; /* 0x02 */
145 U8 Function; /* 0x03 */
146 U16 Reserved2; /* 0x04 */
147 U8 Reserved3; /* 0x06 */
148 U8 MsgFlags; /* 0x07 */
149 U8 VP_ID; /* 0x08 */
150 U8 VF_ID; /* 0x09 */
151 U16 Reserved4; /* 0x0A */
152 MPI2_SGE_SIMPLE_UNION SGL; /* 0x0C */
153 } MPI2_TOOLBOX_MEM_MOVE_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_MEM_MOVE_REQUEST,
154 Mpi2ToolboxMemMoveRequest_t, MPI2_POINTER pMpi2ToolboxMemMoveRequest_t;
155
156 /****************************************************************************
157 * Toolbox Diagnostic Data Upload request
158 ****************************************************************************/
159
160 typedef struct _MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST
161 {
162 U8 Tool; /* 0x00 */
163 U8 Reserved1; /* 0x01 */
164 U8 ChainOffset; /* 0x02 */
165 U8 Function; /* 0x03 */
166 U16 Reserved2; /* 0x04 */
167 U8 Reserved3; /* 0x06 */
168 U8 MsgFlags; /* 0x07 */
169 U8 VP_ID; /* 0x08 */
170 U8 VF_ID; /* 0x09 */
171 U16 Reserved4; /* 0x0A */
172 U8 SGLFlags; /* 0x0C */
173 U8 Reserved5; /* 0x0D */
174 U16 Reserved6; /* 0x0E */
175 U32 Flags; /* 0x10 */
176 U32 DataLength; /* 0x14 */
177 MPI2_SGE_SIMPLE_UNION SGL; /* 0x18 */
178 } MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST,
179 MPI2_POINTER PTR_MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST,
180 Mpi2ToolboxDiagDataUploadRequest_t,
181 MPI2_POINTER pMpi2ToolboxDiagDataUploadRequest_t;
182
183 /* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
184
185 typedef struct _MPI2_DIAG_DATA_UPLOAD_HEADER
186 {
187 U32 DiagDataLength; /* 00h */
188 U8 FormatCode; /* 04h */
189 U8 Reserved1; /* 05h */
190 U16 Reserved2; /* 06h */
191 } MPI2_DIAG_DATA_UPLOAD_HEADER, MPI2_POINTER PTR_MPI2_DIAG_DATA_UPLOAD_HEADER,
192 Mpi2DiagDataUploadHeader_t, MPI2_POINTER pMpi2DiagDataUploadHeader_t;
193
194 /****************************************************************************
195 * Toolbox ISTWI Read Write Tool
196 ****************************************************************************/
197
198 /* Toolbox ISTWI Read Write Tool request message */
199 typedef struct _MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
200 {
201 U8 Tool; /* 0x00 */
202 U8 Reserved1; /* 0x01 */
203 U8 ChainOffset; /* 0x02 */
204 U8 Function; /* 0x03 */
205 U16 Reserved2; /* 0x04 */
206 U8 Reserved3; /* 0x06 */
207 U8 MsgFlags; /* 0x07 */
208 U8 VP_ID; /* 0x08 */
209 U8 VF_ID; /* 0x09 */
210 U16 Reserved4; /* 0x0A */
211 U32 Reserved5; /* 0x0C */
212 U32 Reserved6; /* 0x10 */
213 U8 DevIndex; /* 0x14 */
214 U8 Action; /* 0x15 */
215 U8 SGLFlags; /* 0x16 */
216 U8 Reserved7; /* 0x17 */
217 U16 TxDataLength; /* 0x18 */
218 U16 RxDataLength; /* 0x1A */
219 U32 Reserved8; /* 0x1C */
220 U32 Reserved9; /* 0x20 */
221 U32 Reserved10; /* 0x24 */
222 U32 Reserved11; /* 0x28 */
223 U32 Reserved12; /* 0x2C */
224 MPI2_SGE_SIMPLE_UNION SGL; /* 0x30 */
225 } MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST,
226 MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST,
227 Mpi2ToolboxIstwiReadWriteRequest_t,
228 MPI2_POINTER pMpi2ToolboxIstwiReadWriteRequest_t;
229
230 /* values for the Action field */
231 #define MPI2_TOOL_ISTWI_ACTION_READ_DATA (0x01)
232 #define MPI2_TOOL_ISTWI_ACTION_WRITE_DATA (0x02)
233 #define MPI2_TOOL_ISTWI_ACTION_SEQUENCE (0x03)
234 #define MPI2_TOOL_ISTWI_ACTION_RESERVE_BUS (0x10)
235 #define MPI2_TOOL_ISTWI_ACTION_RELEASE_BUS (0x11)
236 #define MPI2_TOOL_ISTWI_ACTION_RESET (0x12)
237
238 /* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
239
240 /* Toolbox ISTWI Read Write Tool reply message */
241 typedef struct _MPI2_TOOLBOX_ISTWI_REPLY
242 {
243 U8 Tool; /* 0x00 */
244 U8 Reserved1; /* 0x01 */
245 U8 MsgLength; /* 0x02 */
246 U8 Function; /* 0x03 */
247 U16 Reserved2; /* 0x04 */
248 U8 Reserved3; /* 0x06 */
249 U8 MsgFlags; /* 0x07 */
250 U8 VP_ID; /* 0x08 */
251 U8 VF_ID; /* 0x09 */
252 U16 Reserved4; /* 0x0A */
253 U16 Reserved5; /* 0x0C */
254 U16 IOCStatus; /* 0x0E */
255 U32 IOCLogInfo; /* 0x10 */
256 U8 DevIndex; /* 0x14 */
257 U8 Action; /* 0x15 */
258 U8 IstwiStatus; /* 0x16 */
259 U8 Reserved6; /* 0x17 */
260 U16 TxDataCount; /* 0x18 */
261 U16 RxDataCount; /* 0x1A */
262 } MPI2_TOOLBOX_ISTWI_REPLY, MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_REPLY,
263 Mpi2ToolboxIstwiReply_t, MPI2_POINTER pMpi2ToolboxIstwiReply_t;
264
265 /****************************************************************************
266 * Toolbox Beacon Tool request
267 ****************************************************************************/
268
269 typedef struct _MPI2_TOOLBOX_BEACON_REQUEST
270 {
271 U8 Tool; /* 0x00 */
272 U8 Reserved1; /* 0x01 */
273 U8 ChainOffset; /* 0x02 */
274 U8 Function; /* 0x03 */
275 U16 Reserved2; /* 0x04 */
276 U8 Reserved3; /* 0x06 */
277 U8 MsgFlags; /* 0x07 */
278 U8 VP_ID; /* 0x08 */
279 U8 VF_ID; /* 0x09 */
280 U16 Reserved4; /* 0x0A */
281 U8 Reserved5; /* 0x0C */
282 U8 PhysicalPort; /* 0x0D */
283 U8 Reserved6; /* 0x0E */
284 U8 Flags; /* 0x0F */
285 } MPI2_TOOLBOX_BEACON_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_BEACON_REQUEST,
286 Mpi2ToolboxBeaconRequest_t, MPI2_POINTER pMpi2ToolboxBeaconRequest_t;
287
288 /* values for the Flags field */
289 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_OFF (0x00)
290 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_ON (0x01)
291
292 /****************************************************************************
293 * Toolbox Diagnostic CLI Tool
294 ****************************************************************************/
295
296 #define MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH (0x5C)
297
298 /* Toolbox Diagnostic CLI Tool request message */
299 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
300 {
301 U8 Tool; /* 0x00 */
302 U8 Reserved1; /* 0x01 */
303 U8 ChainOffset; /* 0x02 */
304 U8 Function; /* 0x03 */
305 U16 Reserved2; /* 0x04 */
306 U8 Reserved3; /* 0x06 */
307 U8 MsgFlags; /* 0x07 */
308 U8 VP_ID; /* 0x08 */
309 U8 VF_ID; /* 0x09 */
310 U16 Reserved4; /* 0x0A */
311 U8 SGLFlags; /* 0x0C */
312 U8 Reserved5; /* 0x0D */
313 U16 Reserved6; /* 0x0E */
314 U32 DataLength; /* 0x10 */
315 U8 DiagnosticCliCommand[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH]; /* 0x14 */
316 MPI2_SGE_SIMPLE_UNION SGL; /* 0x70 */
317 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST,
318 MPI2_POINTER PTR_MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST,
319 Mpi2ToolboxDiagnosticCliRequest_t,
320 MPI2_POINTER pMpi2ToolboxDiagnosticCliRequest_t;
321
322 /* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */
323
324 /* Toolbox Diagnostic CLI Tool reply message */
325 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY
326 {
327 U8 Tool; /* 0x00 */
328 U8 Reserved1; /* 0x01 */
329 U8 MsgLength; /* 0x02 */
330 U8 Function; /* 0x03 */
331 U16 Reserved2; /* 0x04 */
332 U8 Reserved3; /* 0x06 */
333 U8 MsgFlags; /* 0x07 */
334 U8 VP_ID; /* 0x08 */
335 U8 VF_ID; /* 0x09 */
336 U16 Reserved4; /* 0x0A */
337 U16 Reserved5; /* 0x0C */
338 U16 IOCStatus; /* 0x0E */
339 U32 IOCLogInfo; /* 0x10 */
340 U32 ReturnedDataLength; /* 0x14 */
341 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY,
342 MPI2_POINTER PTR_MPI2_TOOLBOX_DIAG_CLI_REPLY,
343 Mpi2ToolboxDiagnosticCliReply_t,
344 MPI2_POINTER pMpi2ToolboxDiagnosticCliReply_t;
345
346 /*****************************************************************************
347 *
348 * Diagnostic Buffer Messages
349 *
350 *****************************************************************************/
351
352 /****************************************************************************
353 * Diagnostic Buffer Post request
354 ****************************************************************************/
355
356 typedef struct _MPI2_DIAG_BUFFER_POST_REQUEST
357 {
358 U8 ExtendedType; /* 0x00 */
359 U8 BufferType; /* 0x01 */
360 U8 ChainOffset; /* 0x02 */
361 U8 Function; /* 0x03 */
362 U16 Reserved2; /* 0x04 */
363 U8 Reserved3; /* 0x06 */
364 U8 MsgFlags; /* 0x07 */
365 U8 VP_ID; /* 0x08 */
366 U8 VF_ID; /* 0x09 */
367 U16 Reserved4; /* 0x0A */
368 U64 BufferAddress; /* 0x0C */
369 U32 BufferLength; /* 0x14 */
370 U32 Reserved5; /* 0x18 */
371 U32 Reserved6; /* 0x1C */
372 U32 Flags; /* 0x20 */
373 U32 ProductSpecific[23]; /* 0x24 */
374 } MPI2_DIAG_BUFFER_POST_REQUEST, MPI2_POINTER PTR_MPI2_DIAG_BUFFER_POST_REQUEST,
375 Mpi2DiagBufferPostRequest_t, MPI2_POINTER pMpi2DiagBufferPostRequest_t;
376
377 /* values for the ExtendedType field */
378 #define MPI2_DIAG_EXTENDED_TYPE_UTILIZATION (0x02)
379
380 /* values for the BufferType field */
381 #define MPI2_DIAG_BUF_TYPE_TRACE (0x00)
382 #define MPI2_DIAG_BUF_TYPE_SNAPSHOT (0x01)
383 #define MPI2_DIAG_BUF_TYPE_EXTENDED (0x02)
384 /* count of the number of buffer types */
385 #define MPI2_DIAG_BUF_TYPE_COUNT (0x03)
386
387 /* values for the Flags field */
388 #define MPI2_DIAG_BUF_FLAG_RELEASE_ON_FULL (0x00000002)
389 #define MPI2_DIAG_BUF_FLAG_IMMEDIATE_RELEASE (0x00000001)
390
391 /****************************************************************************
392 * Diagnostic Buffer Post reply
393 ****************************************************************************/
394
395 typedef struct _MPI2_DIAG_BUFFER_POST_REPLY
396 {
397 U8 ExtendedType; /* 0x00 */
398 U8 BufferType; /* 0x01 */
399 U8 MsgLength; /* 0x02 */
400 U8 Function; /* 0x03 */
401 U16 Reserved2; /* 0x04 */
402 U8 Reserved3; /* 0x06 */
403 U8 MsgFlags; /* 0x07 */
404 U8 VP_ID; /* 0x08 */
405 U8 VF_ID; /* 0x09 */
406 U16 Reserved4; /* 0x0A */
407 U16 Reserved5; /* 0x0C */
408 U16 IOCStatus; /* 0x0E */
409 U32 IOCLogInfo; /* 0x10 */
410 U32 TransferLength; /* 0x14 */
411 } MPI2_DIAG_BUFFER_POST_REPLY, MPI2_POINTER PTR_MPI2_DIAG_BUFFER_POST_REPLY,
412 Mpi2DiagBufferPostReply_t, MPI2_POINTER pMpi2DiagBufferPostReply_t;
413
414 /****************************************************************************
415 * Diagnostic Release request
416 ****************************************************************************/
417
418 typedef struct _MPI2_DIAG_RELEASE_REQUEST
419 {
420 U8 Reserved1; /* 0x00 */
421 U8 BufferType; /* 0x01 */
422 U8 ChainOffset; /* 0x02 */
423 U8 Function; /* 0x03 */
424 U16 Reserved2; /* 0x04 */
425 U8 Reserved3; /* 0x06 */
426 U8 MsgFlags; /* 0x07 */
427 U8 VP_ID; /* 0x08 */
428 U8 VF_ID; /* 0x09 */
429 U16 Reserved4; /* 0x0A */
430 } MPI2_DIAG_RELEASE_REQUEST, MPI2_POINTER PTR_MPI2_DIAG_RELEASE_REQUEST,
431 Mpi2DiagReleaseRequest_t, MPI2_POINTER pMpi2DiagReleaseRequest_t;
432
433 /****************************************************************************
434 * Diagnostic Buffer Post reply
435 ****************************************************************************/
436
437 typedef struct _MPI2_DIAG_RELEASE_REPLY
438 {
439 U8 Reserved1; /* 0x00 */
440 U8 BufferType; /* 0x01 */
441 U8 MsgLength; /* 0x02 */
442 U8 Function; /* 0x03 */
443 U16 Reserved2; /* 0x04 */
444 U8 Reserved3; /* 0x06 */
445 U8 MsgFlags; /* 0x07 */
446 U8 VP_ID; /* 0x08 */
447 U8 VF_ID; /* 0x09 */
448 U16 Reserved4; /* 0x0A */
449 U16 Reserved5; /* 0x0C */
450 U16 IOCStatus; /* 0x0E */
451 U32 IOCLogInfo; /* 0x10 */
452 } MPI2_DIAG_RELEASE_REPLY, MPI2_POINTER PTR_MPI2_DIAG_RELEASE_REPLY,
453 Mpi2DiagReleaseReply_t, MPI2_POINTER pMpi2DiagReleaseReply_t;
454
455 #endif
Cache object: 674cfe9694e28dbde0a1a320ded2962f
|