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 (71946B)


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