xref: /onnv-gate/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mpi/mpi2_tool.h (revision 11194:e429b4b36c3c)
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 to 2009, LSI Corporation.
24  * All rights reserved.
25  *
26  * Redistribution and use in source and binary forms of all code within
27  * this file that is exclusively owned by LSI, with or without
28  * modification, is permitted provided that, in addition to the CDDL 1.0
29  * License requirements, the following conditions are met:
30  *
31  *    Neither the name of the author nor the names of its contributors may be
32  *    used to endorse or promote products derived from this software without
33  *    specific prior written permission.
34  *
35  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
38  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
39  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
40  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
41  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
42  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
43  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
46  * DAMAGE.
47  */
48 
49 /*
50  *           Name:  mpi2_tool.h
51  *          Title:  MPI diagnostic tool structures and definitions
52  *  Creation Date:  March 26, 2007
53  *
54  *    mpi2_tool.h Version:  02.00.04
55  *
56  *  Version History
57  *  ---------------
58  *
59  *  Date      Version   Description
60  *  --------  --------  ------------------------------------------------------
61  *  04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
62  *  12-18-07  02.00.01  Added Diagnostic Buffer Post and Diagnostic Release
63  *                      structures and defines.
64  *  02-29-08  02.00.02  Modified various names to make them 32-character unique.
65  *  05-06-09  02.00.03  Added ISTWI Read Write Tool and Diagnostic CLI Tool.
66  *  07-30-09  02.00.04  Added ExtendedType field to DiagnosticBufferPost request
67  *                      and reply messages.
68  *                      Added MPI2_DIAG_BUF_TYPE_EXTENDED.
69  *                      Incremented MPI2_DIAG_BUF_TYPE_COUNT.
70  *  --------------------------------------------------------------------------
71  */
72 
73 #ifndef MPI2_TOOL_H
74 #define MPI2_TOOL_H
75 
76 /*****************************************************************************
77 *
78 *               Toolbox Messages
79 *
80 *****************************************************************************/
81 
82 /* defines for the Tools */
83 #define MPI2_TOOLBOX_CLEAN_TOOL                     (0x00)
84 #define MPI2_TOOLBOX_MEMORY_MOVE_TOOL               (0x01)
85 #define MPI2_TOOLBOX_ISTWI_READ_WRITE_TOOL          (0x03)
86 #define MPI2_TOOLBOX_BEACON_TOOL                    (0x05)
87 #define MPI2_TOOLBOX_DIAGNOSTIC_CLI_TOOL            (0x06)
88 
89 
90 /****************************************************************************
91 *  Toolbox reply
92 ****************************************************************************/
93 
94 typedef struct _MPI2_TOOLBOX_REPLY
95 {
96     U8                      Tool;                       /* 0x00 */
97     U8                      Reserved1;                  /* 0x01 */
98     U8                      MsgLength;                  /* 0x02 */
99     U8                      Function;                   /* 0x03 */
100     U16                     Reserved2;                  /* 0x04 */
101     U8                      Reserved3;                  /* 0x06 */
102     U8                      MsgFlags;                   /* 0x07 */
103     U8                      VP_ID;                      /* 0x08 */
104     U8                      VF_ID;                      /* 0x09 */
105     U16                     Reserved4;                  /* 0x0A */
106     U16                     Reserved5;                  /* 0x0C */
107     U16                     IOCStatus;                  /* 0x0E */
108     U32                     IOCLogInfo;                 /* 0x10 */
109 } MPI2_TOOLBOX_REPLY, MPI2_POINTER PTR_MPI2_TOOLBOX_REPLY,
110   Mpi2ToolboxReply_t, MPI2_POINTER pMpi2ToolboxReply_t;
111 
112 
113 /****************************************************************************
114 *  Toolbox Clean Tool request
115 ****************************************************************************/
116 
117 typedef struct _MPI2_TOOLBOX_CLEAN_REQUEST
118 {
119     U8                      Tool;                       /* 0x00 */
120     U8                      Reserved1;                  /* 0x01 */
121     U8                      ChainOffset;                /* 0x02 */
122     U8                      Function;                   /* 0x03 */
123     U16                     Reserved2;                  /* 0x04 */
124     U8                      Reserved3;                  /* 0x06 */
125     U8                      MsgFlags;                   /* 0x07 */
126     U8                      VP_ID;                      /* 0x08 */
127     U8                      VF_ID;                      /* 0x09 */
128     U16                     Reserved4;                  /* 0x0A */
129     U32                     Flags;                      /* 0x0C */
130    } MPI2_TOOLBOX_CLEAN_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_CLEAN_REQUEST,
131   Mpi2ToolboxCleanRequest_t, MPI2_POINTER pMpi2ToolboxCleanRequest_t;
132 
133 /* values for the Flags field */
134 #define MPI2_TOOLBOX_CLEAN_BOOT_SERVICES            (0x80000000)
135 #define MPI2_TOOLBOX_CLEAN_PERSIST_MANUFACT_PAGES   (0x40000000)
136 #define MPI2_TOOLBOX_CLEAN_OTHER_PERSIST_PAGES      (0x20000000)
137 #define MPI2_TOOLBOX_CLEAN_FW_CURRENT               (0x10000000)
138 #define MPI2_TOOLBOX_CLEAN_FW_BACKUP                (0x08000000)
139 #define MPI2_TOOLBOX_CLEAN_MEGARAID                 (0x02000000)
140 #define MPI2_TOOLBOX_CLEAN_INITIALIZATION           (0x01000000)
141 #define MPI2_TOOLBOX_CLEAN_FLASH                    (0x00000004)
142 #define MPI2_TOOLBOX_CLEAN_SEEPROM                  (0x00000002)
143 #define MPI2_TOOLBOX_CLEAN_NVSRAM                   (0x00000001)
144 
145 
146 /****************************************************************************
147 *  Toolbox Memory Move request
148 ****************************************************************************/
149 
150 typedef struct _MPI2_TOOLBOX_MEM_MOVE_REQUEST
151 {
152     U8                      Tool;                       /* 0x00 */
153     U8                      Reserved1;                  /* 0x01 */
154     U8                      ChainOffset;                /* 0x02 */
155     U8                      Function;                   /* 0x03 */
156     U16                     Reserved2;                  /* 0x04 */
157     U8                      Reserved3;                  /* 0x06 */
158     U8                      MsgFlags;                   /* 0x07 */
159     U8                      VP_ID;                      /* 0x08 */
160     U8                      VF_ID;                      /* 0x09 */
161     U16                     Reserved4;                  /* 0x0A */
162     MPI2_SGE_SIMPLE_UNION   SGL;                        /* 0x0C */
163 } MPI2_TOOLBOX_MEM_MOVE_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_MEM_MOVE_REQUEST,
164   Mpi2ToolboxMemMoveRequest_t, MPI2_POINTER pMpi2ToolboxMemMoveRequest_t;
165 
166 
167 /****************************************************************************
168 *  Toolbox ISTWI Read Write Tool
169 ****************************************************************************/
170 
171 /* Toolbox ISTWI Read Write Tool request message */
172 typedef struct _MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST
173 {
174     U8                      Tool;                       /* 0x00 */
175     U8                      Reserved1;                  /* 0x01 */
176     U8                      ChainOffset;                /* 0x02 */
177     U8                      Function;                   /* 0x03 */
178     U16                     Reserved2;                  /* 0x04 */
179     U8                      Reserved3;                  /* 0x06 */
180     U8                      MsgFlags;                   /* 0x07 */
181     U8                      VP_ID;                      /* 0x08 */
182     U8                      VF_ID;                      /* 0x09 */
183     U16                     Reserved4;                  /* 0x0A */
184     U32                     Reserved5;                  /* 0x0C */
185     U32                     Reserved6;                  /* 0x10 */
186     U8                      DevIndex;                   /* 0x14 */
187     U8                      Action;                     /* 0x15 */
188     U8                      SGLFlags;                   /* 0x16 */
189     U8                      Reserved7;                  /* 0x17 */
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   MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST,
200   Mpi2ToolboxIstwiReadWriteRequest_t,
201   MPI2_POINTER pMpi2ToolboxIstwiReadWriteRequest_t;
202 
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)
210 
211 /* values for SGLFlags field are in the SGL section of mpi2.h */
212 
213 
214 /* Toolbox ISTWI Read Write Tool reply message */
215 typedef struct _MPI2_TOOLBOX_ISTWI_REPLY
216 {
217     U8                      Tool;                       /* 0x00 */
218     U8                      Reserved1;                  /* 0x01 */
219     U8                      MsgLength;                  /* 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     U16                     Reserved5;                  /* 0x0C */
228     U16                     IOCStatus;                  /* 0x0E */
229     U32                     IOCLogInfo;                 /* 0x10 */
230     U8                      DevIndex;                   /* 0x14 */
231     U8                      Action;                     /* 0x15 */
232     U8                      IstwiStatus;                /* 0x16 */
233     U8                      Reserved6;                  /* 0x17 */
234     U16                     TxDataCount;                /* 0x18 */
235     U16                     RxDataCount;                /* 0x1A */
236 } MPI2_TOOLBOX_ISTWI_REPLY, MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_REPLY,
237   Mpi2ToolboxIstwiReply_t, MPI2_POINTER pMpi2ToolboxIstwiReply_t;
238 
239 
240 /****************************************************************************
241 *  Toolbox Beacon Tool request
242 ****************************************************************************/
243 
244 typedef struct _MPI2_TOOLBOX_BEACON_REQUEST
245 {
246     U8                      Tool;                       /* 0x00 */
247     U8                      Reserved1;                  /* 0x01 */
248     U8                      ChainOffset;                /* 0x02 */
249     U8                      Function;                   /* 0x03 */
250     U16                     Reserved2;                  /* 0x04 */
251     U8                      Reserved3;                  /* 0x06 */
252     U8                      MsgFlags;                   /* 0x07 */
253     U8                      VP_ID;                      /* 0x08 */
254     U8                      VF_ID;                      /* 0x09 */
255     U16                     Reserved4;                  /* 0x0A */
256     U8                      Reserved5;                  /* 0x0C */
257     U8                      PhysicalPort;               /* 0x0D */
258     U8                      Reserved6;                  /* 0x0E */
259     U8                      Flags;                      /* 0x0F */
260 } MPI2_TOOLBOX_BEACON_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_BEACON_REQUEST,
261   Mpi2ToolboxBeaconRequest_t, MPI2_POINTER pMpi2ToolboxBeaconRequest_t;
262 
263 /* values for the Flags field */
264 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_OFF       (0x00)
265 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_ON        (0x01)
266 
267 
268 /****************************************************************************
269 *  Toolbox Diagnostic CLI Tool
270 ****************************************************************************/
271 
272 #define MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH    (0x5C)
273 
274 /* Toolbox Diagnostic CLI Tool request message */
275 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST
276 {
277     U8                      Tool;                       /* 0x00 */
278     U8                      Reserved1;                  /* 0x01 */
279     U8                      ChainOffset;                /* 0x02 */
280     U8                      Function;                   /* 0x03 */
281     U16                     Reserved2;                  /* 0x04 */
282     U8                      Reserved3;                  /* 0x06 */
283     U8                      MsgFlags;                   /* 0x07 */
284     U8                      VP_ID;                      /* 0x08 */
285     U8                      VF_ID;                      /* 0x09 */
286     U16                     Reserved4;                  /* 0x0A */
287     U8                      SGLFlags;                   /* 0x0C */
288     U8                      Reserved5;                  /* 0x0D */
289     U16                     Reserved6;                  /* 0x0E */
290     U32                     DataLength;                 /* 0x10 */
291     U8                      DiagnosticCliCommand[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH]; /* 0x14 */
292     MPI2_SGE_SIMPLE_UNION   SGL;                        /* 0x70 */
293 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST,
294   MPI2_POINTER PTR_MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST,
295   Mpi2ToolboxDiagnosticCliRequest_t,
296   MPI2_POINTER pMpi2ToolboxDiagnosticCliRequest_t;
297 
298 /* values for SGLFlags field are in the SGL section of mpi2.h */
299 
300 
301 /* Toolbox Diagnostic CLI Tool reply message */
302 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY
303 {
304     U8                      Tool;                       /* 0x00 */
305     U8                      Reserved1;                  /* 0x01 */
306     U8                      MsgLength;                  /* 0x02 */
307     U8                      Function;                   /* 0x03 */
308     U16                     Reserved2;                  /* 0x04 */
309     U8                      Reserved3;                  /* 0x06 */
310     U8                      MsgFlags;                   /* 0x07 */
311     U8                      VP_ID;                      /* 0x08 */
312     U8                      VF_ID;                      /* 0x09 */
313     U16                     Reserved4;                  /* 0x0A */
314     U16                     Reserved5;                  /* 0x0C */
315     U16                     IOCStatus;                  /* 0x0E */
316     U32                     IOCLogInfo;                 /* 0x10 */
317     U32                     ReturnedDataLength;         /* 0x14 */
318 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY,
319   MPI2_POINTER PTR_MPI2_TOOLBOX_DIAG_CLI_REPLY,
320   Mpi2ToolboxDiagnosticCliReply_t,
321   MPI2_POINTER pMpi2ToolboxDiagnosticCliReply_t;
322 
323 
324 /*****************************************************************************
325 *
326 *       Diagnostic Buffer Messages
327 *
328 *****************************************************************************/
329 
330 
331 /****************************************************************************
332 *  Diagnostic Buffer Post request
333 ****************************************************************************/
334 
335 typedef struct _MPI2_DIAG_BUFFER_POST_REQUEST
336 {
337     U8                      ExtendedType;               /* 0x00 */
338     U8                      BufferType;                 /* 0x01 */
339     U8                      ChainOffset;                /* 0x02 */
340     U8                      Function;                   /* 0x03 */
341     U16                     Reserved2;                  /* 0x04 */
342     U8                      Reserved3;                  /* 0x06 */
343     U8                      MsgFlags;                   /* 0x07 */
344     U8                      VP_ID;                      /* 0x08 */
345     U8                      VF_ID;                      /* 0x09 */
346     U16                     Reserved4;                  /* 0x0A */
347     U64                     BufferAddress;              /* 0x0C */
348     U32                     BufferLength;               /* 0x14 */
349     U32                     Reserved5;                  /* 0x18 */
350     U32                     Reserved6;                  /* 0x1C */
351     U32                     Flags;                      /* 0x20 */
352     U32                     ProductSpecific[23];        /* 0x24 */
353 } MPI2_DIAG_BUFFER_POST_REQUEST, MPI2_POINTER PTR_MPI2_DIAG_BUFFER_POST_REQUEST,
354   Mpi2DiagBufferPostRequest_t, MPI2_POINTER pMpi2DiagBufferPostRequest_t;
355 
356 /* values for the ExtendedType field */
357 #define MPI2_DIAG_EXTENDED_TYPE_UTILIZATION         (0x02)
358 
359 /* values for the BufferType field */
360 #define MPI2_DIAG_BUF_TYPE_TRACE                    (0x00)
361 #define MPI2_DIAG_BUF_TYPE_SNAPSHOT                 (0x01)
362 #define MPI2_DIAG_BUF_TYPE_EXTENDED                 (0x02)
363 /* count of the number of buffer types */
364 #define MPI2_DIAG_BUF_TYPE_COUNT                    (0x03)
365 
366 
367 /****************************************************************************
368 *  Diagnostic Buffer Post reply
369 ****************************************************************************/
370 
371 typedef struct _MPI2_DIAG_BUFFER_POST_REPLY
372 {
373     U8                      ExtendedType;               /* 0x00 */
374     U8                      BufferType;                 /* 0x01 */
375     U8                      MsgLength;                  /* 0x02 */
376     U8                      Function;                   /* 0x03 */
377     U16                     Reserved2;                  /* 0x04 */
378     U8                      Reserved3;                  /* 0x06 */
379     U8                      MsgFlags;                   /* 0x07 */
380     U8                      VP_ID;                      /* 0x08 */
381     U8                      VF_ID;                      /* 0x09 */
382     U16                     Reserved4;                  /* 0x0A */
383     U16                     Reserved5;                  /* 0x0C */
384     U16                     IOCStatus;                  /* 0x0E */
385     U32                     IOCLogInfo;                 /* 0x10 */
386     U32                     TransferLength;             /* 0x14 */
387 } MPI2_DIAG_BUFFER_POST_REPLY, MPI2_POINTER PTR_MPI2_DIAG_BUFFER_POST_REPLY,
388   Mpi2DiagBufferPostReply_t, MPI2_POINTER pMpi2DiagBufferPostReply_t;
389 
390 
391 /****************************************************************************
392 *  Diagnostic Release request
393 ****************************************************************************/
394 
395 typedef struct _MPI2_DIAG_RELEASE_REQUEST
396 {
397     U8                      Reserved1;                  /* 0x00 */
398     U8                      BufferType;                 /* 0x01 */
399     U8                      ChainOffset;                /* 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 } MPI2_DIAG_RELEASE_REQUEST, MPI2_POINTER PTR_MPI2_DIAG_RELEASE_REQUEST,
408   Mpi2DiagReleaseRequest_t, MPI2_POINTER pMpi2DiagReleaseRequest_t;
409 
410 
411 /****************************************************************************
412 *  Diagnostic Buffer Post reply
413 ****************************************************************************/
414 
415 typedef struct _MPI2_DIAG_RELEASE_REPLY
416 {
417     U8                      Reserved1;                  /* 0x00 */
418     U8                      BufferType;                 /* 0x01 */
419     U8                      MsgLength;                  /* 0x02 */
420     U8                      Function;                   /* 0x03 */
421     U16                     Reserved2;                  /* 0x04 */
422     U8                      Reserved3;                  /* 0x06 */
423     U8                      MsgFlags;                   /* 0x07 */
424     U8                      VP_ID;                      /* 0x08 */
425     U8                      VF_ID;                      /* 0x09 */
426     U16                     Reserved4;                  /* 0x0A */
427     U16                     Reserved5;                  /* 0x0C */
428     U16                     IOCStatus;                  /* 0x0E */
429     U32                     IOCLogInfo;                 /* 0x10 */
430 } MPI2_DIAG_RELEASE_REPLY, MPI2_POINTER PTR_MPI2_DIAG_RELEASE_REPLY,
431   Mpi2DiagReleaseReply_t, MPI2_POINTER pMpi2DiagReleaseReply_t;
432 
433 
434 #endif
435 
436