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 /**************************************************************************** 84 * Toolbox reply 85 ****************************************************************************/ 86 87 typedef struct _MPI2_TOOLBOX_REPLY 88 { 89 U8 Tool; /* 0x00 */ 90 U8 Reserved1; /* 0x01 */ 91 U8 MsgLength; /* 0x02 */ 92 U8 Function; /* 0x03 */ 93 U16 Reserved2; /* 0x04 */ 94 U8 Reserved3; /* 0x06 */ 95 U8 MsgFlags; /* 0x07 */ 96 U8 VP_ID; /* 0x08 */ 97 U8 VF_ID; /* 0x09 */ 98 U16 Reserved4; /* 0x0A */ 99 U16 Reserved5; /* 0x0C */ 100 U16 IOCStatus; /* 0x0E */ 101 U32 IOCLogInfo; /* 0x10 */ 102 } MPI2_TOOLBOX_REPLY, MPI2_POINTER PTR_MPI2_TOOLBOX_REPLY, 103 Mpi2ToolboxReply_t, MPI2_POINTER pMpi2ToolboxReply_t; 104 105 106 /**************************************************************************** 107 * Toolbox Clean Tool request 108 ****************************************************************************/ 109 110 typedef struct _MPI2_TOOLBOX_CLEAN_REQUEST 111 { 112 U8 Tool; /* 0x00 */ 113 U8 Reserved1; /* 0x01 */ 114 U8 ChainOffset; /* 0x02 */ 115 U8 Function; /* 0x03 */ 116 U16 Reserved2; /* 0x04 */ 117 U8 Reserved3; /* 0x06 */ 118 U8 MsgFlags; /* 0x07 */ 119 U8 VP_ID; /* 0x08 */ 120 U8 VF_ID; /* 0x09 */ 121 U16 Reserved4; /* 0x0A */ 122 U32 Flags; /* 0x0C */ 123 } MPI2_TOOLBOX_CLEAN_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_CLEAN_REQUEST, 124 Mpi2ToolboxCleanRequest_t, MPI2_POINTER pMpi2ToolboxCleanRequest_t; 125 126 /* values for the Flags field */ 127 #define MPI2_TOOLBOX_CLEAN_BOOT_SERVICES (0x80000000) 128 #define MPI2_TOOLBOX_CLEAN_PERSIST_MANUFACT_PAGES (0x40000000) 129 #define MPI2_TOOLBOX_CLEAN_OTHER_PERSIST_PAGES (0x20000000) 130 #define MPI2_TOOLBOX_CLEAN_FW_CURRENT (0x10000000) 131 #define MPI2_TOOLBOX_CLEAN_FW_BACKUP (0x08000000) 132 #define MPI2_TOOLBOX_CLEAN_MEGARAID (0x02000000) 133 #define MPI2_TOOLBOX_CLEAN_INITIALIZATION (0x01000000) 134 #define MPI2_TOOLBOX_CLEAN_FLASH (0x00000004) 135 #define MPI2_TOOLBOX_CLEAN_SEEPROM (0x00000002) 136 #define MPI2_TOOLBOX_CLEAN_NVSRAM (0x00000001) 137 138 139 /**************************************************************************** 140 * Toolbox Memory Move request 141 ****************************************************************************/ 142 143 typedef struct _MPI2_TOOLBOX_MEM_MOVE_REQUEST 144 { 145 U8 Tool; /* 0x00 */ 146 U8 Reserved1; /* 0x01 */ 147 U8 ChainOffset; /* 0x02 */ 148 U8 Function; /* 0x03 */ 149 U16 Reserved2; /* 0x04 */ 150 U8 Reserved3; /* 0x06 */ 151 U8 MsgFlags; /* 0x07 */ 152 U8 VP_ID; /* 0x08 */ 153 U8 VF_ID; /* 0x09 */ 154 U16 Reserved4; /* 0x0A */ 155 MPI2_SGE_SIMPLE_UNION SGL; /* 0x0C */ 156 } MPI2_TOOLBOX_MEM_MOVE_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_MEM_MOVE_REQUEST, 157 Mpi2ToolboxMemMoveRequest_t, MPI2_POINTER pMpi2ToolboxMemMoveRequest_t; 158 159 160 /**************************************************************************** 161 * Toolbox Diagnostic Data Upload request 162 ****************************************************************************/ 163 164 typedef struct _MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST 165 { 166 U8 Tool; /* 0x00 */ 167 U8 Reserved1; /* 0x01 */ 168 U8 ChainOffset; /* 0x02 */ 169 U8 Function; /* 0x03 */ 170 U16 Reserved2; /* 0x04 */ 171 U8 Reserved3; /* 0x06 */ 172 U8 MsgFlags; /* 0x07 */ 173 U8 VP_ID; /* 0x08 */ 174 U8 VF_ID; /* 0x09 */ 175 U16 Reserved4; /* 0x0A */ 176 U8 SGLFlags; /* 0x0C */ 177 U8 Reserved5; /* 0x0D */ 178 U16 Reserved6; /* 0x0E */ 179 U32 Flags; /* 0x10 */ 180 U32 DataLength; /* 0x14 */ 181 MPI2_SGE_SIMPLE_UNION SGL; /* 0x18 */ 182 } MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST, 183 MPI2_POINTER PTR_MPI2_TOOLBOX_DIAG_DATA_UPLOAD_REQUEST, 184 Mpi2ToolboxDiagDataUploadRequest_t, 185 MPI2_POINTER pMpi2ToolboxDiagDataUploadRequest_t; 186 187 /* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */ 188 189 190 typedef struct _MPI2_DIAG_DATA_UPLOAD_HEADER 191 { 192 U32 DiagDataLength; /* 00h */ 193 U8 FormatCode; /* 04h */ 194 U8 Reserved1; /* 05h */ 195 U16 Reserved2; /* 06h */ 196 } MPI2_DIAG_DATA_UPLOAD_HEADER, MPI2_POINTER PTR_MPI2_DIAG_DATA_UPLOAD_HEADER, 197 Mpi2DiagDataUploadHeader_t, MPI2_POINTER pMpi2DiagDataUploadHeader_t; 198 199 200 /**************************************************************************** 201 * Toolbox ISTWI Read Write Tool 202 ****************************************************************************/ 203 204 /* Toolbox ISTWI Read Write Tool request message */ 205 typedef struct _MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST 206 { 207 U8 Tool; /* 0x00 */ 208 U8 Reserved1; /* 0x01 */ 209 U8 ChainOffset; /* 0x02 */ 210 U8 Function; /* 0x03 */ 211 U16 Reserved2; /* 0x04 */ 212 U8 Reserved3; /* 0x06 */ 213 U8 MsgFlags; /* 0x07 */ 214 U8 VP_ID; /* 0x08 */ 215 U8 VF_ID; /* 0x09 */ 216 U16 Reserved4; /* 0x0A */ 217 U32 Reserved5; /* 0x0C */ 218 U32 Reserved6; /* 0x10 */ 219 U8 DevIndex; /* 0x14 */ 220 U8 Action; /* 0x15 */ 221 U8 SGLFlags; /* 0x16 */ 222 U8 Reserved7; /* 0x17 */ 223 U16 TxDataLength; /* 0x18 */ 224 U16 RxDataLength; /* 0x1A */ 225 U32 Reserved8; /* 0x1C */ 226 U32 Reserved9; /* 0x20 */ 227 U32 Reserved10; /* 0x24 */ 228 U32 Reserved11; /* 0x28 */ 229 U32 Reserved12; /* 0x2C */ 230 MPI2_SGE_SIMPLE_UNION SGL; /* 0x30 */ 231 } MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST, 232 MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_READ_WRITE_REQUEST, 233 Mpi2ToolboxIstwiReadWriteRequest_t, 234 MPI2_POINTER pMpi2ToolboxIstwiReadWriteRequest_t; 235 236 /* values for the Action field */ 237 #define MPI2_TOOL_ISTWI_ACTION_READ_DATA (0x01) 238 #define MPI2_TOOL_ISTWI_ACTION_WRITE_DATA (0x02) 239 #define MPI2_TOOL_ISTWI_ACTION_SEQUENCE (0x03) 240 #define MPI2_TOOL_ISTWI_ACTION_RESERVE_BUS (0x10) 241 #define MPI2_TOOL_ISTWI_ACTION_RELEASE_BUS (0x11) 242 #define MPI2_TOOL_ISTWI_ACTION_RESET (0x12) 243 244 /* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */ 245 246 247 /* Toolbox ISTWI Read Write Tool reply message */ 248 typedef struct _MPI2_TOOLBOX_ISTWI_REPLY 249 { 250 U8 Tool; /* 0x00 */ 251 U8 Reserved1; /* 0x01 */ 252 U8 MsgLength; /* 0x02 */ 253 U8 Function; /* 0x03 */ 254 U16 Reserved2; /* 0x04 */ 255 U8 Reserved3; /* 0x06 */ 256 U8 MsgFlags; /* 0x07 */ 257 U8 VP_ID; /* 0x08 */ 258 U8 VF_ID; /* 0x09 */ 259 U16 Reserved4; /* 0x0A */ 260 U16 Reserved5; /* 0x0C */ 261 U16 IOCStatus; /* 0x0E */ 262 U32 IOCLogInfo; /* 0x10 */ 263 U8 DevIndex; /* 0x14 */ 264 U8 Action; /* 0x15 */ 265 U8 IstwiStatus; /* 0x16 */ 266 U8 Reserved6; /* 0x17 */ 267 U16 TxDataCount; /* 0x18 */ 268 U16 RxDataCount; /* 0x1A */ 269 } MPI2_TOOLBOX_ISTWI_REPLY, MPI2_POINTER PTR_MPI2_TOOLBOX_ISTWI_REPLY, 270 Mpi2ToolboxIstwiReply_t, MPI2_POINTER pMpi2ToolboxIstwiReply_t; 271 272 273 /**************************************************************************** 274 * Toolbox Beacon Tool request 275 ****************************************************************************/ 276 277 typedef struct _MPI2_TOOLBOX_BEACON_REQUEST 278 { 279 U8 Tool; /* 0x00 */ 280 U8 Reserved1; /* 0x01 */ 281 U8 ChainOffset; /* 0x02 */ 282 U8 Function; /* 0x03 */ 283 U16 Reserved2; /* 0x04 */ 284 U8 Reserved3; /* 0x06 */ 285 U8 MsgFlags; /* 0x07 */ 286 U8 VP_ID; /* 0x08 */ 287 U8 VF_ID; /* 0x09 */ 288 U16 Reserved4; /* 0x0A */ 289 U8 Reserved5; /* 0x0C */ 290 U8 PhysicalPort; /* 0x0D */ 291 U8 Reserved6; /* 0x0E */ 292 U8 Flags; /* 0x0F */ 293 } MPI2_TOOLBOX_BEACON_REQUEST, MPI2_POINTER PTR_MPI2_TOOLBOX_BEACON_REQUEST, 294 Mpi2ToolboxBeaconRequest_t, MPI2_POINTER pMpi2ToolboxBeaconRequest_t; 295 296 /* values for the Flags field */ 297 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_OFF (0x00) 298 #define MPI2_TOOLBOX_FLAGS_BEACONMODE_ON (0x01) 299 300 301 /**************************************************************************** 302 * Toolbox Diagnostic CLI Tool 303 ****************************************************************************/ 304 305 #define MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH (0x5C) 306 307 /* Toolbox Diagnostic CLI Tool request message */ 308 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST 309 { 310 U8 Tool; /* 0x00 */ 311 U8 Reserved1; /* 0x01 */ 312 U8 ChainOffset; /* 0x02 */ 313 U8 Function; /* 0x03 */ 314 U16 Reserved2; /* 0x04 */ 315 U8 Reserved3; /* 0x06 */ 316 U8 MsgFlags; /* 0x07 */ 317 U8 VP_ID; /* 0x08 */ 318 U8 VF_ID; /* 0x09 */ 319 U16 Reserved4; /* 0x0A */ 320 U8 SGLFlags; /* 0x0C */ 321 U8 Reserved5; /* 0x0D */ 322 U16 Reserved6; /* 0x0E */ 323 U32 DataLength; /* 0x10 */ 324 U8 DiagnosticCliCommand[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH]; /* 0x14 */ 325 MPI2_SGE_SIMPLE_UNION SGL; /* 0x70 */ 326 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, 327 MPI2_POINTER PTR_MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, 328 Mpi2ToolboxDiagnosticCliRequest_t, 329 MPI2_POINTER pMpi2ToolboxDiagnosticCliRequest_t; 330 331 /* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */ 332 333 334 /* Toolbox Diagnostic CLI Tool reply message */ 335 typedef struct _MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY 336 { 337 U8 Tool; /* 0x00 */ 338 U8 Reserved1; /* 0x01 */ 339 U8 MsgLength; /* 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 U16 Reserved5; /* 0x0C */ 348 U16 IOCStatus; /* 0x0E */ 349 U32 IOCLogInfo; /* 0x10 */ 350 U32 ReturnedDataLength; /* 0x14 */ 351 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REPLY, 352 MPI2_POINTER PTR_MPI2_TOOLBOX_DIAG_CLI_REPLY, 353 Mpi2ToolboxDiagnosticCliReply_t, 354 MPI2_POINTER pMpi2ToolboxDiagnosticCliReply_t; 355 356 357 /***************************************************************************** 358 * 359 * Diagnostic Buffer Messages 360 * 361 *****************************************************************************/ 362 363 364 /**************************************************************************** 365 * Diagnostic Buffer Post request 366 ****************************************************************************/ 367 368 typedef struct _MPI2_DIAG_BUFFER_POST_REQUEST 369 { 370 U8 ExtendedType; /* 0x00 */ 371 U8 BufferType; /* 0x01 */ 372 U8 ChainOffset; /* 0x02 */ 373 U8 Function; /* 0x03 */ 374 U16 Reserved2; /* 0x04 */ 375 U8 Reserved3; /* 0x06 */ 376 U8 MsgFlags; /* 0x07 */ 377 U8 VP_ID; /* 0x08 */ 378 U8 VF_ID; /* 0x09 */ 379 U16 Reserved4; /* 0x0A */ 380 U64 BufferAddress; /* 0x0C */ 381 U32 BufferLength; /* 0x14 */ 382 U32 Reserved5; /* 0x18 */ 383 U32 Reserved6; /* 0x1C */ 384 U32 Flags; /* 0x20 */ 385 U32 ProductSpecific[23]; /* 0x24 */ 386 } MPI2_DIAG_BUFFER_POST_REQUEST, MPI2_POINTER PTR_MPI2_DIAG_BUFFER_POST_REQUEST, 387 Mpi2DiagBufferPostRequest_t, MPI2_POINTER pMpi2DiagBufferPostRequest_t; 388 389 /* values for the ExtendedType field */ 390 #define MPI2_DIAG_EXTENDED_TYPE_UTILIZATION (0x02) 391 392 /* values for the BufferType field */ 393 #define MPI2_DIAG_BUF_TYPE_TRACE (0x00) 394 #define MPI2_DIAG_BUF_TYPE_SNAPSHOT (0x01) 395 #define MPI2_DIAG_BUF_TYPE_EXTENDED (0x02) 396 /* count of the number of buffer types */ 397 #define MPI2_DIAG_BUF_TYPE_COUNT (0x03) 398 399 /* values for the Flags field */ 400 #define MPI2_DIAG_BUF_FLAG_RELEASE_ON_FULL (0x00000002) 401 #define MPI2_DIAG_BUF_FLAG_IMMEDIATE_RELEASE (0x00000001) 402 403 404 /**************************************************************************** 405 * Diagnostic Buffer Post reply 406 ****************************************************************************/ 407 408 typedef struct _MPI2_DIAG_BUFFER_POST_REPLY 409 { 410 U8 ExtendedType; /* 0x00 */ 411 U8 BufferType; /* 0x01 */ 412 U8 MsgLength; /* 0x02 */ 413 U8 Function; /* 0x03 */ 414 U16 Reserved2; /* 0x04 */ 415 U8 Reserved3; /* 0x06 */ 416 U8 MsgFlags; /* 0x07 */ 417 U8 VP_ID; /* 0x08 */ 418 U8 VF_ID; /* 0x09 */ 419 U16 Reserved4; /* 0x0A */ 420 U16 Reserved5; /* 0x0C */ 421 U16 IOCStatus; /* 0x0E */ 422 U32 IOCLogInfo; /* 0x10 */ 423 U32 TransferLength; /* 0x14 */ 424 } MPI2_DIAG_BUFFER_POST_REPLY, MPI2_POINTER PTR_MPI2_DIAG_BUFFER_POST_REPLY, 425 Mpi2DiagBufferPostReply_t, MPI2_POINTER pMpi2DiagBufferPostReply_t; 426 427 428 /**************************************************************************** 429 * Diagnostic Release request 430 ****************************************************************************/ 431 432 typedef struct _MPI2_DIAG_RELEASE_REQUEST 433 { 434 U8 Reserved1; /* 0x00 */ 435 U8 BufferType; /* 0x01 */ 436 U8 ChainOffset; /* 0x02 */ 437 U8 Function; /* 0x03 */ 438 U16 Reserved2; /* 0x04 */ 439 U8 Reserved3; /* 0x06 */ 440 U8 MsgFlags; /* 0x07 */ 441 U8 VP_ID; /* 0x08 */ 442 U8 VF_ID; /* 0x09 */ 443 U16 Reserved4; /* 0x0A */ 444 } MPI2_DIAG_RELEASE_REQUEST, MPI2_POINTER PTR_MPI2_DIAG_RELEASE_REQUEST, 445 Mpi2DiagReleaseRequest_t, MPI2_POINTER pMpi2DiagReleaseRequest_t; 446 447 448 /**************************************************************************** 449 * Diagnostic Buffer Post reply 450 ****************************************************************************/ 451 452 typedef struct _MPI2_DIAG_RELEASE_REPLY 453 { 454 U8 Reserved1; /* 0x00 */ 455 U8 BufferType; /* 0x01 */ 456 U8 MsgLength; /* 0x02 */ 457 U8 Function; /* 0x03 */ 458 U16 Reserved2; /* 0x04 */ 459 U8 Reserved3; /* 0x06 */ 460 U8 MsgFlags; /* 0x07 */ 461 U8 VP_ID; /* 0x08 */ 462 U8 VF_ID; /* 0x09 */ 463 U16 Reserved4; /* 0x0A */ 464 U16 Reserved5; /* 0x0C */ 465 U16 IOCStatus; /* 0x0E */ 466 U32 IOCLogInfo; /* 0x10 */ 467 } MPI2_DIAG_RELEASE_REPLY, MPI2_POINTER PTR_MPI2_DIAG_RELEASE_REPLY, 468 Mpi2DiagReleaseReply_t, MPI2_POINTER pMpi2DiagReleaseReply_t; 469 470 471 #endif 472 473