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

dev.h (5283B)


      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 BCMINT_LTSW_MBCM_DEV_H
     12 #define BCMINT_LTSW_MBCM_DEV_H
     13 
     14 #include <bcm/types.h>
     15 
     16 #include <bcm_int/ltsw/dev_int.h>
     17 
     18 /*!
     19  * \brief Initialize the device information of the unit.
     20  *
     21  * \param [in] unit Unit Number.
     22  * \param [out] dev_info Device Information.
     23  *
     24  * \retval SHR_E_NONE No errors.
     25  * \retval !SHR_E_NONE Failure.
     26  */
     27 typedef int (*dev_info_init_f)(
     28     int unit,
     29     bcmint_dev_info_t *dev_info);
     30 
     31 /*!
     32  * \brief Get PP pipe index of a given logical port for this unit.
     33  *
     34  * \param [in] unit Unit Number.
     35  * \param [in] port Port Number.
     36  * \param [out] pipe PP pipe index, or -1 on error.
     37  *
     38  * \retval SHR_E_NONE No errors.
     39  * \retval !SHR_E_NONE Failure.
     40  */
     41 typedef int (*dev_logic_port_pp_pipe_f)(
     42     int unit,
     43     bcm_port_t port,
     44     int *pipe);
     45 
     46 /*!
     47  * \brief Get port index inside its PP pipe, for a given logical port for this unit.
     48  *
     49  * \param [in] unit Unit Number.
     50  * \param [in] port Port Number.
     51  * \param [out] pp_port Port index inside its PP pipe, or -1 on error.
     52  *
     53  * \retval SHR_E_NONE No errors.
     54  * \retval !SHR_E_NONE Failure.
     55  */
     56 typedef int (*dev_logic_port_pp_pipe_port_f)(
     57     int unit,
     58     bcm_port_t port,
     59     int *pp_port);
     60 
     61 /*!
     62  * \brief Get logical port, from given PP pipe and port index inside its PP pipe.
     63  *
     64  * \param [in] unit Unit Number.
     65  * \param [in] pipe PP pipe index.
     66  * \param [in] pp_port Port index inside its PP pipe.
     67  * \param [out] port Port Number.
     68  *
     69  * \retval SHR_E_NONE No errors.
     70  * \retval !SHR_E_NONE Failure.
     71  */
     72 typedef int (*dev_pp_pipe_port_logic_port_f)(
     73     int unit,
     74     int pipe,
     75     int pp_port,
     76     bcm_port_t *port);
     77 
     78 /*!
     79  * \brief Get bit map of logical ports associated with a given PP pipe.
     80  *
     81  * \param [in] unit Unit Number.
     82  * \param [in] pipe PP pipe index.
     83  * \param [out] pbmp Bitmap of logical ports associated with the specified PP pipe.
     84  *
     85  * \retval SHR_E_NONE No errors.
     86  * \retval !SHR_E_NONE Failure.
     87  */
     88 typedef int (*dev_pp_pipe_logic_pbmp_f)(
     89     int unit,
     90     int pipe,
     91     bcm_pbmp_t *pbmp);
     92 
     93 /*!
     94  * \brief Dev driver structure.
     95  */
     96 typedef struct mbcm_ltsw_dev_drv_s {
     97 
     98     /*! Initialize the device information of the unit. */
     99     dev_info_init_f dev_info_init;
    100 
    101     /*! Get PP pipe index of a given logical port for this unit. */
    102     dev_logic_port_pp_pipe_f dev_logic_port_pp_pipe;
    103 
    104     /*! Get port index inside its PP pipe, for a given logical port for this unit. */
    105     dev_logic_port_pp_pipe_port_f dev_logic_port_pp_pipe_port;
    106 
    107     /*! Get logical port, from given PP pipe and port index inside its PP pipe. */
    108     dev_pp_pipe_port_logic_port_f dev_pp_pipe_port_logic_port;
    109 
    110     /*! Get bit map of logical ports associated with a given PP pipe. */
    111     dev_pp_pipe_logic_pbmp_f dev_pp_pipe_logic_pbmp;
    112 
    113 } mbcm_ltsw_dev_drv_t;
    114 
    115 /*!
    116  * \brief Set the DEV driver of the device.
    117  *
    118  * \param [in] unit Unit Number.
    119  * \param [in] drv Dev driver to set.
    120  *
    121  * \retval SHR_E_NONE No errors.
    122  * \retval !SHR_E_NONE Failure.
    123  */
    124 extern int
    125 mbcm_ltsw_dev_drv_set(
    126     int unit,
    127     mbcm_ltsw_dev_drv_t *drv);
    128 
    129 /*!
    130  * \brief Initialize the device information of the unit.
    131  *
    132  * \param [in] unit Unit Number.
    133  * \param [out] dev_info Device Information.
    134  *
    135  * \retval SHR_E_NONE No errors.
    136  * \retval !SHR_E_NONE Failure.
    137  */
    138 extern int
    139 mbcm_ltsw_dev_info_init(
    140     int unit,
    141     bcmint_dev_info_t *dev_info);
    142 
    143 /*!
    144  * \brief Get PP pipe index of a given logical port for this unit.
    145  *
    146  * \param [in] unit Unit Number.
    147  * \param [in] port Port Number.
    148  * \param [out] pipe PP pipe index, or -1 on error.
    149  *
    150  * \retval SHR_E_NONE No errors.
    151  * \retval !SHR_E_NONE Failure.
    152  */
    153 extern int
    154 mbcm_ltsw_dev_logic_port_pp_pipe(
    155     int unit,
    156     bcm_port_t port,
    157     int *pipe);
    158 
    159 /*!
    160  * \brief Get port index inside its PP pipe, for a given logical port for this unit.
    161  *
    162  * \param [in] unit Unit Number.
    163  * \param [in] port Port Number.
    164  * \param [out] pp_port Port index inside its PP pipe, or -1 on error.
    165  *
    166  * \retval SHR_E_NONE No errors.
    167  * \retval !SHR_E_NONE Failure.
    168  */
    169 extern int
    170 mbcm_ltsw_dev_logic_port_pp_pipe_port(
    171     int unit,
    172     bcm_port_t port,
    173     int *pp_port);
    174 
    175 /*!
    176  * \brief Get logical port, from given PP pipe and port index inside its PP pipe.
    177  *
    178  * \param [in] unit Unit Number.
    179  * \param [in] pipe PP pipe index.
    180  * \param [in] pp_port Port index inside its PP pipe.
    181  * \param [out] port Port Number.
    182  *
    183  * \retval SHR_E_NONE No errors.
    184  * \retval !SHR_E_NONE Failure.
    185  */
    186 extern int
    187 mbcm_ltsw_dev_pp_pipe_port_logic_port(
    188     int unit,
    189     int pipe,
    190     int pp_port,
    191     bcm_port_t *port);
    192 
    193 /*!
    194  * \brief Get bit map of logical ports associated with a given PP pipe.
    195  *
    196  * \param [in] unit Unit Number.
    197  * \param [in] pipe PP pipe index.
    198  * \param [out] pbmp Bitmap of logical ports associated with the specified PP pipe.
    199  *
    200  * \retval SHR_E_NONE No errors.
    201  * \retval !SHR_E_NONE Failure.
    202  */
    203 extern int
    204 mbcm_ltsw_dev_pp_pipe_logic_pbmp(
    205     int unit,
    206     int pipe,
    207     bcm_pbmp_t *pbmp);
    208 
    209 #endif /* BCMINT_LTSW_MBCM_DEV_H */