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

monterey.h (71909B)


      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:        monterey.h
      8  * Purpose:     Function declarations for monterey Internal functions.
      9  */
     10 
     11 #ifndef _BCM_INT_MONTEREY_H_
     12 #define _BCM_INT_MONTEREY_H_
     13 
     14 #if defined(BCM_MONTEREY_SUPPORT)
     15 
     16 #include <bcm_int/esw/mbcm.h>
     17 #include <bcm_int/esw/firebolt.h>
     18 #include <bcm_int/esw/flex_ctr.h>
     19 #include <bcm_int/esw/cosq.h>
     20 #include <bcm_int/esw/switch.h>
     21 #include <bcm_int/esw/vxlan.h>
     22 
     23 #define BCM_MN_COS_PORT_TYPE_HSP 0x1 
     24 #define BCM_MN_COS_PORT_TYPE_LLS 0x2
     25 #define BCM_MN_COS_PORT_TYPE_OVERSUB 0x4
     26 
     27 
     28 /*
     29  * 8 Priority Groups supported.
     30  */
     31 #define MN_PRIOROTY_GROUP_ID_MIN 0
     32 #define MN_PRIOROTY_GROUP_ID_MAX 7
     33 /*
     34  * Inpur priority range.
     35  * PFC : 0-7
     36  * SAFC : 0-15
     37  */
     38 #define MN_PFC_INPUT_PRIORITY_MIN  0
     39 #define MN_PFC_INPUT_PRIORITY_MAX  7
     40 #define MN_SAFC_INPUT_PRIORITY_MIN MN_PFC_INPUT_PRIORITY_MIN
     41 #define MN_SAFC_INPUT_PRIORITY_MAX 15
     42 extern int bcmi_mn_preemption_capability_set(int unit, bcm_port_t port,
     43                                               uint32 arg);
     44 extern int bcmi_mn_preemption_queue_bitmap_set(int unit, bcm_port_t port,
     45                                                 uint32 arg);
     46 extern int bcmi_mn_preemption_capability_get(int unit, bcm_port_t port,
     47                                               uint32* arg);
     48 extern int bcmi_mn_preemption_queue_bitmap_get(int unit, bcm_port_t port,
     49                                                 uint32* arg);
     50 
     51 extern int bcm_mn_port_rate_ingress_set(int unit, bcm_port_t port,
     52                                          uint32 bandwidth, uint32 burst);
     53 extern int bcm_mn_port_rate_ingress_get(int unit, bcm_port_t port,
     54                                          uint32 *bandwidth, uint32 *burst);
     55 extern int bcm_mn_port_rate_pause_get(int unit, bcm_port_t port,
     56                                        uint32 *pause, uint32 *resume);
     57 extern int bcm_mn_port_rate_egress_set(int unit, bcm_port_t port,
     58                                         uint32 bandwidth, uint32 burst,
     59                                         uint32 mode);
     60 extern int bcm_mn_port_rate_egress_get(int unit, bcm_port_t port,
     61                                         uint32 *bandwidth, uint32 *burst,
     62                                         uint32 *mode);
     63 
     64 extern int bcm_monterey_flexport_pbmp_update(int unit, bcm_pbmp_t *pbmp);
     65 
     66 extern int bcm_monterey_port_drain_cells(int unit, int port);
     67 extern int bcm_mn_port_init(int unit);
     68 
     69 extern int _bcm_mn_port_hsp_config_set(int unit, bcm_port_t port);
     70 extern int bcm_mn_cosq_flex_port_update(int unit, bcm_port_t port , 
     71                                                       int enable); 
     72 extern int
     73 bcm_mn_port_priority_group_mapping_set(int unit, bcm_gport_t gport,
     74                                         int prio, int priority_group);
     75 extern int
     76 bcm_mn_port_priority_group_mapping_get(int unit, bcm_gport_t gport,
     77                                         int prio, int *priority_group);
     78 #if defined(BCM_FIELD_SUPPORT)
     79 extern int _bcm_field_mn_stage_init(int unit, _field_stage_t *stage_fc);
     80 extern int _bcm_field_mn_init(int unit, _field_control_t *fc);
     81 extern int _bcm_field_mn_qual_tcam_key_mask_set(int unit,
     82                                                  _field_entry_t *f_ent,
     83                                                  unsigned validf);
     84 extern int _bcm_field_mn_egress_selcode_set(int unit,
     85                                              _field_group_t *fg,
     86                                              uint32 efp_slice_mode, 
     87                                              uint32 efp_key_mode,
     88                                              uint32 key_match_type, 
     89                                              int *parts_count);
     90 extern int _bcm_field_mn_group_construct_quals_add(int unit,
     91                                                     _field_control_t *fc,
     92                                                     _field_stage_t   *stage_fc,
     93                                                     bcm_field_qset_t qset,
     94                                                     uint8 entry_type,
     95                                                     _field_group_t *fg
     96                                                    );
     97 extern int _bcm_field_mn_qual_tcam_key_mask_get(int unit,
     98                                                 _field_entry_t *f_ent,
     99                                                 _field_tcam_t *tcam);
    100 extern int _bcm_field_mn_qualify_PacketRes(int               unit,
    101                                             bcm_field_entry_t entry,
    102                                             uint32            *data,
    103                                             uint32            *mask
    104                                             );
    105 extern int _bcm_field_mn_qualify_PacketRes_get(int               unit,
    106                                                 bcm_field_entry_t entry,
    107                                                 uint32            *data,
    108                                                 uint32            *mask
    109                                                 );
    110 extern int
    111 _bcm_field_mn_qualify_LoopbackType(bcm_field_LoopbackType_t loopback_type,
    112                                     uint32                   *tcam_data,
    113                                     uint32                   *tcam_mask
    114                                     );
    115 extern int
    116 _bcm_field_mn_qualify_LoopbackType_get(uint8                    tcam_data,
    117                                         uint8                    tcam_mask,
    118                                         bcm_field_LoopbackType_t *loopback_type
    119                                         );
    120 extern int 
    121 _bcm_field_mn_qualify_TunnelType(bcm_field_TunnelType_t tunnel_type,
    122                                   uint32                 *tcam_data,
    123                                   uint32                 *tcam_mask
    124                                   );
    125 extern int 
    126 _bcm_field_mn_qualify_TunnelType_get(uint8                  tcam_data,
    127                                       uint8                  tcam_mask,
    128                                       bcm_field_TunnelType_t *tunnel_type
    129                                       );
    130 extern int _bcm_field_mn_qualify_class(int unit,
    131                                         bcm_field_entry_t entry,
    132                                         bcm_field_qualify_t qual,
    133                                         uint32 *data,
    134                                         uint32 *mask
    135                                         );
    136 extern int _bcm_field_mn_qualify_class_get(int unit,
    137                                             bcm_field_entry_t entry,
    138                                             bcm_field_qualify_t qual,
    139                                             uint32 *data,
    140                                             uint32 *mask
    141                                             );
    142 extern int _bcm_field_mn_action_get(int             unit,
    143                                      soc_mem_t       mem,
    144                                      _field_entry_t  *f_ent,
    145                                      int             tcam_idx,
    146                                      _field_action_t *fa,
    147                                      uint32          *buf
    148                                      );
    149 extern int 
    150 _bcm_field_mn_hash_select_profile_ref_count_get(int unit,
    151                                                  soc_mem_t profile_mem, 
    152                                                  int index, 
    153                                                  int *ref_count);
    154 extern int 
    155 _bcm_field_mn_hash_select_profile_delete(int unit, 
    156                                          soc_mem_t profile_mem, 
    157                                          int index);
    158 extern int 
    159 _bcm_field_mn_hash_select_profile_alloc(int unit,
    160                                          _field_entry_t *f_ent,
    161                                          _field_action_t *fa);
    162 extern int 
    163 _bcm_field_mn_hash_select_profile_get(int unit, 
    164                                        soc_mem_t profile_mem,
    165                                        soc_profile_mem_t **hash_select_profile);
    166 extern int
    167 _bcm_field_mn_hash_select_profile_hw_free(int unit, 
    168                                            _field_entry_t *f_ent, 
    169                                            uint32 flags);
    170 extern int
    171 _bcm_field_mn_hash_select_profile_hw_alloc (int unit, _field_entry_t *f_ent);
    172 
    173 extern int _bcm_field_mn_group_install(int unit, _field_group_t *fg);
    174 extern int _bcm_field_mn_write_slice_map(int unit, _field_stage_t *stage_fc);
    175 
    176 extern int _bcm_field_mn_slice_clear(int unit,
    177                                       _field_group_t *fg,
    178                                       _field_slice_t *fs);
    179 
    180 extern int _bcm_field_mn_selcodes_install(int unit,
    181                                            _field_group_t *fg,
    182                                            uint8 slice_num,
    183                                            bcm_pbmp_t pbmp,
    184                                            int selcode_idx);
    185 
    186 extern int _bcm_field_mn_entry_move(int unit,
    187                                      _field_entry_t *f_ent,
    188                                     int parts_count,
    189                                     int *tcam_idx_old,
    190                                     int *tcam_idx_new);
    191 
    192 extern int _bcm_field_mn_action_support_check(int unit,
    193                                                _field_entry_t *f_ent,
    194                                                bcm_field_action_t action,
    195                                                int *result);
    196 
    197 extern int _bcm_field_mn_action_params_check(int unit,
    198                                               _field_entry_t  *f_ent,
    199                                               _field_action_t *fa);
    200 
    201 extern int _bcm_field_mn_stage_action_support_check(int unit,
    202                                                      unsigned stage,
    203                                                      bcm_field_action_t action,
    204                                                      int *result);
    205 extern int
    206 _bcm_field_mn_lookup_selcodes_install(int            unit,
    207                                        _field_group_t *fg,
    208                                        uint8          slice_num,
    209                                        int            selcode_idx
    210                                        );
    211 extern int
    212 _bcm_field_mn_lookup_mode_set(int            unit,
    213                                uint8          slice_num,
    214                                _field_group_t *fg,
    215                                uint8          flags
    216                                );
    217 extern int
    218 _bcm_field_mn_qualify_VlanTranslationHit(int               unit,
    219                                           bcm_field_entry_t entry,
    220                                           uint8             *data,
    221                                           uint8             *mask);
    222 extern int
    223 _bcm_field_mn_qualify_VlanTranslationHit_get(int               unit,
    224                                               bcm_field_entry_t entry,
    225                                               uint8             *data,
    226                                               uint8             *mask);
    227 
    228 extern int 
    229 _bcm_field_mn_qualify_ip_type(int unit, _field_entry_t *f_ent, 
    230                                           bcm_field_IpType_t type);
    231 extern int 
    232 _bcm_field_mn_qualify_ip_type_get(int unit, _field_entry_t *f_ent, 
    233                                               bcm_field_IpType_t *type);
    234 extern int 
    235 _bcm_field_mn_qualify_ip_type_encode_get(int unit, uint32 hw_data,
    236                                                      uint32 hw_mask,
    237                                                      bcm_field_IpType_t *type);
    238 
    239 #endif /* BCM_FIELD_SUPPORT */
    240 
    241 #define _BCM_MN_L3_PORT_MASK        0x7f
    242 #define _BCM_MN_L3_MODID_MASK       0xff
    243 #define _BCM_MN_L3_MODID_SHIFT      0x7
    244 #define _BCM_MN_L3_DEFAULT_MTU_SIZE 0x3fff
    245 
    246 #if defined(INCLUDE_L3)
    247 
    248 #define BCM_MN_L3_USE_EMBEDDED_NEXT_HOP(_u_, _intf_, _nhidx_)      \
    249              ((_nhidx_ == BCM_XGS3_L3_INVALID_INDEX)             && \
    250               (!BCM_XGS3_L3_EGRESS_IDX_VALID(_u_, _intf_))       && \
    251               (!BCM_XGS3_L3_MPATH_EGRESS_IDX_VALID(_u_, _intf_)) && \
    252               (!BCM_XGS3_DVP_EGRESS_IDX_VALID(_u_, _intf_))      && \
    253               (BCM_XGS3_L3_EGRESS_MODE_ISSET(_u_))               && \
    254               (soc_feature(unit, soc_feature_l3_extended_host_entry)))
    255             
    256 #define BCM_MN_L3_HOST_TABLE_MEM(_u_, _intf_, _v6_, _mem_, _nhidx_)                     \
    257             _mem_ = (_v6_) ? ((BCM_MN_L3_USE_EMBEDDED_NEXT_HOP(_u_, _intf_, _nhidx_))?  \
    258                              L3_ENTRY_IPV6_MULTICASTm:L3_ENTRY_IPV6_UNICASTm) :          \
    259                            ((BCM_MN_L3_USE_EMBEDDED_NEXT_HOP(_u_, _intf_, _nhidx_))?    \
    260                              L3_ENTRY_IPV4_MULTICASTm:L3_ENTRY_IPV4_UNICASTm)
    261 
    262 #define BCM_MN_L3_IS_EMBEDDED_NH_TABLE(_mem_, _v6_)   \
    263     (_mem_ == L3_ENTRY_IPV4_MULTICASTm && !_v6_) || \
    264     (_mem_ == L3_ENTRY_IPV4_MULTICASTm && _v6_)
    265 
    266 #define  BCM_MN_L3_HOST_TABLE_FLD(_u_, _mem_, _v6_, _fld_)                                   \
    267               _fld_ = (_bcm_l3_fields_t *) INT_TO_PTR((_v6_) ?                                \
    268                        ((_mem_ == L3_ENTRY_IPV6_UNICASTm) ?                                   \
    269                          BCM_XGS3_L3_MEM_FIELDS(_u_,v6): BCM_XGS3_L3_MEM_FIELDS(_u_, v6_4)) : \
    270                        ((_mem_ == L3_ENTRY_IPV4_UNICASTm) ?                                   \
    271                          BCM_XGS3_L3_MEM_FIELDS(_u_,v4): BCM_XGS3_L3_MEM_FIELDS(_u_, v4_2)))
    272 
    273 #define BCM_MN_L3_HOST_ENTRY_BUF(_v6_, _mem_, _buf_, _v4ent_, _v4extent_, _v6ent_, _v6extent_)  \
    274             _buf_ = ((_v6_) ?                                                        \
    275                   ((_mem_ == L3_ENTRY_IPV6_UNICASTm) ? (uint32 *) &_v6ent_ :         \
    276                    (uint32 *) &_v6extent_) :                                         \
    277                   ((_mem_ == L3_ENTRY_IPV4_UNICASTm) ? (uint32 *) &_v4ent_ :         \
    278                    (uint32 *) &_v4extent_)) 
    279 
    280 
    281 /* L3 Internal Functions */
    282 /* Host table support */
    283 extern int _bcm_mn_l3_add(int unit, _bcm_l3_cfg_t *l3cfg, int nh_idx);
    284 extern int _bcm_mn_l3_get(int unit, _bcm_l3_cfg_t *l3cfg, int *nh_idx);
    285 extern int _bcm_mn_l3_del(int unit, _bcm_l3_cfg_t *l3cfg);
    286 extern int _bcm_mn_l3_del_match(int unit, int flags, void *pattern,
    287                        bcm_xgs3_ent_op_cb cmp_func,
    288                        bcm_l3_host_traverse_cb notify_cb, void *user_data);
    289 extern int _bcm_mn_l3_traverse(int unit, int flags, uint32 start, uint32 end,
    290                                  bcm_l3_host_traverse_cb cb, void *user_data);
    291 
    292 extern int _bcm_mn_l3_get_by_idx(int unit, void *dma_ptr, int idx,
    293                                    _bcm_l3_cfg_t *l3cfg, int *nh_idx);
    294 extern int bcm_mn_l3_conflict_get(int unit, bcm_l3_key_t *ipkey, bcm_l3_key_t *cf_array,
    295                                    int cf_max, int *cf_count);
    296 extern int bcm_mn_l3_replace(int unit, _bcm_l3_cfg_t *l3cfg);
    297 extern int bcm_mn_l3_del_intf(int unit, _bcm_l3_cfg_t *l3cfg, int negate);
    298 
    299 #ifdef ALPM_ENABLE
    300 /* ALPM */
    301 extern int _bcm_mn_alpm_add(int unit, _bcm_defip_cfg_t *lpm_cfg, 
    302                              int nh_ecmp_idx);
    303 extern int _bcm_mn_alpm_del(int unit, _bcm_defip_cfg_t *lpm_cfg);
    304 extern int _bcm_mn_alpm_get(int unit, _bcm_defip_cfg_t *lpm_cfg, int
    305                              *nh_ecmp_idx);
    306 extern int _bcm_mn_alpm_find(int unit, _bcm_defip_cfg_t *lpm_cfg, 
    307                               int *nh_ecmp_idx);
    308 extern int _bcm_mn_alpm_update_match(int unit, _bcm_l3_trvrs_data_t *trv_data);
    309 #endif
    310 
    311 
    312 /* L3 IPMC */
    313 extern int _bcm_mn_l3_ipmc_get_by_idx(int unit, void *dma_ptr, int idx,
    314                                        _bcm_l3_cfg_t *l3cfg);
    315 extern int _bcm_mn_l3_ipmc_get(int unit, _bcm_l3_cfg_t *l3cfg);
    316 extern int _bcm_mn_l3_ipmc_add(int unit, _bcm_l3_cfg_t *l3cfg);
    317 extern int _bcm_mn_l3_ipmc_del(int unit, _bcm_l3_cfg_t *l3cfg);
    318 extern int bcm_mn_ipmc_pim_bidir_init(int unit);
    319 extern int bcm_mn_ipmc_pim_bidir_detach(int unit);
    320 extern int bcm_mn_ipmc_rp_create(int unit, uint32 flags, int *rp_id);
    321 extern int bcm_mn_ipmc_rp_destroy(int unit, int rp_id);
    322 extern int bcm_mn_ipmc_rp_set(int unit, int rp_id, int intf_count,
    323         bcm_if_t *intf_array);
    324 extern int bcm_mn_ipmc_rp_get(int unit, int rp_id, int intf_max,
    325         bcm_if_t *intf_array, int *intf_count);
    326 extern int bcm_mn_ipmc_rp_add(int unit, int rp_id, bcm_if_t intf_id);
    327 extern int bcm_mn_ipmc_rp_delete(int unit, int rp_id, bcm_if_t intf_id);
    328 extern int bcm_mn_ipmc_rp_delete_all(int unit, int rp_id);
    329 extern int bcm_mn_ipmc_rp_ref_count_incr(int unit, int rp_id);
    330 extern int bcm_mn_ipmc_rp_ref_count_decr(int unit, int rp_id);
    331 extern int bcm_mn_ipmc_range_add(int unit, int *range_id,
    332         bcm_ipmc_range_t *range);
    333 extern int bcm_mn_ipmc_range_delete(int unit, int range_id);
    334 extern int bcm_mn_ipmc_range_delete_all(int unit);
    335 extern int bcm_mn_ipmc_range_get(int unit, int range_id,
    336         bcm_ipmc_range_t *range);
    337 extern int bcm_mn_ipmc_range_size_get(int unit, int *size);
    338 /* MN v6 reserved multicast */
    339 extern int  _bcm_mn_ipv6_reserved_multicast_addr_set(int unit, bcm_ip6_t ip6_addr,
    340                                                       bcm_ip6_t ip6_mask);
    341 extern int  _bcm_mn_ipv6_reserved_multicast_addr_get(int unit, bcm_ip6_t *ip6_addr,
    342                                                       bcm_ip6_t *ip6_mask);
    343 #if defined(INCLUDE_BFD)
    344 extern int bcmi_mn_bfd_init(int unit);
    345 #endif /* INCLUDE_BFD */
    346 
    347 #ifdef BCM_WARM_BOOT_SUPPORT
    348 extern int bcm_mn_ipmc_pim_bidir_scache_size_get(int unit, uint32 *size);
    349 extern int bcm_mn_ipmc_pim_bidir_sync(int unit, uint8 **scache_ptr);
    350 extern int bcm_mn_ipmc_pim_bidir_scache_recover(int unit, uint8 **scache_ptr); 
    351 extern int bcm_mn_ipmc_rp_ref_count_recover(int unit, int rp_id); 
    352 #endif /* BCM_WARM_BOOT_SUPPORT */
    353 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP
    354 extern void _bcm_mn_ipmc_pim_bidir_sw_dump(int unit);
    355 extern void _bcm_mn_vxlan_sw_dump(int unit);
    356 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */
    357 
    358 /* Flex stat - L3 host table */
    359 extern bcm_error_t _bcm_mn_l3_host_stat_attach(
    360             int unit,
    361             bcm_l3_host_t *info,
    362             uint32 stat_counter_id);
    363 extern bcm_error_t _bcm_mn_l3_host_stat_detach(
    364             int unit,
    365             bcm_l3_host_t *info);
    366 extern bcm_error_t _bcm_mn_l3_host_stat_counter_get(
    367             int unit,
    368             int sync_mode,
    369             bcm_l3_host_t *info,
    370             bcm_l3_stat_t stat,
    371             uint32 num_entries,
    372             uint32 *counter_indexes,
    373             bcm_stat_value_t *counter_values);
    374 extern bcm_error_t _bcm_mn_l3_host_stat_counter_set(
    375             int unit,
    376             bcm_l3_host_t *info,
    377             bcm_l3_stat_t stat,
    378             uint32 num_entries,
    379             uint32 *counter_indexes,
    380             bcm_stat_value_t *counter_values);
    381 extern bcm_error_t _bcm_mn_l3_host_stat_id_get(
    382             int unit,
    383             bcm_l3_host_t *info,
    384             bcm_l3_stat_t stat,
    385             uint32 *stat_counter_id);
    386 
    387 /* Flex Stat - L3 Route defip */
    388 extern bcm_error_t _bcm_mn_l3_route_stat_attach (
    389             int                 unit,
    390             bcm_l3_route_t      *info,
    391             uint32              stat_counter_id);
    392 extern bcm_error_t    _bcm_mn_l3_route_stat_detach (
    393             int                 unit,
    394             bcm_l3_route_t      *info);
    395 
    396 extern bcm_error_t _bcm_mn_l3_route_stat_counter_get(
    397             int                 unit, 
    398             int                 sync_mode, 
    399             bcm_l3_route_t      *info,
    400             bcm_l3_route_stat_t stat, 
    401             uint32              num_entries, 
    402             uint32              *counter_indexes, 
    403             bcm_stat_value_t    *counter_values);
    404 
    405 extern bcm_error_t _bcm_mn_l3_route_stat_counter_set(
    406             int                 unit, 
    407             bcm_l3_route_t      *info,
    408             bcm_l3_route_stat_t stat, 
    409             uint32              num_entries, 
    410             uint32              *counter_indexes, 
    411             bcm_stat_value_t    *counter_values);
    412 extern bcm_error_t _bcm_mn_l3_route_stat_multi_get(
    413             int                 unit, 
    414             bcm_l3_route_t      *info,
    415             int                 nstat, 
    416             bcm_l3_route_stat_t    *stat_arr,
    417             uint64              *value_arr);
    418 
    419 extern bcm_error_t _bcm_mn_l3_route_stat_multi_get32(
    420             int                 unit, 
    421             bcm_l3_route_t      *info,
    422             int                 nstat, 
    423             bcm_l3_route_stat_t    *stat_arr,
    424             uint32              *value_arr);
    425 
    426 extern bcm_error_t _bcm_mn_l3_route_stat_multi_set(
    427             int                 unit, 
    428             bcm_l3_route_t      *info,
    429             int                 nstat, 
    430             bcm_l3_route_stat_t    *stat_arr,
    431             uint64              *value_arr);
    432 
    433 extern bcm_error_t _bcm_mn_l3_route_stat_multi_set32(
    434             int                 unit, 
    435             bcm_l3_route_t      *info,
    436             int                 nstat, 
    437             bcm_l3_route_stat_t  *stat_arr,
    438             uint32              *value_arr);
    439 extern bcm_error_t _bcm_mn_l3_route_stat_id_get(
    440             int                 unit,
    441             bcm_l3_route_t      *info,
    442             bcm_l3_route_stat_t stat, 
    443             uint32              *stat_counter_id);
    444 extern bcm_error_t _bcm_mn_ipmc_stat_attach(
    445             int unit,
    446             bcm_ipmc_addr_t *info,
    447             uint32 stat_counter_id);
    448 extern bcm_error_t _bcm_mn_ipmc_stat_detach(
    449             int unit,
    450             bcm_ipmc_addr_t *info);
    451 extern bcm_error_t _bcm_mn_ipmc_stat_counter_get(
    452             int unit,
    453             int sync_mode,
    454             bcm_ipmc_addr_t *info,
    455             bcm_ipmc_stat_t stat,
    456             uint32 num_entries,
    457             uint32 *counter_indexes,
    458             bcm_stat_value_t *counter_values);
    459 extern bcm_error_t _bcm_mn_ipmc_stat_counter_set(
    460             int unit,
    461             bcm_ipmc_addr_t *info,
    462             bcm_ipmc_stat_t stat,
    463             uint32 num_entries,
    464             uint32 *counter_indexes,
    465             bcm_stat_value_t *counter_values);
    466 extern bcm_error_t _bcm_mn_ipmc_stat_id_get(
    467             int unit,
    468             bcm_ipmc_addr_t *info,
    469             bcm_ipmc_stat_t stat,
    470             uint32 *stat_counter_id);
    471 extern  bcm_error_t  _bcm_mn_ipmc_stat_multi_get(
    472                             int                 unit, 
    473                             bcm_ipmc_addr_t     *info,
    474                             int                 nstat, 
    475                             bcm_ipmc_stat_t     *stat_arr,
    476                             uint64              *value_arr);
    477 extern bcm_error_t  _bcm_mn_ipmc_stat_multi_get32(
    478                             int                 unit, 
    479                             bcm_ipmc_addr_t     *info,
    480                             int                 nstat, 
    481                             bcm_ipmc_stat_t     *stat_arr,
    482                             uint32              *value_arr);
    483 extern bcm_error_t  _bcm_mn_ipmc_stat_multi_set(
    484                             int                 unit, 
    485                             bcm_ipmc_addr_t     *info,
    486                             int                 nstat, 
    487                             bcm_ipmc_stat_t     *stat_arr,
    488                             uint64              *value_arr);
    489 extern  bcm_error_t  _bcm_mn_ipmc_stat_multi_set32(
    490                             int                 unit, 
    491                             bcm_ipmc_addr_t     *info,
    492                             int                 nstat, 
    493                             bcm_ipmc_stat_t     *stat_arr,
    494                             uint32              *value_arr);
    495 
    496 extern int _bcm_mn_l3_ip4_options_free_resources(int unit);
    497 extern int _bcm_mn_l3_ip4_options_profile_init(int unit);
    498 extern int _bcm_mn_l3_ip4_options_profile_create(int unit, uint32 flags, 
    499                                    bcm_l3_ip4_options_action_t default_action, 
    500                                    int *ip4_options_profile_id);
    501 extern int _bcm_mn_l3_ip4_options_profile_destroy(int unit, 
    502                                                    int ip4_options_profile_id);
    503 extern int _bcm_mn_l3_ip4_options_profile_action_set(int unit,
    504                          int ip4_options_profile_id, 
    505                          int ip4_option, 
    506                          bcm_l3_ip4_options_action_t action);
    507 extern int _bcm_mn_l3_ip4_options_profile_action_get(int unit,
    508                          int ip4_options_profile_id, 
    509                          int ip4_option, 
    510                          bcm_l3_ip4_options_action_t *action);
    511 extern int _bcm_mn_l3_ip4_options_profile_multi_get(int unit, int array_size, 
    512                                       int *ip_options_ids_array, 
    513                                       int *array_count);
    514 extern int _bcm_mn_l3_ip4_options_profile_action_multi_get(int unit, 
    515                           uint32 flags,
    516                           int ip_option_profile_id, int array_size, 
    517                           bcm_l3_ip4_options_action_t *array, int *array_count);
    518 extern int _bcm_mn_l3_ip4_options_profile_id2idx(int unit, int profile_id, 
    519                                                   int *hw_idx);
    520 extern int _bcm_mn_l3_ip4_options_profile_idx2id(int unit, int hw_idx, 
    521                                                   int *profile_id);
    522 extern int _bcm_mn_vp_urpf_mode_set(int unit, bcm_port_t port, int arg);
    523 extern int _bcm_mn_vp_urpf_mode_get(int unit, bcm_port_t port, int *arg);
    524 extern int _bcm_mn_l3_intf_iif_profile_update(int unit, bcm_vlan_t vid,
    525                                                bcm_vlan_control_vlan_t *control);
    526 extern int _bcm_mn_l3_intf_iif_profile_get(int unit, bcm_vlan_t vid,
    527                                             bcm_vlan_control_vlan_t *control);
    528 #ifdef BCM_WARM_BOOT_SUPPORT
    529 extern int _bcm_mn_l3_ip4_options_profile_scache_len_get(int unit, 
    530                                                           int *wb_alloc_size);
    531 extern int _bcm_mn_l3_ip4_options_recover(int unit, uint8 **scache_ptr);
    532 
    533 extern int _bcm_mn_l3_ip4_options_sync(int unit, uint8 **scache_ptr);
    534 #endif /* BCM_WARM_BOOT_SUPPORT */
    535 
    536 /* VXLAN */
    537 extern int bcm_mn_vxlan_udpDestPort_set(int unit, int udpDestPort);
    538 extern int bcm_mn_vxlan_udpSourcePort_set(int unit, int hashEnable);
    539 extern int bcm_mn_vxlan_udpDestPort_get(int unit, int *udpDestPort);
    540 extern int bcm_mn_vxlan_udpSourcePort_get(int unit, int *hashEnable);
    541 extern int bcm_mn_vxlan_egress_get(int unit, bcm_l3_egress_t *egr, int nh_index);
    542 extern int bcm_mn_vxlan_egress_set(int unit, int nh_index, uint32 flags);
    543 extern int bcm_mn_vxlan_egress_reset(int unit, int nh_index);
    544 
    545 extern int _bcm_mn_vxlan_port_resolve(
    546            int unit, 
    547            bcm_gport_t l2gre_port_id, 
    548            bcm_if_t encap_id, 
    549            bcm_module_t *modid, 
    550            bcm_port_t *port,
    551            bcm_trunk_t *trunk_id, 
    552            int *id);
    553 
    554 extern  int  bcm_mn_vxlan_lock(int unit);
    555 extern void bcm_mn_vxlan_unlock(int unit);
    556 extern int bcm_mn_vxlan_init(int unit);
    557 extern int bcm_mn_vxlan_cleanup(int unit);
    558 extern int bcm_mn_vxlan_vpn_create(int unit, bcm_vxlan_vpn_config_t *info);
    559 extern int bcm_mn_vxlan_vpn_destroy(int unit, bcm_vpn_t l2vpn);
    560 extern int bcm_mn_vxlan_vpn_destroy_all(int unit);
    561 extern int bcm_mn_vxlan_vpn_traverse(int unit, bcm_vxlan_vpn_traverse_cb cb, void *user_data);
    562 extern int bcm_mn_vxlan_vpn_get( int unit, bcm_vpn_t l2vpn, bcm_vxlan_vpn_config_t *info);
    563 extern int bcm_mn_vxlan_port_add(int unit, bcm_vpn_t vpn, bcm_vxlan_port_t  *vxlan_port);
    564 extern int bcm_mn_vxlan_port_delete(int unit, bcm_vpn_t vpn, bcm_gport_t vxlan_port_id);
    565 extern int bcm_mn_vxlan_port_delete_all(int unit, bcm_vpn_t vpn);
    566 extern int bcm_mn_vxlan_port_get(int unit, bcm_vpn_t vpn, bcm_vxlan_port_t *vxlan_port);
    567 extern int bcm_mn_vxlan_port_get_all( int unit, bcm_vpn_t l2vpn, int port_max, bcm_vxlan_port_t *port_array, int *port_count);
    568 extern int bcm_mn_vxlan_tunnel_initiator_create(int unit, bcm_tunnel_initiator_t *info);
    569 extern int bcm_mn_vxlan_tunnel_initiator_destroy(int unit, bcm_gport_t vxlan_tunnel_id);
    570 extern int bcm_mn_vxlan_tunnel_initiator_destroy_all(int unit);
    571 extern int bcm_mn_vxlan_tunnel_initiator_get(int unit, bcm_tunnel_initiator_t *info);
    572 extern int bcm_mn_vxlan_tunnel_initiator_traverse(int unit, bcm_tunnel_initiator_traverse_cb cb, void *user_data);
    573 extern int bcm_mn_vxlan_tunnel_terminator_create(int unit, bcm_tunnel_terminator_t *info);
    574 extern int bcm_mn_vxlan_tunnel_terminator_update(int unit, bcm_tunnel_terminator_t *info);
    575 extern int bcm_mn_vxlan_tunnel_terminator_destroy(int unit, bcm_gport_t vxlan_tunnel_id);
    576 extern int bcm_mn_vxlan_tunnel_terminator_destroy_all(int unit);
    577 extern int bcm_mn_vxlan_tunnel_terminator_get( int unit, bcm_tunnel_terminator_t *info);
    578 extern int bcm_mn_vxlan_tunnel_terminator_traverse(int unit, bcm_tunnel_terminator_traverse_cb cb, void *user_data);
    579 extern int  _bcm_mn_vxlan_vpn_get(int unit, int vfi_index, bcm_vlan_t *vid);
    580 extern int bcm_mn_vxlan_multicast_leaf_entry_check(int unit, bcm_ip_t mc_ip_addr, bcm_ip_t  src_ip_addr, int enable_flag);
    581 extern int _bcm_mn_vxlan_vpn_is_eline( int unit, bcm_vpn_t l2vpn, uint8 *isEline);
    582 extern int bcm_mn_vxlan_port_learn_set(int unit, bcm_gport_t vxlan_port_id, uint32 flags);
    583 extern int bcm_mn_vxlan_port_learn_get(int unit, bcm_gport_t vxlan_port_id, uint32 *flags);
    584 extern int bcm_mn_vxlan_trunk_member_add (int unit, bcm_trunk_t trunk_id, 
    585                                              int trunk_member_count, bcm_port_t *trunk_member_array);
    586 extern int bcm_mn_vxlan_trunk_member_delete(int unit, bcm_trunk_t trunk_id, 
    587                                              int trunk_member_count, bcm_port_t *trunk_member_array); 
    588 extern int _bcm_mn_vxlan_port_get(int unit, bcm_vpn_t vpn, int vp,
    589 									bcm_vxlan_port_t  *vxlan_port);
    590 
    591 /* L2GRE */
    592 extern int bcm_mn_l2gre_match_add(int unit, bcm_l2gre_port_t *l2gre_port, int vp, bcm_vpn_t vpn);
    593 extern int bcm_mn_l2gre_match_delete(int unit,  int vp);
    594 extern int _bcm_mn_l2gre_eline_vp_configure (int unit, int vfi_index, int active_vp, 
    595                   source_vp_entry_t *svp, int tpid_enable, bcm_l2gre_port_t  *l2gre_port);
    596 extern int _bcm_mn_l2gre_elan_vp_configure (int unit, int vfi_index, int active_vp, 
    597                   source_vp_entry_t *svp, int tpid_enable, bcm_l2gre_port_t  *l2gre_port);
    598 extern int _bcm_mn_vxlan_port_get(int unit, bcm_vpn_t vpn, int vp,
    599                                   bcm_vxlan_port_t  *vxlan_port);
    600 
    601 /* Port Extender */
    602 extern int bcm_mn_extender_forward_add(int unit,
    603         bcm_extender_forward_t *extender_forward_entry);
    604 extern int bcm_mn_extender_forward_delete(int unit,
    605         bcm_extender_forward_t *extender_forward_entry);
    606 extern int bcm_mn_extender_forward_delete_all(int unit);
    607 extern int bcm_mn_extender_forward_get(int unit,
    608         bcm_extender_forward_t *extender_forward_entry);
    609 extern int bcm_mn_extender_forward_traverse(int unit,
    610         bcm_extender_forward_traverse_cb cb, void *user_data);
    611 
    612 /* VP LAG */
    613 extern int bcm_mn_vp_lag_init(int unit);
    614 extern void bcm_mn_vp_lag_deinit(int unit);
    615 extern int bcm_mn_vp_lag_create(int unit, uint32 flags, bcm_trunk_t *tid);
    616 extern int bcm_mn_vp_lag_info_get(int unit, int *ngroups_vp_lag,
    617         int *nports_vp_lag);
    618 extern int bcm_mn_vp_lag_set(int unit, bcm_trunk_t tid,
    619         bcm_trunk_info_t *trunk_info, int member_count,
    620         bcm_trunk_member_t *member_array);
    621 extern int bcm_mn_vp_lag_destroy(int unit, bcm_trunk_t tid);
    622 extern int bcm_mn_vp_lag_get(int unit, bcm_trunk_t tid,
    623         bcm_trunk_info_t *trunk_info, int member_max,
    624         bcm_trunk_member_t *member_array, int *member_count);
    625 extern int bcm_mn_tid_to_vp_lag_vp(int unit, bcm_trunk_t tid, int *vp_lag_vp);
    626 extern int bcm_mn_vp_lag_vp_to_tid(int unit, int vp_lag_vp, bcm_trunk_t *tid);
    627 extern int bcm_mn_vp_lag_find(int unit, bcm_port_t port, bcm_trunk_t *tid);
    628 extern int bcm_mn_vlan_vp_source_vp_lag_set(int unit, bcm_gport_t gport,
    629         int vp_lag_vp);
    630 extern int bcm_mn_vlan_vp_source_vp_lag_clear(int unit, bcm_gport_t gport,
    631         int vp_lag_vp);
    632 extern int bcm_mn_vlan_vp_source_vp_lag_get(int unit, bcm_gport_t gport,
    633         int *vp_lag_vp);
    634 extern int bcm_mn_niv_port_source_vp_lag_set(int unit, bcm_gport_t gport,
    635         int vp_lag_vp);
    636 extern int bcm_mn_niv_port_source_vp_lag_clear(int unit, bcm_gport_t gport,
    637         int vp_lag_vp);
    638 extern int bcm_mn_niv_port_source_vp_lag_get(int unit, bcm_gport_t gport,
    639         int *vp_lag_vp);
    640 extern int bcm_mn_extender_port_source_vp_lag_set(int unit, bcm_gport_t gport,
    641         int vp_lag_vp);
    642 extern int bcm_mn_extender_port_source_vp_lag_clear(int unit, bcm_gport_t gport,
    643         int vp_lag_vp);
    644 extern int bcm_mn_extender_port_source_vp_lag_get(int unit, bcm_gport_t gport,
    645         int *vp_lag_vp);
    646 extern int bcm_mn_vp_lag_status_get(int unit, int vp_lag_id, int *is_vp_lag,
    647         int *is_used, int *has_member);
    648 extern int _bcm_esw_num_vp_trunk_groups(int unit);
    649 #ifdef BCM_WARM_BOOT_SUPPORT
    650 extern int bcm_mn_vp_lag_reinit(int unit);
    651 #endif /* BCM_WARM_BOOT_SUPPORT */
    652 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP
    653 extern void bcm_mn_vp_lag_sw_dump(int unit);
    654 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */
    655 
    656 extern int bcm_mn_multicast_l3_vp_init(int unit);
    657 extern int bcm_mn_multicast_l3_vp_detach(int unit);
    658 extern int bcm_mn_multicast_l3_vp_encap_get(int unit, bcm_multicast_t group,
    659         bcm_gport_t port, bcm_if_t intf, bcm_if_t *encap_id);
    660 extern int bcm_mn_multicast_l3_vp_next_hop_free(int unit, int intf);
    661 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP
    662 extern void bcm_mn_multicast_l3_vp_sw_dump(int unit);
    663 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */
    664 
    665 /* ECMP resilient hashing */
    666 extern int bcm_mn_ecmp_rh_init(int unit);
    667 extern void bcm_mn_ecmp_rh_deinit(int unit);
    668 extern int bcm_mn_l3_egress_ecmp_rh_create(int unit,
    669         bcm_l3_egress_ecmp_t *ecmp, int intf_count, bcm_if_t *intf_array,
    670         int op, int count, bcm_if_t *intf);
    671 extern int bcm_mn_l3_egress_ecmp_rh_destroy(int unit, bcm_if_t mpintf);
    672 extern int bcm_mn_l3_egress_ecmp_rh_get(int unit, bcm_l3_egress_ecmp_t *ecmp);
    673 extern int bcm_mn_l3_egress_ecmp_rh_ethertype_set(int unit, uint32 flags,
    674         int ethertype_count, int *ethertype_array);
    675 extern int bcm_mn_l3_egress_ecmp_rh_ethertype_get(int unit, uint32 *flags,
    676         int ethertype_max, int *ethertype_array, int *ethertype_count);
    677 extern int bcm_mn_l3_egress_ecmp_rh_shared_copy(int unit, int old_ecmp_group,
    678         int new_ecmp_group);
    679 #ifdef BCM_WARM_BOOT_SUPPORT
    680 extern int bcm_mn_ecmp_rh_hw_recover(int unit);
    681 #endif /* BCM_WARM_BOOT_SUPPORT */
    682 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP
    683 extern void bcm_mn_ecmp_rh_sw_dump(int unit);
    684 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */
    685 
    686 /* Proxy */
    687 extern int bcm_mn_proxy_egress_create(int unit, uint32 flags, bcm_proxy_egress_t *proxy_egr, 
    688                           bcm_if_t *proxy_intf_id);
    689 extern int  bcm_mn_proxy_egress_destroy(int unit, bcm_if_t proxy_intf_id);
    690 extern int  bcm_mn_proxy_egress_get(int unit, bcm_if_t proxy_intf_id, bcm_proxy_egress_t *proxy_egr);
    691 extern int _bcm_mn_proxy_nh_add(int unit, int idx, void *buf, int max_paths);
    692 extern int _bcm_mn_proxy_nh_get(int unit, int idx, bcm_proxy_egress_t *proxy_nh_entry);
    693 extern int bcm_mn_proxy_egress_traverse(int unit, bcm_proxy_egress_traverse_cb  cb,
    694                                                         void *user_data);
    695 
    696 #endif /* INCLUDE_L3 */
    697 
    698 extern int bcm_mn_cosq_init(int unit);
    699 
    700 extern int bcm_mn_cosq_detach(int unit, int software_state_only);
    701 
    702 extern int bcm_mn_cosq_config_set(int unit, int numq);
    703 
    704 extern int bcm_mn_cosq_config_get(int unit, int *numq);
    705 
    706 extern int bcm_mn_cosq_mapping_set(int unit, bcm_port_t gport, 
    707                         bcm_cos_t priority, bcm_cos_queue_t cosq);
    708 
    709 extern int bcm_mn_cosq_mapping_get(int unit, bcm_port_t gport,
    710                         bcm_cos_t priority, bcm_cos_queue_t *cosq);
    711 
    712 extern int bcm_mn_cosq_port_sched_set(int unit, bcm_pbmp_t pbm,
    713                            int mode, const int *weights, int delay);
    714 
    715 extern int bcm_mn_cosq_port_sched_get(int unit, bcm_pbmp_t pbm,
    716                            int *mode, int *weights, int *delay);
    717 
    718 extern int bcm_mn_cosq_sched_weight_max_get(int unit, int mode, 
    719                                                 int *weight_max);
    720 
    721 extern int bcm_mn_cosq_discard_set(int unit, uint32 flags);
    722 
    723 extern int bcm_mn_cosq_discard_get(int unit, uint32 *flags);
    724 
    725 extern int
    726 bcm_mn_cosq_gport_discard_set(int unit, bcm_gport_t gport,
    727                                bcm_cos_queue_t cosq,
    728                                bcm_cosq_gport_discard_t *discard);
    729 
    730 extern int
    731 bcm_mn_cosq_gport_discard_get(int unit, bcm_gport_t gport,
    732                                bcm_cos_queue_t cosq,
    733                                bcm_cosq_gport_discard_t *discard);
    734 
    735 extern int
    736 _bcm_mn_cosq_pfc_class_resolve(bcm_switch_control_t sctype, int *type,
    737                                int *class);
    738 
    739 extern int
    740 bcm_mn_cosq_port_pfc_op(int unit, bcm_port_t port,
    741                         bcm_switch_control_t sctype, _bcm_cosq_op_t op,
    742                         bcm_gport_t *gport, int gport_count);
    743 
    744 extern int
    745 bcm_mn_cosq_port_pfc_get(int unit, bcm_port_t port,
    746                          bcm_switch_control_t sctype,
    747                          bcm_gport_t *gport, int gport_count,
    748                          int *actual_gport_count);
    749 
    750 extern int
    751 bcm_mn_cosq_gport_add(int unit, bcm_gport_t port, int numq, uint32 flags,
    752                       bcm_gport_t *gport);
    753 
    754 extern int
    755 bcm_mn_cosq_gport_detach(int unit, bcm_gport_t sched_gport,
    756                          bcm_gport_t input_gport, bcm_cos_queue_t cosq);
    757 
    758 extern int
    759 bcm_mn_cosq_discard_port_get(int unit, bcm_port_t port, 
    760                  bcm_cos_queue_t cosq, uint32 color, int *drop_start, 
    761                         int *drop_slope, int *average_time);
    762 
    763 extern int
    764 bcm_mn_cosq_gport_delete(int unit, bcm_gport_t gport);
    765 
    766 extern int
    767 bcm_mn_cosq_gport_get(int unit, bcm_gport_t gport, bcm_gport_t *port,
    768                       int *numq, uint32 *flags);
    769 
    770 extern int
    771 bcm_mn_cosq_gport_traverse(int unit, bcm_cosq_gport_traverse_cb cb,
    772                            void *user_data);
    773 
    774 extern int
    775 bcm_mn_cosq_discard_port_set(int unit, bcm_port_t port, 
    776                             bcm_cos_queue_t cosq,
    777                             uint32 color, int drop_start, int drop_slope,
    778                             int average_time);
    779 
    780 extern int
    781 bcm_mn_cosq_gport_attach(int unit, bcm_gport_t sched_gport,
    782                          bcm_gport_t input_gport, bcm_cos_queue_t cosq);
    783 
    784 extern int
    785 bcm_mn_cosq_gport_attach_get(int unit, bcm_gport_t sched_gport,
    786                              bcm_gport_t *input_gport, bcm_cos_queue_t *cosq);
    787 
    788 extern int
    789 bcm_mn_cosq_gport_child_get(int unit, bcm_gport_t in_gport,
    790                              bcm_cos_queue_t cosq, bcm_gport_t *out_gport);
    791 
    792 extern int
    793 bcm_mn_cosq_port_bandwidth_set(int unit, bcm_port_t port,
    794                                bcm_cos_queue_t cosq,
    795                                uint32 min_quantum, uint32 max_quantum,
    796                                uint32 burst_quantum, uint32 flags);
    797 
    798 extern int
    799 bcm_mn_cosq_port_bandwidth_get(int unit, bcm_port_t port,
    800                                bcm_cos_queue_t cosq,
    801                                uint32 *min_quantum, uint32 *max_quantum,
    802                                uint32 *burst_quantum, uint32 *flags);
    803 
    804 extern int
    805 bcm_mn_cosq_port_pps_set(int unit, bcm_port_t port, bcm_cos_queue_t cosq,
    806                          int pps);
    807 
    808 extern int
    809 bcm_mn_cosq_port_pps_get(int unit, bcm_port_t port, bcm_cos_queue_t cosq,
    810                          int *pps);
    811 
    812 extern int bcm_mn_cosq_port_burst_set(int unit, bcm_port_t port, 
    813                                        bcm_cos_queue_t cosq, int burst);
    814 
    815 extern int
    816 bcm_mn_cosq_stat_set(int unit, bcm_gport_t port, bcm_cos_queue_t cosq,
    817                      bcm_cosq_stat_t stat, uint64 value);
    818 
    819 extern int
    820 bcm_mn_cosq_stat_get(int unit, bcm_port_t port, bcm_cos_queue_t cosq,
    821                      bcm_cosq_stat_t stat, int sync_mode, uint64 *value);
    822 
    823 extern int
    824 bcm_mn_cosq_port_burst_get(int unit, bcm_port_t port, bcm_cos_queue_t cosq,
    825                            int *burst);
    826 
    827 extern int
    828 bcm_mn_cosq_control_set(int unit, bcm_gport_t gport, bcm_cos_queue_t cosq,
    829                         bcm_cosq_control_t type, int arg);
    830 
    831 extern int
    832 bcm_mn_cosq_control_get(int unit, bcm_gport_t gport, bcm_cos_queue_t cosq,
    833                         bcm_cosq_control_t type, int *arg);
    834 
    835 extern int
    836 bcm_mn_cosq_service_pool_set(int unit, bcm_service_pool_id_t id, 
    837                                       bcm_cosq_service_pool_t cosq_service_pool);
    838 
    839 extern int
    840 bcm_mn_cosq_service_pool_get(int unit, bcm_service_pool_id_t id, 
    841                                       bcm_cosq_service_pool_t *cosq_service_pool);
    842 
    843 extern int
    844 bcm_mn_cosq_gport_bandwidth_burst_set(int unit, bcm_gport_t gport,
    845                                       bcm_cos_queue_t cosq,
    846                                       uint32 kbits_burst_min, 
    847                                       uint32 kbits_burst_max);
    848 
    849 extern int
    850 bcm_mn_cosq_gport_bandwidth_burst_get(int unit, bcm_gport_t gport,
    851                                        bcm_cos_queue_t cosq,
    852                                        uint32 *kbits_burst_min,
    853                                        uint32 *kbits_burst_max);
    854 extern int
    855 bcm_mn_cosq_gport_bandwidth_set(int unit, bcm_gport_t gport,
    856                                 bcm_cos_queue_t cosq, uint32 kbits_sec_min,
    857                                 uint32 kbits_sec_max, uint32 flags);
    858 
    859 extern int
    860 bcm_mn_cosq_gport_bandwidth_get(int unit, bcm_gport_t gport,
    861                                 bcm_cos_queue_t cosq, uint32 *kbits_sec_min,
    862                                 uint32 *kbits_sec_max, uint32 *flags);
    863 
    864 extern int bcm_mn_cosq_congestion_queue_set(int unit, bcm_port_t port,
    865                                             bcm_cos_queue_t cosq, int index);
    866 extern int bcm_mn_cosq_congestion_queue_get(int unit, bcm_port_t port,
    867                                             bcm_cos_queue_t cosq, int *index);
    868 extern int bcm_mn_cosq_congestion_quantize_set(int unit, bcm_port_t port,
    869                                                bcm_cos_queue_t cosq,
    870                                                int weight_code, int setpoint);
    871 extern int bcm_mn_cosq_congestion_quantize_get(int unit, bcm_port_t port,
    872                                                bcm_cos_queue_t cosq,
    873                                                int *weight_code,
    874                                                int *setpoint);
    875 extern int bcm_mn_cosq_congestion_sample_int_set(int unit, bcm_port_t port,
    876                                                  bcm_cos_queue_t cosq,
    877                                                  int min, int max);
    878 extern int bcm_mn_cosq_congestion_sample_int_get(int unit, bcm_port_t port,
    879                                                  bcm_cos_queue_t cosq,
    880                                                  int *min, int *max);
    881 extern int bcm_mn_cosq_drop_status_enable_set(int unit, bcm_port_t port,
    882                                               int enable);
    883 extern int _bcm_mn_get_def_qbase(int unit, bcm_port_t inport, int qtype, 
    884                             int *pbase, int *pnumq);
    885 
    886 extern int bcm_mn_cosq_gport_sched_set(int unit, bcm_gport_t gport,
    887                                        bcm_cos_queue_t cosq, int mode,
    888                                        int weight);
    889 extern int bcm_mn_cosq_gport_sched_get(int unit, bcm_gport_t gport,
    890                                        bcm_cos_queue_t cosq, int *mode,
    891                                        int *weight);
    892 extern int
    893 _bcm_mn_cosq_port_resolve(int unit, bcm_gport_t gport, bcm_module_t *modid,
    894                           bcm_port_t *port, bcm_trunk_t *trunk_id, int *id,
    895                           int *qnum);
    896 
    897 extern int
    898 bcm_mn_cosq_gport_mapping_set(int unit, bcm_port_t ing_port,
    899                               bcm_cos_t int_pri, uint32 flags,
    900                               bcm_gport_t gport, bcm_cos_queue_t cosq);
    901 
    902 extern int 
    903 bcm_mn_cosq_gport_congestion_config_set(int unit, bcm_gport_t port, 
    904                                          bcm_cos_queue_t cosq, 
    905                                          bcm_cosq_congestion_info_t *config);
    906 extern int
    907 bcm_mn_cosq_gport_mapping_get(int unit, bcm_port_t ing_port,
    908                               bcm_cos_t int_pri, uint32 flags,
    909                               bcm_gport_t *gport, bcm_cos_queue_t *cosq);
    910 extern int 
    911 bcm_mn_cosq_gport_congestion_config_get(int unit, bcm_gport_t port, 
    912                                          bcm_cos_queue_t cosq, 
    913                                          bcm_cosq_congestion_info_t *config);
    914 
    915 extern int 
    916 bcm_mn_cosq_bst_profile_set(int unit, 
    917                              bcm_gport_t port, 
    918                              bcm_cos_queue_t cosq, 
    919                              bcm_bst_stat_id_t bid,
    920                              bcm_cosq_bst_profile_t *profile);
    921 
    922 extern int 
    923 bcm_mn_cosq_bst_profile_get(int unit, 
    924                              bcm_gport_t port, 
    925                              bcm_cos_queue_t cosq, 
    926                              bcm_bst_stat_id_t bid,
    927                              bcm_cosq_bst_profile_t *profile);
    928 
    929 extern int 
    930 bcm_mn_cosq_bst_stat_get(int unit, 
    931                               bcm_gport_t port, 
    932                               bcm_cos_queue_t cosq, 
    933                               bcm_bst_stat_id_t bid,
    934                               uint32 options,
    935                               uint64 *pvalue);
    936 
    937 extern int 
    938 bcm_mn_cosq_bst_stat_multi_get(int unit,
    939                                 bcm_gport_t port,
    940                                 bcm_cos_queue_t cosq,
    941                                 uint32 options,
    942                                 int max_values,
    943                                 bcm_bst_stat_id_t *id_list,
    944                                 uint64 *pvalues);
    945 extern int 
    946 bcm_mn_cosq_bst_stat_clear(int unit, 
    947                             bcm_gport_t port, 
    948                             bcm_cos_queue_t cosq, 
    949                             bcm_bst_stat_id_t bid);
    950 
    951 extern int 
    952 bcm_mn_cosq_bst_stat_sync(int unit, bcm_bst_stat_id_t bid);
    953 
    954 extern int bcm_mn_cosq_endpoint_create(
    955         int unit, 
    956         bcm_cosq_classifier_t *classifier, 
    957         int *classifier_id);
    958 extern int bcm_mn_cosq_endpoint_destroy(
    959         int unit, 
    960         int classifier_id);
    961 extern int bcm_mn_cosq_endpoint_get(
    962         int unit, 
    963         int classifier_id,
    964         bcm_cosq_classifier_t *classifier);
    965 extern int bcm_mn_cosq_endpoint_map_set(
    966         int unit, 
    967         bcm_port_t port, 
    968         int classifier_id, 
    969         bcm_gport_t queue_group, 
    970         int array_count, 
    971         bcm_cos_t *priority_array, 
    972         bcm_cos_queue_t *cosq_array);
    973 extern int bcm_mn_cosq_endpoint_map_get(
    974         int unit, 
    975         bcm_port_t port, 
    976         int classifier_id, 
    977         bcm_gport_t *queue_group, 
    978         int array_max, 
    979         bcm_cos_t *priority_array, 
    980         bcm_cos_queue_t *cosq_array, 
    981         int *array_count);
    982 extern int bcm_mn_cosq_endpoint_map_clear(
    983         int unit, 
    984         bcm_gport_t port, 
    985         int classifier_id);
    986 
    987 extern int
    988 bcm_mn_cosq_field_classifier_get(
    989     int unit, int classifier_id, bcm_cosq_classifier_t *classifier);
    990 
    991 extern int
    992 bcm_mn_cosq_field_classifier_id_create(
    993     int unit, bcm_cosq_classifier_t *classifier, int *classifier_id);
    994 
    995 extern int
    996 bcm_mn_cosq_field_classifier_id_destroy(
    997     int unit, int classifier_id);
    998 
    999 extern int
   1000 bcm_mn_cosq_field_classifier_map_set(
   1001     int unit, int classifier_id, int count,
   1002     bcm_cos_t *priority_array, bcm_cos_queue_t *cosq_array);
   1003 
   1004 extern int
   1005 bcm_mn_cosq_field_classifier_map_get(
   1006     int unit, int classifier_id,
   1007     int array_max, bcm_cos_t *priority_array,
   1008     bcm_cos_queue_t *cosq_array, int *array_count);
   1009 
   1010 extern int
   1011 bcm_mn_cosq_field_classifier_map_clear(
   1012     int unit, int classifier_id);
   1013 
   1014 extern int bcm_mn_cosq_sync(int unit);
   1015 extern int bcm_mn_cosq_reinit(int unit);
   1016 
   1017 extern void bcm_mn_cosq_sw_dump(int unit);
   1018 
   1019 extern int bcm_mn_cosq_cpu_cosq_enable_set(
   1020         int unit, 
   1021         bcm_cos_queue_t cosq, 
   1022         int enable);
   1023 
   1024 extern int bcm_mn_cosq_cpu_cosq_enable_get(
   1025         int unit, 
   1026         bcm_cos_queue_t cosq, 
   1027         int *enable);
   1028 
   1029 typedef enum {
   1030     _BCM_MN_COSQ_INDEX_STYLE_BUCKET,
   1031     _BCM_MN_COSQ_INDEX_STYLE_QCN,
   1032     _BCM_MN_COSQ_INDEX_STYLE_WRED,
   1033     _BCM_MN_COSQ_INDEX_STYLE_WRED_PORT,
   1034     _BCM_MN_COSQ_INDEX_STYLE_SCHEDULER,
   1035     _BCM_MN_COSQ_INDEX_STYLE_PERQ_XMT,
   1036     _BCM_MN_COSQ_INDEX_STYLE_UCAST_DROP,
   1037     _BCM_MN_COSQ_INDEX_STYLE_COS,
   1038     _BCM_MN_COSQ_INDEX_STYLE_UCAST_QUEUE,
   1039     _BCM_MN_COSQ_INDEX_STYLE_MCAST_QUEUE,
   1040     _BCM_MN_COSQ_INDEX_STYLE_EXT_UCAST_QUEUE,
   1041     _BCM_MN_COSQ_INDEX_STYLE_EGR_POOL,
   1042     _BCM_MN_COSQ_INDEX_STYLE_EGR_PERQ_UCAST,
   1043     _BCM_MN_COSQ_INDEX_STYLE_EGR_PERQ_MCAST,
   1044     _BCM_MN_COSQ_INDEX_STYLE_UC_EGR_POOL,
   1045     _BCM_MN_COSQ_INDEX_STYLE_UCAST_QUEUE_GROUP,
   1046     _BCM_MN_COSQ_INDEX_STYLE_COUNT
   1047 } _bcm_mn_cosq_index_style_t;
   1048 
   1049 extern int
   1050 _bcm_mn_cosq_index_resolve(int unit, bcm_port_t port, bcm_cos_queue_t cosq, 
   1051                            _bcm_mn_cosq_index_style_t style,                 
   1052                            bcm_port_t *local_port, int *index, int *count);
   1053 
   1054 /* Flexible hashing support routines */
   1055 extern int bcm_mn_switch_hash_entry_create( 
   1056                                 int unit, 
   1057                                 bcm_field_group_t group, 
   1058                                 bcm_hash_entry_t *entry_id);
   1059 extern int bcm_mn_switch_hash_entry_create_qset( 
   1060                                 int unit, 
   1061                                 bcm_field_qset_t qset, 
   1062                                 bcm_hash_entry_t *entry_id);
   1063 extern int bcm_mn_switch_hash_qualify_data (
   1064                                 int unit, 
   1065                                 bcm_hash_entry_t entry_id,
   1066                                 int qual_id, 
   1067                                 uint32 data, 
   1068                                 uint32 mask);
   1069 extern int bcm_mn_switch_hash_entry_remove (
   1070                                 int unit, 
   1071                                 bcm_hash_entry_t entry_id);
   1072 extern int bcm_mn_switch_hash_entry_reinstall (
   1073                                 int unit, 
   1074                                 bcm_hash_entry_t entry_id, 
   1075                                 uint32 offset, 
   1076                                 uint32 mask);
   1077 extern int bcm_mn_switch_hash_entry_install (
   1078                                 int unit, 
   1079                                 bcm_hash_entry_t entry_id, 
   1080                                 uint32 offset, 
   1081                                 uint32 mask);
   1082 extern int bcm_mn_switch_hash_entry_destroy (
   1083                                 int unit, 
   1084                                 bcm_hash_entry_t entry_id);
   1085 extern int bcm_mn_switch_hash_entry_detach(int unit);
   1086 extern int bcm_mn_switch_hash_entry_init (int unit);
   1087 
   1088 extern int bcm_mn_ing_vp_vlan_membership_add(int unit, 
   1089                       int vp, bcm_vlan_t vlan, uint32 flags);
   1090 extern int bcm_mn_egr_vp_vlan_membership_add(int unit, 
   1091                              int vp, bcm_vlan_t vlan, uint32 flags);
   1092 extern int bcm_mn_ing_vp_vlan_membership_delete(int unit,
   1093                              int vp, bcm_vlan_t vlan);
   1094 extern int bcm_mn_egr_vp_vlan_membership_delete(int unit,
   1095                              int vp, bcm_vlan_t vlan);
   1096 extern int bcm_mn_ing_vp_vlan_membership_get(int unit, 
   1097               int vp, bcm_vlan_t vlan, uint32 *flags);
   1098 extern int bcm_mn_egr_vp_vlan_membership_get(int unit, 
   1099               int vp, bcm_vlan_t vlan, uint32 *flags);
   1100 extern int bcm_mn_ing_vp_vlan_membership_get_all(int unit, bcm_vlan_t vlan,
   1101         SHR_BITDCL *vp_bitmap, int arr_size, int *flags_arr);
   1102 extern int bcm_mn_egr_vp_vlan_membership_get_all(int unit, bcm_vlan_t vlan,
   1103         SHR_BITDCL *vp_bitmap, int arr_size, int *flags_arr);
   1104 extern int bcm_mn_ing_vp_vlan_membership_delete_all(int unit, bcm_vlan_t vlan);
   1105 extern int bcm_mn_egr_vp_vlan_membership_delete_all(int unit, bcm_vlan_t vlan);
   1106 
   1107 /* Higig resilient hashing */
   1108 extern int bcm_mn_hg_rh_init(int unit);
   1109 extern void bcm_mn_hg_rh_deinit(int unit);
   1110 extern int bcm_mn_hg_rh_dynamic_size_encode(int dynamic_size,
   1111         int *encoded_value);
   1112 extern int bcm_mn_hg_rh_set(int unit, int hgtid,
   1113         _esw_trunk_add_info_t *add_info);
   1114 extern int bcm_mn_hg_rh_add(int unit, int hgtid,
   1115         _esw_trunk_add_info_t *add_info, bcm_trunk_member_t *new_member);
   1116 extern int bcm_mn_hg_rh_delete(int unit, int hgtid,
   1117         _esw_trunk_add_info_t *add_info, bcm_trunk_member_t *leaving_member);
   1118 extern int bcm_mn_hg_rh_free_resource(int unit, int hgtid);
   1119 extern int bcm_mn_hg_rh_status_get(int unit, int *rh_status);
   1120 extern int bcm_mn_hg_rh_dynamic_size_set(int unit, int hgtid, int dynamic_size);
   1121 extern int bcm_mn_hg_rh_ethertype_set(int unit, uint32 flags,
   1122         int ethertype_count, int *ethertype_array);
   1123 extern int bcm_mn_hg_rh_ethertype_get(int unit, uint32 *flags,
   1124         int ethertype_max, int *ethertype_array, int *ethertype_count);
   1125 #ifdef BCM_WARM_BOOT_SUPPORT
   1126 extern int bcm_mn_hg_rh_recover(int unit, int hgtid,
   1127         trunk_private_t *trunk_info);
   1128 #endif /* BCM_WARM_BOOT_SUPPORT */
   1129 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP
   1130 extern void bcm_mn_hg_rh_sw_dump(int unit);
   1131 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */
   1132 
   1133 extern int bcm_mn_trunk_init(int unit);
   1134 
   1135 /* LAG resilient hashing */
   1136 extern int bcm_mn_lag_rh_init(int unit);
   1137 extern void bcm_mn_lag_rh_deinit(int unit);
   1138 extern int bcm_mn_lag_rh_dynamic_size_encode(int dynamic_size,
   1139         int *encoded_value);
   1140 extern int bcm_mn_lag_rh_set(int unit, int tid,
   1141         _esw_trunk_add_info_t *add_info, int num_rh_ports, int *mod_array,
   1142         int *port_array);
   1143 extern int bcm_mn_lag_rh_add(int unit, int tid,
   1144         _esw_trunk_add_info_t *add_info, int num_rh_ports, int *mod_array,
   1145         int *port_array, bcm_trunk_member_t *new_member);
   1146 extern int bcm_mn_lag_rh_delete(int unit, int tid,
   1147         _esw_trunk_add_info_t *add_info, int num_rh_ports, int *mod_array,
   1148         int *port_array, bcm_trunk_member_t *leaving_member);
   1149 extern int bcm_mn_lag_rh_free_resource(int unit, int tid);
   1150 extern int bcm_mn_lag_rh_dynamic_size_set(int unit, int tid, int dynamic_size);
   1151 extern int bcm_mn_lag_rh_ethertype_set(int unit, uint32 flags,
   1152         int ethertype_count, int *ethertype_array);
   1153 extern int bcm_mn_lag_rh_ethertype_get(int unit, uint32 *flags,
   1154         int ethertype_max, int *ethertype_array, int *ethertype_count);
   1155 #ifdef BCM_WARM_BOOT_SUPPORT
   1156 extern int bcm_mn_lag_rh_recover(int unit, int tid,
   1157         trunk_private_t *trunk_info);
   1158 #endif /* BCM_WARM_BOOT_SUPPORT */
   1159 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP
   1160 extern void bcm_mn_lag_rh_sw_dump(int unit);
   1161 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */
   1162 
   1163 /* FCOE */
   1164 extern int bcm_mn_fcoe_init(int unit);
   1165 extern int bcm_mn_fcoe_cleanup(int unit);
   1166 extern int bcm_mn_fcoe_zone_add(int unit, bcm_fcoe_zone_entry_t *zone);
   1167 extern int bcm_mn_fcoe_zone_delete(int unit,
   1168                                     bcm_fcoe_zone_entry_t *zone);
   1169 extern int bcm_mn_fcoe_zone_delete_all (int unit);
   1170 extern int bcm_mn_fcoe_zone_delete_by_vsan (int unit,
   1171                                              bcm_fcoe_zone_entry_t *zone);
   1172 extern int bcm_mn_fcoe_zone_delete_by_sid (int unit,
   1173                                             bcm_fcoe_zone_entry_t *zone);
   1174 extern int bcm_mn_fcoe_zone_delete_by_did (int unit,
   1175                                             bcm_fcoe_zone_entry_t *zone);
   1176 extern int bcm_mn_fcoe_zone_get (int unit, bcm_fcoe_zone_entry_t *zone);
   1177 extern int bcm_mn_fcoe_route_add(int unit, bcm_fcoe_route_t *route);
   1178 extern int bcm_mn_fcoe_route_delete(int unit, bcm_fcoe_route_t *route);
   1179 extern int bcm_mn_fcoe_route_delete_by_prefix(int unit,
   1180                                                bcm_fcoe_route_t *route);
   1181 extern int bcm_mn_fcoe_route_delete_by_interface(int unit,
   1182                                                   bcm_fcoe_route_t *route);
   1183 extern int bcm_mn_fcoe_route_delete_all(int unit);
   1184 extern int bcm_mn_fcoe_route_find(int unit, bcm_fcoe_route_t *route);
   1185 extern int bcm_mn_fcoe_vsan_create(int unit, uint32 options, 
   1186                                     bcm_fcoe_vsan_t *vsan, 
   1187                                     bcm_fcoe_vsan_id_t *vsan_id);
   1188 extern int bcm_mn_fcoe_vsan_destroy(int unit,  bcm_fcoe_vsan_id_t vsan_id);
   1189 extern int bcm_mn_fcoe_vsan_destroy_all(int unit);
   1190 extern int bcm_mn_fcoe_control_vsan_get(int unit,  
   1191                                          uint32 vsan_id, 
   1192                                          bcm_fcoe_vsan_control_t type, 
   1193                                          int *arg);
   1194 extern int bcm_mn_fcoe_control_vsan_set(int unit, 
   1195                                          uint32 vsan_id, 
   1196                                          bcm_fcoe_vsan_control_t type, 
   1197                                          int arg);
   1198 extern int bcm_mn_fcoe_vsan_get(int unit, uint32 vsan_id, 
   1199                                  bcm_fcoe_vsan_t *vsan);
   1200 extern int bcm_mn_fcoe_vsan_set(int unit, uint32 vsan_id, 
   1201                                  bcm_fcoe_vsan_t *vsan);
   1202 extern int bcm_mn_fcoe_vsan_stat_attach(int                 unit,
   1203                                          bcm_fcoe_vsan_id_t  vsan,
   1204                                          uint32              stat_counter_id);
   1205 extern int bcm_mn_fcoe_vsan_stat_detach(int unit, bcm_fcoe_vsan_id_t  vsan);
   1206 extern int bcm_mn_fcoe_vsan_stat_counter_get(
   1207                                       int                  unit, 
   1208                                       int                  sync_mode, 
   1209                                       bcm_fcoe_vsan_id_t   vsan,
   1210                                       bcm_fcoe_vsan_stat_t stat, 
   1211                                       uint32               num_entries, 
   1212                                       uint32               *counter_indexes, 
   1213                                       bcm_stat_value_t     *counter_values);
   1214 extern int bcm_mn_fcoe_vsan_stat_counter_set(
   1215                                       int                  unit, 
   1216                                       bcm_fcoe_vsan_id_t   vsan,
   1217                                       bcm_fcoe_vsan_stat_t stat, 
   1218                                       uint32               num_entries, 
   1219                                       uint32               *counter_indexes, 
   1220                                       bcm_stat_value_t     *counter_values);
   1221 extern int bcm_mn_fcoe_vsan_stat_id_get(int                  unit,
   1222                                          bcm_fcoe_vsan_id_t   vsan,
   1223                                          bcm_fcoe_vsan_stat_t stat, 
   1224                                          uint32               *stat_counter_id);
   1225 extern int bcm_mn_fcoe_route_stat_attach(int                 unit,
   1226                                           bcm_fcoe_route_t    *route,
   1227                                           uint32              stat_counter_id);
   1228 extern int bcm_mn_fcoe_route_stat_detach(int unit, bcm_fcoe_route_t *route);
   1229 extern int bcm_mn_fcoe_route_stat_counter_get(
   1230                                        int                   unit, 
   1231                                        int                   sync_mode, 
   1232                                        bcm_fcoe_route_t      *route,
   1233                                        bcm_fcoe_route_stat_t stat, 
   1234                                        uint32                num_entries, 
   1235                                        uint32                *counter_indexes, 
   1236                                        bcm_stat_value_t      *counter_values);
   1237 extern int bcm_mn_fcoe_route_stat_counter_set (
   1238                                         int                   unit, 
   1239                                         bcm_fcoe_route_t      *route,
   1240                                         bcm_fcoe_route_stat_t stat, 
   1241                                         uint32                num_entries, 
   1242                                         uint32                *counter_indexes, 
   1243                                         bcm_stat_value_t      *counter_values);
   1244 extern int bcm_mn_fcoe_route_stat_id_get(
   1245                                         int                   unit,
   1246                                         bcm_fcoe_route_t      *route,
   1247                                         bcm_fcoe_route_stat_t stat, 
   1248                                         uint32                *stat_counter_id);
   1249 int bcm_mn_fcoe_intf_config_set(int unit, uint32 flags, bcm_if_t intf, 
   1250                                  bcm_fcoe_intf_config_t *cfg);
   1251 
   1252 int bcm_mn_fcoe_intf_config_get(int unit, uint32 flags, bcm_if_t intf, 
   1253                                  bcm_fcoe_intf_config_t *cfg);
   1254 extern int bcm_mn_fcoe_zone_traverse(int unit,
   1255                                       uint32 flags,
   1256                                       bcm_fcoe_zone_traverse_cb trav_fn,
   1257                                       void *user_data);
   1258 extern int bcm_mn_fcoe_vsan_traverse(int unit,
   1259                                       uint32 flags,
   1260                                       bcm_fcoe_vsan_traverse_cb trav_fn,
   1261                                       void *user_data);
   1262 extern int bcm_mn_fcoe_route_traverse(int unit,
   1263                                        uint32 flags,
   1264                                        bcm_fcoe_route_traverse_cb trav_fn,
   1265                                        void *user_data);
   1266 
   1267 /* QOS */
   1268 #define _BCM_QOS_MAP_TYPE_ING_VFT_PRI_MAP    6
   1269 #define _BCM_QOS_MAP_TYPE_EGR_VFT_PRI_MAP    7
   1270 #define _BCM_QOS_MAP_TYPE_EGR_VSAN_PRI_MAP   8
   1271 #define _BCM_QOS_MAP_TYPE_ING_L2_VLAN_ETAG_MAP   9
   1272 #define _BCM_QOS_MAP_TYPE_EGR_L2_VLAN_ETAG_MAP   10
   1273 #define _BCM_QOS_VFT_MAP_SHIFT               11
   1274 
   1275 #define QOS_MAP_IS_FCOE(map_id)                                                \
   1276   (  ((map_id >> _BCM_QOS_VFT_MAP_SHIFT) == _BCM_QOS_MAP_TYPE_ING_VFT_PRI_MAP) \
   1277   || ((map_id >> _BCM_QOS_VFT_MAP_SHIFT) == _BCM_QOS_MAP_TYPE_EGR_VFT_PRI_MAP) \
   1278   || ((map_id >> _BCM_QOS_VFT_MAP_SHIFT) == _BCM_QOS_MAP_TYPE_EGR_VSAN_PRI_MAP)\
   1279   )
   1280 
   1281 #define QOS_MAP_IS_L2_VLAN_ETAG(map_id)                                        \
   1282   (  ((map_id >> _BCM_QOS_VFT_MAP_SHIFT) == _BCM_QOS_MAP_TYPE_ING_L2_VLAN_ETAG_MAP) \
   1283   || ((map_id >> _BCM_QOS_VFT_MAP_SHIFT) == _BCM_QOS_MAP_TYPE_EGR_L2_VLAN_ETAG_MAP) \
   1284   )
   1285 
   1286 #define QOS_FLAGS_ARE_FCOE(flags) \
   1287   ( (flags & BCM_QOS_MAP_VFT) || (flags & BCM_QOS_MAP_VSAN) )
   1288 
   1289 extern int bcm_mn_qos_init(int unit);
   1290 extern int bcm_mn_qos_detach(int unit);
   1291 extern int bcm_mn_qos_map_create(int unit, uint32 flags, int *map_id);
   1292 extern int bcm_mn_qos_map_destroy(int unit, int map_id);
   1293 extern int bcm_mn_qos_map_add(int unit, uint32 flags, bcm_qos_map_t *map,
   1294                                int map_id);
   1295 extern int bcm_mn_qos_map_delete(int unit, uint32 flags, bcm_qos_map_t *map,
   1296                                   int map_id);
   1297 extern int bcm_mn_qos_port_map_set(int unit, bcm_gport_t port, int ing_map,
   1298                                     int egr_map);
   1299 extern int bcm_mn_qos_map_multi_get(int unit, uint32 flags,
   1300                                       int map_id, int array_size, 
   1301                                       bcm_qos_map_t *array, int *array_count);
   1302 extern int _bcm_mn_egr_port_set(int unit, bcm_port_t port, 
   1303                                  soc_field_t field, int value);
   1304 extern int bcm_mn_fcoe_fc_header_type_set(int unit, uint32 flags, uint8 r_ctl, 
   1305                                            bcm_fcoe_fc_header_type_t hdr_type);
   1306 extern int bcm_mn_fcoe_fc_header_type_get(int unit, uint32 flags, uint8 r_ctl, 
   1307                                            bcm_fcoe_fc_header_type_t *hdr_type);
   1308 
   1309 extern int bcm_mn_fcoe_vsan_translate_action_add(
   1310                                     int unit, 
   1311                                     bcm_fcoe_vsan_translate_key_config_t *key, 
   1312                                     bcm_fcoe_vsan_action_set_t *action);
   1313 extern int bcm_mn_fcoe_vsan_translate_action_delete(
   1314                                     int unit, 
   1315                                     bcm_fcoe_vsan_translate_key_config_t *key);
   1316 extern uint32 _bcm_mn_fcoe_ing_vft_pri_action_encode(
   1317                                     bcm_fcoe_vsan_action_t action);
   1318 extern uint32 _bcm_mn_fcoe_egr_vft_pri_action_encode(
   1319                                     bcm_fcoe_vsan_action_t action);
   1320 extern uint32 _bcm_mn_fcoe_egr_vft_tag_action_encode(
   1321                                     bcm_fcoe_vsan_action_t action);
   1322 extern int bcm_mn_port_dscp_map_set(int unit, bcm_port_t port, int srccp,
   1323                             int mapcp, int prio, int cng);
   1324 
   1325 /* L2 */
   1326 extern int _bcm_mn_l2_hit_retrieve(int unit, l2x_entry_t *l2x_entry,
   1327                                  int l2_hw_index);
   1328 
   1329 extern int
   1330 _bcm_mn_port_enqueue_set(int unit, bcm_port_t gport,
   1331                                     int enable);
   1332 
   1333 extern int
   1334 _bcm_mn_cosq_port_queue_state_check(int unit, bcm_port_t gport);
   1335 
   1336 extern int
   1337 _bcm_mn_port_enqueue_get(int unit, bcm_port_t gport,
   1338                                             int *enable);
   1339 extern int
   1340 _bcm_mn_cosq_safc_class_mapping_set(int unit,
   1341                     bcm_gport_t port,
   1342                     int array_count,
   1343                     bcm_cosq_safc_class_mapping_t *mapping_array);
   1344 extern  int
   1345 _bcm_mn_cosq_safc_class_mapping_get(int unit, bcm_gport_t port,
   1346                                      int array_max,
   1347                                      bcm_cosq_safc_class_mapping_t *mapping_array,
   1348                                      int *array_count);
   1349 
   1350 extern int
   1351 _bcm_mn_cosq_pfc_class_mapping_set(int unit,
   1352                     bcm_gport_t port,
   1353                     int array_count,
   1354                     bcm_cosq_pfc_class_mapping_t *mapping_array);
   1355 extern int 
   1356 _bcm_mn_cosq_pfc_class_mapping_get(int unit,
   1357       bcm_gport_t port,
   1358       int array_max,
   1359       int *array_count,
   1360       bcm_cosq_pfc_class_mapping_t *mapping_array);
   1361 extern int
   1362 bcm_mn_cosq_default_llfc_profile_attach(int unit, bcm_gport_t port);
   1363 
   1364 extern int
   1365 bcm_mn_cosq_llfc_profile_detach(int unit, bcm_gport_t port);
   1366 
   1367 /* Subport functions */
   1368 extern int bcm_monterey_subport_coe_init(int unit);
   1369 
   1370 /* Service Queuing functions */
   1371 extern int
   1372 bcm_mn_cosq_service_classifier_id_create(int unit,
   1373     bcm_cosq_classifier_t *classifier, int *classifier_id);
   1374 
   1375 extern int
   1376 bcm_mn_cosq_service_classifier_id_destroy(int unit,
   1377     int classifier_id);
   1378 
   1379 extern int
   1380 bcm_mn_cosq_service_classifier_get(int unit,
   1381     int classifier_id, bcm_cosq_classifier_t *classifier);
   1382 
   1383 extern int
   1384 bcm_mn_cosq_service_map_set(int unit,
   1385     bcm_port_t port, int classifier_id, bcm_gport_t queue_group,
   1386     int array_count, bcm_cos_t *priority_array, bcm_cos_queue_t *cosq_array);
   1387 
   1388 extern int
   1389 bcm_mn_cosq_service_map_get(int unit,
   1390     bcm_port_t port, int classifier_id, bcm_gport_t *queue_group,
   1391     int array_max, bcm_cos_t *priority_array, bcm_cos_queue_t *cosq_array,
   1392     int *array_count);
   1393 
   1394 extern int
   1395 bcm_mn_cosq_service_map_clear( int unit,
   1396     bcm_gport_t port, int classifier_id);
   1397 extern int bcm_mn_cosq_subport_flow_control_set(int unit, bcm_gport_t subport,
   1398                                                    bcm_gport_t sched_port);
   1399 extern int bcm_mn_cosq_subport_flow_control_get(int unit, bcm_gport_t subport,
   1400                                                   bcm_gport_t * sched_port);
   1401 extern int
   1402 _bcm_mn_cosq_localport_resolve(int unit, bcm_gport_t gport,
   1403                                bcm_port_t *local_port);
   1404 
   1405 /* OAM functions */
   1406 extern int
   1407 _bcm_monterey_oam_drop_control_fp_encode(bcm_field_oam_drop_mep_type_t mep_type,
   1408                                        uint8 *data,
   1409                                        uint8 *mask);
   1410 
   1411 
   1412 
   1413 extern int
   1414 _bcm_monterey_port_mac_get(int unit, bcm_port_t port, int oui, uint32* mac);
   1415 
   1416 extern int
   1417 _bcm_monterey_port_mac_set(int unit, bcm_port_t port, int oui, uint32 mac);
   1418 
   1419 /* tag/pri actions for ING_VLAN_TAG_ACTION_PROFILE table */
   1420 #define _BCM_MN_ING_TAG_ACTION_NONE              0 /* do not modify */
   1421 #define _BCM_MN_ING_TAG_CFI_ACTION_NONE          0 /* do not modify */
   1422 #define _BCM_MN_ING_TAG_PRI_ACTION_NONE          0 /* do not modify */
   1423 #define _BCM_MN_EGR_TAG_ACTION_NONE              0 /* do not modify */
   1424 #define _BCM_MN_EGR_TAG_CFI_ACTION_NONE          0 /* do not modify */
   1425 #define _BCM_MN_EGR_TAG_PRI_ACTION_NONE          0 /* do not modify */
   1426 
   1427 /* actions for ING VFT PRI (ING_VLAN_TAG_ACTION_PROFILE) */
   1428 #define _BCM_MN_ING_VFT_PRI_ACTION_NONE          0
   1429 #define _BCM_MN_ING_VFT_PRI_ACTION_USE_INNER_PRI 1
   1430 #define _BCM_MN_ING_VFT_PRI_ACTION_USE_OUTER_PRI 2
   1431 #define _BCM_MN_ING_VFT_PRI_ACTION_REPLACE       3  /* use VLAN_XLATE.XLATE::
   1432                                                         FCOE_VSAN_PRI */
   1433 
   1434 /* actions for EGR VFT PRI (EGR_VLAN_TAG_ACTION_PROFILE) */
   1435 #define _BCM_MN_EGR_VFT_PRI_ACTION_NONE              0
   1436 #define _BCM_MN_EGR_VFT_PRI_ACTION_USE_INTERNAL_IPRI 1
   1437 #define _BCM_MN_EGR_VFT_PRI_ACTION_USE_INTERNAL_OPRI 2
   1438 #define _BCM_MN_EGR_VFT_PRI_ACTION_REPLACE           3  /* use EVXLT.XLATE::
   1439                                                             FCOE_VSAN_PRI */
   1440 
   1441 /* actions for EGR VFT Tag (EGR_VLAN_TAG_ACTION_PROFILE) */
   1442 #define _BCM_MN_EGR_VFT_TAG_ACTION_NONE              0
   1443 #define _BCM_MN_EGR_VFT_TAG_ACTION_USE_INTERNAL_IVID 1
   1444 #define _BCM_MN_EGR_VFT_TAG_ACTION_USE_INTERNAL_OVID 2
   1445 #define _BCM_MN_EGR_VFT_TAG_ACTION_DELETE            3
   1446 #define _BCM_MN_EGR_VFT_TAG_ACTION_USE_INTERNAL_VSAN 4
   1447 #define _BCM_MN_EGR_VFT_TAG_ACTION_REPLACE           5  /* use EVXLT.XLATE::
   1448                                                             FCOE_VSAN_ID */
   1449 
   1450 #ifdef BCM_WARM_BOOT_SUPPORT
   1451 extern int _bcm_mn_fcoe_sync(int unit);
   1452 extern int _bcm_mn_fcoe_reinit(int unit);
   1453 #endif /* BCM_WARM_BOOT_SUPPORT */
   1454 
   1455 extern int
   1456 bcm_monterey_dump_port_lls_sw( int unit, int port);
   1457 
   1458 extern int
   1459 _soc_monterey_s1_scheduler_index(int unit, int port, int level, int hw_index);
   1460 
   1461 /*
   1462  * Port Functions
   1463  */
   1464 extern int
   1465 bcmi_monterey_port_fn_drv_init(int unit);
   1466 extern int
   1467 bcmi_monterey_port_lanes_get(int unit, bcm_port_t port, int *lanes);
   1468 extern int
   1469 bcmi_monterey_port_lanes_set(int unit, bcm_port_t port, int lanes);
   1470 extern int
   1471 bcmi_mn_preemption_capability_set(int unit, bcm_port_t port,
   1472                                    uint32 arg);
   1473 extern int
   1474 bcmi_mn_preemption_queue_bitmap_set(int unit, bcm_port_t port,
   1475                                      uint32 arg);
   1476 extern int
   1477 bcmi_mn_preemption_capability_get(int unit, bcm_port_t port,
   1478                                    uint32* arg);
   1479 extern int
   1480 bcmi_mn_preemption_queue_bitmap_get(int unit, bcm_port_t port,
   1481                                      uint32* arg);
   1482 extern int
   1483 bcmi_mn_preemption_init(int unit);
   1484 #ifdef INCLUDE_L3
   1485 extern int
   1486 _bcm_monterey_ecmp_rh_dynamic_size_encode(int dynamic_size, int *encoded_value);
   1487 extern int
   1488 _bcm_monterey_ecmp_rh_dynamic_size_decode(int encoded_value, int *dynamic_size);
   1489 #endif
   1490 /*
   1491  * OBM Classifier functions.
   1492  */
   1493 
   1494 extern int
   1495 bcm_mn_switch_obm_classifier_mapping_multi_set(
   1496     int unit,
   1497     bcm_gport_t gport,
   1498     bcm_switch_obm_classifier_type_t switch_obm_classifier_type,
   1499     int array_count,
   1500     bcm_switch_obm_classifier_t *switch_obm_classifier);
   1501 
   1502 extern int
   1503 bcm_mn_switch_obm_classifier_mapping_multi_get(
   1504     int unit,
   1505     bcm_gport_t gport,
   1506     bcm_switch_obm_classifier_type_t switch_obm_classifier_type,
   1507     int array_max,
   1508     bcm_switch_obm_classifier_t *switch_obm_classifier,
   1509     int *array_count);
   1510 
   1511 extern int
   1512 bcm_mn_obm_classifier_port_control_set(
   1513     int unit,
   1514     bcm_port_t port,
   1515     bcm_port_control_t type,
   1516     int value);
   1517 
   1518 extern int
   1519 bcm_mn_obm_classifier_port_control_get(
   1520     int unit,
   1521     bcm_port_t port,
   1522     bcm_port_control_t type,
   1523     int *value);
   1524 extern int
   1525 bcmi_mn_preemption_frag_config_tx_set(int unit,
   1526                                       bcm_port_t port,
   1527                                       int is_final,
   1528                                       uint32 value);
   1529 extern int
   1530 bcmi_mn_preemption_frag_config_tx_get(int unit,
   1531                                       bcm_port_t port,
   1532                                       int is_final,
   1533                                       uint32* value);
   1534 
   1535 #endif /* !_BCM_INT_MONTEREY_H_ */
   1536 #endif /* BCM_MONTEREY_SUPPORT */