oob.h (12864B)
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_OOB_H 12 #define BCMINT_LTSW_MBCM_OOB_H 13 14 #include <bcm/oob.h> 15 #include <bcm/types.h> 16 17 /*! 18 * \brief Initialize OOB module. 19 * 20 * \param [in] unit Unit Number. 21 * 22 * \retval SHR_E_NONE No errors. 23 * \retval !SHR_E_NONE Failure. 24 */ 25 typedef int (*oob_init_f)(int unit); 26 27 /*! 28 * \brief Detach OOB module. 29 * 30 * \param [in] unit Unit Number. 31 * 32 * \retval SHR_E_NONE No errors. 33 * \retval !SHR_E_NONE Failure. 34 */ 35 typedef int (*oob_detach_f)(int unit); 36 37 /*! 38 * \brief Set OOB Tx Queue configuration profile. 39 * 40 * \param [in] unit Unit Number. 41 * \param [in] profile_id OOB Tx Queue configuration profile id. 42 * \param [in] count The number of Queue configurations in the config array. 43 * \param [in] config Queue configuration array. 44 * 45 * \retval SHR_E_NONE No errors. 46 * \retval !SHR_E_NONE Failure. 47 */ 48 typedef int (*oob_tx_queue_profile_set_f)( 49 int unit, 50 int profile_id, 51 int count, 52 bcm_oob_fc_tx_queue_config_t *config); 53 54 /*! 55 * \brief Retrieve OOB Tx Queue configuration profile. 56 * 57 * \param [in] unit Unit Number. 58 * \param [in] profile_id OOB Tx Queue configuration profile id. 59 * \param [in] max_count Allocated number of Queue configurations. 60 * \param [out] config Queue configuration array. 61 * \param [out] count The number of Queue configurations returned. 62 * 63 * \retval SHR_E_NONE No errors. 64 * \retval !SHR_E_NONE Failure. 65 */ 66 typedef int (*oob_tx_queue_profile_get_f)( 67 int unit, 68 int profile_id, 69 int max_count, 70 bcm_oob_fc_tx_queue_config_t *config, 71 int *count); 72 73 /*! 74 * \brief Set logical port to OOB port mapping. 75 * 76 * \param [in] unit Unit Number. 77 * \param [in] count The number of device port to OOB port mappings. 78 * \param [in] port_array Logical port array. 79 * \param [in] oob_port_array OOB port array. 80 * 81 * \retval SHR_E_NONE No errors. 82 * \retval !SHR_E_NONE Failure. 83 */ 84 typedef int (*oob_tx_port_mapping_set_f)( 85 int unit, 86 int count, 87 int *port_array, 88 int *oob_port_array); 89 90 /*! 91 * \brief Retrieve logical port to OOB port mapping. 92 * 93 * \param [in] unit Unit Number. 94 * \param [in] max_count Allocated number of device port to oob port mappings. 95 * \param [in] port_array Logical port array. 96 * \param [out] oob_port_array Returned OOB port array. 97 * \param [out] count The number of mappings returned. 98 * 99 * \retval SHR_E_NONE No errors. 100 * \retval !SHR_E_NONE Failure. 101 */ 102 typedef int (*oob_tx_port_mapping_get_f)( 103 int unit, 104 int max_count, 105 int *port_array, 106 int *oob_port_array, 107 int *count); 108 109 /*! 110 * \brief Configure the global configuration parameters for OOB Flow Control Tx. 111 * 112 * \param [in] unit Unit Number. 113 * \param [in] config OOB Tx global configuration structure. 114 * 115 * \retval SHR_E_NONE No errors. 116 * \retval !SHR_E_NONE Failure. 117 */ 118 typedef int (*oob_tx_config_set_f)( 119 int unit, 120 bcm_oob_fc_tx_config_t *config); 121 122 /*! 123 * \brief Retrieve the global configuration parameters for OOB Flow Control Tx. 124 * 125 * \param [in] unit Unit Number. 126 * \param [out] config OOB Tx global configuration structure. 127 * 128 * \retval SHR_E_NONE No errors. 129 * \retval !SHR_E_NONE Failure. 130 */ 131 typedef int (*oob_tx_config_get_f)( 132 int unit, 133 bcm_oob_fc_tx_config_t *config); 134 135 /*! 136 * \brief Retrieve the OOB Flow Control Tx global information. 137 * 138 * \param [in] unit Unit Number. 139 * \param [out] info Pointer to OOB Flow Control Tx global information structure. 140 * 141 * \retval SHR_E_NONE No errors. 142 * \retval !SHR_E_NONE Failure. 143 */ 144 typedef int (*oob_tx_info_get_f)( 145 int unit, 146 bcm_oob_fc_tx_info_t *info); 147 148 /*! 149 * \brief Set OOB queue profile id for a port. 150 * 151 * \param [in] unit Unit Number. 152 * \param [in] port Port id. 153 * \param [in] profile_id OOB queue profile id. 154 * 155 * \retval SHR_E_NONE No errors. 156 * \retval !SHR_E_NONE Failure. 157 */ 158 typedef int (*oob_egr_profile_id_set_f)( 159 int unit, 160 bcm_port_t port, 161 int profile_id); 162 163 /*! 164 * \brief Get OOB queue profile id on a port. 165 * 166 * \param [in] unit Unit Number. 167 * \param [in] port Port id. 168 * \param [out] profile_id OOB queue profile id. 169 * 170 * \retval SHR_E_NONE No errors. 171 * \retval !SHR_E_NONE Failure. 172 */ 173 typedef int (*oob_egr_profile_id_get_f)( 174 int unit, 175 bcm_port_t port, 176 int *profile_id); 177 178 /*! 179 * \brief Get OOB queue profile number. 180 * 181 * \param [in] unit Unit Number. 182 * \param [out] num OOB queue profile number. 183 * 184 * \retval SHR_E_NONE No errors. 185 * \retval !SHR_E_NONE Failure. 186 */ 187 typedef int (*oob_egr_profile_num_get_f)( 188 int unit, 189 int *num); 190 191 /*! 192 * \brief Set OOB port configuration(enable/disable OOB notification on a port). 193 * 194 * \param [in] unit Unit Number. 195 * \param [in] port Port id. 196 * \param [in] egress 0 = Ingreess, 1 = Egress. 197 * \param [in] enable Enable/Disable congestion State reporting. 198 * 199 * \retval SHR_E_NONE No errors. 200 * \retval !SHR_E_NONE Failure. 201 */ 202 typedef int (*oob_port_control_set_f)( 203 int unit, 204 bcm_port_t port, 205 int egress, 206 int enable); 207 208 /*! 209 * \brief Get OOB port configuration(OOB notification status on a port). 210 * 211 * \param [in] unit Unit Number. 212 * \param [in] port Port id. 213 * \param [in] egress 0 = Ingreess, 1 = Egress. 214 * \param [out] enable Enable/Disable congestion State reporting. 215 * 216 * \retval SHR_E_NONE No errors. 217 * \retval !SHR_E_NONE Failure. 218 */ 219 typedef int (*oob_port_control_get_f)( 220 int unit, 221 bcm_port_t port, 222 int egress, 223 int *enable); 224 225 /*! 226 * \brief Oob driver structure. 227 */ 228 typedef struct mbcm_ltsw_oob_drv_s { 229 230 /*! Initialize OOB module. */ 231 oob_init_f oob_init; 232 233 /*! Detach OOB module. */ 234 oob_detach_f oob_detach; 235 236 /*! Set OOB Tx Queue configuration profile. */ 237 oob_tx_queue_profile_set_f oob_tx_queue_profile_set; 238 239 /*! Retrieve OOB Tx Queue configuration profile. */ 240 oob_tx_queue_profile_get_f oob_tx_queue_profile_get; 241 242 /*! Set logical port to OOB port mapping. */ 243 oob_tx_port_mapping_set_f oob_tx_port_mapping_set; 244 245 /*! Retrieve logical port to OOB port mapping. */ 246 oob_tx_port_mapping_get_f oob_tx_port_mapping_get; 247 248 /*! Configure the global configuration parameters for OOB Flow Control Tx. */ 249 oob_tx_config_set_f oob_tx_config_set; 250 251 /*! Retrieve the global configuration parameters for OOB Flow Control Tx. */ 252 oob_tx_config_get_f oob_tx_config_get; 253 254 /*! Retrieve the OOB Flow Control Tx global information. */ 255 oob_tx_info_get_f oob_tx_info_get; 256 257 /*! Set OOB queue profile id for a port. */ 258 oob_egr_profile_id_set_f oob_egr_profile_id_set; 259 260 /*! Get OOB queue profile id on a port. */ 261 oob_egr_profile_id_get_f oob_egr_profile_id_get; 262 263 /*! Get OOB queue profile number. */ 264 oob_egr_profile_num_get_f oob_egr_profile_num_get; 265 266 /*! Set OOB port configuration(enable/disable OOB notification on a port). */ 267 oob_port_control_set_f oob_port_control_set; 268 269 /*! Get OOB port configuration(OOB notification status on a port). */ 270 oob_port_control_get_f oob_port_control_get; 271 272 } mbcm_ltsw_oob_drv_t; 273 274 /*! 275 * \brief Set the OOB driver of the device. 276 * 277 * \param [in] unit Unit Number. 278 * \param [in] drv Oob driver to set. 279 * 280 * \retval SHR_E_NONE No errors. 281 * \retval !SHR_E_NONE Failure. 282 */ 283 extern int 284 mbcm_ltsw_oob_drv_set( 285 int unit, 286 mbcm_ltsw_oob_drv_t *drv); 287 288 /*! 289 * \brief Initialize OOB module. 290 * 291 * \param [in] unit Unit Number. 292 * 293 * \retval SHR_E_NONE No errors. 294 * \retval !SHR_E_NONE Failure. 295 */ 296 extern int 297 mbcm_ltsw_oob_init(int unit); 298 299 /*! 300 * \brief Detach OOB module. 301 * 302 * \param [in] unit Unit Number. 303 * 304 * \retval SHR_E_NONE No errors. 305 * \retval !SHR_E_NONE Failure. 306 */ 307 extern int 308 mbcm_ltsw_oob_detach(int unit); 309 310 /*! 311 * \brief Set OOB Tx Queue configuration profile. 312 * 313 * \param [in] unit Unit Number. 314 * \param [in] profile_id OOB Tx Queue configuration profile id. 315 * \param [in] count The number of Queue configurations in the config array. 316 * \param [in] config Queue configuration array. 317 * 318 * \retval SHR_E_NONE No errors. 319 * \retval !SHR_E_NONE Failure. 320 */ 321 extern int 322 mbcm_ltsw_oob_tx_queue_profile_set( 323 int unit, 324 int profile_id, 325 int count, 326 bcm_oob_fc_tx_queue_config_t *config); 327 328 /*! 329 * \brief Retrieve OOB Tx Queue configuration profile. 330 * 331 * \param [in] unit Unit Number. 332 * \param [in] profile_id OOB Tx Queue configuration profile id. 333 * \param [in] max_count Allocated number of Queue configurations. 334 * \param [out] config Queue configuration array. 335 * \param [out] count The number of Queue configurations returned. 336 * 337 * \retval SHR_E_NONE No errors. 338 * \retval !SHR_E_NONE Failure. 339 */ 340 extern int 341 mbcm_ltsw_oob_tx_queue_profile_get( 342 int unit, 343 int profile_id, 344 int max_count, 345 bcm_oob_fc_tx_queue_config_t *config, 346 int *count); 347 348 /*! 349 * \brief Set logical port to OOB port mapping. 350 * 351 * \param [in] unit Unit Number. 352 * \param [in] count The number of device port to OOB port mappings. 353 * \param [in] port_array Logical port array. 354 * \param [in] oob_port_array OOB port array. 355 * 356 * \retval SHR_E_NONE No errors. 357 * \retval !SHR_E_NONE Failure. 358 */ 359 extern int 360 mbcm_ltsw_oob_tx_port_mapping_set( 361 int unit, 362 int count, 363 int *port_array, 364 int *oob_port_array); 365 366 /*! 367 * \brief Retrieve logical port to OOB port mapping. 368 * 369 * \param [in] unit Unit Number. 370 * \param [in] max_count Allocated number of device port to oob port mappings. 371 * \param [in] port_array Logical port array. 372 * \param [out] oob_port_array Returned OOB port array. 373 * \param [out] count The number of mappings returned. 374 * 375 * \retval SHR_E_NONE No errors. 376 * \retval !SHR_E_NONE Failure. 377 */ 378 extern int 379 mbcm_ltsw_oob_tx_port_mapping_get( 380 int unit, 381 int max_count, 382 int *port_array, 383 int *oob_port_array, 384 int *count); 385 386 /*! 387 * \brief Configure the global configuration parameters for OOB Flow Control Tx. 388 * 389 * \param [in] unit Unit Number. 390 * \param [in] config OOB Tx global configuration structure. 391 * 392 * \retval SHR_E_NONE No errors. 393 * \retval !SHR_E_NONE Failure. 394 */ 395 extern int 396 mbcm_ltsw_oob_tx_config_set( 397 int unit, 398 bcm_oob_fc_tx_config_t *config); 399 400 /*! 401 * \brief Retrieve the global configuration parameters for OOB Flow Control Tx. 402 * 403 * \param [in] unit Unit Number. 404 * \param [out] config OOB Tx global configuration structure. 405 * 406 * \retval SHR_E_NONE No errors. 407 * \retval !SHR_E_NONE Failure. 408 */ 409 extern int 410 mbcm_ltsw_oob_tx_config_get( 411 int unit, 412 bcm_oob_fc_tx_config_t *config); 413 414 /*! 415 * \brief Retrieve the OOB Flow Control Tx global information. 416 * 417 * \param [in] unit Unit Number. 418 * \param [out] info Pointer to OOB Flow Control Tx global information structure. 419 * 420 * \retval SHR_E_NONE No errors. 421 * \retval !SHR_E_NONE Failure. 422 */ 423 extern int 424 mbcm_ltsw_oob_tx_info_get( 425 int unit, 426 bcm_oob_fc_tx_info_t *info); 427 428 /*! 429 * \brief Set OOB queue profile id for a port. 430 * 431 * \param [in] unit Unit Number. 432 * \param [in] port Port id. 433 * \param [in] profile_id OOB queue profile id. 434 * 435 * \retval SHR_E_NONE No errors. 436 * \retval !SHR_E_NONE Failure. 437 */ 438 extern int 439 mbcm_ltsw_oob_egr_profile_id_set( 440 int unit, 441 bcm_port_t port, 442 int profile_id); 443 444 /*! 445 * \brief Get OOB queue profile id on a port. 446 * 447 * \param [in] unit Unit Number. 448 * \param [in] port Port id. 449 * \param [out] profile_id OOB queue profile id. 450 * 451 * \retval SHR_E_NONE No errors. 452 * \retval !SHR_E_NONE Failure. 453 */ 454 extern int 455 mbcm_ltsw_oob_egr_profile_id_get( 456 int unit, 457 bcm_port_t port, 458 int *profile_id); 459 460 /*! 461 * \brief Get OOB queue profile number. 462 * 463 * \param [in] unit Unit Number. 464 * \param [out] num OOB queue profile number. 465 * 466 * \retval SHR_E_NONE No errors. 467 * \retval !SHR_E_NONE Failure. 468 */ 469 extern int 470 mbcm_ltsw_oob_egr_profile_num_get( 471 int unit, 472 int *num); 473 474 /*! 475 * \brief Set OOB port configuration(enable/disable OOB notification on a port). 476 * 477 * \param [in] unit Unit Number. 478 * \param [in] port Port id. 479 * \param [in] egress 0 = Ingreess, 1 = Egress. 480 * \param [in] enable Enable/Disable congestion State reporting. 481 * 482 * \retval SHR_E_NONE No errors. 483 * \retval !SHR_E_NONE Failure. 484 */ 485 extern int 486 mbcm_ltsw_oob_port_control_set( 487 int unit, 488 bcm_port_t port, 489 int egress, 490 int enable); 491 492 /*! 493 * \brief Get OOB port configuration(OOB notification status on a port). 494 * 495 * \param [in] unit Unit Number. 496 * \param [in] port Port id. 497 * \param [in] egress 0 = Ingreess, 1 = Egress. 498 * \param [out] enable Enable/Disable congestion State reporting. 499 * 500 * \retval SHR_E_NONE No errors. 501 * \retval !SHR_E_NONE Failure. 502 */ 503 extern int 504 mbcm_ltsw_oob_port_control_get( 505 int unit, 506 bcm_port_t port, 507 int egress, 508 int *enable); 509 510 #endif /* BCMINT_LTSW_MBCM_OOB_H */