1 /* 2 * Broadcom Event protocol definitions 3 * 4 * Dependencies: bcmeth.h 5 * 6 * Copyright (C) 1999-2019, Broadcom. 7 * 8 * Unless you and Broadcom execute a separate written software license 9 * agreement governing use of this software, this software is licensed to you 10 * under the terms of the GNU General Public License version 2 (the "GPL"), 11 * available at http://www.broadcom.com/licenses/GPLv2.php, with the 12 * following added to such license: 13 * 14 * As a special exception, the copyright holders of this software give you 15 * permission to link this software with independent modules, and to copy and 16 * distribute the resulting executable under terms of your choice, provided that 17 * you also meet, for each linked independent module, the terms and conditions 18 * of the license of that module. An independent module is a module which is 19 * not derived from this software. The special exception does not apply to any 20 * modifications of the software. 21 * 22 * Notwithstanding the above, under no circumstances may you combine this 23 * software in any way with any other Broadcom software provided under a license 24 * other than the GPL, without Broadcom's express prior written consent. 25 * 26 * 27 * <<Broadcom-WL-IPTag/Open:>> 28 * 29 * $Id: dnglevent.h $ 30 * 31 * ----------------------------------------------------------------------------- 32 * 33 */ 34 35 /* 36 * Broadcom dngl Ethernet Events protocol defines 37 * 38 */ 39 40 #ifndef _DNGLEVENT_H_ 41 #define _DNGLEVENT_H_ 42 43 #ifndef _TYPEDEFS_H_ 44 #include <typedefs.h> 45 #endif // endif 46 #include <bcmeth.h> 47 #include <ethernet.h> 48 49 /* This marks the start of a packed structure section. */ 50 #include <packed_section_start.h> 51 #define BCM_DNGL_EVENT_MSG_VERSION 1 52 #define DNGL_E_RSRVD_1 0x0 53 #define DNGL_E_RSRVD_2 0x1 54 #define DNGL_E_SOCRAM_IND 0x2 55 typedef BWL_PRE_PACKED_STRUCT struct { 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 typedef enum socram_ind_tag { 77 SOCRAM_IND_ASSERT_TAG = 1, 78 SOCRAM_IND_TAG_HEALTH_CHECK = 2 79 } socram_ind_tag_t; 80 81 /* Health check top level module tags */ 82 typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_healthcheck { 83 uint16 top_module_tag; /* top level module tag */ 84 uint16 top_module_len; /* Type of PCIE issue indication */ 85 uint8 value[1]; /* data value with variable length specified by length */ 86 } BWL_POST_PACKED_STRUCT bcm_dngl_healthcheck_t; 87 88 /* Health check top level module tags */ 89 #define HEALTH_CHECK_TOP_LEVEL_MODULE_PCIEDEV_RTE 1 90 #define HEALTH_CHECK_PCIEDEV_VERSION_1 1 91 #define HEALTH_CHECK_PCIEDEV_FLAG_IN_D3_SHIFT 0 92 #define HEALTH_CHECK_PCIEDEV_FLAG_AER_SHIFT 1 93 #define HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN_SHIFT 2 94 #define HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT_SHIFT 3 95 #define HEALTH_CHECK_PCIEDEV_FLAG_NODS_SHIFT 4 96 #define HEALTH_CHECK_PCIEDEV_FLAG_NO_HOST_WAKE_SHIFT 5 97 #define HEALTH_CHECK_PCIEDEV_FLAG_IN_D3 \ 98 1 << HEALTH_CHECK_PCIEDEV_FLAG_IN_D3_SHIFT 99 #define HEALTH_CHECK_PCIEDEV_FLAG_AER 1 << HEALTH_CHECK_PCIEDEV_FLAG_AER_SHIFT 100 #define HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN \ 101 1 << HEALTH_CHECK_PCIEDEV_FLAG_LINKDOWN_SHIFT 102 #define HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT \ 103 1 << HEALTH_CHECK_PCIEDEV_FLAG_MSI_INT_SHIFT 104 #define HEALTH_CHECK_PCIEDEV_FLAG_NODS 1 << HEALTH_CHECK_PCIEDEV_FLAG_NODS_SHIFT 105 #define HEALTH_CHECK_PCIEDEV_FLAG_NO_HOST_WAKE \ 106 1 << HEALTH_CHECK_PCIEDEV_FLAG_NO_HOST_WAKE_SHIFT 107 /* PCIE Module TAGs */ 108 #define HEALTH_CHECK_PCIEDEV_INDUCED_IND 0x1 109 #define HEALTH_CHECK_PCIEDEV_H2D_DMA_IND 0x2 110 #define HEALTH_CHECK_PCIEDEV_D2H_DMA_IND 0x3 111 #define HEALTH_CHECK_PCIEDEV_IOCTL_STALL_IND 0x4 112 #define HEALTH_CHECK_PCIEDEV_D3ACK_STALL_IND 0x5 113 #define HEALTH_CHECK_PCIEDEV_NODS_IND 0x6 114 #define HEALTH_CHECK_PCIEDEV_LINKSPEED_FALLBACK_IND 0x7 115 #define HEALTH_CHECK_PCIEDEV_DSACK_STALL_IND 0x8 116 117 #define HC_PCIEDEV_CONFIG_REGLIST_MAX 25 118 typedef BWL_PRE_PACKED_STRUCT struct bcm_dngl_pcie_hc { 119 uint16 version; /* HEALTH_CHECK_PCIEDEV_VERSION_1 */ 120 uint16 reserved; 121 uint16 pcie_err_ind_type; /* PCIE Module TAGs */ 122 uint16 pcie_flag; 123 uint32 pcie_control_reg; 124 uint32 pcie_config_regs[HC_PCIEDEV_CONFIG_REGLIST_MAX]; 125 } BWL_POST_PACKED_STRUCT bcm_dngl_pcie_hc_t; 126 127 #ifdef HCHK_COMMON_SW_EVENT 128 /* Enumerating top level SW entities for use by health check */ 129 typedef enum { 130 HCHK_SW_ENTITY_UNDEFINED = 0, 131 HCHK_SW_ENTITY_PCIE = 1, 132 HCHK_SW_ENTITY_SDIO = 2, 133 HCHK_SW_ENTITY_USB = 3, 134 HCHK_SW_ENTITY_RTE = 4, 135 HCHK_SW_ENTITY_WL_PRIMARY = 5, /* WL instance 0 */ 136 HCHK_SW_ENTITY_WL_SECONDARY = 6, /* WL instance 1 */ 137 HCHK_SW_ENTITY_MAX 138 } hchk_sw_entity_t; 139 #endif /* HCHK_COMMON_SW_EVENT */ 140 141 /* This marks the end of a packed structure section. */ 142 #include <packed_section_end.h> 143 144 #endif /* _DNGLEVENT_H_ */ 145