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

rx.h (7777B)


      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_RX_H
     12 #define BCMINT_LTSW_MBCM_RX_H
     13 
     14 #include <bcm/rx.h>
     15 #include <bcm/types.h>
     16 
     17 #include <bcm_int/ltsw/rx_int.h>
     18 
     19 /*!
     20  * \brief Add a CPU cos map.
     21  *
     22  * \param [in] unit Unit Number.
     23  * \param [in] options options
     24  * \param [in] rx_cosq_mapping rx cosq mapping ptr
     25  *
     26  * \retval SHR_E_NONE No errors.
     27  * \retval !SHR_E_NONE Failure.
     28  */
     29 typedef int (*rx_cosq_mapping_extended_add_f)(
     30     int unit,
     31     uint32 options,
     32     bcm_rx_cosq_mapping_t *rx_cosq_mapping);
     33 
     34 /*!
     35  * \brief Delete a CPU cos map. 
     36  *
     37  * \param [in] unit Unit Number.
     38  * \param [in] rx_cosq_mapping rx cosq mapping ptr
     39  *
     40  * \retval SHR_E_NONE No errors.
     41  * \retval !SHR_E_NONE Failure.
     42  */
     43 typedef int (*rx_cosq_mapping_extended_delete_f)(
     44     int unit,
     45     bcm_rx_cosq_mapping_t *rx_cosq_mapping);
     46 
     47 /*!
     48  * \brief Delete all CPU cos maps.
     49  *
     50  * \param [in] unit Unit Number.
     51  *
     52  * \retval SHR_E_NONE No errors.
     53  * \retval !SHR_E_NONE Failure.
     54  */
     55 typedef int (*rx_cosq_mapping_extended_delete_all_f)(int unit);
     56 
     57 /*!
     58  * \brief Get packets to CPU COS queue mappings
     59  *
     60  * \param [in] unit Unit Number.
     61  * \param [out] rx_cosq_mapping rx cosq mapping ptr
     62  *
     63  * \retval SHR_E_NONE No errors.
     64  * \retval !SHR_E_NONE Failure.
     65  */
     66 typedef int (*rx_cosq_mapping_extended_get_f)(
     67     int unit,
     68     bcm_rx_cosq_mapping_t *rx_cosq_mapping);
     69 
     70 /*!
     71  * \brief Get the associated rx channel with a given cosq
     72  *
     73  * \param [in] unit Unit Number.
     74  * \param [in] queue_id CPU cos queue index (0 - (max cosq - 1))
     75  * \param [out] chan_id channel index
     76  *
     77  * \retval SHR_E_NONE No errors.
     78  * \retval !SHR_E_NONE Failure.
     79  */
     80 typedef int (*rx_queue_channel_get_f)(
     81     int unit,
     82     bcm_cos_queue_t queue_id,
     83     bcm_rx_chan_t *chan_id);
     84 
     85 /*!
     86  * \brief Assign a RX channel to a cosq
     87  *
     88  * \param [in] unit Unit Number.
     89  * \param [in] queue_id CPU cos queue index (0 - (max cosq - 1))
     90  * \param [in] chan_id channel index
     91  *
     92  * \retval SHR_E_NONE No errors.
     93  * \retval !SHR_E_NONE Failure.
     94  */
     95 typedef int (*rx_queue_channel_set_f)(
     96     int unit,
     97     bcm_cos_queue_t queue_id,
     98     bcm_rx_chan_t chan_id);
     99 
    100 /*!
    101  * \brief Initialize the rx module.
    102  *
    103  * \param [in] unit Unit Number.
    104  *
    105  * \retval SHR_E_NONE No errors.
    106  * \retval !SHR_E_NONE Failure.
    107  */
    108 typedef int (*rx_init_f)(int unit);
    109 
    110 /*!
    111  * \brief Detach the rx module.
    112  *
    113  * \param [in] unit Unit Number.
    114  *
    115  * \retval SHR_E_NONE No errors.
    116  * \retval !SHR_E_NONE Failure.
    117  */
    118 typedef int (*rx_detach_f)(int unit);
    119 
    120 /*!
    121  * \brief rx map database initialization.
    122  *
    123  * \param [in] unit Unit Number.
    124  * \param [in|out] map_db rx map database.
    125  *
    126  * \retval SHR_E_NONE No errors.
    127  * \retval !SHR_E_NONE Failure.
    128  */
    129 typedef int (*rx_map_db_init_f)(
    130     int unit,
    131     const bcmint_rx_map_db_t ** map_db);
    132 
    133 /*!
    134  * \brief retrieve TM_COS_Q_CPU_MAP_INFO.
    135  *
    136  * \param [in] unit Unit Number.
    137  * \param [in] info_id cosq cpu map info id.
    138  * \param [out] info cosq cpu map info.
    139  *
    140  * \retval SHR_E_NONE No errors.
    141  * \retval !SHR_E_NONE Failure.
    142  */
    143 typedef int (*rx_tm_cos_q_cpu_map_info_get_f)(
    144     int unit,
    145     const char *info_id,
    146     bcmint_tm_cos_q_cpu_map_info_t *info);
    147 
    148 /*!
    149  * \brief Rx driver structure.
    150  */
    151 typedef struct mbcm_ltsw_rx_drv_s {
    152 
    153     /*! Add a CPU cos map. */
    154     rx_cosq_mapping_extended_add_f rx_cosq_mapping_extended_add;
    155 
    156     /*! Delete a CPU cos map.  */
    157     rx_cosq_mapping_extended_delete_f rx_cosq_mapping_extended_delete;
    158 
    159     /*! Delete all CPU cos maps. */
    160     rx_cosq_mapping_extended_delete_all_f rx_cosq_mapping_extended_delete_all;
    161 
    162     /*! Get packets to CPU COS queue mappings */
    163     rx_cosq_mapping_extended_get_f rx_cosq_mapping_extended_get;
    164 
    165     /*! Get the associated rx channel with a given cosq */
    166     rx_queue_channel_get_f rx_queue_channel_get;
    167 
    168     /*! Assign a RX channel to a cosq */
    169     rx_queue_channel_set_f rx_queue_channel_set;
    170 
    171     /*! Initialize the rx module. */
    172     rx_init_f rx_init;
    173 
    174     /*! Detach the rx module. */
    175     rx_detach_f rx_detach;
    176 
    177     /*! rx map database initialization. */
    178     rx_map_db_init_f rx_map_db_init;
    179 
    180     /*! retrieve TM_COS_Q_CPU_MAP_INFO. */
    181     rx_tm_cos_q_cpu_map_info_get_f rx_tm_cos_q_cpu_map_info_get;
    182 
    183 } mbcm_ltsw_rx_drv_t;
    184 
    185 /*!
    186  * \brief Set the RX driver of the device.
    187  *
    188  * \param [in] unit Unit Number.
    189  * \param [in] drv Rx driver to set.
    190  *
    191  * \retval SHR_E_NONE No errors.
    192  * \retval !SHR_E_NONE Failure.
    193  */
    194 extern int
    195 mbcm_ltsw_rx_drv_set(
    196     int unit,
    197     mbcm_ltsw_rx_drv_t *drv);
    198 
    199 /*!
    200  * \brief Add a CPU cos map.
    201  *
    202  * \param [in] unit Unit Number.
    203  * \param [in] options options
    204  * \param [in] rx_cosq_mapping rx cosq mapping ptr
    205  *
    206  * \retval SHR_E_NONE No errors.
    207  * \retval !SHR_E_NONE Failure.
    208  */
    209 extern int
    210 mbcm_ltsw_rx_cosq_mapping_extended_add(
    211     int unit,
    212     uint32 options,
    213     bcm_rx_cosq_mapping_t *rx_cosq_mapping);
    214 
    215 /*!
    216  * \brief Delete a CPU cos map. 
    217  *
    218  * \param [in] unit Unit Number.
    219  * \param [in] rx_cosq_mapping rx cosq mapping ptr
    220  *
    221  * \retval SHR_E_NONE No errors.
    222  * \retval !SHR_E_NONE Failure.
    223  */
    224 extern int
    225 mbcm_ltsw_rx_cosq_mapping_extended_delete(
    226     int unit,
    227     bcm_rx_cosq_mapping_t *rx_cosq_mapping);
    228 
    229 /*!
    230  * \brief Delete all CPU cos maps.
    231  *
    232  * \param [in] unit Unit Number.
    233  *
    234  * \retval SHR_E_NONE No errors.
    235  * \retval !SHR_E_NONE Failure.
    236  */
    237 extern int
    238 mbcm_ltsw_rx_cosq_mapping_extended_delete_all(int unit);
    239 
    240 /*!
    241  * \brief Get packets to CPU COS queue mappings
    242  *
    243  * \param [in] unit Unit Number.
    244  * \param [out] rx_cosq_mapping rx cosq mapping ptr
    245  *
    246  * \retval SHR_E_NONE No errors.
    247  * \retval !SHR_E_NONE Failure.
    248  */
    249 extern int
    250 mbcm_ltsw_rx_cosq_mapping_extended_get(
    251     int unit,
    252     bcm_rx_cosq_mapping_t *rx_cosq_mapping);
    253 
    254 /*!
    255  * \brief Get the associated rx channel with a given cosq
    256  *
    257  * \param [in] unit Unit Number.
    258  * \param [in] queue_id CPU cos queue index (0 - (max cosq - 1))
    259  * \param [out] chan_id channel index
    260  *
    261  * \retval SHR_E_NONE No errors.
    262  * \retval !SHR_E_NONE Failure.
    263  */
    264 extern int
    265 mbcm_ltsw_rx_queue_channel_get(
    266     int unit,
    267     bcm_cos_queue_t queue_id,
    268     bcm_rx_chan_t *chan_id);
    269 
    270 /*!
    271  * \brief Assign a RX channel to a cosq
    272  *
    273  * \param [in] unit Unit Number.
    274  * \param [in] queue_id CPU cos queue index (0 - (max cosq - 1))
    275  * \param [in] chan_id channel index
    276  *
    277  * \retval SHR_E_NONE No errors.
    278  * \retval !SHR_E_NONE Failure.
    279  */
    280 extern int
    281 mbcm_ltsw_rx_queue_channel_set(
    282     int unit,
    283     bcm_cos_queue_t queue_id,
    284     bcm_rx_chan_t chan_id);
    285 
    286 /*!
    287  * \brief Initialize the rx module.
    288  *
    289  * \param [in] unit Unit Number.
    290  *
    291  * \retval SHR_E_NONE No errors.
    292  * \retval !SHR_E_NONE Failure.
    293  */
    294 extern int
    295 mbcm_ltsw_rx_init(int unit);
    296 
    297 /*!
    298  * \brief Detach the rx module.
    299  *
    300  * \param [in] unit Unit Number.
    301  *
    302  * \retval SHR_E_NONE No errors.
    303  * \retval !SHR_E_NONE Failure.
    304  */
    305 extern int
    306 mbcm_ltsw_rx_detach(int unit);
    307 
    308 /*!
    309  * \brief rx map database initialization.
    310  *
    311  * \param [in] unit Unit Number.
    312  * \param [in|out] map_db rx map database.
    313  *
    314  * \retval SHR_E_NONE No errors.
    315  * \retval !SHR_E_NONE Failure.
    316  */
    317 extern int
    318 mbcm_ltsw_rx_map_db_init(
    319     int unit,
    320     const bcmint_rx_map_db_t ** map_db);
    321 
    322 /*!
    323  * \brief retrieve TM_COS_Q_CPU_MAP_INFO.
    324  *
    325  * \param [in] unit Unit Number.
    326  * \param [in] info_id cosq cpu map info id.
    327  * \param [out] info cosq cpu map info.
    328  *
    329  * \retval SHR_E_NONE No errors.
    330  * \retval !SHR_E_NONE Failure.
    331  */
    332 extern int
    333 mbcm_ltsw_rx_tm_cos_q_cpu_map_info_get(
    334     int unit,
    335     const char *info_id,
    336     bcmint_tm_cos_q_cpu_map_info_t *info);
    337 
    338 #endif /* BCMINT_LTSW_MBCM_RX_H */