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 /* Copyright 2009 QLogic Corporation */ 23 24 /* 25 * File Name: exioct.h 26 * 27 * San/Device Management Ioctl Header 28 * File is created to adhere to Solaris requirement using 8-space tabs. 29 * 30 * !!!!! PLEASE DO NOT REMOVE THE TABS !!!!! 31 * !!!!! PLEASE NO SINGLE LINE COMMENTS: // !!!!! 32 * !!!!! PLEASE NO MORE THAN 80 CHARS PER LINE !!!!! 33 * 34 * *********************************************************************** 35 * * ** 36 * * NOTICE ** 37 * * COPYRIGHT (C) 2000-2009 QLOGIC CORPORATION ** 38 * * ALL RIGHTS RESERVED ** 39 * * ** 40 * *********************************************************************** 41 */ 42 43 #ifndef _EXIOCT_H 44 #define _EXIOCT_H 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 #include <exioctso.h> 51 52 /* 53 * NOTE: the following version defines must be updated each time the 54 * changes made may affect the backward compatibility of the 55 * input/output relations of the SDM IOCTL functions. 56 */ 57 #define EXT_VERSION 5 58 59 /* 60 * OS independent General definitions 61 */ 62 #define EXT_DEF_SIGNATURE_SIZE 8 63 #define EXT_DEF_WWN_NAME_SIZE 8 64 #define EXT_DEF_WWP_NAME_SIZE 8 65 #define EXT_DEF_SERIAL_NUM_SIZE 4 66 #define EXT_DEF_PORTID_SIZE 4 67 #define EXT_DEF_PORTID_SIZE_ACTUAL 3 68 #define EXT_DEF_MAX_STR_SIZE 128 69 #define EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH 12 70 71 #define EXT_DEF_ADDR_MODE_32 1 72 #define EXT_DEF_ADDR_MODE_64 2 73 74 /* 75 * *********************************************************************** 76 * OS dependent General configuration defines 77 * *********************************************************************** 78 */ 79 #define EXT_DEF_MAX_HBA EXT_DEF_MAX_HBA_OS 80 #define EXT_DEF_MAX_BUS EXT_DEF_MAX_BUS_OS 81 #define EXT_DEF_MAX_TARGET EXT_DEF_MAX_TARGET_OS 82 #define EXT_DEF_MAX_LUN EXT_DEF_MAX_LUN_OS 83 #define EXT_DEF_NON_SCSI3_MAX_LUN EXT_DEF_NON_SCSI3_MAX_LUN_OS 84 85 /* 86 * *********************************************************************** 87 * Common header struct definitions for San/Device Mgmt 88 * *********************************************************************** 89 */ 90 typedef struct { 91 UINT64 Signature; /* 8 chars string */ 92 UINT64 RequestAdr; /* 8 */ 93 UINT64 ResponseAdr; /* 8 */ 94 UINT64 VendorSpecificData; /* 8 chars string */ 95 UINT32 Status; /* 4 */ 96 UINT32 DetailStatus; /* 4 */ 97 UINT32 Reserved1; /* 4 */ 98 UINT32 RequestLen; /* 4 */ 99 UINT32 ResponseLen; /* 4 */ 100 UINT16 AddrMode; /* 2 */ 101 UINT16 Version; /* 2 */ 102 UINT16 SubCode; /* 2 */ 103 UINT16 Instance; /* 2 */ 104 UINT16 HbaSelect; /* 2 */ 105 UINT16 VendorSpecificStatus[11]; /* 22 */ 106 } EXT_IOCTL, *PEXT_IOCTL; /* size = 84 / 0x54 */ 107 108 typedef union _ext_signature { 109 UINT64 Signature; 110 char bytes[EXT_DEF_SIGNATURE_SIZE]; 111 } ext_sig_t; 112 113 /* 114 * Addressing mode used by the user application 115 */ 116 #define EXT_ADDR_MODE EXT_ADDR_MODE_OS 117 118 /* 119 * Status. These macros are being used for setting Status field in 120 * EXT_IOCTL structure. 121 */ 122 #define EXT_STATUS_OK 0 123 #define EXT_STATUS_ERR 1 124 #define EXT_STATUS_BUSY 2 125 #define EXT_STATUS_PENDING 3 126 #define EXT_STATUS_SUSPENDED 4 127 #define EXT_STATUS_RETRY_PENDING 5 128 #define EXT_STATUS_INVALID_PARAM 6 129 #define EXT_STATUS_DATA_OVERRUN 7 130 #define EXT_STATUS_DATA_UNDERRUN 8 131 #define EXT_STATUS_DEV_NOT_FOUND 9 132 #define EXT_STATUS_COPY_ERR 10 133 #define EXT_STATUS_MAILBOX 11 134 #define EXT_STATUS_UNSUPPORTED_SUBCODE 12 135 #define EXT_STATUS_UNSUPPORTED_VERSION 13 136 #define EXT_STATUS_MS_NO_RESPONSE 14 137 #define EXT_STATUS_SCSI_STATUS 15 138 #define EXT_STATUS_BUFFER_TOO_SMALL 16 139 #define EXT_STATUS_NO_MEMORY 17 140 #define EXT_STATUS_UNKNOWN 18 141 #define EXT_STATUS_UNKNOWN_DSTATUS 19 142 #define EXT_STATUS_INVALID_REQUEST 20 143 #define EXT_STATUS_DEVICE_NOT_READY 21 144 #define EXT_STATUS_DEVICE_OFFLINE 22 145 #define EXT_STATUS_HBA_NOT_READY 23 146 #define EXT_STATUS_HBA_QUEUE_FULL 24 147 #define EXT_STATUS_INVALID_VPINDEX 25 148 149 /* 150 * Detail Status contains the SCSI bus status codes. 151 */ 152 153 #define EXT_DSTATUS_GOOD 0x00 154 #define EXT_DSTATUS_CHECK_CONDITION 0x02 155 #define EXT_DSTATUS_CONDITION_MET 0x04 156 #define EXT_DSTATUS_BUSY 0x08 157 #define EXT_DSTATUS_INTERMEDIATE 0x10 158 #define EXT_DSTATUS_INTERMEDIATE_COND_MET 0x14 159 #define EXT_DSTATUS_RESERVATION_CONFLICT 0x18 160 #define EXT_DSTATUS_COMMAND_TERMINATED 0x22 161 #define EXT_DSTATUS_QUEUE_FULL 0x28 162 163 /* 164 * Detail Status contains the needed Response buffer space(bytes) 165 * when Status = EXT_STATUS_BUFFER_TOO_SMALL 166 */ 167 168 169 /* 170 * Detail Status contains one of the following codes 171 * when Status = EXT_STATUS_INVALID_PARAM or 172 * = EXT_STATUS_DEV_NOT_FOUND 173 */ 174 #define EXT_DSTATUS_NOADNL_INFO 0x00 175 #define EXT_DSTATUS_HBA_INST 0x01 176 #define EXT_DSTATUS_TARGET 0x02 177 #define EXT_DSTATUS_LUN 0x03 178 #define EXT_DSTATUS_REQUEST_LEN 0x04 179 #define EXT_DSTATUS_PATH_INDEX 0x05 180 181 /* 182 * Currently supported DeviceControl / ioctl command codes 183 */ 184 #define EXT_CC_QUERY EXT_CC_QUERY_OS 185 #define EXT_CC_SEND_FCCT_PASSTHRU EXT_CC_SEND_FCCT_PASSTHRU_OS 186 #define EXT_CC_REG_AEN EXT_CC_REG_AEN_OS 187 #define EXT_CC_GET_AEN EXT_CC_GET_AEN_OS 188 #define EXT_CC_SEND_ELS_RNID EXT_CC_SEND_ELS_RNID_OS 189 #define EXT_CC_SEND_SCSI_PASSTHRU EXT_CC_SCSI_PASSTHRU_OS 190 #define EXT_CC_READ_HOST_PARAMS EXT_CC_READ_HOST_PARAMS_OS 191 #define EXT_CC_READ_RISC_PARAMS EXT_CC_READ_RISC_PARAMS_OS 192 #define EXT_CC_UPDATE_HOST_PARAMS EXT_CC_UPDATE_HOST_PARAMS_OS 193 #define EXT_CC_UPDATE_RISC_PARAMS EXT_CC_UPDATE_RISC_PARAMS_OS 194 #define EXT_CC_READ_NVRAM EXT_CC_READ_NVRAM_OS 195 #define EXT_CC_UPDATE_NVRAM EXT_CC_UPDATE_NVRAM_OS 196 #define EXT_CC_HOST_IDX EXT_CC_HOST_IDX_OS 197 #define EXT_CC_LOOPBACK EXT_CC_LOOPBACK_OS 198 #define EXT_CC_READ_OPTION_ROM EXT_CC_READ_OPTION_ROM_OS 199 #define EXT_CC_READ_OPTION_ROM_EX EXT_CC_READ_OPTION_ROM_EX_OS 200 #define EXT_CC_UPDATE_OPTION_ROM EXT_CC_UPDATE_OPTION_ROM_OS 201 #define EXT_CC_UPDATE_OPTION_ROM_EX EXT_CC_UPDATE_OPTION_ROM_EX_OS 202 #define EXT_CC_GET_VPD EXT_CC_GET_VPD_OS 203 #define EXT_CC_SET_VPD EXT_CC_SET_VPD_OS 204 #define EXT_CC_GET_FCACHE EXT_CC_GET_FCACHE_OS 205 #define EXT_CC_GET_FCACHE_EX EXT_CC_GET_FCACHE_EX_OS 206 #define EXT_CC_HOST_DRVNAME EXT_CC_HOST_DRVNAME_OS 207 #define EXT_CC_GET_SFP_DATA EXT_CC_GET_SFP_DATA_OS 208 #define EXT_CC_WWPN_TO_SCSIADDR EXT_CC_WWPN_TO_SCSIADDR_OS 209 #define EXT_CC_PORT_PARAM EXT_CC_PORT_PARAM_OS 210 #define EXT_CC_GET_PCI_DATA EXT_CC_GET_PCI_DATA_OS 211 #define EXT_CC_GET_FWEXTTRACE EXT_CC_GET_FWEXTTRACE_OS 212 #define EXT_CC_GET_FWFCETRACE EXT_CC_GET_FWFCETRACE_OS 213 #define EXT_CC_GET_VP_CNT_ID EXT_CC_GET_VP_CNT_ID_OS 214 #define EXT_CC_VPORT_CMD EXT_CC_VPORT_CMD_OS 215 #define EXT_CC_ACCESS_FLASH EXT_CC_ACCESS_FLASH_OS 216 #define EXT_CC_RESET_FW EXT_CC_RESET_FW_OS 217 218 /* 219 * HBA port operations 220 */ 221 #define EXT_CC_GET_DATA EXT_CC_GET_DATA_OS 222 #define EXT_CC_SET_DATA EXT_CC_SET_DATA_OS 223 224 /* 225 * The following DeviceControl / ioctl command codes currently are not 226 * supported. 227 */ 228 #define EXT_CC_SEND_ELS_RTIN EXT_CC_SEND_ELS_RTIN_OS 229 230 231 /* 232 * *********************************************************************** 233 * EXT_IOCTL SubCode definition. 234 * These macros are being used for setting SubCode field in EXT_IOCTL 235 * structure. 236 * *********************************************************************** 237 */ 238 239 /* 240 * Query. 241 * Uses with EXT_QUERY as the ioctl code. 242 */ 243 #define EXT_SC_QUERY_HBA_NODE 1 244 #define EXT_SC_QUERY_HBA_PORT 2 245 #define EXT_SC_QUERY_DISC_PORT 3 246 #define EXT_SC_QUERY_DISC_TGT 4 247 #define EXT_SC_QUERY_DISC_LUN 5 /* Currently Not Supported */ 248 #define EXT_SC_QUERY_DRIVER 6 249 #define EXT_SC_QUERY_FW 7 250 #define EXT_SC_QUERY_CHIP 8 251 252 /* 253 * Get. 254 * Uses with EXT_GET_DATA as the ioctl code 255 */ 256 /* 1 - 99 Common */ 257 #define EXT_SC_GET_SCSI_ADDR 1 /* Currently Not Supported */ 258 #define EXT_SC_GET_ERR_DETECTIONS 2 /* Currently Not Supported */ 259 #define EXT_SC_GET_STATISTICS 3 260 #define EXT_SC_GET_BUS_MODE 4 /* Currently Not Supported */ 261 #define EXT_SC_GET_DR_DUMP_BUF 5 /* Currently Not Supported */ 262 #define EXT_SC_GET_RISC_CODE 6 263 #define EXT_SC_GET_FLASH_RAM 7 264 #define EXT_SC_GET_BEACON_STATE 8 265 266 /* 100 - 199 FC_INTF_TYPE */ 267 #define EXT_SC_GET_LINK_STATUS 101 /* Currently Not Supported */ 268 #define EXT_SC_GET_LOOP_ID 102 /* Currently Not Supported */ 269 #define EXT_SC_GET_LUN_BITMASK 103 270 #define EXT_SC_GET_PORT_DATABASE 104 /* Currently Not Supported */ 271 #define EXT_SC_GET_PORT_DATABASE_MEM 105 /* Currently Not Supported */ 272 #define EXT_SC_GET_PORT_SUMMARY 106 273 #define EXT_SC_GET_POSITION_MAP 107 274 #define EXT_SC_GET_RETRY_CNT 108 /* Currently Not Supported */ 275 #define EXT_SC_GET_RNID 109 276 #define EXT_SC_GET_RTIN 110 /* Currently Not Supported */ 277 #define EXT_SC_GET_FC_LUN_BITMASK 111 278 #define EXT_SC_GET_FC_STATISTICS 112 279 #define EXT_SC_GET_FC4_STATISTICS 113 280 #define EXT_SC_GET_TARGET_ID 114 281 282 283 /* 200 - 299 SCSI_INTF_TYPE */ 284 #define EXT_SC_GET_SEL_TIMEOUT 201 /* Currently Not Supported */ 285 286 287 /* 288 * Set. 289 * Uses with EXT_SET_DATA as the ioctl code 290 */ 291 /* 1 - 99 Common */ 292 #define EXT_SC_RST_STATISTICS 3 293 #define EXT_SC_SET_BUS_MODE 4 /* Currently Not Supported */ 294 #define EXT_SC_SET_DR_DUMP_BUF 5 /* Currently Not Supported */ 295 #define EXT_SC_SET_RISC_CODE 6 296 #define EXT_SC_SET_FLASH_RAM 7 297 #define EXT_SC_SET_BEACON_STATE 8 298 299 /* special types (non snia) */ 300 #define EXT_SC_SET_PARMS 99 /* dpb */ 301 302 /* 100 - 199 FC_INTF_TYPE */ 303 #define EXT_SC_SET_LUN_BITMASK 103 304 #define EXT_SC_SET_RETRY_CNT 108 /* Currently Not Supported */ 305 #define EXT_SC_SET_RNID 109 306 #define EXT_SC_SET_RTIN 110 /* Currently Not Supported */ 307 #define EXT_SC_SET_FC_LUN_BITMASK 111 308 #define EXT_SC_ADD_TARGET_DEVICE 112 309 #define EXT_SC_SWAP_TARGET_DEVICE 113 310 311 /* 200 - 299 SCSI_INTF_TYPE */ 312 #define EXT_SC_SET_SEL_TIMEOUT 201 /* Currently Not Supported */ 313 314 /* SCSI passthrough */ 315 #define EXT_SC_SEND_SCSI_PASSTHRU 0 316 #define EXT_SC_SEND_FC_SCSI_PASSTHRU 1 317 318 /* NVRAM */ 319 #define EXT_SC_NVRAM_HARDWARE 0 /* Save */ 320 #define EXT_SC_NVRAM_DRIVER 1 /* Driver (Apply) */ 321 #define EXT_SC_NVRAM_ALL 2 /* NVRAM/Driver (Save+Apply) */ 322 323 /* 324 * Vport functions 325 * Used with EXT_CC_VPORT_CMD as the ioctl code. 326 */ 327 #define EXT_VF_SC_VPORT_GETINFO 1 328 #define EXT_VF_SC_VPORT_DELETE 2 329 #define EXT_VF_SC_VPORT_MODIFY 3 330 #define EXT_VF_SC_VPORT_CREATE 4 331 332 /* 333 * Flash access sub codes 334 * Used with EXT_CC_ACCESS_FLASH as the ioctl code. 335 */ 336 #define EXT_SC_FLASH_READ 0 337 #define EXT_SC_FLASH_WRITE 1 338 339 /* 340 * Reset FW subcodes for Schultz 341 * Used with EXT_CC_RESET_FW as the ioctl code. 342 */ 343 #define EXT_SC_RESET_FC_FW 1 344 #define EXT_SC_RESET_MPI_FW 2 345 346 /* Read */ 347 348 /* Write */ 349 350 /* Reset */ 351 352 /* Request struct */ 353 354 355 /* 356 * Response struct 357 */ 358 typedef struct _EXT_HBA_NODE { 359 UINT32 DriverAttr; /* 4 */ 360 UINT32 FWAttr; /* 4 */ 361 UINT16 PortCount; /* 2; 1 */ 362 UINT16 InterfaceType; /* 2; FC/SCSI */ 363 UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 364 UINT8 Manufacturer[EXT_DEF_MAX_STR_SIZE]; /* 128; "QLOGIC" */ 365 UINT8 Model[EXT_DEF_MAX_STR_SIZE]; /* 128; "QLA2200" */ 366 UINT8 SerialNum[EXT_DEF_SERIAL_NUM_SIZE]; /* 4; 123 */ 367 UINT8 DriverVersion[EXT_DEF_MAX_STR_SIZE]; /* 128; "7.4.3" */ 368 UINT8 FWVersion[EXT_DEF_MAX_STR_SIZE]; /* 128; "2.1.6" */ 369 UINT8 OptRomVersion[EXT_DEF_MAX_STR_SIZE]; /* 128; "1.44" */ 370 UINT8 Reserved[32]; /* 32 */ 371 } EXT_HBA_NODE, *PEXT_HBA_NODE; /* 696 */ 372 373 /* HBA node query interface type */ 374 #define EXT_DEF_FC_INTF_TYPE 1 375 #define EXT_DEF_SCSI_INTF_TYPE 2 376 #define EXT_DEF_VIRTUAL_FC_INTF_TYPE 3 377 378 typedef struct _EXT_HBA_PORT { 379 UINT64 Target; /* 8 */ 380 UINT32 PortSupportedSpeed; /* 4 */ 381 UINT32 PortSpeed; /* 4 */ 382 UINT16 Type; /* 2; Port Type */ 383 UINT16 State; /* 2; Port State */ 384 UINT16 Mode; /* 2 */ 385 UINT16 DiscPortCount; /* 2 */ 386 UINT16 DiscPortNameType; /* 2; USE_NODE_NAME or */ 387 /* USE_PORT_NAME */ 388 UINT16 DiscTargetCount; /* 2 */ 389 UINT16 Bus; /* 2 */ 390 UINT16 Lun; /* 2 */ 391 UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 392 UINT8 Id [EXT_DEF_PORTID_SIZE]; /* 4; 3 bytes valid Port Id. */ 393 UINT8 PortSupportedFC4Types; /* 1 */ 394 UINT8 PortActiveFC4Types; /* 1 */ 395 UINT8 FabricName[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 396 UINT16 LinkState2; /* 2; sfp status */ 397 UINT16 LinkState3; /* 2; reserved field */ 398 UINT8 Reserved[6]; /* 6 */ 399 } EXT_HBA_PORT, *PEXT_HBA_PORT; /* 62 */ 400 401 /* FC-4 Instrumentation */ 402 typedef struct _EXT_HBA_FC4Statistics { 403 INT64 InputRequests; /* 8 */ 404 INT64 OutputRequests; /* 8 */ 405 INT64 ControlRequests; /* 8 */ 406 INT64 InputMegabytes; /* 8 */ 407 INT64 OutputMegabytes; /* 8 */ 408 UINT64 Reserved[6]; /* 48 */ 409 } EXT_HBA_FC4STATISTICS, *PEXT_HBA_FC4STATISTICS; /* 88 */ 410 411 typedef struct _EXT_LOOPBACK_REQ { 412 UINT32 TransferCount; 413 UINT32 IterationCount; 414 UINT32 BufferAddress; 415 UINT32 BufferLength; 416 UINT16 Options; 417 UINT8 Reserved[18]; 418 } EXT_LOOPBACK_REQ, *PEXT_LOOPBACK_REQ; 419 420 typedef struct _EXT_LOOPBACK_RSP { 421 UINT64 BufferAddress; 422 UINT32 BufferLength; 423 UINT32 IterationCountLastError; 424 UINT16 CompletionStatus; 425 UINT16 CrcErrorCount; 426 UINT16 DisparityErrorCount; 427 UINT16 FrameLengthErrorCount; 428 UINT8 CommandSent; 429 UINT8 Reserved[15]; 430 } EXT_LOOPBACK_RSP, *PEXT_LOOPBACK_RSP; 431 432 /* used with loopback response CommandSent */ 433 #define INT_DEF_LB_LOOPBACK_CMD 0 434 #define INT_DEF_LB_ECHO_CMD 1 435 436 /* definition for interpreting CompletionStatus values */ 437 #define EXT_DEF_LB_COMPLETE 0x4000 438 #define EXT_DEF_LB_PARAM_ERR 0x4006 439 #define EXT_DEF_LB_LOOP_DOWN 0x400b 440 #define EXT_DEF_LB_CMD_ERROR 0x400c 441 442 /* port type */ 443 #define EXT_DEF_INITIATOR_DEV 0x1 444 #define EXT_DEF_TARGET_DEV 0x2 445 #define EXT_DEF_TAPE_DEV 0x4 446 #define EXT_DEF_FABRIC_DEV 0x8 447 448 449 /* HBA port state */ 450 #define EXT_DEF_HBA_OK 0 451 #define EXT_DEF_HBA_SUSPENDED 1 452 #define EXT_DEF_HBA_LOOP_DOWN 2 453 454 /* Connection mode */ 455 #define EXT_DEF_UNKNOWN_MODE 0 456 #define EXT_DEF_P2P_MODE 1 457 #define EXT_DEF_LOOP_MODE 2 458 #define EXT_DEF_FL_MODE 3 459 #define EXT_DEF_N_MODE 4 460 461 /* Valid name type for Disc. port/target */ 462 #define EXT_DEF_USE_NODE_NAME 1 463 #define EXT_DEF_USE_PORT_NAME 2 464 465 /* FC4 type values */ 466 #define EXT_DEF_FC4_TYPE_SCSI 0x1 467 #define EXT_DEF_FC4_TYPE_IP 0x2 468 #define EXT_DEF_FC4_TYPE_SCTP 0x4 469 #define EXT_DEF_FC4_TYPE_VI 0x8 470 471 /* IIDMA rate values */ 472 #define IIDMA_RATE_1GB 0x0 473 #define IIDMA_RATE_2GB 0x1 474 #define IIDMA_RATE_4GB 0x3 475 #define IIDMA_RATE_8GB 0x4 476 #define IIDMA_RATE_UNKNOWN 0xffff 477 478 /* IIDMA Mode values */ 479 #define IIDMA_MODE_0 0 480 #define IIDMA_MODE_1 1 481 #define IIDMA_MODE_2 2 482 #define IIDMA_MODE_3 3 483 484 /* Port Speed values */ 485 #define EXT_DEF_PORTSPEED_UNKNOWN 0x0 486 #define EXT_DEF_PORTSPEED_1GBIT 0x1 487 #define EXT_DEF_PORTSPEED_2GBIT 0x2 488 #define EXT_DEF_PORTSPEED_4GBIT 0x4 489 #define EXT_DEF_PORTSPEED_8GBIT 0x8 490 #define EXT_DEF_PORTSPEED_10GBIT 0x10 491 #define EXT_PORTSPEED_NOT_NEGOTIATED (1<<15) /* Speed not established */ 492 493 typedef struct _EXT_DISC_PORT { 494 UINT64 TargetId; /* 8 */ 495 UINT16 Type; /* 2; Port Type */ 496 UINT16 Status; /* 2; Port Status */ 497 UINT16 Bus; /* 2; n/a for Solaris */ 498 UINT16 LoopID; /* 2; Loop ID */ 499 UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 500 UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 501 UINT8 Id[EXT_DEF_PORTID_SIZE]; /* 4; 3 bytes used big endian */ 502 UINT8 Local; /* 1; Local or Remote */ 503 UINT8 Reserved[27]; /* 27 */ 504 } EXT_DISC_PORT, *PEXT_DISC_PORT; /* 64 */ 505 506 typedef struct _EXT_DISC_TARGET { 507 UINT64 TargetId; /* 8 */ 508 UINT16 Type; /* 2; Target Type */ 509 UINT16 Status; /* 2; Target Status */ 510 UINT16 Bus; /* 2; n/a for Solaris */ 511 UINT16 LunCount; /* 2; n/a for nt */ 512 UINT16 LoopID; /* 2; Loop ID */ 513 UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 514 UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 515 UINT8 Id[EXT_DEF_PORTID_SIZE]; /* 4; 3 bytes used big endian */ 516 UINT8 Local; /* 1; Local or Remote */ 517 UINT8 Reserved[25]; /* 25 */ 518 } EXT_DISC_TARGET, *PEXT_DISC_TARGET; /* 64 */ 519 520 /* The following command is not supported */ 521 typedef struct _EXT_DISC_LUN { /* n/a for nt */ 522 UINT16 Id; /* 2 */ 523 UINT16 State; /* 2 */ 524 UINT16 IoCount; /* 2 */ 525 UINT8 Reserved[30]; /* 30 */ 526 } EXT_DISC_LUN, *PEXT_DISC_LUN; /* 36 */ 527 528 529 /* SCSI address */ 530 typedef struct _EXT_SCSI_ADDR { 531 UINT64 Target; /* 8 */ 532 UINT16 Bus; /* 2 */ 533 UINT16 Lun; /* 2 */ 534 UINT8 Padding[12]; /* 12 */ 535 } EXT_SCSI_ADDR, *PEXT_SCSI_ADDR; /* 24 */ 536 537 538 /* Fibre Channel address */ 539 typedef struct _EXT_FC_ADDR { 540 UINT16 Type; /* 2 */ 541 union { 542 UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 543 UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 544 UINT8 Id[EXT_DEF_PORTID_SIZE]; /* 4 */ 545 } FcAddr; 546 UINT8 Padding[4]; /* 4 */ 547 } EXT_FC_ADDR, *PEXT_FC_ADDR; /* 14 */ 548 549 #define EXT_DEF_TYPE_WWNN 1 550 #define EXT_DEF_TYPE_WWPN 2 551 #define EXT_DEF_TYPE_PORTID 3 552 #define EXT_DEF_TYPE_FABRIC 4 553 554 /* Destination address */ 555 typedef struct _EXT_DEST_ADDR { 556 union { 557 struct { 558 UINT64 Target; /* 8 */ 559 UINT16 Bus; /* 2 */ 560 UINT8 pad[6]; /* 6 */ 561 } ScsiAddr; 562 UINT8 WWNN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 563 UINT8 WWPN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 564 UINT8 Id[EXT_DEF_PORTID_SIZE]; /* 4 */ 565 } DestAddr; 566 UINT16 DestType; /* 2 */ 567 UINT16 Lun; /* 2 */ 568 UINT8 Padding[4]; /* 4 */ 569 } EXT_DEST_ADDR, *PEXT_DEST_ADDR; /* 24 */ 570 571 572 #define EXT_DEF_DESTTYPE_WWNN 1 573 #define EXT_DEF_DESTTYPE_WWPN 2 574 #define EXT_DEF_DESTTYPE_PORTID 3 575 #define EXT_DEF_DESTTYPE_FABRIC 4 576 #define EXT_DEF_DESTTYPE_SCSI 5 577 578 /* Statistic */ 579 typedef struct _EXT_HBA_PORT_STAT { 580 UINT32 ControllerErrorCount; /* 4 */ 581 UINT32 DeviceErrorCount; /* 4 */ 582 UINT32 IoCount; /* 4 */ 583 UINT32 MBytesCount; /* 4; MB of data processed */ 584 UINT32 LipResetCount; /* 4; Total no. of LIP Reset */ 585 UINT32 InterruptCount; /* 4; Total no. of Interrupts */ 586 UINT32 LinkFailureCount; /* 4 */ 587 UINT32 LossOfSyncCount; /* 4 */ 588 UINT32 LossOfSignalsCount; /* 4 */ 589 UINT32 PrimitiveSeqProtocolErrorCount; /* 4 */ 590 UINT32 InvalidTransmissionWordCount; /* 4 */ 591 UINT32 InvalidCRCCount; /* 4 */ 592 UINT8 Reserved[64]; /* 64 */ 593 } EXT_HBA_PORT_STAT, *PEXT_HBA_PORT_STAT; /* 112 */ 594 595 596 /* Driver property */ 597 typedef struct _EXT_DRIVER { 598 UINT32 MaxTransferLen; /* 4 */ 599 UINT32 MaxDataSegments; /* 4 */ 600 UINT32 Attrib; /* 4 */ 601 UINT32 InternalFlags[4]; /* 16 */ 602 UINT16 NumOfBus; /* 2; Port Type */ 603 UINT16 TargetsPerBus; /* 2; Port Status */ 604 UINT16 LunsPerTarget; /* 2 */ 605 UINT16 DmaBitAddresses; /* 2 */ 606 UINT16 IoMapType; /* 2 */ 607 UINT8 Version[EXT_DEF_MAX_STR_SIZE]; /* 128 */ 608 UINT8 Reserved[32]; /* 32 */ 609 } EXT_DRIVER, *PEXT_DRIVER; /* 198 */ 610 611 612 /* Firmware property */ 613 typedef struct _EXT_FW { 614 UINT32 Attrib; /* 4 */ 615 UINT8 Version[EXT_DEF_MAX_STR_SIZE]; /* 128 */ 616 UINT8 Reserved[66]; /* 66 */ 617 } EXT_FW, *PEXT_FW; /* 198 */ 618 619 /* ISP/Chip property */ 620 typedef struct _EXT_CHIP { 621 UINT32 IoAddr; /* 4 */ 622 UINT32 IoAddrLen; /* 4 */ 623 UINT32 MemAddr; /* 4 */ 624 UINT32 MemAddrLen; /* 4 */ 625 UINT16 VendorId; /* 2 */ 626 UINT16 DeviceId; /* 2 */ 627 UINT16 SubVendorId; /* 2 */ 628 UINT16 SubSystemId; /* 2 */ 629 UINT16 PciBusNumber; /* 2 */ 630 UINT16 PciSlotNumber; /* 2 */ 631 UINT16 ChipType; /* 2 */ 632 UINT16 InterruptLevel; /* 2 */ 633 UINT16 OutMbx[8]; /* 16 */ 634 UINT16 FuncNo; /* 2 */ 635 UINT8 Reserved[29]; /* 29 */ 636 UINT8 ChipRevID; /* 1 */ 637 } EXT_CHIP, *PEXT_CHIP; /* 80 */ 638 639 640 /* Request Buffer for RNID */ 641 typedef struct _EXT_RNID_REQ { 642 EXT_FC_ADDR Addr; /* 14 */ 643 UINT8 DataFormat; /* 1 */ 644 UINT8 Pad; /* 1 */ 645 UINT8 OptWWN[EXT_DEF_WWN_NAME_SIZE]; /* 8 */ 646 UINT8 OptPortId[EXT_DEF_PORTID_SIZE]; /* 4 */ 647 UINT8 Reserved[51]; /* 51 */ 648 } EXT_RNID_REQ, *PEXT_RNID_REQ; /* 79 */ 649 650 #define EXT_DEF_RNID_DFORMAT_NONE 0 651 #define EXT_DEF_RNID_DFORMAT_TOPO_DISC 0xDF 652 653 /* Request Buffer for Set RNID */ 654 typedef struct _EXT_SET_RNID_REQ { 655 UINT8 IPVersion[2]; /* 2 */ 656 UINT8 UDPPortNumber[2]; /* 2 */ 657 UINT8 IPAddress[16]; /* 16 */ 658 UINT8 Reserved[64]; /* 64 */ 659 } EXT_SET_RNID_REQ, *PEXT_SET_RNID_REQ; /* 84 */ 660 661 /* RNID definition and data struct */ 662 #define SEND_RNID_RSP_SIZE 72 663 664 typedef struct _RNID_DATA 665 { 666 UINT32 UnitType; /* 4 */ 667 UINT32 NumOfAttachedNodes; /* 4 */ 668 UINT16 TopoDiscFlags; /* 2 */ 669 UINT16 Reserved; /* 2 */ 670 UINT8 WWN[16]; /* 16 */ 671 UINT8 PortId[4]; /* 4 */ 672 UINT8 IPVersion[2]; /* 2 */ 673 UINT8 UDPPortNumber[2]; /* 2 */ 674 UINT8 IPAddress[16]; /* 16 */ 675 } EXT_RNID_DATA, *PEXT_RNID_DATA; /* 52 */ 676 677 678 /* SCSI pass-through */ 679 typedef struct _EXT_SCSI_PASSTHRU { 680 EXT_SCSI_ADDR TargetAddr; 681 UINT8 Direction; 682 UINT8 CdbLength; 683 UINT8 Cdb[EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH]; 684 UINT8 Reserved[66]; 685 UINT8 SenseData[256]; 686 } EXT_SCSI_PASSTHRU, *PEXT_SCSI_PASSTHRU; 687 688 /* FC SCSI pass-through */ 689 typedef struct _EXT_FC_SCSI_PASSTHRU { 690 EXT_DEST_ADDR FCScsiAddr; 691 UINT8 Direction; 692 UINT8 CdbLength; 693 UINT8 Cdb[EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH]; 694 UINT8 Reserved[64]; 695 UINT8 SenseData[256]; 696 } EXT_FC_SCSI_PASSTHRU, *PEXT_FC_SCSI_PASSTHRU; 697 698 /* SCSI pass-through direction */ 699 #define EXT_DEF_SCSI_PASSTHRU_DATA_IN 1 700 #define EXT_DEF_SCSI_PASSTHRU_DATA_OUT 2 701 702 703 /* EXT_REG_AEN Request struct */ 704 typedef struct _EXT_REG_AEN { 705 UINT32 Enable; /* 4; non-0 to enable, 0 to disable. */ 706 UINT8 Reserved[4]; /* 4 */ 707 } EXT_REG_AEN, *PEXT_REG_AEN; /* 8 */ 708 709 /* EXT_GET_AEN Response struct */ 710 typedef struct _EXT_ASYNC_EVENT { 711 UINT32 AsyncEventCode; /* 4 */ 712 union { 713 struct { 714 UINT8 RSCNInfo[EXT_DEF_PORTID_SIZE_ACTUAL]; /* 3 BE */ 715 UINT8 AddrFormat; /* 1 */ 716 UINT8 Rsvd_1[8]; /* 8 */ 717 } RSCN; 718 719 UINT8 Reserved[12]; /* 12 */ 720 } Payload; 721 } EXT_ASYNC_EVENT, *PEXT_ASYNC_EVENT; /* 16 */ 722 723 724 /* Asynchronous Event Codes */ 725 #define EXT_DEF_LIP_OCCURRED 0x8010 726 #define EXT_DEF_LINK_UP 0x8011 727 #define EXT_DEF_LINK_DOWN 0x8012 728 #define EXT_DEF_LIP_RESET 0x8013 729 #define EXT_DEF_RSCN 0x8015 730 #define EXT_DEF_DEVICE_UPDATE 0x8014 731 732 /* LED state information */ 733 #define EXT_DEF_GRN_BLINK_OFF 0x00 734 #define EXT_DEF_GRN_BLINK_ON 0x01 735 736 typedef struct _EXT_BEACON_CONTROL { 737 UINT32 State; /* 4 */ 738 UINT8 Reserved[12]; /* 12 */ 739 } EXT_BEACON_CONTROL, *PEXT_BEACON_CONTROL; /* 16 */ 740 741 /* Required # of entries in the queue buffer allocated. */ 742 #define EXT_DEF_MAX_AEN_QUEUE EXT_DEF_MAX_AEN_QUEUE_OS 743 744 /* 745 * LUN BitMask structure definition, array of 8bit bytes, 746 * 1 bit per lun. When bit == 1, the lun is masked. 747 * Most significant bit of mask[0] is lun 0. 748 * Least significant bit of mask[0] is lun 7. 749 */ 750 typedef struct _EXT_LUN_BIT_MASK { 751 #if ((EXT_DEF_NON_SCSI3_MAX_LUN & 0x7) == 0) 752 UINT8 mask[EXT_DEF_NON_SCSI3_MAX_LUN >> 3]; 753 #else 754 UINT8 mask[(EXT_DEF_NON_SCSI3_MAX_LUN + 8) >> 3 ]; 755 #endif 756 } EXT_LUN_BIT_MASK, *PEXT_LUN_BIT_MASK; 757 758 /* Device type to get for EXT_SC_GET_PORT_SUMMARY */ 759 #define EXT_DEF_GET_KNOWN_DEVICE 0x1 760 #define EXT_DEF_GET_VISIBLE_DEVICE 0x2 761 #define EXT_DEF_GET_HIDDEN_DEVICE 0x4 762 #define EXT_DEF_GET_FABRIC_DEVICE 0x8 763 #define EXT_DEF_GET_LOOP_DEVICE 0x10 764 765 /* Each entry in device database */ 766 typedef struct _EXT_DEVICEDATAENTRY 767 { 768 EXT_SCSI_ADDR TargetAddress; /* scsi address */ 769 UINT32 DeviceFlags; /* Flags for device */ 770 UINT16 LoopID; /* Loop ID */ 771 UINT16 BaseLunNumber; 772 UINT8 NodeWWN[8]; /* Node World Wide Name for device */ 773 UINT8 PortWWN[8]; /* Port World Wide Name for device */ 774 UINT8 PortID[3]; /* Current PortId for device */ 775 UINT8 ControlFlags; /* Control flag */ 776 UINT8 Reserved[132]; 777 } EXT_DEVICEDATAENTRY, *PEXT_DEVICEDATAENTRY; 778 779 #define EXT_DEF_EXTERNAL_LUN_COUNT 2048 780 #define EXT_DEF_EXTERNAL_LUN_BITMASK_BYTES (EXT_DEF_EXTERNAL_LUN_COUNT / 8) 781 782 /* Structure as used in the IOCTL. */ 783 784 typedef struct _EXT_EXTERNAL_LUN_BITMASK_ENTRY 785 { 786 UINT8 NodeName[EXT_DEF_WWN_NAME_SIZE]; 787 UINT8 PortName[EXT_DEF_WWN_NAME_SIZE]; 788 UINT8 Reserved1[16]; /* Pad to 32-byte header */ 789 UINT8 Bitmask[EXT_DEF_EXTERNAL_LUN_BITMASK_BYTES]; 790 } EXT_EXTERNAL_LUN_BITMASK_ENTRY, *PEXT_EXTERNAL_LUN_BITMASK_ENTRY; 791 792 793 /* Structure as it is stored in the NT registry */ 794 795 typedef struct _LUN_BITMASK_LIST 796 { 797 UINT16 Version; /* Should be LUN_BITMASK_REGISTRY_VERSION */ 798 UINT16 EntryCount; /* Count of variable entries following */ 799 UINT8 Reserved[28]; /* Pad to 32-byte header */ 800 801 EXT_EXTERNAL_LUN_BITMASK_ENTRY 802 BitmaskEntry[1]; /* Var-length data */ 803 } EXT_LUN_BITMASK_LIST, *PEXT_LUN_BITMASK_LIST; 804 805 806 /* Device database information */ 807 typedef struct _EXT_DEVICEDATA 808 { 809 UINT32 TotalDevices; /* Set to total number of device */ 810 UINT32 ReturnListEntryCount; /* Set to number of device entries */ 811 /* returned in list. */ 812 813 EXT_DEVICEDATAENTRY EntryList[1]; /* Variable length */ 814 } EXT_DEVICEDATA, *PEXT_DEVICEDATA; 815 816 817 /* Swap Target Device Data structure */ 818 typedef struct _EXT_SWAPTARGETDEVICE 819 { 820 EXT_DEVICEDATAENTRY CurrentExistDevice; 821 EXT_DEVICEDATAENTRY NewDevice; 822 } EXT_SWAPTARGETDEVICE, *PEXT_SWAPTARGETDEVICE; 823 824 #define EXT_DEF_LUN_BITMASK_LIST_MIN_ENTRIES 1 825 #define EXT_DEF_LUN_BITMASK_LIST_MAX_ENTRIES 256 826 827 #ifdef _WIN64 828 #define EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE 32 829 #else 830 #define EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE \ 831 offsetof(LUN_BITMASK_LIST_BUFFER, asBitmaskEntry) 832 #endif 833 834 #define EXT_DEF_LUN_BITMASK_LIST_MIN_SIZE \ 835 (EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE + \ 836 (sizeof (EXT_EXTERNAL_LUN_BITMASK_ENTRY) * \ 837 EXT_DEF_LUN_BITMASK_LIST_MIN_ENTRIES)) 838 #define EXT_DEF_LUN_BITMASK_LIST_MAX_SIZE \ 839 (EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE + \ 840 (sizeof (EXT_EXTERNAL_LUN_BITMASK_ENTRY) * \ 841 EXT_DEF_LUN_BITMASK_LIST_MAX_ENTRIES)) 842 /* 843 * LUN mask bit manipulation macros 844 * 845 * P = Pointer to an EXT_LUN_BIT_MASK union. 846 * L = LUN number. 847 */ 848 #define EXT_IS_LUN_BIT_SET(P, L) \ 849 (((P)->mask[L / 8] & (0x80 >> (L % 8))) ? 1 : 0) 850 851 #define EXT_SET_LUN_BIT(P, L) \ 852 ((P)->mask[L / 8] |= (0x80 >> (L % 8))) 853 854 #define EXT_CLR_LUN_BIT(P, L) \ 855 ((P)->mask[L / 8] &= ~(0x80 >> (L % 8))) 856 857 typedef struct _EXT_PORT_PARAM { 858 EXT_DEST_ADDR FCScsiAddr; 859 UINT16 Mode; 860 UINT16 Speed; 861 } EXT_PORT_PARAM, *PEXT_PORT_PARAM; 862 863 #define EXT_IIDMA_MODE_GET 0 864 #define EXT_IIDMA_MODE_SET 1 865 866 /* 867 * PCI header structure definitions. 868 */ 869 870 typedef struct _PCI_HEADER_T { 871 UINT8 signature[2]; 872 UINT8 reserved[0x16]; 873 UINT8 dataoffset[2]; 874 UINT8 pad[6]; 875 } PCI_HEADER_T, *PPCI_HEADER_T; 876 877 /* 878 * PCI data structure definitions. 879 */ 880 typedef struct _PCI_DATA_T { 881 UINT8 signature[4]; 882 UINT8 vid[2]; 883 UINT8 did[2]; 884 UINT8 reserved0[2]; 885 UINT8 pcidatalen[2]; 886 UINT8 pcidatarev; 887 UINT8 classcode[3]; 888 UINT8 imagelength[2]; /* In sectors */ 889 UINT8 revisionlevel[2]; 890 UINT8 codetype; 891 UINT8 indicator; 892 UINT8 reserved1[2]; 893 UINT8 pad[8]; 894 } PCI_DATA_T, *PPCI_DATA_T; 895 896 /* 897 * Mercury/Menlo 898 */ 899 900 #define MENLO_RESET_FLAG_ENABLE_DIAG_FW 1 901 902 typedef struct _EXT_MENLO_RESET { 903 UINT16 Flags; 904 UINT16 Reserved; 905 } EXT_MENLO_RESET, *PEXT_MENLO_RESET; 906 907 typedef struct _EXT_MENLO_GET_FW_VERSION { 908 UINT32 FwVersion; 909 } EXT_MENLO_GET_FW_VERSION, *PEXT_MENLO_GET_FW_VERSION; 910 911 #define MENLO_UPDATE_FW_FLAG_DIAG_FW 0x0008 /* if flag is cleared then */ 912 /* it must be an fw op */ 913 typedef struct _EXT_MENLO_UPDATE_FW { 914 UINT64 pFwDataBytes; 915 UINT32 TotalByteCount; 916 UINT16 Flags; 917 UINT16 Reserved; 918 } EXT_MENLO_UPDATE_FW, *PEXT_MENLO_UPDATE_FW; 919 920 #define CONFIG_PARAM_ID_RESERVED 1 921 #define CONFIG_PARAM_ID_UIF 2 922 #define CONFIG_PARAM_ID_FCOE_COS 3 923 #define CONFIG_PARAM_ID_PAUSE_TYPE 4 924 #define CONFIG_PARAM_ID_TIMEOUTS 5 925 926 #define INFO_DATA_TYPE_CONFIG_LOG_DATA 1 /* Fetch Config Log Data */ 927 #define INFO_DATA_TYPE_LOG_DATA 2 /* Fetch Log Data */ 928 #define INFO_DATA_TYPE_PORT_STATISTICS 3 /* Fetch Port Statistics */ 929 #define INFO_DATA_TYPE_LIF_STATISTICS 4 /* Fetch LIF Statistics */ 930 #define INFO_DATA_TYPE_ASIC_STATISTICS 5 /* Fetch ASIC Statistics */ 931 #define INFO_DATA_TYPE_CONFIG_PARAMETERS 6 /* Fetch Config Parameters */ 932 #define INFO_DATA_TYPE_PANIC_LOG 7 /* Fetch Panic Log */ 933 934 /* 935 * InfoContext defines for INFO_DATA_TYPE_LOG_DATA 936 */ 937 #define IC_LOG_DATA_LOG_ID_DEBUG_LOG 0 938 #define IC_LOG_DATA_LOG_ID_LEARN_LOG 1 939 #define IC_LOG_DATA_LOG_ID_FC_ACL_INGRESS_LOG 2 940 #define IC_LOG_DATA_LOG_ID_FC_ACL_EGRESS_LOG 3 941 #define IC_LOG_DATA_LOG_ID_ETHERNET_ACL_INGRESS_LOG 4 942 #define IC_LOG_DATA_LOG_ID_ETHERNET_ACL_EGRESS_LOG 5 943 #define IC_LOG_DATA_LOG_ID_MESSAGE_TRANSMIT_LOG 6 944 #define IC_LOG_DATA_LOG_ID_MESSAGE_RECEIVE_LOG 7 945 #define IC_LOG_DATA_LOG_ID_LINK_EVENT_LOG 8 946 #define IC_LOG_DATA_LOG_ID_DCX_LOG 9 947 948 /* 949 * InfoContext defines for INFO_DATA_TYPE_PORT_STATISTICS 950 */ 951 #define IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT0 0 952 #define IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT1 1 953 #define IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT0 2 954 #define IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT1 3 955 #define IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT0 4 956 #define IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT1 5 957 958 /* 959 * InfoContext defines for INFO_DATA_TYPE_LIF_STATISTICS 960 */ 961 #define IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT0 0 962 #define IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT1 1 963 #define IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT0 2 964 #define IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT1 3 965 #define IC_LIF_STATISTICS_LIF_NUMBER_CPU 6 966 967 typedef struct _EXT_MENLO_ACCESS_PARAMETERS { 968 union { 969 struct { 970 UINT32 StartingAddr; 971 UINT32 Reserved2; 972 UINT32 Reserved3; 973 } MenloMemory; /* For Read & Write Menlo Memory */ 974 975 struct { 976 UINT32 ConfigParamID; 977 UINT32 ConfigParamData0; 978 UINT32 ConfigParamData1; 979 } MenloConfig; /* For change Configuration */ 980 981 struct { 982 UINT32 InfoDataType; 983 UINT32 InfoContext; 984 UINT32 Reserved; 985 } MenloInfo; /* For fetch Menlo Info */ 986 } ap; 987 } EXT_MENLO_ACCESS_PARAMETERS, *PEXT_MENLO_ACCESS_PARAMETERS; 988 989 #define INFO_DATA_TYPE_LOG_CONFIG_TBC ((10*7)+1)*4 990 #define INFO_DATA_TYPE_PORT_STAT_ETH_TBC 0x194 991 #define INFO_DATA_TYPE_PORT_STAT_FC_TBC 0xC0 992 #define INFO_DATA_TYPE_LIF_STAT_TBC 0x40 993 #define INFO_DATA_TYPE_ASIC_STAT_TBC 0x5F8 994 #define INFO_DATA_TYPE_CONFIG_TBC 0x140 995 996 #define MENLO_OP_READ_MEM 0 /* Read Menlo Memory */ 997 #define MENLO_OP_WRITE_MEM 1 /* Write Menlo Memory */ 998 #define MENLO_OP_CHANGE_CONFIG 2 /* Change Configuration */ 999 #define MENLO_OP_GET_INFO 3 /* Fetch Menlo Info (Logs, & */ 1000 /* Statistics, Configuration) */ 1001 1002 typedef struct _EXT_MENLO_MANAGE_INFO { 1003 UINT64 pDataBytes; /* 4 */ 1004 EXT_MENLO_ACCESS_PARAMETERS Parameters; /* 12 */ 1005 UINT32 TotalByteCount; 1006 UINT16 Operation; 1007 UINT16 Reserved; 1008 } EXT_MENLO_MANAGE_INFO, *PEXT_MENLO_MANAGE_INFO; 1009 1010 #define MENLO_FC_CHECKSUM_FAILURE 0x01 1011 #define MENLO_FC_INVALID_LENGTH 0x02 1012 #define MENLO_FC_INVALID_ADDRESS 0x04 1013 #define MENLO_FC_INVALID_CONFIG_ID_TYPE 0x05 1014 #define MENLO_FC_INVALID_CONFIG_DATA 0x06 1015 #define MENLO_FC_INVALID_INFO_CONTEXT 0x07 1016 1017 typedef struct _EXT_MENLO_MGT { 1018 union { 1019 EXT_MENLO_RESET MenloReset; 1020 EXT_MENLO_GET_FW_VERSION MenloGetFwVer; 1021 EXT_MENLO_UPDATE_FW MenloUpdateFw; 1022 EXT_MENLO_MANAGE_INFO MenloManageInfo; 1023 } sp; 1024 } EXT_MENLO_MGT, *PEXT_MENLO_MGT; 1025 1026 /* 1027 * vport enum definations 1028 */ 1029 typedef enum vport_options { 1030 EXT_VPO_LOGIN_RETRY_ENABLE = 0, 1031 EXT_VPO_PERSISTENT = 1, 1032 EXT_VPO_QOS_BW = 2, 1033 EXT_VPO_VFABRIC_ENABLE = 3 1034 } vport_options_t; 1035 1036 /* 1037 * vport struct definations 1038 */ 1039 #define MAX_DEV_PATH 256 1040 #define MAX_VP_ID 256 1041 #define EXT_OLD_VPORT_ID_CNT_SIZE 260 1042 typedef struct _EXT_VPORT_ID_CNT { 1043 UINT32 VpCnt; 1044 UINT8 VpId[MAX_VP_ID]; 1045 UINT8 vp_path[MAX_VP_ID][MAX_DEV_PATH]; 1046 INT32 VpDrvInst[MAX_VP_ID]; 1047 } EXT_VPORT_ID_CNT, *PEXT_VPORT_ID_CNT; 1048 1049 typedef struct _EXT_VPORT_PARAMS { 1050 UINT32 vp_id; 1051 vport_options_t options; 1052 UINT8 wwpn[EXT_DEF_WWN_NAME_SIZE]; 1053 UINT8 wwnn[EXT_DEF_WWN_NAME_SIZE]; 1054 } EXT_VPORT_PARAMS, *PEXT_VPORT_PARAMS; 1055 1056 typedef struct _EXT_VPORT_INFO { 1057 UINT32 free; 1058 UINT32 used; 1059 UINT32 id; 1060 UINT32 state; 1061 UINT32 bound; 1062 UINT8 wwnn[EXT_DEF_WWN_NAME_SIZE]; 1063 UINT8 wwpn[EXT_DEF_WWN_NAME_SIZE]; 1064 UINT8 reserved[220]; 1065 } EXT_VPORT_INFO, *PEXT_VPORT_INFO; 1066 1067 #ifdef __cplusplus 1068 } 1069 #endif 1070 1071 #endif /* _EXIOCT_H */ 1072