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