bst.h (11402B)
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_BST_H 12 #define BCMINT_LTSW_MBCM_BST_H 13 14 #include <bcm/types.h> 15 #include <bcm/cosq.h> 16 17 #include <sal/sal_types.h> 18 19 /*! 20 * \brief Get the BST profile for CosQ objects 21 * 22 * \param [in] unit Unit Number. 23 * \param [in] gport Gport Number. 24 * \param [in] cosq COS queue. 25 * \param [in] bid BST stat ID to identify the COSQ resource/object. 26 * \param [out] profile BST profile configuration. 27 * 28 * \retval SHR_E_NONE No errors. 29 * \retval !SHR_E_NONE Failure. 30 */ 31 typedef int (*cosq_bst_profile_get_f)( 32 int unit, 33 bcm_gport_t gport, 34 bcm_cos_queue_t cosq, 35 bcm_bst_stat_id_t bid, 36 bcm_cosq_bst_profile_t *profile); 37 38 /*! 39 * \brief Set the BST profile for CosQ objects 40 * 41 * \param [in] unit Unit Number. 42 * \param [in] gport Gport Number. 43 * \param [in] cosq COS queue. 44 * \param [in] bid BST stat ID to identify the COSQ resource/object. 45 * \param [in] profile BST profile configuration. 46 * 47 * \retval SHR_E_NONE No errors. 48 * \retval !SHR_E_NONE Failure. 49 */ 50 typedef int (*cosq_bst_profile_set_f)( 51 int unit, 52 bcm_gport_t gport, 53 bcm_cos_queue_t cosq, 54 bcm_bst_stat_id_t bid, 55 bcm_cosq_bst_profile_t *profile); 56 57 /*! 58 * \brief Get the BST profile for CosQ objects 59 * 60 * \param [in] unit Unit Number. 61 * \param [in] gport Gport Number. 62 * \param [in] cosq COS queue. 63 * \param [in] buffer BST stat ID to identify the COSQ resource/object. 64 * \param [in] bid BST stat ID to identify the COSQ resource/object. 65 * \param [in] options BST stat read options. 66 * \param [out] pvalue BST stat count. 67 * 68 * \retval SHR_E_NONE No errors. 69 * \retval !SHR_E_NONE Failure. 70 */ 71 typedef int (*cosq_bst_stat_get_f)( 72 int unit, 73 bcm_gport_t gport, 74 bcm_cos_queue_t cosq, 75 bcm_cosq_buffer_id_t buffer, 76 bcm_bst_stat_id_t bid, 77 uint32_t options, 78 uint64_t *pvalue); 79 80 /*! 81 * \brief Clear speficied BST stat 82 * 83 * \param [in] unit Unit Number. 84 * \param [in] gport Gport Number. 85 * \param [in] cosq COS queue. 86 * \param [in] buffer BST stat ID to identify the COSQ resource/object. 87 * \param [in] bid BST stat ID to identify the COSQ resource/object. 88 * 89 * \retval SHR_E_NONE No errors. 90 * \retval !SHR_E_NONE Failure. 91 */ 92 typedef int (*cosq_bst_stat_clear_f)( 93 int unit, 94 bcm_gport_t gport, 95 bcm_cos_queue_t cosq, 96 bcm_cosq_buffer_id_t buffer, 97 bcm_bst_stat_id_t bid); 98 99 /*! 100 * \brief Sync the HW stats value to SW copy for all or given BST resource 101 * 102 * \param [in] unit Unit Number. 103 * \param [in] bid BST stat ID to identify the COSQ resource/object. 104 * 105 * \retval SHR_E_NONE No errors. 106 * \retval !SHR_E_NONE Failure. 107 */ 108 typedef int (*cosq_bst_stat_sync_f)( 109 int unit, 110 bcm_bst_stat_id_t bid); 111 112 /*! 113 * \brief Initialize the bst module. 114 * 115 * \param [in] unit Unit Number. 116 * 117 * \retval SHR_E_NONE No errors. 118 * \retval !SHR_E_NONE Failure. 119 */ 120 typedef int (*cosq_bst_init_f)(int unit); 121 122 /*! 123 * \brief Detach the bst module. 124 * 125 * \param [in] unit Unit Number. 126 * 127 * \retval SHR_E_NONE No errors. 128 * \retval !SHR_E_NONE Failure. 129 */ 130 typedef int (*cosq_bst_detach_f)(int unit); 131 132 /*! 133 * \brief Enable BST tracking. 134 * 135 * \param [in] unit Unit Number. 136 * \param [in] arg BST enable value. 137 * 138 * \retval SHR_E_NONE No errors. 139 * \retval !SHR_E_NONE Failure. 140 */ 141 typedef int (*cosq_bst_enable_set_f)( 142 int unit, 143 int arg); 144 145 /*! 146 * \brief Get BST enable value. 147 * 148 * \param [in] unit Unit Number. 149 * \param [out] arg BST enable value. 150 * 151 * \retval SHR_E_NONE No errors. 152 * \retval !SHR_E_NONE Failure. 153 */ 154 typedef int (*cosq_bst_enable_get_f)( 155 int unit, 156 int *arg); 157 158 /*! 159 * \brief Set BST resource usage tracking mode. 160 * 161 * \param [in] unit Unit Number. 162 * \param [in] arg BST resource usage tracking mode value. 163 * 164 * \retval SHR_E_NONE No errors. 165 * \retval !SHR_E_NONE Failure. 166 */ 167 typedef int (*cosq_bst_tracking_mode_set_f)( 168 int unit, 169 int arg); 170 171 /*! 172 * \brief Get BST resource usage tracking mode. 173 * 174 * \param [in] unit Unit Number. 175 * \param [out] arg BST resource usage tracking mode value. 176 * 177 * \retval SHR_E_NONE No errors. 178 * \retval !SHR_E_NONE Failure. 179 */ 180 typedef int (*cosq_bst_tracking_mode_get_f)( 181 int unit, 182 int *arg); 183 184 /*! 185 * \brief Set BST resource usage SnapShot mode. 186 * 187 * \param [in] unit Unit Number. 188 * \param [in] arg BST resource usage SnapShot mode value. 189 * 190 * \retval SHR_E_NONE No errors. 191 * \retval !SHR_E_NONE Failure. 192 */ 193 typedef int (*cosq_bst_snapshot_enable_set_f)( 194 int unit, 195 int arg); 196 197 /*! 198 * \brief Get BST resource usage SnapShot mode. 199 * 200 * \param [in] unit Unit Number. 201 * \param [out] arg BST resource usage SnapShot mode value. 202 * 203 * \retval SHR_E_NONE No errors. 204 * \retval !SHR_E_NONE Failure. 205 */ 206 typedef int (*cosq_bst_snapshot_enable_get_f)( 207 int unit, 208 int *arg); 209 210 /*! 211 * \brief Cosq_bst driver structure. 212 */ 213 typedef struct mbcm_ltsw_cosq_bst_drv_s { 214 215 /*! Get the BST profile for CosQ objects */ 216 cosq_bst_profile_get_f cosq_bst_profile_get; 217 218 /*! Set the BST profile for CosQ objects */ 219 cosq_bst_profile_set_f cosq_bst_profile_set; 220 221 /*! Get the BST profile for CosQ objects */ 222 cosq_bst_stat_get_f cosq_bst_stat_get; 223 224 /*! Clear speficied BST stat */ 225 cosq_bst_stat_clear_f cosq_bst_stat_clear; 226 227 /*! Sync the HW stats value to SW copy for all or given BST resource */ 228 cosq_bst_stat_sync_f cosq_bst_stat_sync; 229 230 /*! Initialize the bst module. */ 231 cosq_bst_init_f cosq_bst_init; 232 233 /*! Detach the bst module. */ 234 cosq_bst_detach_f cosq_bst_detach; 235 236 /*! Enable BST tracking. */ 237 cosq_bst_enable_set_f cosq_bst_enable_set; 238 239 /*! Get BST enable value. */ 240 cosq_bst_enable_get_f cosq_bst_enable_get; 241 242 /*! Set BST resource usage tracking mode. */ 243 cosq_bst_tracking_mode_set_f cosq_bst_tracking_mode_set; 244 245 /*! Get BST resource usage tracking mode. */ 246 cosq_bst_tracking_mode_get_f cosq_bst_tracking_mode_get; 247 248 /*! Set BST resource usage SnapShot mode. */ 249 cosq_bst_snapshot_enable_set_f cosq_bst_snapshot_enable_set; 250 251 /*! Get BST resource usage SnapShot mode. */ 252 cosq_bst_snapshot_enable_get_f cosq_bst_snapshot_enable_get; 253 254 } mbcm_ltsw_cosq_bst_drv_t; 255 256 /*! 257 * \brief Set the COSQ_BST driver of the device. 258 * 259 * \param [in] unit Unit Number. 260 * \param [in] drv Cosq_bst driver to set. 261 * 262 * \retval SHR_E_NONE No errors. 263 * \retval !SHR_E_NONE Failure. 264 */ 265 extern int 266 mbcm_ltsw_cosq_bst_drv_set( 267 int unit, 268 mbcm_ltsw_cosq_bst_drv_t *drv); 269 270 /*! 271 * \brief Get the BST profile for CosQ objects 272 * 273 * \param [in] unit Unit Number. 274 * \param [in] gport Gport Number. 275 * \param [in] cosq COS queue. 276 * \param [in] bid BST stat ID to identify the COSQ resource/object. 277 * \param [out] profile BST profile configuration. 278 * 279 * \retval SHR_E_NONE No errors. 280 * \retval !SHR_E_NONE Failure. 281 */ 282 extern int 283 mbcm_ltsw_cosq_bst_profile_get( 284 int unit, 285 bcm_gport_t gport, 286 bcm_cos_queue_t cosq, 287 bcm_bst_stat_id_t bid, 288 bcm_cosq_bst_profile_t *profile); 289 290 /*! 291 * \brief Set the BST profile for CosQ objects 292 * 293 * \param [in] unit Unit Number. 294 * \param [in] gport Gport Number. 295 * \param [in] cosq COS queue. 296 * \param [in] bid BST stat ID to identify the COSQ resource/object. 297 * \param [in] profile BST profile configuration. 298 * 299 * \retval SHR_E_NONE No errors. 300 * \retval !SHR_E_NONE Failure. 301 */ 302 extern int 303 mbcm_ltsw_cosq_bst_profile_set( 304 int unit, 305 bcm_gport_t gport, 306 bcm_cos_queue_t cosq, 307 bcm_bst_stat_id_t bid, 308 bcm_cosq_bst_profile_t *profile); 309 310 /*! 311 * \brief Get the BST profile for CosQ objects 312 * 313 * \param [in] unit Unit Number. 314 * \param [in] gport Gport Number. 315 * \param [in] cosq COS queue. 316 * \param [in] buffer BST stat ID to identify the COSQ resource/object. 317 * \param [in] bid BST stat ID to identify the COSQ resource/object. 318 * \param [in] options BST stat read options. 319 * \param [out] pvalue BST stat count. 320 * 321 * \retval SHR_E_NONE No errors. 322 * \retval !SHR_E_NONE Failure. 323 */ 324 extern int 325 mbcm_ltsw_cosq_bst_stat_get( 326 int unit, 327 bcm_gport_t gport, 328 bcm_cos_queue_t cosq, 329 bcm_cosq_buffer_id_t buffer, 330 bcm_bst_stat_id_t bid, 331 uint32_t options, 332 uint64_t *pvalue); 333 334 /*! 335 * \brief Clear speficied BST stat 336 * 337 * \param [in] unit Unit Number. 338 * \param [in] gport Gport Number. 339 * \param [in] cosq COS queue. 340 * \param [in] buffer BST stat ID to identify the COSQ resource/object. 341 * \param [in] bid BST stat ID to identify the COSQ resource/object. 342 * 343 * \retval SHR_E_NONE No errors. 344 * \retval !SHR_E_NONE Failure. 345 */ 346 extern int 347 mbcm_ltsw_cosq_bst_stat_clear( 348 int unit, 349 bcm_gport_t gport, 350 bcm_cos_queue_t cosq, 351 bcm_cosq_buffer_id_t buffer, 352 bcm_bst_stat_id_t bid); 353 354 /*! 355 * \brief Sync the HW stats value to SW copy for all or given BST resource 356 * 357 * \param [in] unit Unit Number. 358 * \param [in] bid BST stat ID to identify the COSQ resource/object. 359 * 360 * \retval SHR_E_NONE No errors. 361 * \retval !SHR_E_NONE Failure. 362 */ 363 extern int 364 mbcm_ltsw_cosq_bst_stat_sync( 365 int unit, 366 bcm_bst_stat_id_t bid); 367 368 /*! 369 * \brief Initialize the bst module. 370 * 371 * \param [in] unit Unit Number. 372 * 373 * \retval SHR_E_NONE No errors. 374 * \retval !SHR_E_NONE Failure. 375 */ 376 extern int 377 mbcm_ltsw_cosq_bst_init(int unit); 378 379 /*! 380 * \brief Detach the bst module. 381 * 382 * \param [in] unit Unit Number. 383 * 384 * \retval SHR_E_NONE No errors. 385 * \retval !SHR_E_NONE Failure. 386 */ 387 extern int 388 mbcm_ltsw_cosq_bst_detach(int unit); 389 390 /*! 391 * \brief Enable BST tracking. 392 * 393 * \param [in] unit Unit Number. 394 * \param [in] arg BST enable value. 395 * 396 * \retval SHR_E_NONE No errors. 397 * \retval !SHR_E_NONE Failure. 398 */ 399 extern int 400 mbcm_ltsw_cosq_bst_enable_set( 401 int unit, 402 int arg); 403 404 /*! 405 * \brief Get BST enable value. 406 * 407 * \param [in] unit Unit Number. 408 * \param [out] arg BST enable value. 409 * 410 * \retval SHR_E_NONE No errors. 411 * \retval !SHR_E_NONE Failure. 412 */ 413 extern int 414 mbcm_ltsw_cosq_bst_enable_get( 415 int unit, 416 int *arg); 417 418 /*! 419 * \brief Set BST resource usage tracking mode. 420 * 421 * \param [in] unit Unit Number. 422 * \param [in] arg BST resource usage tracking mode value. 423 * 424 * \retval SHR_E_NONE No errors. 425 * \retval !SHR_E_NONE Failure. 426 */ 427 extern int 428 mbcm_ltsw_cosq_bst_tracking_mode_set( 429 int unit, 430 int arg); 431 432 /*! 433 * \brief Get BST resource usage tracking mode. 434 * 435 * \param [in] unit Unit Number. 436 * \param [out] arg BST resource usage tracking mode value. 437 * 438 * \retval SHR_E_NONE No errors. 439 * \retval !SHR_E_NONE Failure. 440 */ 441 extern int 442 mbcm_ltsw_cosq_bst_tracking_mode_get( 443 int unit, 444 int *arg); 445 446 /*! 447 * \brief Set BST resource usage SnapShot mode. 448 * 449 * \param [in] unit Unit Number. 450 * \param [in] arg BST resource usage SnapShot mode value. 451 * 452 * \retval SHR_E_NONE No errors. 453 * \retval !SHR_E_NONE Failure. 454 */ 455 extern int 456 mbcm_ltsw_cosq_bst_snapshot_enable_set( 457 int unit, 458 int arg); 459 460 /*! 461 * \brief Get BST resource usage SnapShot mode. 462 * 463 * \param [in] unit Unit Number. 464 * \param [out] arg BST resource usage SnapShot mode value. 465 * 466 * \retval SHR_E_NONE No errors. 467 * \retval !SHR_E_NONE Failure. 468 */ 469 extern int 470 mbcm_ltsw_cosq_bst_snapshot_enable_get( 471 int unit, 472 int *arg); 473 474 #endif /* BCMINT_LTSW_MBCM_BST_H */