/* * Copyright (c) 2011-2015, Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #if !defined(__ECD_LOCAL_H__) #define __ECD_LOCAL_H__ #include #include #if !defined(ARRAY_SIZE) #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #endif /* Coredump Constants */ #define COREDUMP_INTERFACE_VER_HI 1 #define COREDUMP_INTERFACE_VER_LO 0 #define COREDUMP_FILE_VER_HI 1 #define COREDUMP_FILE_VER_LO 0 #define COREDUMP_CHIP_DEAD 1 #define COREDUMP_CHIP_ALIVE 0 #define COREDUMP_COMPONENT_BYTECODE 1 #define COREDUMP_COMPONENT_FW 2 #define COREDUMP_COMPONENT_FW_CLI 3 #define COREDUMP_COMPONENT_DRIVER 4 #define COREDUMP_COMPONENT_MGMT 5 #define COREDUMP_COMPONENT_BOOT 6 #define COREDUMP_COMPONENT_OEM 7 #define COREDUMP_COMPONENT_MAX 7 #define COREDUMP_STATUS_SUCCESS 0 #define COREDUMP_STATUS_NO_COMPONENT 1 #define COREDUMP_STATUS_SEGMENT_ERROR 2 #define COREDUMP_STATUS_SEGMENT_PARTIAL 3 /* Chip defines */ #define SLI4_INTF_VALID_SHIFT 29 #define SLI4_INTF_VALID_MASK 0x7 #define SLI4_INTF_VALID 0x6 #define SLI4_INTF_IF_TYPE_SHIFT 12 #define SLI4_INTF_IF_TYPE_MASK 0xf #define SLI4_INTF_SLI_FAMILY_SHIFT 8 #define SLI4_INTF_SLI_FAMILY_MASK 0xf #define SLI4_INTF_SLI_FAMILY_BE2 0 #define SLI4_INTF_SLI_FAMILY_BE3 1 #define SLI4_INTF_SLI_FAMILY_SKYHAWK 2 #define SLI4_INTF_SLI_FAMILY_LANCER_A0 0xa #define SLI4_INTF_SLI_FAMILY_LANCER_B0 0xb #define SLI4_INTF_SLI_FAMILY_USE_ASIC_ID 0xf #define SLI4_INTF_SLI_REVISION_SHIFT 4 #define SLI4_INTF_SLI_REVISION_MASK 0xf #define SLI4_INTF_SLI_REVISION 4 #define SLI4_ASIC_REV_SHIFT 0 #define SLI4_ASIC_REV_MASK 0xf #define SLI4_ASIC_VER_SHIFT 4 #define SLI4_ASIC_VER_MASK 0xf #define SLI4_ASIC_GEN_SHIFT 8 #define SLI4_ASIC_GEN_MASK 0xff #define SLI4_ASIC_GEN_BE2 0x00 #define SLI4_ASIC_GEN_BE3 0x03 #define SLI4_ASIC_GEN_SKYHAWK 0x04 #define SLI4_ASIC_GEN_CORSAIR 0x05 #define SLI4_ASIC_GEN_LANCER 0x0b struct CORE_DUMP_HEADER { char signature[4]; unsigned int component_id; unsigned int segment_id; unsigned int flag; char low_version; char high_version; UEXACT16 fun_id; unsigned int offset; unsigned int length; unsigned int status; unsigned int duration; unsigned int data_offset; unsigned int instance; unsigned int rsvd0; unsigned int rsvd1; unsigned int rsvd2; unsigned int rsvd3; unsigned int rsvd4; }; struct RECORD_CORE_DUMP { char signature[4]; unsigned int flag; char low_version; char high_version; char asic_state; char rsvd0; unsigned int rsvd1; char system_name[32]; UEXACT16 year; UEXACT16 month; UEXACT16 day; UEXACT16 hour; UEXACT16 minute; UEXACT16 second; UEXACT16 utc_bias; UEXACT16 rsvd2; char commandline[256]; unsigned int total_segements; unsigned int os_version_major; unsigned int os_version_minor; unsigned int rsvd3; char os_name[32]; UEXACT16 end_year; UEXACT16 end_month; UEXACT16 end_day; UEXACT16 end_hour; UEXACT16 end_minute; UEXACT16 end_second; UEXACT16 end_utc_bias; UEXACT16 rsvd4; unsigned int sli_intf; unsigned int asic_id; unsigned int coredump_status; char ioctl_low_version; char ioctl_high_version; UEXACT16 rsvd5; char rsvd6[624]; }; #endif // __ECD_LOCAL_H__