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

l2.h (9701B)


      1 /*
      2  * DO NOT EDIT THIS FILE!
      3  * This file is auto-generated.
      4  * Edits to this file will be lost when it is regenerated.
      5  *
      6  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      7  * 
      8  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      9  */
     10 
     11 #ifndef BCMI_LTSW_L2_H
     12 #define BCMI_LTSW_L2_H
     13 
     14 #include <bcm/types.h>
     15 
     16 #include <sal/sal_types.h>
     17 
     18 /*!
     19  * \brief Flags to indicate which part of VLAN info is to be updated. These flags are used by bcmi_ltsw_l2_station_vlan_update API.
     20  */
     21 /*! Update membership profile pointer. */
     22 #define BCMI_LTSW_L2_STATION_VLAN_F_MEMBER_PRF_PTR (1 << 0)
     23 
     24 /*! Update spanning tree group id. */
     25 #define BCMI_LTSW_L2_STATION_VLAN_F_STG (1 << 1)
     26 
     27 /*!
     28  * \brief VLAN info used for station API.
     29  */
     30 typedef struct bcmi_ltsw_l2_station_vlan_s {
     31 
     32     /*! Membership profile pointer. */
     33     uint16_t member_prf_ptr;
     34 
     35     /*! Spanning tree group id. */
     36     uint16_t stg;
     37 
     38 } bcmi_ltsw_l2_station_vlan_t;
     39 
     40 /*!
     41  * \brief L2 table view vlan info structure.
     42  */
     43 typedef struct bcmi_ltsw_l2_view_vlan_info_s {
     44 
     45     /*! VLAN id. */
     46     bcm_vlan_t vlan;
     47 
     48     /*! L2 table view for this vlan. 0: Double wide view, 1: single wide view. */
     49     bool l2_view;
     50 
     51 } bcmi_ltsw_l2_view_vlan_info_t;
     52 
     53 /*!
     54  * \brief Virtual info for L2 table refresh.
     55  */
     56 typedef struct bcmi_ltsw_l2_virtual_info_s {
     57 
     58     /*! Gport id. */
     59     bcm_gport_t gport;
     60 
     61     /*! Egress object. */
     62     bcm_if_t egress_if;
     63 
     64 } bcmi_ltsw_l2_virtual_info_t;
     65 
     66 /*!
     67  * \brief Set force vlan for all L2 entries of associated port.
     68  *
     69  * \param [in] unit Unit Number.
     70  * \param [in] port Port id.
     71  * \param [in] vlan Force vlan id.
     72  * \param [in] flags Force vlan flags.
     73  *
     74  * \retval SHR_E_NONE No errors.
     75  * \retval !SHR_E_NONE Failure.
     76  */
     77 extern int
     78 bcmi_ltsw_l2_force_vlan_set(
     79     int unit,
     80     bcm_port_t port,
     81     bcm_vlan_t vlan,
     82     uint32_t flags);
     83 
     84 /*!
     85  * \brief Clear Hit bits of L2 address entries.
     86  *
     87  * \param [in] unit Unit Number.
     88  * \param [in] src_hit Clear source hit bit.
     89  * \param [in] des_hit Clear destination hit bit.
     90  *
     91  * \retval SHR_E_NONE No errors.
     92  * \retval !SHR_E_NONE Failure.
     93  */
     94 extern int
     95 bcmi_ltsw_l2_addr_hit_clear(
     96     int unit,
     97     bool src_hit,
     98     bool des_hit);
     99 
    100 /*!
    101  * \brief Enable or disable one field L2 control table.
    102  *
    103  * \param [in] unit Unit Number.
    104  * \param [in] l2_ctrl_name LT name.
    105  * \param [in] l2_ctrl_fld LT field name.
    106  * \param [in] enable 1: enable, 0: disable.
    107  *
    108  * \retval SHR_E_NONE No errors.
    109  * \retval !SHR_E_NONE Failure.
    110  */
    111 extern int
    112 bcmi_ltsw_l2_ctrl_set(
    113     int unit,
    114     const char *l2_ctrl_name,
    115     const char *l2_ctrl_fld,
    116     int enable);
    117 
    118 /*!
    119  * \brief Get status L2 control table.
    120  *
    121  * \param [in] unit Unit Number.
    122  * \param [in] l2_ctrl_name LT name.
    123  * \param [in] l2_ctrl_fld LT field name.
    124  * \param [out] enable 1: enable, 0: disable.
    125  *
    126  * \retval SHR_E_NONE No errors.
    127  * \retval !SHR_E_NONE Failure.
    128  */
    129 extern int
    130 bcmi_ltsw_l2_ctrl_get(
    131     int unit,
    132     const char *l2_ctrl_name,
    133     const char *l2_ctrl_fld,
    134     int *enable);
    135 
    136 /*!
    137  * \brief Public function to stop L2 age thread without breaking current interval.
    138  *
    139  * \param [in] unit Unit Number.
    140  *
    141  * \retval SHR_E_NONE No errors.
    142  * \retval !SHR_E_NONE Failure.
    143  */
    144 extern int
    145 bcmi_ltsw_l2_age_stop(int unit);
    146 
    147 /*!
    148  * \brief Public function to resume L2 age thread with current interval.
    149  *
    150  * \param [in] unit Unit Number.
    151  *
    152  * \retval SHR_E_NONE No errors.
    153  * \retval !SHR_E_NONE Failure.
    154  */
    155 extern int
    156 bcmi_ltsw_l2_age_resume(int unit);
    157 
    158 /*!
    159  * \brief Public function to enable/disable global L2 learning.
    160  *
    161  * \param [in] unit Unit Number.
    162  * \param [in] enable 1 indicates enable, 0 indicates disable.
    163  *
    164  * \retval SHR_E_NONE No errors.
    165  * \retval !SHR_E_NONE Failure.
    166  */
    167 extern int
    168 bcmi_ltsw_l2_learn_set(
    169     int unit,
    170     int enable);
    171 
    172 /*!
    173  * \brief Public function to get global L2 learning setting.
    174  *
    175  * \param [in] unit Unit Number.
    176  * \param [out] enable Current global L2 learning setting.
    177  *
    178  * \retval SHR_E_NONE No errors.
    179  * \retval !SHR_E_NONE Failure.
    180  */
    181 extern int
    182 bcmi_ltsw_l2_learn_get(
    183     int unit,
    184     int *enable);
    185 
    186 /*!
    187  * \brief Public function to update VLAN info used by station.
    188  *
    189  * \param [in] unit Unit Number.
    190  * \param [in] vid VLAN id or vfi.
    191  * \param [in] flags Flags to indicate update which part of VLAN info.
    192  * \param [in] vlan_info VLAN info used by station.
    193  *
    194  * \retval SHR_E_NONE No errors.
    195  * \retval !SHR_E_NONE Failure.
    196  */
    197 extern int
    198 bcmi_ltsw_l2_station_vlan_update(
    199     int unit,
    200     int vid,
    201     int flags,
    202     bcmi_ltsw_l2_station_vlan_t *vlan_info);
    203 
    204 /*!
    205  * \brief Public function to freeze L2 H/W activities.
    206  *
    207  * \param [in] unit Unit Number.
    208  *
    209  * \retval SHR_E_NONE No errors.
    210  * \retval !SHR_E_NONE Failure.
    211  */
    212 extern int
    213 bcmi_ltsw_l2_hw_freeze(int unit);
    214 
    215 /*!
    216  * \brief Public function to thaw L2 H/W activities.
    217  *
    218  * \param [in] unit Unit Number.
    219  *
    220  * \retval SHR_E_NONE No errors.
    221  * \retval !SHR_E_NONE Failure.
    222  */
    223 extern int
    224 bcmi_ltsw_l2_hw_thaw(int unit);
    225 
    226 /*!
    227  * \brief Public function to get L2 H/W frozen state.
    228  *
    229  * \param [in] unit Unit Number.
    230  * \param [out] frozen L2 H/W is frozen or not.
    231  *
    232  * \retval SHR_E_NONE No errors.
    233  * \retval !SHR_E_NONE Failure.
    234  */
    235 extern int
    236 bcmi_ltsw_l2_hw_is_frozen(
    237     int unit,
    238     int *frozen);
    239 
    240 /*!
    241  * \brief Public function to get L2 table size.
    242  *
    243  * \param [in] unit Unit Number.
    244  * \param [out] size L2 table size.
    245  *
    246  * \retval SHR_E_NONE No errors.
    247  * \retval !SHR_E_NONE Failure.
    248  */
    249 extern int
    250 bcmi_ltsw_l2_size_get(
    251     int unit,
    252     int *size);
    253 
    254 /*!
    255  * \brief Public function to get current L2 entry count.
    256  *
    257  * \param [in] unit Unit Number.
    258  * \param [out] count L2 entry count.
    259  *
    260  * \retval SHR_E_NONE No errors.
    261  * \retval !SHR_E_NONE Failure.
    262  */
    263 extern int
    264 bcmi_ltsw_l2_count_get(
    265     int unit,
    266     int *count);
    267 
    268 /*!
    269  * \brief Public function to update L2 table view info for a vlan.
    270  *
    271  * \param [in] unit Unit Number.
    272  * \param [in] info L2 table view info.
    273  *
    274  * \retval SHR_E_NONE No errors.
    275  * \retval !SHR_E_NONE Failure.
    276  */
    277 extern int
    278 bcmi_ltsw_l2_view_vlan_update(
    279     int unit,
    280     bcmi_ltsw_l2_view_vlan_info_t *info);
    281 
    282 /*!
    283  * \brief Update logical table L2_OPAQUE_TAG.
    284  *
    285  * \param [in] unit Unit Number.
    286  * \param [in] opaque_tag_id Index into the L2 opaque tag table.
    287  * \param [in] tag_size Size of the opaque tag.
    288  * \param [in] ether_type Ethertype used to identify the opaque tag.
    289  * \param [in] tag_type Type of the opaque tag.
    290  * \param [in] valid Make config active or not.
    291  *
    292  * \retval SHR_E_NONE No errors.
    293  * \retval !SHR_E_NONE Failure.
    294  */
    295 extern int
    296 bcmi_ltsw_l2_opaque_tag_set(
    297     int unit,
    298     int opaque_tag_id,
    299     int tag_size,
    300     int ether_type,
    301     int tag_type,
    302     int valid);
    303 
    304 /*!
    305  * \brief Get value of fields of logical table L2_OPAQUE_TAG.
    306  *
    307  * \param [in] unit Unit Number.
    308  * \param [in] opaque_tag_id Index into the L2 opaque tag table.
    309  * \param [out] tag_size Size of the opaque tag.
    310  * \param [out] ether_type Ethertype used to identify the opaque tag.
    311  * \param [out] tag_type Type of the opaque tag.
    312  * \param [out] valid Make config active or not.
    313  *
    314  * \retval SHR_E_NONE No errors.
    315  * \retval !SHR_E_NONE Failure.
    316  */
    317 extern int
    318 bcmi_ltsw_l2_opaque_tag_get(
    319     int unit,
    320     int opaque_tag_id,
    321     int *tag_size,
    322     int *ether_type,
    323     int *tag_type,
    324     int *valid);
    325 
    326 /*!
    327  * \brief Update logical table L2_PAYLOAD_OPAQUE_TAG.
    328  *
    329  * \param [in] unit Unit Number.
    330  * \param [in] opaque_tag_id Index into the L2 opaque tag table.
    331  * \param [in] tag_size Size of the opaque tag.
    332  * \param [in] ether_type Ethertype used to identify the opaque tag.
    333  * \param [in] tag_type Type of the opaque tag.
    334  * \param [in] valid Make config active or not.
    335  *
    336  * \retval SHR_E_NONE No errors.
    337  * \retval !SHR_E_NONE Failure.
    338  */
    339 extern int
    340 bcmi_ltsw_l2_payload_opaque_tag_set(
    341     int unit,
    342     int opaque_tag_id,
    343     int tag_size,
    344     int ether_type,
    345     int tag_type,
    346     int valid);
    347 
    348 /*!
    349  * \brief Get value of fields of logical table L2_PAYLOAD_OPAQUE_TAG.
    350  *
    351  * \param [in] unit Unit Number.
    352  * \param [in] opaque_tag_id Index into the L2 opaque tag table.
    353  * \param [out] tag_size Size of the opaque tag.
    354  * \param [out] ether_type Ethertype used to identify the opaque tag.
    355  * \param [out] tag_type Type of the opaque tag.
    356  * \param [out] valid Make config active or not.
    357  *
    358  * \retval SHR_E_NONE No errors.
    359  * \retval !SHR_E_NONE Failure.
    360  */
    361 extern int
    362 bcmi_ltsw_l2_payload_opaque_tag_get(
    363     int unit,
    364     int opaque_tag_id,
    365     int *tag_size,
    366     int *ether_type,
    367     int *tag_type,
    368     int *valid);
    369 
    370 /*!
    371  * \brief Dump L2 module software bookkeepings.
    372  *
    373  * \param [in] unit Unit Number.
    374  */
    375 extern void
    376 bcmi_ltsw_l2_sw_dump(int unit);
    377 
    378 /*!
    379  * \brief Public function to update L2 table virtual info for a gport.
    380  *
    381  * \param [in] unit Unit Number.
    382  * \param [in] info Virtual info.
    383  *
    384  * \retval SHR_E_NONE No errors.
    385  * \retval !SHR_E_NONE Failure.
    386  */
    387 extern int
    388 bcmi_ltsw_l2_virtual_info_update(
    389     int unit,
    390     bcmi_ltsw_l2_virtual_info_t *info);
    391 
    392 /*!
    393  * \brief Clear L2 entries on a port during flex port.
    394  *
    395  * \param [in] unit Unit Number.
    396  * \param [in] port Port id.
    397  *
    398  * \retval SHR_E_NONE No errors.
    399  * \retval !SHR_E_NONE Failure.
    400  */
    401 extern int
    402 bcmi_ltsw_l2_port_detach(
    403     int unit,
    404     bcm_port_t port);
    405 
    406 /*!
    407  * \brief Clear Hit bits of L2 address entries.
    408  *
    409  * \param [in] unit Unit Number.
    410  * \param [in] src_hit Clear source hit bit.
    411  * \param [in] des_hit Clear destination hit bit.
    412  *
    413  * \retval SHR_E_NONE No errors.
    414  * \retval !SHR_E_NONE Failure.
    415  */
    416 extern int
    417 bcmi_ltsw_l2_addr_hit_clear(
    418     int unit,
    419     bool src_hit,
    420     bool des_hit);
    421 
    422 #endif /* BCMI_LTSW_L2_H */