eth_lm_dm.h (2989B)
1 2 /* 3 * 4 * 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 8 * 9 * File: eth_lm_dm.h 10 * Purpose: ETH_LM_DM definitions common to SDK and uKernel 11 */ 12 #ifndef __ETH_LM_DM_H__ 13 #define __ETH_LM_DM_H__ 14 #if defined(INCLUDE_ETH_LM_DM) 15 16 #include <bcm/types.h> 17 #include <soc/uc_msg.h> 18 #include <soc/shared/mos_msg_common.h> 19 #include <soc/shared/eth_lm_dm.h> 20 #include <soc/shared/eth_lm_dm_pkt.h> 21 #include <soc/shared/eth_lm_dm_msg.h> 22 #include <soc/shared/eth_lm_dm_pack.h> 23 24 #include <bcm_int/common/rx.h> 25 26 /* 27 * ETH_LM_DM Encapsulation Definitions 28 * 29 * Defines for building the ETH_LM_DM packet encapsulation 30 */ 31 32 #define BCM_ETH_ENDPOINT_MAX_MEP_ID_LENGTH 32 33 34 /**************************************************************************************/ 35 #define _ETH_LM_DM_UC_MSG_TIMEOUT_USECS 5000000 36 37 #define BCM_ETH_ENDPOINT_PASSIVE 0x0004 /* Specifies endpoint 38 takes passive role */ 39 #define BCM_ETH_ENDPOINT_DEMAND 0x0008 /* Specifies local*/ 40 #define BCM_ETH_ENDPOINT_ENCAP_SET 0x0010 /* Update encapsulation 41 on existing BFD 42 endpoint */ 43 /* 44 * ETH_LM_DM Encapsulation Format Header flags 45 * 46 * Indicates the type of headers/labels present in a ETH_LM_DM packet. 47 */ 48 #define _ETH_LM_DM_ENCAP_PKT_ETH_LM_DM (1 << 11) 49 /* 50 * Internal flags for ETH_LM_DM. 51 */ 52 #define _ETH_LM_DM_F_SESSION_IS_SET 0x00000001 53 #define _ETH_LM_DM_F_DM_IS_SET 0x00000002 54 #define _ETH_LM_DM_F_LM_IS_SET 0x00000004 55 56 #define ETH_LMDM_EVENT_THREAD_PRIORITY 200 57 58 /* 59 * Macros to pack uint8, uint16, uint32 in Network byte order 60 */ 61 #define _ETH_LM_DM_ENCAP_PACK_U8(_buf, _var) SHR_ETH_LM_DM_ENCAP_PACK_U8(_buf, _var) 62 #define _ETH_LM_DM_ENCAP_PACK_U16(_buf, _var) SHR_ETH_LM_DM_ENCAP_PACK_U16(_buf, _var) 63 #define _ETH_LM_DM_ENCAP_PACK_U32(_buf, _var) SHR_ETH_LM_DM_ENCAP_PACK_U32(_buf, _var) 64 65 66 /* VLAN Tag - 802.1Q */ 67 typedef struct _eth_lm_dm_vlan_tag_s { 68 uint16 tpid; /* 16: Tag Protocol Identifier */ 69 struct { 70 uint16 prio:3, /* 3: Priority Code Point */ 71 cfi:1, /* 1: Canonical Format Indicator */ 72 vid:12; /* 12: Vlan Identifier */ 73 } tci; /* Tag Control Identifier */ 74 } _eth_lm_dm_vlan_tag_t; 75 76 /* L2 Header */ 77 typedef struct _eth_l2_header_s { 78 bcm_mac_t dst_mac; /* 48: Destination MAC */ 79 bcm_mac_t src_mac; /* 48: Source MAC */ 80 _eth_lm_dm_vlan_tag_t vlan_tag; /* VLAN Tag */ 81 _eth_lm_dm_vlan_tag_t inner_vlan_tag; /* VLAN Tag */ 82 uint16 etype; /* 16: Ether Type */ 83 } _eth_l2_header_t; 84 85 #endif 86 #endif