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

link.h (2910B)


      1 /*! \file link.h
      2  *
      3  * Link module definitions internal to the BCM LTSW library.
      4  *
      5  * Note, this file should only contain declarations for cross-moudle usage.
      6  * Functions/structures used inside Link module should be declared in
      7  * link_int.h.
      8  */
      9 /*
     10  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
     11  * 
     12  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
     13  */
     14 
     15 #ifndef BCMI_LTSW_LINK_H
     16 #define BCMI_LTSW_LINK_H
     17 
     18 /*!
     19  * \brief Add/Remove given port to skip_info pbmp.
     20  *
     21  * Add/Remove given port to skip_info pbmp to indicate if skip port_info_get
     22  * during link down event notification or not.
     23  *
     24  * \param [in] unit Unit number.
     25  * \param [in] port Port to set/remove.
     26  * \param [in] skip Identificator to set or remove.
     27  *
     28  * \retval SHR_E_NONE No errors.
     29  * \retval SHR_E_PORT Invalid port.
     30  */
     31 extern int
     32 bcmi_ltsw_link_port_info_skip_set(int unit, bcm_port_t port, int skip);
     33 
     34 /*!
     35  * \brief Get status of given port if skip port_info_get or not.
     36  *
     37  * Get status of given port to indicate if skip port_info_get during link
     38  * down event notification or not.
     39  *
     40  * \param [in] unit Unit number.
     41  * \param [in] port Port to set/remove.
     42  * \param [out] skip Identificator to set or remove.
     43  *
     44  * \retval SHR_E_NONE No errors.
     45  * \retval SHR_E_PORT Invalid port.
     46  */
     47 extern int
     48 bcmi_ltsw_link_port_info_skip_get(int unit, bcm_port_t port, int *skip);
     49 
     50 /*!
     51  * \brief Get current link status for the given port.
     52  *
     53  * Return logical link state if linkscan is enabled on the port. Otherwise,
     54  * return PHY link state.
     55  *
     56  * \param [in] unit Unit number.
     57  * \param [in] port Port number.
     58  * \param [out] link Current link status.
     59  *
     60  * \retval SHR_E_NONE No errors.
     61  * \retval SHR_E_PORT Invalid port.
     62  * \retval SHR_E_DISABLED Port not being scanned.
     63  */
     64 extern int
     65 bcmi_ltsw_link_state_get(int unit, bcm_port_t port, int *link);
     66 
     67 /*!
     68  * \brief Get port characteristics from PHY and program MAC to match.
     69  *
     70  * This API is called only for ports that are not scaned.
     71  *
     72  * \param [in] unit Unit number.
     73  * \param [in] port Port number.
     74  * \param [in] link Link status.
     75  *
     76  * \retval SHR_E_NONE No errors.
     77  * \retval SHR_E_PORT Invalid port.
     78  */
     79 extern int
     80 bcmi_ltsw_link_port_update(int unit, bcm_port_t port, int link);
     81 
     82 /*!
     83  * \brief Initialize linkscan port control for newly added port.
     84  *
     85  * \param [in] unit Unit number.
     86  * \param [in] port Port number.
     87  *
     88  * \retval SHR_E_NONE No errors.
     89  * \retval SHR_E_PORT Invalid port.
     90  */
     91 extern int
     92 bcmi_ltsw_link_port_control_attach(int unit, bcm_port_t port);
     93 
     94 /*!
     95  * \brief Clear linkscan port control of given port.
     96  *
     97  * \param [in] unit Unit number.
     98  * \param [in] port Port number.
     99  *
    100  * \retval SHR_E_NONE No errors.
    101  * \retval SHR_E_PORT Invalid port.
    102  */
    103 extern int
    104 bcmi_ltsw_link_port_control_detach(int unit, bcm_port_t port);
    105 
    106 #endif /* !BCMI_LTSW_LINK_H */
    107