trident2plus.h (29549B)
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: trident2plus.h 8 * Purpose: Function declarations for Trident2+ Internal functions. 9 */ 10 11 #ifndef _BCM_INT_TRIDENT2PLUS_H_ 12 #define _BCM_INT_TRIDENT2PLUS_H_ 13 14 #if defined(BCM_TRIDENT2PLUS_SUPPORT) 15 16 #include <bcm_int/esw/subport.h> 17 #include <bcm_int/esw/vxlan.h> 18 #include <bcm_int/esw/port.h> 19 #include <bcm_int/esw/l3.h> 20 #include <bcm/failover.h> 21 #include <bcm/rx.h> 22 #include <bcm/mpls.h> 23 #include <bcm/l3.h> 24 #include <bcm/oam.h> 25 26 27 28 #define TD2P_AGG_ID_INVALID (-1) 29 #define TD2P_AGG_ID_HW_INVALID (0x7F) 30 /* Number of protection switching groups/next hops 31 * represented per entry in the PROT_SW tables 32 * (INITIAL_PROT_NHI_TABLE_1, TX_INITIAL_PROT_GROUP_TABLE, 33 * RX_PROT_GROUP_TABLE, EGR_TX_PROT_GROUP_TABLE and 34 * EGR_L3_NEXT_HOP_1) 35 */ 36 #define BCM_TD2P_MPLS_PS_NUM_GROUPS_PER_ENTRY 128 37 38 #define BCM_TD2P_COE_MODULE_1 1 39 #define BCM_TD2P_COE_MODULE_2 2 40 #define BCM_TD2P_COE_MODULE_3 3 41 #define BCM_TD2P_COE_MODULE_4 4 42 #define BCM_TD2P_COE_MODULE_5 5 43 44 #define BCM_TD2P_ENTROPY_LABEL_ID_MAX (0xfffff) 45 #define BCM_TD2P_ENTROPY_LABEL_ID_VALID(_label_) \ 46 (_label_ <= BCM_TD2P_ENTROPY_LABEL_ID_MAX) 47 48 #define BCM_TD2P_ENTROPY_LABEL_MASK_MAX (0xfffff) 49 #define BCM_TD2P_ENTROPY_LABEL_MASK_VALID(_mask_) \ 50 ((_mask_ > 0) && (_mask_ <= BCM_TD2P_ENTROPY_LABEL_MASK_MAX)) 51 52 /* Corresponds of maximum logical number for the chip */ 53 #define TD2P_MAX_NUM_PORTS 106 54 55 #define BCM_PORT_IS_LOCAL_PHYSICAL(port) \ 56 (!BCM_GPORT_IS_SET(port) || \ 57 BCM_GPORT_IS_LOCAL(port) || \ 58 BCM_GPORT_IS_MODPORT(port)) 59 60 extern int bcm_td2p_vp_group_init(int unit); 61 extern int bcm_td2p_vp_group_detach(int unit); 62 extern int bcm_td2p_vp_vlan_member_set(int unit, bcm_gport_t gport, uint32 flags); 63 extern int bcm_td2p_vp_vlan_member_get(int unit, bcm_gport_t gport, uint32 *flags); 64 extern int bcm_td2p_vp_group_delete_all(int unit, bcm_vlan_t vlan_vpn, int egress); 65 extern int bcm_td2p_ing_vp_group_vlan_get_all(int unit, bcm_vlan_t vlan, 66 SHR_BITDCL *vp_bitmap); 67 extern int bcm_td2p_eg_vp_group_vlan_get_all(int unit, bcm_vlan_t vlan, 68 SHR_BITDCL *vp_bitmap); 69 70 extern int bcm_td2p_egr_vp_group_unmanaged_set(int unit, int flag); 71 extern int bcm_td2p_ing_vp_group_unmanaged_set(int unit, int flag); 72 extern int bcm_td2p_ing_vp_group_unmanaged_get(int unit); 73 extern int bcm_td2p_egr_vp_group_unmanaged_get(int unit); 74 extern int bcm_td2p_vlan_vp_group_set(int unit, int vlan_vpn, int egress, 75 int vp_group, int enable); 76 extern int bcm_td2p_vlan_vp_group_get(int unit, int vlan_vpn, int egress, 77 int vp_group, int *enable); 78 extern int bcm_td2p_vp_group_ut_state_set(int unit, int egr_vlan, 79 int vp_group, int ut_state); 80 extern int bcm_td2p_vp_group_ut_state_get(int unit, bcm_port_t gport, 81 bcm_vlan_t vlan, int *ut_state); 82 extern int bcm_td2p_vlan_vp_group_get_all(int unit, int vlan, int array_max, 83 bcm_gport_t *gport_array, int *flags_array, int *port_cnt); 84 85 86 extern int bcm_td2p_vp_group_port_move(int unit, int gport, bcm_vlan_t vlan_vpn, 87 int add, int egress, int flags); 88 extern int bcm_td2p_vp_group_vlan_vpn_stg_set(int unit, 89 int vlan_vpn, int egress, int stg); 90 extern int bcm_td2p_vp_group_vlan_vpn_stg_get(int unit, 91 int vlan_vpn, int egress, int *stg); 92 93 94 95 #ifdef BCM_WARM_BOOT_SUPPORT 96 extern int bcmi_xgs5_subport_wb_scache_alloc(int unit, uint16 version, 97 int *alloc_sz); 98 extern int bcmi_xgs5_subport_wb_sync(int unit, uint16 version, 99 uint8 **scache_ptr); 100 extern int bcmi_xgs5_subport_wb_recover(int unit, uint16 version, 101 uint8 **scache_ptr); 102 #endif /* BCM_WARM_BOOT_SUPPORT */ 103 104 105 #ifndef BCM_SW_STATE_DUMP_DISABLE 106 extern void bcm_td2p_vp_group_sw_dump(int unit); 107 #endif /* BCM_SW_STATE_DUMP_DISABLE */ 108 109 #ifdef INCLUDE_L3 110 #ifdef BCM_WARM_BOOT_SUPPORT 111 extern int bcm_td2p_ipmc_aggid_info_scache_size_get(int unit, uint32 *size); 112 extern int bcm_td2p_ipmc_aggid_info_sync(int unit, uint8 **scache_ptr); 113 extern int bcm_td2p_ipmc_aggid_info_recover(int unit, uint8 **scache_ptr); 114 #endif 115 116 /* IPMC replication per trunk function */ 117 extern int bcm_td2p_ipmc_egress_intf_set_for_trunk_first_member(int unit, 118 int repl_group, 119 bcm_port_t port, 120 int if_count, 121 bcm_if_t *if_array, 122 int is_l3, 123 int check_port, 124 bcm_trunk_t tgid); 125 extern int bcm_td2p_ipmc_egress_intf_set_for_same_pipe_member(int unit, 126 int repl_group, 127 bcm_port_t port, 128 bcm_port_t ori_port, 129 bcm_trunk_t tgid); 130 extern int bcm_td2p_ipmc_egress_intf_add_in_per_trunk_mode(int unit, 131 int repl_group, 132 bcm_port_t port, 133 int encap_id, 134 int is_l3); 135 extern int bcm_td2p_ipmc_egress_intf_del_in_per_trunk_mode(int unit, 136 int repl_group, 137 bcm_port_t port, 138 int if_max, 139 int encap_id, 140 int is_l3); 141 142 extern int bcm_td2p_ipmc_egress_intf_add_for_trunk(int unit, int repl_group, 143 bcm_trunk_t tgid, 144 int encap_id, int is_l3); 145 extern int bcm_td2p_ipmc_egress_intf_del_for_trunk(int unit, int repl_group, 146 bcm_trunk_t tgid, 147 int if_max, int encap_id, 148 int is_l3); 149 extern int bcm_td2p_ipmc_egress_intf_add_trunk_member(int unit, int repl_group, 150 bcm_port_t port); 151 extern int bcm_td2p_ipmc_egress_intf_del_trunk_member(int unit, int repl_group, 152 bcm_port_t port); 153 154 extern int bcm_td2p_failover_init(int unit); 155 extern void bcm_td2p_failover_unlock(int unit); 156 extern int bcm_td2p_failover_lock(int unit); 157 extern int bcm_td2p_failover_init(int unit); 158 extern int bcm_td2p_failover_cleanup(int unit); 159 extern int bcm_td2p_failover_create(int unit, uint32 flags, 160 bcm_failover_t *failover_id); 161 extern int bcm_td2p_failover_destroy(int unit, bcm_failover_t failover_id); 162 extern int bcm_td2p_failover_status_set(int unit, 163 bcm_failover_element_t *failover, int value); 164 extern int bcm_td2p_failover_status_get(int unit, 165 bcm_failover_element_t *failover, int *value); 166 extern int bcm_td2p_failover_prot_nhi_set(int unit, uint32 flags, 167 int nh_index, uint32 prot_nh_index, bcm_multicast_t mc_group, 168 bcm_failover_t failover_id); 169 extern int bcm_td2p_failover_prot_nhi_get(int unit, int nh_index, 170 bcm_failover_t *failover_id, int *prot_nh_index, 171 bcm_multicast_t *mc_group); 172 extern int bcm_td2p_failover_prot_nhi_cleanup(int unit, int nh_index); 173 extern int bcm_td2p_failover_prot_nhi_update(int unit, int old_nh_index, 174 int new_nh_index); 175 extern int _bcm_td2p_failover_ingress_id_validate(int unit, 176 bcm_failover_t failover_id); 177 extern int bcm_td2p_dvp_vlan_xlate_key_set(int unit, 178 bcm_gport_t port_id, int key_type); 179 extern int bcm_td2p_dvp_vlan_xlate_key_get(int unit, 180 bcm_gport_t port_id, int *key_type); 181 extern void bcm_td2_vxlan_port_match_count_adjust(int unit, int vp, int step); 182 extern int bcm_td2p_share_vp_get(int unit, bcm_vpn_t vpn, SHR_BITDCL *vp_bitmap); 183 extern int bcm_td2p_share_vp_delete(int unit, bcm_vpn_t vpn, int vp); 184 185 /* DVP Group ID check*/ 186 extern int bcm_td2p_dvp_group_validate(int unit, int dvp_group_id); 187 188 extern int bcm_td2p_mpls_entropy_identifier_add(int unit, uint32 options, 189 bcm_mpls_entropy_identifier_t *info); 190 extern int bcm_td2p_mpls_entropy_identifier_delete(int unit, 191 bcm_mpls_entropy_identifier_t *info); 192 extern int bcm_td2p_mpls_entropy_identifier_delete_all(int unit); 193 extern int bcm_td2p_mpls_entropy_identifier_get(int unit, 194 bcm_mpls_entropy_identifier_t *info); 195 extern int bcm_td2p_mpls_entropy_identifier_traverse(int unit, 196 bcm_mpls_entropy_identifier_traverse_cb cb, void *user_data); 197 198 extern int bcm_td2p_l3_tables_init(int unit); 199 extern int bcm_td2p_l3_defip_init(int unit); 200 extern void bcm_td2p_l3_defip_deinit(int unit); 201 extern int bcm_td2p_defip_mc_route_check(int unit, _bcm_defip_cfg_t *lpm_cfg); 202 extern int bcm_td2p_defip_ipmc_count_update(int unit); 203 204 extern void bcmi_failover_dependent_free_resources(int unit); 205 206 #if defined(BCM_RIOT_SUPPORT) || defined(BCM_MULTI_LEVEL_ECMP_SUPPORT) 207 208 /* ECMP Single level */ 209 #define BCMI_L3_ECMP_SINGLE_LEVEL 1 210 211 /* Overlay validity checks */ 212 #define BCMI_L3_ECMP_IS_MULTI_LEVEL(_u) \ 213 (((&_bcm_l3_bk_info[unit])->l3_ecmp_levels) > BCMI_L3_ECMP_SINGLE_LEVEL) 214 215 #define BCMI_L3_ECMP_OVERLAY_ENTRIES(_u) \ 216 ((&_bcm_l3_bk_info[_u])->l3_ecmp_overlay_entries) 217 218 #endif 219 220 /******************************************************************| 221 |************** *****************| 222 |************** RIOT BLOCK *****************| 223 |************** *****************| 224 */ 225 226 /* RIOT related defines */ 227 228 #ifdef BCM_RIOT_SUPPORT 229 230 231 /* TD2+ : EGR_L3_NEXT_HOP-KEY_TYPEf */ 232 #define BCMI_L3_EGR_NH_MCAST_ENTRY_TYPE 7 233 #define BCMI_L3_EGR_NH_SD_TAG_ENTRY_TYPE 2 234 235 236 /* L3 interface banks values */ 237 #define BCMI_L3_INTF_ENT_PER_BANK(_u_) ((SOC_IS_HELIX5(_u_)) ? 1024 : 2048) 238 #define BCMI_L3_INTF_BANKS_MAX(_u_) ((SOC_IS_HELIX5(_u_)) ? 8 : 6) 239 240 /* L3 next hop banks values */ 241 #define BCMI_L3_NH_ENT_PER_BANK(_u_) ((SOC_IS_HELIX5(_u_)) ? 2048 : 4096) 242 #define BCMI_L3_NH_BANKS_MAX 12 243 244 /* L3 ECMP banks values */ 245 #define BCMI_L3_ECMP_GROUP_PER_BANK(_u_) ((SOC_IS_HELIX5(_u_)) ? 256 : 512) 246 #define BCMI_L3_ECMP_PER_BANK(_u_) ((SOC_IS_HELIX5(_u_)) ? 1024 : 4096) 247 #define BCMI_L3_ECMP_MAX_BANKS(_u_) ((SOC_IS_HELIX5(_u_)) ? 4 : 8) 248 249 /* NH destination encodings, masks and macros */ 250 #define BCMI_L3_NH_DEST_DGLP_SHIFT 15 251 #define BCMI_L3_NH_DEST_DGLP_MASK 0x7FFF /* 15 bits value */ 252 #define BCMI_L3_NH_DEST_DGLP_EN_MASK 0x7 /* 3 bits value */ 253 #define BCMI_L3_NH_DEST_DGLP_ENCODING 0x0 /* 15 bits value */ 254 #define BCMI_L3_NH_DEST_DVP_SHIFT 14 /* 14 bits value */ 255 #define BCMI_L3_NH_DEST_DVP_MASK 0x3FFF /* 14 bits value */ 256 #define BCMI_L3_NH_DEST_DVP_EN_MASK 0xF /* 4 bits value */ 257 #define BCMI_L3_NH_DEST_DVP_ENCODING 0x3 /* 15 bits value */ 258 #define BCMI_L3_NH_DEST_LAG_SHIFT 14 /* 14 bits value */ 259 #define BCMI_L3_NH_DEST_LAG_MASK 0x3FFF /* 14 bits value */ 260 #define BCMI_L3_NH_DEST_LAG_EN_MASK 0xF /* 4 bits value */ 261 #define BCMI_L3_NH_DEST_LAG_ENCODING 0x2 /* 15 bits value */ 262 #define BCMI_L3_NH_DEST_DROP_SHIFT 12 /* 12 bits value */ 263 #define BCMI_L3_NH_DEST_DROP_MASK 0xFFF /* 12 bits value */ 264 #define BCMI_L3_NH_DEST_DROP_EN_MASK 0x3F /* 6 bits value */ 265 #define BCMI_L3_NH_DEST_DROP_ENCODING 0x1b /* 15 bits value */ 266 #define BCMI_L3_NH_DEST_IPMC_SHIFT 14 /* 14 bits value */ 267 #define BCMI_L3_NH_DEST_IPMC_MASK 0x3FFF /* 14 bits value */ 268 #define BCMI_L3_NH_DEST_IPMC_EN_MASK 0xF /* 4 bits value */ 269 #define BCMI_L3_NH_DEST_IPMC_ENCODING 0x4 /* 15 bits value */ 270 271 272 #define BCMI_L3_NH_DEST_DVP_GET(gport) \ 273 ((BCMI_L3_NH_DEST_DVP_ENCODING << BCMI_L3_NH_DEST_DVP_SHIFT) | \ 274 (gport & BCMI_L3_NH_DEST_DVP_MASK)) 275 276 #define BCMI_L3_NH_DEST_LAG_GET(gport) \ 277 ((BCMI_L3_NH_DEST_LAG_ENCODING << BCMI_L3_NH_DEST_LAG_SHIFT) | \ 278 (gport & BCMI_L3_NH_DEST_LAG_MASK)) 279 280 #define BCMI_L3_NH_DEST_DGLP_GET(gport) \ 281 ((BCMI_L3_NH_DEST_DGLP_ENCODING << BCMI_L3_NH_DEST_DGLP_SHIFT) | \ 282 (gport & BCMI_L3_NH_DEST_DGLP_MASK)) 283 284 #define BCMI_L3_NH_DEST_DROP_GET(gport) \ 285 ((BCMI_L3_NH_DEST_DROP_ENCODING << BCMI_L3_NH_DEST_DROP_SHIFT) | \ 286 (gport & BCMI_L3_NH_DEST_DROP_MASK)) 287 288 #define BCMI_L3_NH_DEST_IPMC_GET(gport) \ 289 ((BCMI_L3_NH_DEST_IPMC_ENCODING << BCMI_L3_NH_DEST_IPMC_SHIFT) | \ 290 (gport & BCMI_L3_NH_DEST_IPMC_MASK)) 291 292 #define BCMI_L3_NH_DEST_IS_LAG(_dest) \ 293 ((((_dest) >> BCMI_L3_NH_DEST_LAG_SHIFT) & BCMI_L3_NH_DEST_LAG_EN_MASK) == \ 294 BCMI_L3_NH_DEST_LAG_ENCODING) 295 296 #define BCMI_L3_NH_PORT_LAG_GET(_dest) \ 297 (((_dest) & BCMI_L3_NH_DEST_LAG_MASK)) 298 299 #define BCMI_L3_NH_DEST_IS_DGLP(_dest) \ 300 ((((_dest) >> BCMI_L3_NH_DEST_DGLP_SHIFT) & BCMI_L3_NH_DEST_DGLP_EN_MASK) == \ 301 BCMI_L3_NH_DEST_DGLP_ENCODING) 302 #define BCMI_L3_NH_PORT_DGLP_GET(_dest) \ 303 (((_dest) & BCMI_L3_NH_DEST_DGLP_MASK)) 304 305 #define BCMI_L3_NH_DEST_IS_DVP(_dest) \ 306 ((((_dest) >> BCMI_L3_NH_DEST_DVP_SHIFT) & BCMI_L3_NH_DEST_DVP_EN_MASK) == \ 307 BCMI_L3_NH_DEST_DVP_ENCODING) 308 309 #define BCMI_L3_NH_PORT_DVP_GET(_dest) \ 310 (((_dest) & BCMI_L3_NH_DEST_DVP_MASK)) 311 312 #define BCMI_L3_NH_DEST_IS_IPMC(_dest) \ 313 ((((_dest) >> BCMI_L3_NH_DEST_IPMC_SHIFT) & BCMI_L3_NH_DEST_IPMC_EN_MASK) == \ 314 BCMI_L3_NH_DEST_IPMC_ENCODING) 315 316 #define BCMI_L3_NH_PORT_IPMC_GET(_dest) \ 317 (((_dest) & BCMI_L3_NH_DEST_IPMC_MASK)) 318 319 /* Td2+ : EGR_L3_NEXT_HOP-NEXT_PTR field types */ 320 #define BCMI_L3_NH_EGR_NEXT_PTR_TYPE_DVP 1 321 #define BCMI_L3_NH_EGR_NEXT_PTR_TYPE_NH 2 322 323 /* 324 * The below infrastructure is done specially for nh-nh association management. 325 * When overlay nh is associated with underlay nh, we will have to keep 326 * backward tracing to redraw association if underlay NH is changed. 327 */ 328 typedef struct ol_nh_link_s { 329 int o_nh_idx; 330 struct ol_nh_link_s *next_link; 331 } ol_nh_link_t; 332 333 typedef struct ul_nh_link_s { 334 int u_nh_idx; 335 ol_nh_link_t *ol_nh_assoc; 336 struct ul_nh_link_s *ul_nh_link; 337 } ul_nh_link_t; 338 339 /* TD2P specific routines */ 340 extern int bcmi_l3_riot_bank_sel(int unit); 341 extern int bcmi_get_port_from_destination(int unit, 342 uint32 dest, bcm_l3_egress_t *nh); 343 344 /* ol-ul association routines */ 345 extern int bcmi_l3_nh_assoc_ol_ul_link_sw_add(int unit, 346 int ol_nh, int ul_nh); 347 extern int bcmi_l3_nh_assoc_ol_ul_link_delete(int unit, int nh_idx); 348 extern int bcmi_l3_nh_assoc_ol_ul_link_is_required(int unit, int vp_nh_index); 349 extern int bcmi_l3_nh_assoc_ol_ul_link_replace(int unit, 350 int old_ul, int new_ul); 351 extern int bcmi_l3_nh_assoc_ol_ul_link_sw_delete(int unit, int ol_nh, 352 int ul_nh); 353 extern int bcmi_l3_nh_assoc_ol_ul_link_reinit(int unit, int ol_nh_idx); 354 extern int bcmi_l3_nh_dest_set(int unit, 355 bcm_l3_egress_t *nh_entry, uint32 *nh_dest); 356 357 extern bcm_error_t _bcm_td2p_macda_oui_profile_init(int unit); 358 extern void _bcm_td2p_macda_oui_profile_deinit(int unit); 359 extern bcm_error_t 360 _bcm_td2p_l3_macda_oui_profile_entry_del(int unit, _bcm_l3_cfg_t *l3cfg, 361 int macda_oui_profile_index); 362 extern bcm_error_t 363 _bcm_td2p_l3_macda_oui_profile_entry_add(int unit, soc_mem_t mem, _bcm_l3_cfg_t *l3cfg, 364 uint32 *buf_p, int *macda_oui_profile_index); 365 extern bcm_error_t 366 _bcm_td2p_l3_macda_oui_profile_entry_replace(int unit, soc_mem_t mem, 367 _bcm_l3_cfg_t *l3cfg, uint32 *bufp); 368 extern bcm_error_t 369 _bcm_td2p_l3_macda_oui_profile_entry_parse(int unit, soc_mem_t mem, 370 _bcm_l3_cfg_t *l3cfg, void *l3x_entry); 371 extern bcm_error_t 372 _bcm_td2p_l3_get_macda_oui_profile_index(int unit, soc_mem_t mem_ext, 373 _bcm_l3_cfg_t *l3cfg, 374 int *macda_oui_profile_index, 375 int *ref_count); 376 extern void bcm_td2p_l3_extended_required_scache_size_get(int unit, int *size); 377 extern bcm_error_t bcm_td2p_l3_extended_view_sync(int unit, uint8 **scache_ptr); 378 extern bcm_error_t bcm_td2p_l3_extended_view_reinit(int unit, uint8 **scache_ptr); 379 380 /******************************************************************| 381 |************** *****************| 382 |************** RIOT BLOCK - Ends Here *****************| 383 |************** *****************| 384 */ 385 #endif /* BCM_RIOT_SUPPORT */ 386 387 /* 388 * Failover functions 389 */ 390 /******************************************************************| 391 |************** *****************| 392 |************** Multi Level Failover *****************| 393 |************** *****************| 394 */ 395 396 int 397 bcmi_failover_sync(int unit); 398 399 int 400 bcmi_failover_multi_level_prot_nhi_create(int unit, int nh_index); 401 int 402 bcmi_failover_multi_level_prot_nhi_set(int unit, int index, 403 uint32 prot_nh_index, bcm_multicast_t mc_group, 404 bcm_failover_t failover_id); 405 406 int 407 bcmi_failover_multi_level_prot_nhi_cleanup(int unit, int nh_index); 408 int 409 bcmi_failover_multi_level_prot_nhi_get(int unit, int nh_index, 410 bcm_failover_t *failover_id, int *prot_nh_index, 411 bcm_multicast_t *mc_group); 412 int 413 bcmi_failover_multi_level_attach(int unit, 414 bcm_failover_multi_level_t attach_info); 415 int 416 bcmi_failover_sync(int unit); 417 418 /* 419 * Scale is changed from 16K for apache. 420 */ 421 #define BCMI_TX_PROT_GROUP_MASK(u) \ 422 ((soc_feature(u, soc_feature_hierarchical_protection)) ? 0X7F : 0x7) 423 424 /*************** Multi Level Failover-Till Here **************/ 425 426 #endif /* INCLUDE_L3 */ 427 428 /* VLAN VFI */ 429 extern int bcm_td2p_vlan_vfi_mbrship_port_get(int unit, 430 bcm_vlan_t vid, int egress, pbmp_t *pbmp); 431 extern int bcm_td2p_vlan_vfi_mbrship_port_set(int unit, 432 bcm_vlan_t vid, int egress, int add, pbmp_t pbmp); 433 extern int bcm_td2p_vlan_vpn_membership_delete(int unit, bcm_vlan_t vlan_vpn); 434 435 extern int bcm_td2p_vp_group_stg_move(int unit, int stg, int port, int stp_state, 436 int egress); 437 extern int _bcm_vlan_vfi_membership_profile_entry_op(int unit, 438 void **entries, 439 int entries_per_set, 440 int del, 441 int egress, 442 uint32 *index); 443 444 extern int _bcm_vlan_vfi_membership_profile_mem_reference(int unit, 445 int index, 446 int entries_per_set, 447 int egress); 448 extern int bcm_td2p_vp_group_stp_init(int unit, int stg, int egress, int stp_state); 449 extern int bcm_td2p_vp_group_stp_state_set(int unit, int stg, int gport, 450 int egress, int stp_state); 451 extern int bcm_td2p_vp_group_stp_state_get(int unit, int stg, int gport, int egress, 452 int *stp_state); 453 454 extern int _bcm_vlan_vfi_mbrship_profile_ref_count(int unit, int index, 455 int egress, int *ref_count); 456 457 extern int bcmi_td2p_vlan_control_vpn_get(int unit, bcm_vlan_t vid, 458 uint32 valid_fields, bcm_vlan_control_vlan_t *control); 459 extern int bcmi_td2p_vlan_control_vpn_set(int unit, bcm_vlan_t vid, 460 uint32 valid_fields, bcm_vlan_control_vlan_t *control); 461 462 /* Subport functions */ 463 extern int bcm_td2plus_subport_coe_init(int unit); 464 465 extern int bcm_td2p_cosq_ets_mode(int unit); 466 extern int bcm_td2p_rx_queue_channel_set(int unit,bcm_cos_queue_t queue_id,bcm_rx_chan_t chan_id); 467 468 extern int bcm_td2p_oam_init(int unit); 469 extern int bcm_fp_oam_detach(int unit); 470 extern int _bcm_td2p_oam_olp_fp_hw_index_get( 471 int unit, 472 bcm_field_olp_header_type_t olp_hdr_type, 473 int *hwindex); 474 extern int _bcm_td2p_oam_olp_hw_index_olp_type_get( 475 int unit, 476 int hwindex, 477 bcm_field_olp_header_type_t *olp_hdr_type ); 478 extern int bcm_fp_oam_group_create(int unit, 479 bcm_oam_group_info_t *group_info); 480 extern int bcm_fp_oam_group_get(int unit, bcm_oam_group_t group, 481 bcm_oam_group_info_t *group_info); 482 extern int bcm_fp_oam_group_destroy(int unit, bcm_oam_group_t group); 483 extern int bcm_fp_oam_endpoint_create(int unit, 484 bcm_oam_endpoint_info_t *endpoint_info); 485 extern int bcm_fp_oam_endpoint_get(int unit, bcm_oam_endpoint_t endpoint, 486 bcm_oam_endpoint_info_t *endpoint_info); 487 extern int bcm_fp_oam_endpoint_destroy(int unit, bcm_oam_endpoint_t endpoint); 488 extern int bcm_fp_oam_endpoint_destroy_all(int unit, bcm_oam_group_t group); 489 extern int bcm_fp_oam_event_register(int unit, 490 bcm_oam_event_types_t event_types, 491 bcm_oam_event_cb cb, void *user_data); 492 extern int bcm_fp_oam_event_unregister(int unit, 493 bcm_oam_event_types_t event_types, 494 bcm_oam_event_cb cb); 495 extern int bcm_fp_oam_loopback_add(int unit, bcm_oam_loopback_t *loopback_p); 496 extern int bcm_fp_oam_loopback_get(int unit, bcm_oam_loopback_t *loopback_p); 497 extern int bcm_fp_oam_loopback_delete(int unit, bcm_oam_loopback_t *loopback_p); 498 extern int bcm_fp_oam_loss_add(int unit, bcm_oam_loss_t *loss_p); 499 extern int bcm_fp_oam_loss_get(int unit, bcm_oam_loss_t *loss_p); 500 extern int bcm_fp_oam_loss_delete(int unit, bcm_oam_loss_t *loss_p); 501 extern int bcm_fp_oam_delay_add(int unit, bcm_oam_delay_t *delay_p); 502 extern int bcm_fp_oam_delay_get(int unit, bcm_oam_delay_t *delay_p); 503 extern int bcm_fp_oam_delay_delete(int unit, bcm_oam_delay_t *delay_p); 504 extern int _bcm_fp_oam_csf_add(int unit, bcm_oam_csf_t *csf_p); 505 extern int _bcm_fp_oam_csf_get(int unit, bcm_oam_csf_t *csf_p); 506 extern int _bcm_fp_oam_csf_delete(int unit, bcm_oam_csf_t *csf_p); 507 extern void _bcm_fp_oam_sw_dump(int unit); 508 extern int _bcm_fp_oam_sync(int unit); 509 extern int bcm_fp_oam_group_traverse(int unit, bcm_oam_group_traverse_cb cb, 510 void *user_data); 511 extern int bcm_fp_oam_endpoint_traverse(int unit, bcm_oam_group_t group, 512 bcm_oam_endpoint_traverse_cb cb, 513 void *user_data); 514 extern int bcm_fp_oam_endpoint_destroy_all(int unit, bcm_oam_group_t group_id); 515 extern int bcm_fp_oam_group_destroy_all(int unit); 516 extern int 517 bcm_fp_oam_pm_profile_create(int unit, bcm_oam_pm_profile_info_t *profile_info); 518 extern int 519 bcm_fp_oam_pm_profile_delete(int unit, bcm_oam_pm_profile_t profile_id); 520 extern int 521 bcm_fp_oam_pm_profile_delete_all(int unit); 522 extern int 523 bcm_fp_oam_pm_profile_detach(int unit, bcm_oam_endpoint_t endpoint_id, 524 bcm_oam_pm_profile_t profile_id); 525 extern int 526 bcm_fp_oam_pm_profile_get(int unit, bcm_oam_pm_profile_info_t *profile_info); 527 extern int 528 bcm_fp_oam_pm_profile_traverse(int unit, 529 bcm_oam_pm_profile_traverse_cb cb, void *user_data); 530 extern int bcm_fp_oam_pm_stats_get(int unit, 531 bcm_oam_endpoint_t endpoint_id, 532 bcm_oam_pm_stats_t *stats_ptr); 533 extern int bcm_fp_oam_pm_event_register(int unit, 534 bcm_oam_event_types_t event_types, 535 bcm_oam_pm_event_cb cb, void *user_data); 536 extern int bcm_fp_oam_pm_event_unregister(int unit, 537 bcm_oam_event_types_t event_types, 538 bcm_oam_pm_event_cb cb); 539 extern int 540 bcm_fp_oam_pm_raw_data_read_done(int unit, bcm_oam_event_types_t event_types, 541 uint32 read_index); 542 extern int 543 bcm_fp_oam_pm_profile_attach_get(int unit, bcm_oam_endpoint_t endpoint_id, 544 bcm_oam_pm_profile_t *profile_id); 545 extern int 546 bcm_fp_oam_pm_profile_attach(int unit, bcm_oam_endpoint_t endpoint_id, 547 bcm_oam_pm_profile_t profile_id); 548 549 extern int 550 bcm_fp_oam_trunk_ports_add (int unit, bcm_gport_t trunk_gport, 551 int max_ports, bcm_gport_t *port_arr); 552 extern int 553 bcm_fp_oam_trunk_ports_delete (int unit, bcm_gport_t trunk_gport, 554 int max_ports, bcm_gport_t *port_arr); 555 extern int 556 bcm_fp_oam_trunk_ports_get (int unit, bcm_gport_t trunk_gport, 557 int max_ports, bcm_gport_t *port_arr, 558 int *port_count); 559 560 extern int bcm_td2p_port_coe_e2ecc(int unit, bcm_port_t port, 561 bcm_port_congestion_config_t *config); 562 extern int bcm_td2p_cosq_subport_flow_control_set(int unit, bcm_gport_t subport, 563 bcm_gport_t sched_port); 564 extern int bcm_td2p_cosq_subport_flow_control_get(int unit, bcm_gport_t subport, 565 bcm_gport_t * sched_port); 566 567 /* 568 * Port Functions 569 */ 570 extern int 571 _bcm_td2p_port_control_egress_class_select_set(int unit, bcm_port_t port, uint32 value); 572 573 extern int 574 _bcm_td2p_port_control_egress_class_select_get(int unit, bcm_port_t port, uint32 *value); 575 576 extern int 577 _bcm_td2p_port_control_higig_class_select_set(int unit, bcm_port_t port, uint32 value); 578 579 extern int 580 _bcm_td2p_port_control_higig_class_select_get(int unit, bcm_port_t port, uint32 *value); 581 582 extern int 583 bcmi_td2p_port_fn_drv_init(int unit); 584 extern int 585 bcmi_td2p_port_lanes_get(int unit, bcm_port_t port, int *lanes); 586 extern int 587 bcmi_td2p_port_lanes_set(int unit, bcm_port_t port, int lanes); 588 589 /* Flexport port attach/detach functions */ 590 extern int 591 bcm_esw_td2p_flexport_port_attach(int unit, bcm_port_t port); 592 593 extern int 594 bcm_esw_td2p_flexport_port_detach(int unit, bcm_port_t port); 595 596 extern int 597 _bcm_td2p_port_stack_port_attach(int unit, bcm_port_t port); 598 599 extern int 600 _bcm_td2p_port_stack_port_detach(int unit, bcm_port_t port); 601 602 extern int 603 _bcm_td2p_vfi_membership_port_attach(int unit, bcm_port_t port); 604 605 extern int 606 _bcm_td2p_vfi_membership_port_detach(int unit, bcm_port_t port); 607 608 /* IPMC multicast enhancement */ 609 extern int bcm_td2p_aggid_info_detach(int unit); 610 extern int bcm_td2p_aggid_info_init(int unit); 611 extern int bcm_td2p_set_port_hw_agg_map(int unit, bcm_port_t port, int aggid); 612 extern int bcm_td2p_port_aggid_add(int unit, bcm_port_t port, bcm_trunk_t tgid, 613 int *aggid); 614 extern int bcm_td2p_port_aggid_del(int unit, bcm_port_t port); 615 extern int bcm_td2p_port_trunkid_get(int unit, bcm_port_t port, int *tgid); 616 extern int bcm_td2p_port_last_member_check(int unit, bcm_port_t port, int *val); 617 extern int bcm_td2p_port_to_aggid(int unit, bcm_port_t port, int *aggid); 618 619 /* Stat functions */ 620 extern int bcmi_td2p_stat_port_attach(int unit, bcm_port_t port); 621 extern int bcmi_td2p_stat_port_detach(int unit, bcm_port_t port); 622 623 /* Flex port */ 624 extern int 625 bcm_td2p_flexport_pbmp_update(int unit, bcm_pbmp_t *pbmp); 626 627 extern int bcm_td2p_vp_vlan_membership_get_all(int unit, bcm_vlan_t vlan, 628 int array_max, bcm_gport_t *gport_array, 629 int *flags_array, int *array_size); 630 631 extern int bcmi_td2p_vlan_block_set(int unit, bcm_vlan_t vid, 632 bcm_vlan_block_t *block); 633 extern int bcmi_td2p_vlan_block_get(int unit, bcm_vlan_t vid, 634 bcm_vlan_block_t *block); 635 #if defined(INCLUDE_BHH) 636 extern int bcm_fp_oam_mpls_tp_channel_type_tx_get(int unit, 637 bcm_oam_mpls_tp_channel_type_t channel_type, 638 int *value); 639 extern int bcm_fp_oam_mpls_tp_channel_type_tx_set(int unit, 640 bcm_oam_mpls_tp_channel_type_t channel_type, 641 int value); 642 #endif 643 #endif /* BCM_TRIDENT2PLUS_SUPPORT */ 644 645 #endif /* !_BCM_INT_TRIDENT2PLUS_H_ */