ipmc.c (3892B)
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 * 7 * File: ipmc.c 8 * Purpose: Tracks and manages IPMC tables. 9 */ 10 11 #ifdef INCLUDE_L3 12 13 #include <soc/drv.h> 14 #include <soc/mem.h> 15 16 #include <bcm/error.h> 17 18 #include <bcm_int/esw/mbcm.h> 19 #include <bcm_int/esw/hercules.h> 20 21 int 22 bcm_hercules_ipmc_init(int unit) 23 { 24 #ifdef BCM_HERCULES_SUPPORT 25 if (SOC_IS_HERCULES15(unit)) { 26 return soc_mem_clear(unit, MEM_IPMCm, MEM_BLOCK_ALL, 0); 27 } 28 #endif 29 #ifdef BCM_HUMV_SUPPORT 30 if (SOC_IS_HUMV(unit)) { 31 ipmc_entry_t ent; 32 int i, imin, imax; 33 34 imin = soc_mem_index_min(unit, L3_IPMCm); 35 imax = soc_mem_index_max(unit, L3_IPMCm); 36 37 sal_memset(&ent, 0, sizeof(ent)); 38 soc_L3_IPMCm_field32_set(unit, &ent, VALIDf, 1); 39 for (i = imin; i <= imax; i++) { 40 SOC_IF_ERROR_RETURN 41 (WRITE_L3_IPMCm(unit, SOC_BLOCK_ALL, i, &ent)); 42 } 43 return BCM_E_NONE; 44 } 45 #endif 46 47 return BCM_E_UNAVAIL; 48 } 49 50 int 51 bcm_hercules_ipmc_detach(int unit) 52 { 53 /* Just clear tables, as done in init */ 54 return bcm_hercules_ipmc_init(unit); 55 } 56 57 int 58 bcm_hercules_ipmc_get(int unit, int index, bcm_ipmc_addr_t *ipmc) 59 { 60 return BCM_E_UNAVAIL; 61 } 62 63 int 64 bcm_hercules_ipmc_lookup(int unit, int *index, bcm_ipmc_addr_t *ipmc) 65 { 66 return BCM_E_UNAVAIL; 67 } 68 69 int 70 bcm_hercules_ipmc_add(int unit, bcm_ipmc_addr_t *ipmc) 71 { 72 return BCM_E_UNAVAIL; 73 } 74 75 int 76 bcm_hercules_ipmc_put(int unit, int index, bcm_ipmc_addr_t *ipmc) 77 { 78 return BCM_E_UNAVAIL; 79 } 80 81 int 82 bcm_hercules_ipmc_delete(int unit, bcm_ipmc_addr_t *ipmc) 83 { 84 return BCM_E_UNAVAIL; 85 } 86 87 int 88 bcm_hercules_ipmc_delete_all(int unit) 89 { 90 return bcm_hercules_ipmc_init(unit); 91 } 92 93 int 94 bcm_hercules_ipmc_age(int unit, uint32 flags, bcm_ipmc_traverse_cb age_out, 95 void *user_data) 96 { 97 return (BCM_E_UNAVAIL); 98 } 99 100 int 101 bcm_hercules_ipmc_traverse(int unit, uint32 flags, bcm_ipmc_traverse_cb cb, 102 void *user_data) 103 { 104 return (BCM_E_UNAVAIL); 105 } 106 107 int 108 bcm_hercules_ipmc_enable(int unit, int enable) 109 { 110 return BCM_E_UNAVAIL; 111 } 112 113 int 114 bcm_hercules_ipmc_src_port_check(int unit, int enable) 115 { 116 return BCM_E_UNAVAIL; 117 } 118 119 int 120 bcm_hercules_ipmc_src_ip_search(int unit, int enable) 121 { 122 return BCM_E_UNAVAIL; 123 } 124 125 int 126 bcm_hercules_ipmc_egress_port_set(int unit, bcm_port_t port, 127 const bcm_mac_t mac, int untag, 128 bcm_vlan_t vid, int ttl_thresh) 129 { 130 return BCM_E_UNAVAIL; 131 } 132 133 int 134 bcm_hercules_ipmc_egress_port_get(int unit, bcm_port_t port, sal_mac_addr_t mac, 135 int *untag, bcm_vlan_t *vid, int *ttl_thresh) 136 { 137 return BCM_E_UNAVAIL; 138 } 139 140 int 141 bcm_hercules_ipmc_repl_init(int unit) 142 { 143 return BCM_E_UNAVAIL; 144 } 145 146 int 147 bcm_hercules_ipmc_repl_detach(int unit) 148 { 149 return BCM_E_UNAVAIL; 150 } 151 152 int 153 bcm_hercules_ipmc_repl_get(int unit, int index, bcm_port_t port, 154 bcm_vlan_vector_t vlan_vec) 155 { 156 return BCM_E_UNAVAIL; 157 } 158 159 int 160 bcm_hercules_ipmc_repl_add(int unit, int index, bcm_port_t port, 161 bcm_vlan_t vlan) 162 { 163 return BCM_E_UNAVAIL; 164 } 165 166 int 167 bcm_hercules_ipmc_repl_delete(int unit, int index, bcm_port_t port, 168 bcm_vlan_t vlan) 169 { 170 return BCM_E_UNAVAIL; 171 } 172 173 int 174 bcm_hercules_ipmc_repl_delete_all(int unit, int index, bcm_port_t port) 175 { 176 return BCM_E_UNAVAIL; 177 } 178 179 int 180 bcm_hercules_ipmc_egress_intf_add(int unit, int index, bcm_port_t port, 181 bcm_l3_intf_t *l3_intf) 182 { 183 return BCM_E_UNAVAIL; 184 } 185 186 int 187 bcm_hercules_ipmc_egress_intf_delete(int unit, int index, bcm_port_t port, 188 bcm_l3_intf_t *l3_intf) 189 { 190 return BCM_E_UNAVAIL; 191 } 192 #endif /* INCLUDE_L3 */ 193 194 int _bcm_esw_hercules_ipmc_not_empty;