openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

trident2plus.h (30203B)


      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-2020 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, int ingress, 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 /* FB6 : Valid sizes of ECMP group for multi-level ECMP */
    219 #define BCMI_L3_ECMP_GROUP_FIRST_LKUP_MEM_SIZE_A 1024
    220 #define BCMI_L3_ECMP_GROUP_FIRST_LKUP_MEM_SIZE_B 2048
    221 
    222 #define BCMI_L3_ECMP_GROUP_OVERLAY_IN_UPPER_RANGE(_u) \
    223     ((&_bcm_l3_bk_info[_u])->l3_ecmp_group_first_lkup_mem_size == \
    224                         BCMI_L3_ECMP_GROUP_FIRST_LKUP_MEM_SIZE_B)
    225 
    226 #endif
    227 
    228 /******************************************************************|
    229 |**************                                   *****************|
    230 |**************           RIOT BLOCK              *****************|
    231 |**************                                   *****************|
    232  */
    233 
    234 /* RIOT related defines */
    235 
    236 #ifdef BCM_RIOT_SUPPORT
    237 
    238 
    239 /* TD2+ : EGR_L3_NEXT_HOP-KEY_TYPEf */
    240 #define BCMI_L3_EGR_NH_MCAST_ENTRY_TYPE  7
    241 #define BCMI_L3_EGR_NH_SD_TAG_ENTRY_TYPE 2
    242 
    243 
    244 /* L3 interface banks values */
    245 #define BCMI_L3_INTF_ENT_PER_BANK(_u_)   ((SOC_IS_HELIX5(_u_)) ? 1024 : (SOC_IS_HURRICANE4(_u_) ? 256 :2048))
    246 #define BCMI_L3_INTF_BANKS_MAX(_u_)       ((SOC_IS_HELIX5(_u_) || SOC_IS_HURRICANE4(_u_)) ? 8 : 6)
    247 
    248 /* L3 next hop banks values */
    249 #define BCMI_L3_NH_ENT_PER_BANK(_u_)     ((SOC_IS_HELIX5(_u_)) ? 2048 : \
    250                                          ((soc_feature(_u_, soc_feature_8k_l3_nh_per_bank)) ? 8192: 4096))
    251 #define BCMI_L3_NH_BANKS_MAX             (SOC_IS_HURRICANE4(_u_) ? 8 : 12)
    252 
    253 /* L3 ECMP banks values */
    254 #define BCMI_L3_ECMP_GROUP_PER_BANK(_u_) ((SOC_IS_HELIX5(_u_)) ? 256 : (SOC_IS_HURRICANE4(_u_) ? 64 : 512))
    255 #define BCMI_L3_ECMP_PER_BANK(_u_)       ((SOC_IS_HELIX5(_u_)) ? 1024 : (SOC_IS_HURRICANE4(_u_) ? 256 :4096))
    256 #define BCMI_L3_ECMP_MAX_BANKS(_u_)      ((SOC_IS_HELIX5(_u_) || SOC_IS_HURRICANE4(_u_)) ? 4 : 8)
    257 
    258 /* NH destination encodings, masks and macros */
    259 #define BCMI_L3_NH_DEST_DGLP_SHIFT       15
    260 #define BCMI_L3_NH_DEST_DGLP_MASK        0x7FFF   /* 15 bits value */
    261 #define BCMI_L3_NH_DEST_DGLP_EN_MASK     0x7      /* 3 bits value */
    262 #define BCMI_L3_NH_DEST_DGLP_ENCODING    0x0      /* 15 bits value */
    263 #define BCMI_L3_NH_DEST_DVP_SHIFT        14       /* 14 bits value */
    264 #define BCMI_L3_NH_DEST_DVP_MASK         0x3FFF   /* 14 bits value */
    265 #define BCMI_L3_NH_DEST_DVP_EN_MASK      0xF      /* 4 bits value */
    266 #define BCMI_L3_NH_DEST_DVP_ENCODING     0x3      /* 15 bits value */
    267 #define BCMI_L3_NH_DEST_LAG_SHIFT        14       /* 14 bits value */
    268 #define BCMI_L3_NH_DEST_LAG_MASK         0x3FFF   /* 14 bits value */
    269 #define BCMI_L3_NH_DEST_LAG_EN_MASK      0xF      /* 4 bits value */
    270 #define BCMI_L3_NH_DEST_LAG_ENCODING     0x2      /* 15 bits value */
    271 #define BCMI_L3_NH_DEST_DROP_SHIFT       12       /* 12 bits value */
    272 #define BCMI_L3_NH_DEST_DROP_MASK        0xFFF    /* 12 bits value */
    273 #define BCMI_L3_NH_DEST_DROP_EN_MASK     0x3F     /* 6 bits value */
    274 #define BCMI_L3_NH_DEST_DROP_ENCODING    0x1b     /* 15 bits value */
    275 #define BCMI_L3_NH_DEST_IPMC_SHIFT       14       /* 14 bits value */
    276 #define BCMI_L3_NH_DEST_IPMC_MASK        0x3FFF   /* 14 bits value */
    277 #define BCMI_L3_NH_DEST_IPMC_EN_MASK     0xF      /* 4 bits value */
    278 #define BCMI_L3_NH_DEST_IPMC_ENCODING    0x4      /* 15 bits value */
    279 
    280 
    281 #define BCMI_L3_NH_DEST_DVP_GET(gport) \
    282             ((BCMI_L3_NH_DEST_DVP_ENCODING << BCMI_L3_NH_DEST_DVP_SHIFT) | \
    283             (gport & BCMI_L3_NH_DEST_DVP_MASK))
    284 
    285 #define BCMI_L3_NH_DEST_LAG_GET(gport) \
    286             ((BCMI_L3_NH_DEST_LAG_ENCODING << BCMI_L3_NH_DEST_LAG_SHIFT) | \
    287             (gport & BCMI_L3_NH_DEST_LAG_MASK))
    288 
    289 #define BCMI_L3_NH_DEST_DGLP_GET(gport) \
    290             ((BCMI_L3_NH_DEST_DGLP_ENCODING << BCMI_L3_NH_DEST_DGLP_SHIFT) | \
    291             (gport & BCMI_L3_NH_DEST_DGLP_MASK))
    292 
    293 #define BCMI_L3_NH_DEST_DROP_GET(gport) \
    294             ((BCMI_L3_NH_DEST_DROP_ENCODING << BCMI_L3_NH_DEST_DROP_SHIFT) | \
    295             (gport & BCMI_L3_NH_DEST_DROP_MASK))
    296 
    297 #define BCMI_L3_NH_DEST_IPMC_GET(gport) \
    298             ((BCMI_L3_NH_DEST_IPMC_ENCODING << BCMI_L3_NH_DEST_IPMC_SHIFT) | \
    299             (gport & BCMI_L3_NH_DEST_IPMC_MASK))
    300 
    301 #define BCMI_L3_NH_DEST_IS_LAG(_dest)  \
    302             ((((_dest) >> BCMI_L3_NH_DEST_LAG_SHIFT) & BCMI_L3_NH_DEST_LAG_EN_MASK) == \
    303             BCMI_L3_NH_DEST_LAG_ENCODING)
    304 
    305 #define BCMI_L3_NH_PORT_LAG_GET(_dest) \
    306             (((_dest) & BCMI_L3_NH_DEST_LAG_MASK))
    307 
    308 #define BCMI_L3_NH_DEST_IS_DGLP(_dest)  \
    309             ((((_dest) >> BCMI_L3_NH_DEST_DGLP_SHIFT) & BCMI_L3_NH_DEST_DGLP_EN_MASK) == \
    310             BCMI_L3_NH_DEST_DGLP_ENCODING)
    311 #define BCMI_L3_NH_PORT_DGLP_GET(_dest) \
    312             (((_dest) & BCMI_L3_NH_DEST_DGLP_MASK))
    313 
    314 #define BCMI_L3_NH_DEST_IS_DVP(_dest)  \
    315             ((((_dest) >> BCMI_L3_NH_DEST_DVP_SHIFT) & BCMI_L3_NH_DEST_DVP_EN_MASK) == \
    316             BCMI_L3_NH_DEST_DVP_ENCODING)
    317 
    318 #define BCMI_L3_NH_PORT_DVP_GET(_dest) \
    319             (((_dest) & BCMI_L3_NH_DEST_DVP_MASK))
    320 
    321 #define BCMI_L3_NH_DEST_IS_IPMC(_dest)  \
    322             ((((_dest) >> BCMI_L3_NH_DEST_IPMC_SHIFT) & BCMI_L3_NH_DEST_IPMC_EN_MASK) == \
    323             BCMI_L3_NH_DEST_IPMC_ENCODING)
    324 
    325 #define BCMI_L3_NH_PORT_IPMC_GET(_dest) \
    326             (((_dest) & BCMI_L3_NH_DEST_IPMC_MASK))
    327 
    328 /* Td2+ : EGR_L3_NEXT_HOP-NEXT_PTR field types */
    329 #define BCMI_L3_NH_EGR_NEXT_PTR_TYPE_DVP    1
    330 #define BCMI_L3_NH_EGR_NEXT_PTR_TYPE_NH     2
    331 
    332 /*
    333  * The below infrastructure is done specially for nh-nh association management.
    334  * When overlay nh is associated with underlay nh, we will have to keep
    335  * backward tracing to redraw association if underlay NH is changed.
    336  */
    337 typedef struct ol_nh_link_s {
    338     int o_nh_idx;
    339     struct ol_nh_link_s *next_link;
    340 } ol_nh_link_t;
    341 
    342 typedef struct ul_nh_link_s {
    343     int u_nh_idx;
    344     ol_nh_link_t *ol_nh_assoc;
    345     struct ul_nh_link_s *ul_nh_link;
    346 } ul_nh_link_t;
    347 
    348 /* TD2P specific routines */
    349 extern int bcmi_l3_riot_bank_sel(int unit);
    350 extern int bcmi_get_port_from_destination(int unit,
    351                uint32 dest, bcm_l3_egress_t *nh);
    352 
    353 /* ol-ul association routines */
    354 extern int bcmi_l3_nh_assoc_ol_ul_link_sw_add(int unit,
    355                int ol_nh, int ul_nh);
    356 extern int bcmi_l3_nh_assoc_ol_ul_link_delete(int unit, int nh_idx);
    357 extern int bcmi_l3_nh_assoc_ol_ul_link_is_required(int unit, int vp_nh_index);
    358 extern int bcmi_l3_nh_assoc_ol_ul_link_replace(int unit,
    359                int old_ul, int new_ul);
    360 extern int bcmi_l3_nh_assoc_ol_ul_link_sw_delete(int unit, int ol_nh,
    361                int ul_nh);
    362 extern int bcmi_l3_nh_assoc_ol_ul_link_reinit(int unit, int ol_nh_idx);
    363 extern int bcmi_l3_nh_dest_set(int unit,
    364                bcm_l3_egress_t *nh_entry, uint32 *nh_dest);
    365 
    366 extern bcm_error_t _bcm_td2p_macda_oui_profile_init(int unit);
    367 extern void _bcm_td2p_macda_oui_profile_deinit(int unit);
    368 extern bcm_error_t
    369 _bcm_td2p_l3_macda_oui_profile_entry_del(int unit, _bcm_l3_cfg_t *l3cfg,
    370                                          int macda_oui_profile_index);
    371 extern bcm_error_t
    372 _bcm_td2p_l3_macda_oui_profile_entry_add(int unit, soc_mem_t mem, _bcm_l3_cfg_t *l3cfg,
    373                                          uint32 *buf_p, int *macda_oui_profile_index);
    374 extern bcm_error_t
    375 _bcm_td2p_l3_macda_oui_profile_entry_replace(int unit, soc_mem_t mem,
    376                                              _bcm_l3_cfg_t *l3cfg, uint32 *bufp);
    377 extern bcm_error_t
    378 _bcm_td2p_l3_macda_oui_profile_entry_parse(int unit, soc_mem_t mem,
    379                                            _bcm_l3_cfg_t *l3cfg, void *l3x_entry);
    380 extern bcm_error_t
    381 _bcm_td2p_l3_get_macda_oui_profile_index(int unit, soc_mem_t mem_ext,
    382                                          _bcm_l3_cfg_t *l3cfg,
    383                                          int *macda_oui_profile_index,
    384                                          int *ref_count);
    385 extern void bcm_td2p_l3_extended_required_scache_size_get(int unit, int *size);
    386 extern bcm_error_t bcm_td2p_l3_extended_view_sync(int unit, uint8 **scache_ptr);
    387 extern bcm_error_t bcm_td2p_l3_extended_view_reinit(int unit, uint8 **scache_ptr);
    388 
    389 /******************************************************************|
    390 |**************                                   *****************|
    391 |**************    RIOT BLOCK - Ends Here         *****************|
    392 |**************                                   *****************|
    393  */
    394 #endif /* BCM_RIOT_SUPPORT */
    395 
    396 /*
    397  * Failover functions
    398  */
    399 /******************************************************************|
    400 |**************                                   *****************|
    401 |**************    Multi Level Failover           *****************|
    402 |**************                                   *****************|
    403  */
    404 
    405 int
    406 bcmi_failover_sync(int unit);
    407 
    408 int
    409 bcmi_failover_multi_level_prot_nhi_create(int unit, int nh_index);
    410 int
    411 bcmi_failover_multi_level_prot_nhi_set(int unit, int index,
    412                 uint32 prot_nh_index, bcm_multicast_t mc_group,
    413                 bcm_failover_t failover_id);
    414 
    415 int
    416 bcmi_failover_multi_level_prot_nhi_cleanup(int unit, int nh_index);
    417 int
    418 bcmi_failover_multi_level_prot_nhi_get(int unit, int nh_index,
    419                 bcm_failover_t *failover_id, int *prot_nh_index,
    420                 bcm_multicast_t *mc_group);
    421 int
    422 bcmi_failover_multi_level_attach(int unit,
    423         bcm_failover_multi_level_t attach_info);
    424 int
    425 bcmi_failover_sync(int unit);
    426 
    427 /*
    428  * Scale is changed from 16K for apache.
    429  */
    430 #define BCMI_TX_PROT_GROUP_MASK(u)    \
    431     ((soc_feature(u, soc_feature_hierarchical_protection)) ? 0X7F : 0x7)
    432 
    433 /***************     Multi Level Failover-Till Here    **************/
    434 
    435 #endif /* INCLUDE_L3 */
    436 
    437 /* VLAN VFI */
    438 extern int bcm_td2p_vlan_vfi_mbrship_port_get(int unit,
    439                         bcm_vlan_t vid, int egress, pbmp_t *pbmp);
    440 extern int bcm_td2p_vlan_vfi_mbrship_port_set(int unit,
    441                         bcm_vlan_t vid, int egress, int add, pbmp_t pbmp);
    442 extern int bcm_td2p_vlan_vpn_membership_delete(int unit, bcm_vlan_t vlan_vpn);
    443 
    444 extern int bcm_td2p_vp_group_stg_move(int unit, int stg, int port, int stp_state,
    445                            int egress);
    446 extern int _bcm_vlan_vfi_membership_profile_entry_op(int unit,
    447                                                      void **entries,
    448                                                      int entries_per_set,
    449                                                      int del,
    450                                                      int egress,
    451                                                      uint32 *index);
    452 
    453 extern int _bcm_vlan_vfi_membership_profile_mem_reference(int unit,
    454                                                           int index,
    455                                                           int entries_per_set,
    456                                                           int egress);
    457 extern int bcm_td2p_vp_group_stp_init(int unit, int stg, int egress, int stp_state);
    458 extern int bcm_td2p_vp_group_stp_state_set(int unit, int stg, int gport,
    459                                                     int egress, int stp_state);
    460 extern int bcm_td2p_vp_group_stp_state_get(int unit, int stg, int gport, int egress,
    461                                      int *stp_state);
    462 
    463 extern int _bcm_vlan_vfi_mbrship_profile_ref_count(int unit, int index,
    464                                                    int egress, int *ref_count);
    465 
    466 extern int bcmi_td2p_vlan_control_vpn_get(int unit, bcm_vlan_t vid,
    467                uint32 valid_fields, bcm_vlan_control_vlan_t *control);
    468 extern int bcmi_td2p_vlan_control_vpn_set(int unit, bcm_vlan_t vid,
    469                uint32 valid_fields, bcm_vlan_control_vlan_t *control);
    470 
    471 /* Subport functions */
    472 extern int bcm_td2plus_subport_coe_init(int unit);
    473 
    474 extern int bcm_td2p_cosq_ets_mode(int unit);
    475 extern int bcm_td2p_rx_queue_channel_set(int unit,bcm_cos_queue_t queue_id,bcm_rx_chan_t chan_id);
    476 
    477 extern int bcm_td2p_oam_init(int unit);
    478 extern int bcm_fp_oam_detach(int unit);
    479 extern int _bcm_td2p_oam_olp_fp_hw_index_get(
    480             int unit,
    481             bcm_field_olp_header_type_t olp_hdr_type,
    482             int *hwindex);
    483 extern int _bcm_td2p_oam_olp_hw_index_olp_type_get(
    484             int unit,
    485             int hwindex,
    486             bcm_field_olp_header_type_t *olp_hdr_type );
    487 extern int bcm_fp_oam_group_create(int unit,
    488                                       bcm_oam_group_info_t *group_info);
    489 extern int bcm_fp_oam_group_get(int unit, bcm_oam_group_t group,
    490                          bcm_oam_group_info_t *group_info);
    491 extern int bcm_fp_oam_group_destroy(int unit, bcm_oam_group_t group);
    492 extern int bcm_fp_oam_endpoint_create(int unit, 
    493                                       bcm_oam_endpoint_info_t *endpoint_info);
    494 extern int bcm_fp_oam_endpoint_get(int unit, bcm_oam_endpoint_t endpoint,
    495                          bcm_oam_endpoint_info_t *endpoint_info);
    496 extern int bcm_fp_oam_endpoint_destroy(int unit, bcm_oam_endpoint_t endpoint);
    497 extern int bcm_fp_oam_endpoint_destroy_all(int unit, bcm_oam_group_t group);
    498 extern int bcm_fp_oam_event_register(int unit,
    499                                          bcm_oam_event_types_t event_types,
    500                                          bcm_oam_event_cb cb, void *user_data);
    501 extern int bcm_fp_oam_event_unregister(int unit,
    502                                            bcm_oam_event_types_t event_types,
    503                                            bcm_oam_event_cb cb);
    504 extern int bcm_fp_oam_loopback_add(int unit, bcm_oam_loopback_t *loopback_p);
    505 extern int bcm_fp_oam_loopback_get(int unit, bcm_oam_loopback_t *loopback_p);
    506 extern int bcm_fp_oam_loopback_delete(int unit, bcm_oam_loopback_t *loopback_p);
    507 extern int bcm_fp_oam_loss_add(int unit, bcm_oam_loss_t *loss_p);
    508 extern int bcm_fp_oam_loss_get(int unit, bcm_oam_loss_t *loss_p);
    509 extern int bcm_fp_oam_loss_delete(int unit, bcm_oam_loss_t *loss_p);
    510 extern int bcm_fp_oam_delay_add(int unit, bcm_oam_delay_t *delay_p);
    511 extern int bcm_fp_oam_delay_get(int unit, bcm_oam_delay_t *delay_p);
    512 extern int bcm_fp_oam_delay_delete(int unit, bcm_oam_delay_t *delay_p);
    513 extern int _bcm_fp_oam_csf_add(int unit, bcm_oam_csf_t *csf_p);
    514 extern int _bcm_fp_oam_csf_get(int unit, bcm_oam_csf_t *csf_p);
    515 extern int _bcm_fp_oam_csf_delete(int unit, bcm_oam_csf_t *csf_p);
    516 extern void _bcm_fp_oam_sw_dump(int unit);
    517 extern int _bcm_fp_oam_sync(int unit);
    518 extern int bcm_fp_oam_group_traverse(int unit, bcm_oam_group_traverse_cb cb,
    519                            void *user_data);
    520 extern int bcm_fp_oam_endpoint_traverse(int unit, bcm_oam_group_t group,
    521                              bcm_oam_endpoint_traverse_cb cb,
    522                              void *user_data);
    523 extern int bcm_fp_oam_endpoint_destroy_all(int unit, bcm_oam_group_t group_id);
    524 extern int bcm_fp_oam_group_destroy_all(int unit);
    525 extern int
    526 bcm_fp_oam_pm_profile_create(int unit, bcm_oam_pm_profile_info_t *profile_info);
    527 extern int
    528 bcm_fp_oam_pm_profile_delete(int unit, bcm_oam_pm_profile_t profile_id);
    529 extern int
    530 bcm_fp_oam_pm_profile_delete_all(int unit);
    531 extern int 
    532 bcm_fp_oam_pm_profile_detach(int unit, bcm_oam_endpoint_t endpoint_id,
    533                                   bcm_oam_pm_profile_t profile_id);
    534 extern int
    535 bcm_fp_oam_pm_profile_get(int unit, bcm_oam_pm_profile_info_t *profile_info);
    536 extern int
    537 bcm_fp_oam_pm_profile_traverse(int unit,
    538                     bcm_oam_pm_profile_traverse_cb cb, void *user_data);
    539 extern int bcm_fp_oam_pm_stats_get(int unit,
    540                             bcm_oam_endpoint_t endpoint_id, 
    541                             bcm_oam_pm_stats_t *stats_ptr);
    542 extern int bcm_fp_oam_pm_event_register(int unit,
    543                                     bcm_oam_event_types_t event_types,
    544                                     bcm_oam_pm_event_cb cb, void *user_data);
    545 extern int bcm_fp_oam_pm_event_unregister(int unit,
    546                                      bcm_oam_event_types_t event_types,
    547                                      bcm_oam_pm_event_cb cb);
    548 extern int
    549 bcm_fp_oam_pm_raw_data_read_done(int unit, bcm_oam_event_types_t event_types,
    550                                   uint32 read_index);
    551 extern int
    552 bcm_fp_oam_pm_profile_attach_get(int unit, bcm_oam_endpoint_t endpoint_id,
    553                                  bcm_oam_pm_profile_t *profile_id);
    554 extern int
    555 bcm_fp_oam_pm_profile_attach(int unit, bcm_oam_endpoint_t endpoint_id,
    556         bcm_oam_pm_profile_t profile_id);
    557 
    558 extern int 
    559 bcm_fp_oam_trunk_ports_add (int unit, bcm_gport_t trunk_gport,
    560                             int max_ports, bcm_gport_t *port_arr);
    561 extern int
    562 bcm_fp_oam_trunk_ports_delete (int unit, bcm_gport_t trunk_gport,
    563                                int max_ports, bcm_gport_t *port_arr);
    564 extern int
    565 bcm_fp_oam_trunk_ports_get (int unit, bcm_gport_t trunk_gport,
    566                             int max_ports, bcm_gport_t *port_arr,
    567                             int *port_count);
    568 
    569 extern int bcm_td2p_port_coe_e2ecc(int unit, bcm_port_t port,
    570         bcm_port_congestion_config_t *config);
    571 extern int bcm_td2p_cosq_subport_flow_control_set(int unit, bcm_gport_t subport, 
    572                                                   bcm_gport_t sched_port);
    573 extern int bcm_td2p_cosq_subport_flow_control_get(int unit, bcm_gport_t subport, 
    574                                                   bcm_gport_t * sched_port);
    575 
    576 /*
    577  * Port Functions
    578  */
    579 extern int
    580 _bcm_td2p_port_control_egress_class_select_set(int unit, bcm_port_t port, uint32 value);
    581 
    582 extern int
    583 _bcm_td2p_port_control_egress_class_select_get(int unit, bcm_port_t port, uint32 *value);
    584 
    585 extern int
    586 _bcm_td2p_port_control_higig_class_select_set(int unit, bcm_port_t port, uint32 value);
    587 
    588 extern int
    589 _bcm_td2p_port_control_higig_class_select_get(int unit, bcm_port_t port, uint32 *value);
    590 
    591 extern int
    592 bcmi_td2p_port_fn_drv_init(int unit);
    593 extern int
    594 bcmi_td2p_port_lanes_get(int unit, bcm_port_t port, int *lanes);
    595 extern int
    596 bcmi_td2p_port_lanes_set(int unit, bcm_port_t port, int lanes);
    597 
    598 /*  Flexport port attach/detach functions  */
    599 extern int
    600 bcm_esw_td2p_flexport_port_attach(int unit, bcm_port_t port);
    601 
    602 extern int
    603 bcm_esw_td2p_flexport_port_detach(int unit, bcm_port_t port);
    604 
    605 extern  int
    606 _bcm_td2p_port_stack_port_attach(int unit, bcm_port_t port);
    607 
    608 extern  int
    609 _bcm_td2p_port_stack_port_detach(int unit, bcm_port_t port);
    610 
    611 extern int
    612 _bcm_td2p_vfi_membership_port_attach(int unit, bcm_port_t port);
    613 
    614 extern int
    615 _bcm_td2p_vfi_membership_port_detach(int unit, bcm_port_t port);
    616 
    617 /* IPMC multicast enhancement */
    618 extern int bcm_td2p_aggid_info_detach(int unit);
    619 extern int bcm_td2p_aggid_info_init(int unit);
    620 extern int bcm_td2p_set_port_hw_agg_map(int unit, bcm_port_t port, int aggid);
    621 extern int bcm_td2p_port_aggid_add(int unit, bcm_port_t port, bcm_trunk_t tgid,
    622                                    int *aggid);
    623 extern int bcm_td2p_port_aggid_del(int unit, bcm_port_t port);
    624 extern int bcm_td2p_port_trunkid_get(int unit, bcm_port_t port, int *tgid);
    625 extern int bcm_td2p_port_last_member_check(int unit, bcm_port_t port, int *val);
    626 extern int bcm_td2p_port_to_aggid(int unit, bcm_port_t port, int *aggid);
    627 
    628 /* Stat functions */
    629 extern int bcmi_td2p_stat_port_attach(int unit, bcm_port_t port);
    630 extern int bcmi_td2p_stat_port_detach(int unit, bcm_port_t port);
    631 
    632 /* Flex port */
    633 extern int
    634 bcm_td2p_flexport_pbmp_update(int unit, bcm_pbmp_t *pbmp);
    635 
    636 extern int bcm_td2p_vp_vlan_membership_get_all(int unit, bcm_vlan_t vlan,
    637                 int array_max, bcm_gport_t *gport_array,
    638                 int *flags_array, int *array_size);
    639 
    640 extern int bcmi_td2p_vlan_block_set(int unit, bcm_vlan_t vid,
    641                                     bcm_vlan_block_t *block);
    642 extern int bcmi_td2p_vlan_block_get(int unit, bcm_vlan_t vid,
    643                                     bcm_vlan_block_t *block);
    644 #if defined(INCLUDE_BHH)
    645 extern int bcm_fp_oam_mpls_tp_channel_type_tx_get(int unit,
    646                                                   bcm_oam_mpls_tp_channel_type_t channel_type,
    647                                                   int *value);
    648 extern int bcm_fp_oam_mpls_tp_channel_type_tx_set(int unit,
    649                                                   bcm_oam_mpls_tp_channel_type_t channel_type,
    650                                                   int value);
    651 #endif
    652 #endif /* BCM_TRIDENT2PLUS_SUPPORT  */
    653 
    654 #endif /* !_BCM_INT_TRIDENT2PLUS_H_ */