rate.h (8538B)
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_RATE_H 12 #define BCMINT_LTSW_MBCM_RATE_H 13 14 #include <bcm/types.h> 15 16 #include <bcm_int/ltsw/rate_int.h> 17 18 /*! 19 * \brief Initialize rate module. 20 * 21 * \param [in] unit Unit Number. 22 * 23 * \retval SHR_E_NONE No errors. 24 * \retval !SHR_E_NONE Failure. 25 */ 26 typedef int (*rate_init_f)(int unit); 27 28 /*! 29 * \brief De-initializes rate module. 30 * 31 * \param [in] unit Unit Number. 32 * 33 * \retval SHR_E_NONE No errors. 34 * \retval !SHR_E_NONE Failure. 35 */ 36 typedef int (*rate_deinit_f)(int unit); 37 38 /*! 39 * \brief Clear rate related LT tables. 40 * 41 * \param [in] unit Unit Number. 42 * 43 * \retval SHR_E_NONE No errors. 44 * \retval !SHR_E_NONE Failure. 45 */ 46 typedef int (*rate_clear_f)(int unit); 47 48 /*! 49 * \brief Update the rate configuration. 50 * 51 * \param [in] unit Unit Number. 52 * \param [in] port Port Number. 53 * \param [in] rate_info Rate Information. 54 * 55 * \retval SHR_E_NONE No errors. 56 * \retval !SHR_E_NONE Failure. 57 */ 58 typedef int (*rate_set_f)( 59 int unit, 60 bcm_port_t port, 61 bcmint_rate_info_t *rate_info); 62 63 /*! 64 * \brief Get the rate configuration. 65 * 66 * \param [in] unit Unit Number. 67 * \param [in] port Port Number. 68 * \param [out] rate_info Rate Information. 69 * 70 * \retval SHR_E_NONE No errors. 71 * \retval !SHR_E_NONE Failure. 72 */ 73 typedef int (*rate_get_f)( 74 int unit, 75 bcm_port_t port, 76 bcmint_rate_info_t *rate_info); 77 78 /*! 79 * \brief Set the rate device configuration. 80 * 81 * \param [in] unit Unit Number. 82 * \param [in] dev_info Device configuration. 83 * 84 * \retval SHR_E_NONE No errors. 85 * \retval !SHR_E_NONE Failure. 86 */ 87 typedef int (*rate_dev_set_f)( 88 int unit, 89 bcmint_rate_dev_info_t *dev_info); 90 91 /*! 92 * \brief Get the rate device configuration. 93 * 94 * \param [in] unit Unit Number. 95 * \param [out] dev_info Device configuration. 96 * 97 * \retval SHR_E_NONE No errors. 98 * \retval !SHR_E_NONE Failure. 99 */ 100 typedef int (*rate_dev_get_f)( 101 int unit, 102 bcmint_rate_dev_info_t *dev_info); 103 104 /*! 105 * \brief Set Meter/Rate control with overhead on wire accounted for per packet. 106 * 107 * \param [in] unit Unit Number. 108 * \param [in] port Port Number. 109 * \param [in] value Number of bytes to adjust. 110 * 111 * \retval SHR_E_NONE No errors. 112 * \retval !SHR_E_NONE Failure. 113 */ 114 typedef int (*rate_meter_adjust_set_f)( 115 int unit, 116 bcm_port_t port, 117 int value); 118 119 /*! 120 * \brief Get Meter/Rate control with overhead on wire accounted for per packet. 121 * 122 * \param [in] unit Unit Number. 123 * \param [in] port Port Number. 124 * \param [out] value Number of bytes to adjust. 125 * 126 * \retval SHR_E_NONE No errors. 127 * \retval !SHR_E_NONE Failure. 128 */ 129 typedef int (*rate_meter_adjust_get_f)( 130 int unit, 131 bcm_port_t port, 132 int *value); 133 134 /*! 135 * \brief Set Meter/Rate control with overhead on wire accounted for per packet for EFP. 136 * 137 * \param [in] unit Unit Number. 138 * \param [in] port Port Number. 139 * \param [in] value Number of bytes to adjust. 140 * 141 * \retval SHR_E_NONE No errors. 142 * \retval !SHR_E_NONE Failure. 143 */ 144 typedef int (*rate_shaper_adjust_set_f)( 145 int unit, 146 bcm_port_t port, 147 int value); 148 149 /*! 150 * \brief Get Meter/Rate control with overhead on wire accounted for per packet for EFP. 151 * 152 * \param [in] unit Unit Number. 153 * \param [in] port Port Number. 154 * \param [out] value Number of bytes to adjust. 155 * 156 * \retval SHR_E_NONE No errors. 157 * \retval !SHR_E_NONE Failure. 158 */ 159 typedef int (*rate_shaper_adjust_get_f)( 160 int unit, 161 bcm_port_t port, 162 int *value); 163 164 /*! 165 * \brief Rate driver structure. 166 */ 167 typedef struct mbcm_ltsw_rate_drv_s { 168 169 /*! Initialize rate module. */ 170 rate_init_f rate_init; 171 172 /*! De-initializes rate module. */ 173 rate_deinit_f rate_deinit; 174 175 /*! Clear rate related LT tables. */ 176 rate_clear_f rate_clear; 177 178 /*! Update the rate configuration. */ 179 rate_set_f rate_set; 180 181 /*! Get the rate configuration. */ 182 rate_get_f rate_get; 183 184 /*! Set the rate device configuration. */ 185 rate_dev_set_f rate_dev_set; 186 187 /*! Get the rate device configuration. */ 188 rate_dev_get_f rate_dev_get; 189 190 /*! Set Meter/Rate control with overhead on wire accounted for per packet. */ 191 rate_meter_adjust_set_f rate_meter_adjust_set; 192 193 /*! Get Meter/Rate control with overhead on wire accounted for per packet. */ 194 rate_meter_adjust_get_f rate_meter_adjust_get; 195 196 /*! Set Meter/Rate control with overhead on wire accounted for per packet for EFP. */ 197 rate_shaper_adjust_set_f rate_shaper_adjust_set; 198 199 /*! Get Meter/Rate control with overhead on wire accounted for per packet for EFP. */ 200 rate_shaper_adjust_get_f rate_shaper_adjust_get; 201 202 } mbcm_ltsw_rate_drv_t; 203 204 /*! 205 * \brief Set the RATE driver of the device. 206 * 207 * \param [in] unit Unit Number. 208 * \param [in] drv Rate driver to set. 209 * 210 * \retval SHR_E_NONE No errors. 211 * \retval !SHR_E_NONE Failure. 212 */ 213 extern int 214 mbcm_ltsw_rate_drv_set( 215 int unit, 216 mbcm_ltsw_rate_drv_t *drv); 217 218 /*! 219 * \brief Initialize rate module. 220 * 221 * \param [in] unit Unit Number. 222 * 223 * \retval SHR_E_NONE No errors. 224 * \retval !SHR_E_NONE Failure. 225 */ 226 extern int 227 mbcm_ltsw_rate_init(int unit); 228 229 /*! 230 * \brief De-initializes rate module. 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_rate_deinit(int unit); 239 240 /*! 241 * \brief Clear rate related LT tables. 242 * 243 * \param [in] unit Unit Number. 244 * 245 * \retval SHR_E_NONE No errors. 246 * \retval !SHR_E_NONE Failure. 247 */ 248 extern int 249 mbcm_ltsw_rate_clear(int unit); 250 251 /*! 252 * \brief Update the rate configuration. 253 * 254 * \param [in] unit Unit Number. 255 * \param [in] port Port Number. 256 * \param [in] rate_info Rate Information. 257 * 258 * \retval SHR_E_NONE No errors. 259 * \retval !SHR_E_NONE Failure. 260 */ 261 extern int 262 mbcm_ltsw_rate_set( 263 int unit, 264 bcm_port_t port, 265 bcmint_rate_info_t *rate_info); 266 267 /*! 268 * \brief Get the rate configuration. 269 * 270 * \param [in] unit Unit Number. 271 * \param [in] port Port Number. 272 * \param [out] rate_info Rate Information. 273 * 274 * \retval SHR_E_NONE No errors. 275 * \retval !SHR_E_NONE Failure. 276 */ 277 extern int 278 mbcm_ltsw_rate_get( 279 int unit, 280 bcm_port_t port, 281 bcmint_rate_info_t *rate_info); 282 283 /*! 284 * \brief Set the rate device configuration. 285 * 286 * \param [in] unit Unit Number. 287 * \param [in] dev_info Device configuration. 288 * 289 * \retval SHR_E_NONE No errors. 290 * \retval !SHR_E_NONE Failure. 291 */ 292 extern int 293 mbcm_ltsw_rate_dev_set( 294 int unit, 295 bcmint_rate_dev_info_t *dev_info); 296 297 /*! 298 * \brief Get the rate device configuration. 299 * 300 * \param [in] unit Unit Number. 301 * \param [out] dev_info Device configuration. 302 * 303 * \retval SHR_E_NONE No errors. 304 * \retval !SHR_E_NONE Failure. 305 */ 306 extern int 307 mbcm_ltsw_rate_dev_get( 308 int unit, 309 bcmint_rate_dev_info_t *dev_info); 310 311 /*! 312 * \brief Set Meter/Rate control with overhead on wire accounted for per packet. 313 * 314 * \param [in] unit Unit Number. 315 * \param [in] port Port Number. 316 * \param [in] value Number of bytes to adjust. 317 * 318 * \retval SHR_E_NONE No errors. 319 * \retval !SHR_E_NONE Failure. 320 */ 321 extern int 322 mbcm_ltsw_rate_meter_adjust_set( 323 int unit, 324 bcm_port_t port, 325 int value); 326 327 /*! 328 * \brief Get Meter/Rate control with overhead on wire accounted for per packet. 329 * 330 * \param [in] unit Unit Number. 331 * \param [in] port Port Number. 332 * \param [out] value Number of bytes to adjust. 333 * 334 * \retval SHR_E_NONE No errors. 335 * \retval !SHR_E_NONE Failure. 336 */ 337 extern int 338 mbcm_ltsw_rate_meter_adjust_get( 339 int unit, 340 bcm_port_t port, 341 int *value); 342 343 /*! 344 * \brief Set Meter/Rate control with overhead on wire accounted for per packet for EFP. 345 * 346 * \param [in] unit Unit Number. 347 * \param [in] port Port Number. 348 * \param [in] value Number of bytes to adjust. 349 * 350 * \retval SHR_E_NONE No errors. 351 * \retval !SHR_E_NONE Failure. 352 */ 353 extern int 354 mbcm_ltsw_rate_shaper_adjust_set( 355 int unit, 356 bcm_port_t port, 357 int value); 358 359 /*! 360 * \brief Get Meter/Rate control with overhead on wire accounted for per packet for EFP. 361 * 362 * \param [in] unit Unit Number. 363 * \param [in] port Port Number. 364 * \param [out] value Number of bytes to adjust. 365 * 366 * \retval SHR_E_NONE No errors. 367 * \retval !SHR_E_NONE Failure. 368 */ 369 extern int 370 mbcm_ltsw_rate_shaper_adjust_get( 371 int unit, 372 bcm_port_t port, 373 int *value); 374 375 #endif /* BCMINT_LTSW_MBCM_RATE_H */