mim.c (2751B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * All Rights Reserved.$ 7 * 8 * Mac-in-Mac initializers 9 */ 10 #if defined(INCLUDE_L3) 11 #include <sal/core/libc.h> 12 13 #include <soc/drv.h> 14 #include <soc/mem.h> 15 #include <soc/l2u.h> 16 #include <soc/util.h> 17 #include <soc/debug.h> 18 19 #include <bcm/port.h> 20 #include <bcm/error.h> 21 #include <bcm/mim.h> 22 23 /* 24 * Function: 25 * bcm_mim_vpn_config_t_init 26 * Purpose: 27 * Initialize the MiM vpn config struct 28 * Parameters: 29 * mim_vpn_config - Pointer to the struct to be init'ed 30 */ 31 void 32 bcm_mim_vpn_config_t_init(bcm_mim_vpn_config_t *mim_vpn_config) 33 { 34 bcm_vlan_protocol_packet_ctrl_t *protocol_pkt_def; /* default action */ 35 if (mim_vpn_config != NULL) { 36 sal_memset(mim_vpn_config, 0, sizeof(*mim_vpn_config)); 37 protocol_pkt_def = &mim_vpn_config->protocol_pkt; 38 mim_vpn_config->inlif_counting_profile = BCM_STAT_LIF_COUNTING_PROFILE_NONE; 39 mim_vpn_config->outlif_counting_profile = BCM_STAT_LIF_COUNTING_PROFILE_NONE; 40 #if defined(BCM_TRIDENT3_SUPPORT) 41 if (SOC_REG_FIELD_VALID(0, PROTOCOL_PKT_CONTROLr, MMRP_FWD_ACTIONf)) 42 #endif 43 { 44 protocol_pkt_def->mmrp_action = BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 45 } 46 #if defined(BCM_TRIDENT3_SUPPORT) 47 if (SOC_REG_FIELD_VALID(0, PROTOCOL_PKT_CONTROLr, SRP_FWD_ACTIONf)) 48 #endif 49 { 50 protocol_pkt_def->srp_action = BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 51 } 52 protocol_pkt_def->igmp_report_leave_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 53 protocol_pkt_def->igmp_query_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 54 protocol_pkt_def->igmp_unknown_msg_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 55 protocol_pkt_def->mld_report_done_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 56 protocol_pkt_def->mld_query_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 57 protocol_pkt_def->ip4_mc_router_adv_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 58 protocol_pkt_def->ip4_rsvd_mc_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 59 protocol_pkt_def->ip6_mc_router_adv_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 60 protocol_pkt_def->ip6_rsvd_mc_action= BCM_VLAN_PROTO_PKT_FORWARD_ENABLE; 61 } 62 return; 63 } 64 65 /* 66 * Function: 67 * bcm_mim_port_t_init 68 * Purpose: 69 * Initialize the MiM port struct 70 * Parameters: 71 * port_info - Pointer to the struct to be init'ed 72 */ 73 void 74 bcm_mim_port_t_init(bcm_mim_port_t *port_info) 75 { 76 if (port_info != NULL) { 77 sal_memset(port_info, 0, sizeof(*port_info)); 78 } 79 return; 80 } 81 82 #else 83 int _bcm_mim_not_empty; 84 #endif /* INCLUDE_L3 */ 85