1 /* 2 * Broadcom Event protocol definitions 3 * 4 * Copyright (C) 1999-2017, Broadcom Corporation 5 * 6 * Unless you and Broadcom execute a separate written software license 7 * agreement governing use of this software, this software is licensed to you 8 * under the terms of the GNU General Public License version 2 (the "GPL"), 9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the 10 * following added to such license: 11 * 12 * As a special exception, the copyright holders of this software give you 13 * permission to link this software with independent modules, and to copy and 14 * distribute the resulting executable under terms of your choice, provided that 15 * you also meet, for each linked independent module, the terms and conditions of 16 * the license of that module. An independent module is a module which is not 17 * derived from this software. The special exception does not apply to any 18 * modifications of the software. 19 * 20 * Notwithstanding the above, under no circumstances may you combine this 21 * software in any way with any other Broadcom software provided under a license 22 * other than the GPL, without Broadcom's express prior written consent. 23 * 24 * Dependencies: bcmeth.h 25 * 26 * $Id: dnglevent.h $ 27 * 28 * <<Broadcom-WL-IPTag/Open:>> 29 * 30 * ----------------------------------------------------------------------------- 31 * 32 */ 33 34 /* 35 * Broadcom dngl Ethernet Events protocol defines 36 * 37 */ 38 39 #ifndef _DNGLEVENT_H_ 40 #define _DNGLEVENT_H_ 41 42 #ifndef _TYPEDEFS_H_ 43 #include <typedefs.h> 44 #endif 45 #include <bcmeth.h> 46 #include <ethernet.h> 47 48 /* This marks the start of a packed structure section. */ 49 #include <packed_section_start.h> 50 #define BCM_DNGL_EVENT_MSG_VERSION 1 51 #define DNGL_E_RSRVD_1 0x0 52 #define DNGL_E_RSRVD_2 0x1 53 #define DNGL_E_SOCRAM_IND 0x2 54 typedef BWL_PRE_PACKED_STRUCT struct 55 { 56 uint16 version; /* Current version is 1 */ 57 uint16 reserved; /* reserved for any future extension */ 58 uint16 event_type; /* DNGL_E_SOCRAM_IND */ 59 uint16 datalen; /* Length of the event payload */ 60 } BWL_POST_PACKED_STRUCT bcm_dngl_event_msg_t; 61 62 typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_event { 63 struct ether_header eth; 64 bcmeth_hdr_t bcm_hdr; 65 bcm_dngl_event_msg_t dngl_event; 66 /* data portion follows */ 67 } BWL_POST_PACKED_STRUCT bcm_dngl_event_t; 68 69 typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_socramind { 70 uint16 tag; /* data tag */ 71 uint16 length; /* data length */ 72 uint8 value[1]; /* data value with variable length specified by length */ 73 } BWL_POST_PACKED_STRUCT bcm_dngl_socramind_t; 74 75 /* SOCRAM_IND type tags */ 76 #define SOCRAM_IND_ASSERT_TAG 0x1 77 #define SOCRAM_IND_TAG_HEALTH_CHECK 0x2 78 /* Health check top level module tags */ 79 typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_healthcheck { 80 uint16 top_module_tag; /* top level module tag */ 81 uint16 top_module_len; /* Type of PCIE issue indication */ 82 uint8 value[1]; /* data value with variable length specified by length */ 83 } BWL_POST_PACKED_STRUCT bcm_dngl_healthcheck_t; 84 85 /* Health check top level module tags */ 86 #define HEALTH_CHECK_TOP_LEVEL_MODULE_PCIEDEV_RTE 1 87 #define HEALTH_CHECK_PCIEDEV_VERSION_1 1 88 #define HEALTH_CHECK_PCIEDEV_FLAG_IN_D3_SHIFT 0 89 #define HEALTH_CHECK_PCIEDEV_FLAG_AER_SHIFT 1 90 #define HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN_SHIFT 2 91 #define HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT_SHIFT 3 92 #define HEALTH_CHECK_PCIEDEV_FLAG_NODS_SHIFT 4 93 #define HEALTH_CHECK_PCIEDEV_FLAG_IN_D3 1 << HEALTH_CHECK_PCIEDEV_FLAG_IN_D3_SHIFT 94 #define HEALTH_CHECK_PCIEDEV_FLAG_AER 1 << HEALTH_CHECK_PCIEDEV_FLAG_AER_SHIFT 95 #define HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN 1 << HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN_SHIFT 96 #define HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT 1 << HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT_SHIFT 97 #define HEALTH_CHECK_PCIEDEV_FLAG_NODS 1 << HEALTH_CHECK_PCIEDEV_FLAG_NODS_SHIFT 98 /* PCIE Module TAGs */ 99 #define HEALTH_CHECK_PCIEDEV_INDUCED_IND 0x1 100 #define HEALTH_CHECK_PCIEDEV_H2D_DMA_IND 0x2 101 #define HEALTH_CHECK_PCIEDEV_D2H_DMA_IND 0x3 102 #define HEALTH_CHECK_PCIEDEV_IOCTL_STALL_IND 0x4 103 #define HEALTH_CHECK_PCIEDEV_D3ACK_STALL_IND 0x5 104 #define HEALTH_CHECK_PCIEDEV_NODS_IND 0x6 105 #define HEALTH_CHECK_PCIEDEV_LINKSPEED_FALLBACK_IND 0x7 106 107 #define HC_PCIEDEV_CONFIG_REGLIST_MAX 20 108 typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_pcie_hc { 109 uint16 version; /* HEALTH_CHECK_PCIEDEV_VERSION_1 */ 110 uint16 reserved; 111 uint16 pcie_err_ind_type; /* PCIE Module TAGs */ 112 uint16 pcie_flag; 113 uint32 pcie_control_reg; 114 uint32 pcie_config_regs[HC_PCIEDEV_CONFIG_REGLIST_MAX]; 115 } BWL_POST_PACKED_STRUCT bcm_dngl_pcie_hc_t; 116 117 /* This marks the end of a packed structure section. */ 118 #include <packed_section_end.h> 119 120 #endif /* _DNGLEVENT_H_ */ 121