imb.h (75769B)
1 2 /* 3 * 4 * 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 * DO NOT EDIT THIS FILE! 12 */ 13 14 #ifndef BCM_DNX_SUPPORT 15 #error "This file is for use by DNX family only!" 16 #endif /* BCM_DNX_SUPPORT */ 17 18 #ifndef _IMB_H__H_ 19 #define _IMB_H__H_ 20 21 #include <soc/portmod/portmod.h> 22 #include <bcm/port.h> 23 #include <bcm/cosq.h> 24 #include <bcm_int/dnx/port/imb/imb_diag.h> 25 #include <bcm_int/dnx/cosq/ingress/cosq_ingress_port.h> 26 #include <soc/dnxc/dnxc_port.h> 27 28 /*! 29 * @enum imb_dispatch_type_e 30 * @brief Supported Drivers 31 */ 32 typedef enum imb_dispatch_type_e 33 { 34 imbDispatchTypeNone, 35 imbDispatchTypeImb_cdu, 36 imbDispatchTypeImb_clu, 37 imbDispatchTypeImb_ile, 38 imbDispatchTypeImb_ilu, 39 imbDispatchTypeImb_feu, 40 imbDispatchTypeImb_feu_phy, 41 imbDispatchTypeImb_fabric, 42 imbDispatchTypeCount 43 } imb_dispatch_type_t; 44 45 extern const enum_mapping_t imb_dispatch_type_t_mapping[]; 46 /* imb_dispatch_type_t validation */ 47 int imb_dispatch_type_t_validate( 48 int unit, 49 imb_dispatch_type_t imb_dispatch_type); 50 51 /*! 52 * @struct imb_cdu_create_info_s 53 * @brief CDU specific information required for IMB init. 54 */ 55 typedef struct imb_cdu_create_info_s 56 { 57 void *user_acc; /**< user access information to be passed to portmod layer. */ 58 } imb_cdu_create_info_t; 59 60 /* imb_cdu_create_info_t initialization and validation */ 61 int imb_cdu_create_info_t_validate( 62 int unit, 63 const imb_cdu_create_info_t * imb_cdu_create_info); 64 int imb_cdu_create_info_t_init( 65 int unit, 66 imb_cdu_create_info_t * imb_cdu_create_info); 67 68 /*! 69 * @struct imb_clu_create_info_s 70 * @brief CLU specific information required for IMB init. 71 */ 72 typedef struct imb_clu_create_info_s 73 { 74 void *user_acc; /**< user access information to be passed to portmod layer. */ 75 } imb_clu_create_info_t; 76 77 /* imb_clu_create_info_t initialization and validation */ 78 int imb_clu_create_info_t_validate( 79 int unit, 80 const imb_clu_create_info_t * imb_clu_create_info); 81 int imb_clu_create_info_t_init( 82 int unit, 83 imb_clu_create_info_t * imb_clu_create_info); 84 85 /*! 86 * @struct imb_ile_create_info_s 87 * @brief ILU specific information required for IMB init. 88 */ 89 typedef struct imb_ile_create_info_s 90 { 91 int stub; /**< temp stub until ILKN is implemented */ 92 } imb_ile_create_info_t; 93 94 /* imb_ile_create_info_t initialization and validation */ 95 int imb_ile_create_info_t_validate( 96 int unit, 97 const imb_ile_create_info_t * imb_ile_create_info); 98 int imb_ile_create_info_t_init( 99 int unit, 100 imb_ile_create_info_t * imb_ile_create_info); 101 102 /*! 103 * @struct imb_feu_create_info_s 104 * @brief FEU specific information required for IMB init. 105 */ 106 typedef struct imb_feu_create_info_s 107 { 108 int stub; /**< temp stub for FEU */ 109 } imb_feu_create_info_t; 110 111 /* imb_feu_create_info_t initialization and validation */ 112 int imb_feu_create_info_t_validate( 113 int unit, 114 const imb_feu_create_info_t * imb_feu_create_info); 115 int imb_feu_create_info_t_init( 116 int unit, 117 imb_feu_create_info_t * imb_feu_create_info); 118 119 /*! 120 * @struct imb_feu_phy_create_info_s 121 * @brief FEU_PHY specific information required for IMB init. 122 */ 123 typedef struct imb_feu_phy_create_info_s 124 { 125 int stub; /**< temp stub for FEU_PHY */ 126 } imb_feu_phy_create_info_t; 127 128 /* imb_feu_phy_create_info_t initialization and validation */ 129 int imb_feu_phy_create_info_t_validate( 130 int unit, 131 const imb_feu_phy_create_info_t * imb_feu_phy_create_info); 132 int imb_feu_phy_create_info_t_init( 133 int unit, 134 imb_feu_phy_create_info_t * imb_feu_phy_create_info); 135 136 /*! 137 * @struct imb_fabric_create_info_s 138 * @brief Fabric specific information required for IMB init. 139 */ 140 typedef struct imb_fabric_create_info_s 141 { 142 int stub; /**< temp stub until Fabric is implemented */ 143 } imb_fabric_create_info_t; 144 145 /* imb_fabric_create_info_t initialization and validation */ 146 int imb_fabric_create_info_t_validate( 147 int unit, 148 const imb_fabric_create_info_t * imb_fabric_create_info); 149 int imb_fabric_create_info_t_init( 150 int unit, 151 imb_fabric_create_info_t * imb_fabric_create_info); 152 153 typedef union imb_specific_create_info_u 154 { 155 imb_cdu_create_info_t cdu; 156 imb_clu_create_info_t clu; 157 imb_ile_create_info_t ile; 158 imb_feu_create_info_t feu; 159 imb_feu_phy_create_info_t feu_phy; 160 imb_fabric_create_info_t fabric; 161 } imb_specific_create_info_t; 162 163 /*! 164 * @struct imb_create_info_s 165 * @brief This struct contains the required information in order to add new IMB. 166 */ 167 typedef struct imb_create_info_s 168 { 169 imb_dispatch_type_t type; /**< IMB type */ 170 int inst_id; /**< instatnce number. The physical phys will be deducted from the instance id. */ 171 imb_specific_create_info_t imb_specific_info; 172 } imb_create_info_t; 173 174 /* imb_create_info_t initialization and validation */ 175 int imb_create_info_t_validate( 176 int unit, 177 const imb_create_info_t * imb_create_info); 178 int imb_create_info_t_init( 179 int unit, 180 imb_create_info_t * imb_create_info); 181 182 #define IMB_PRD_PRIORITY_ALL (BCM_PORT_F_PRIORITY_0 | BCM_PORT_F_PRIORITY_1 | BCM_PORT_F_PRIORITY_2 | BCM_PORT_F_PRIORITY_3 | BCM_PORT_F_PRIORITY_TDM) /**< Abbriviation to set all PRD priorities */ 183 184 /*! 185 * imb_init_all 186 * 187 * @brief Initialize all IMBs on the specified unit. 188 * 189 * @param [in] unit - unit id 190 */ 191 int imb_init_all( 192 int unit); 193 194 /*! 195 * imb_deinit_all 196 * 197 * @brief De-initialize all IMBs on the specified unit. 198 * 199 * @param [in] unit - unit id 200 */ 201 int imb_deinit_all( 202 int unit); 203 204 /*! 205 * imb_init 206 * 207 * @brief initialize an IMB. 208 * 209 * @param [in] unit - unit id 210 * @param [in] imb_info - IMB information required for the IMB to initialize. 211 * @param [out] imb_specific_info - IMB information to be initialized by the specific IMB type. 212 */ 213 int imb_init( 214 int unit, 215 const imb_create_info_t * imb_info, 216 imb_specific_create_info_t * imb_specific_info); 217 218 /*! 219 * imb_deinit 220 * 221 * @brief De-initialize an existing IMB. 222 * 223 * @param [in] unit - unit id 224 * @param [in] imb_info - IMB information required for the IMB to de-init 225 * @param [out] imb_specific_info - IMB information to be deinitialized by the IMB type. 226 */ 227 int imb_deinit( 228 int unit, 229 const imb_create_info_t * imb_info, 230 imb_specific_create_info_t * imb_specific_info); 231 232 /*! 233 * imb_port_pad_size_set 234 * 235 * @brief TX pad packets to the specified size. value less than 17 means pad is disabled. 236 * 237 * @param [in] unit - unit id 238 * @param [in] port - logical port 239 * @param [in] value - TX packet pad size 240 */ 241 int imb_port_pad_size_set( 242 int unit, 243 bcm_port_t port, 244 int value); 245 /*! 246 * imb_port_pad_size_get 247 * 248 * @brief TX pad packets to the specified size. value less than 17 means pad is disabled. 249 * 250 * @param [in] unit - unit id 251 * @param [in] port - logical port 252 * @param [out] value - TX packet pad size 253 */ 254 int imb_port_pad_size_get( 255 int unit, 256 bcm_port_t port, 257 int *value); 258 259 /*! 260 * @brief Port Add Flags 261 */ 262 #define IMB_PORT_ADD_F_INIT_PASS1 0x1 /**< imb port add PASS1: init port until firmware load */ 263 #define IMB_PORT_ADD_F_INIT_PASS2 0x2 /**< imb port add PASS2: resume init port after firmware load */ 264 #define IMB_PORT_ADD_F_SKIP_SETTINGS 0x4 /**< Skip IMB port settings */ 265 266 #define IMB_PORT_ADD_F_INIT_PASS1_SET(flags) (flags |= IMB_PORT_ADD_F_INIT_PASS1) 267 #define IMB_PORT_ADD_F_INIT_PASS2_SET(flags) (flags |= IMB_PORT_ADD_F_INIT_PASS2) 268 #define IMB_PORT_ADD_F_SKIP_SETTINGS_SET(flags) (flags |= IMB_PORT_ADD_F_SKIP_SETTINGS) 269 270 #define IMB_PORT_ADD_F_INIT_PASS1_CLR(flags) (flags &= ~IMB_PORT_ADD_F_INIT_PASS1) 271 #define IMB_PORT_ADD_F_INIT_PASS2_CLR(flags) (flags &= ~IMB_PORT_ADD_F_INIT_PASS2) 272 #define IMB_PORT_ADD_F_SKIP_SETTINGS_CLR(flags) (flags &= ~IMB_PORT_ADD_F_SKIP_SETTINGS) 273 274 #define IMB_PORT_ADD_F_INIT_PASS1_GET(flags) (flags & IMB_PORT_ADD_F_INIT_PASS1 ? 1 : 0) 275 #define IMB_PORT_ADD_F_INIT_PASS2_GET(flags) (flags & IMB_PORT_ADD_F_INIT_PASS2 ? 1 : 0) 276 #define IMB_PORT_ADD_F_SKIP_SETTINGS_GET(flags) (flags & IMB_PORT_ADD_F_SKIP_SETTINGS ? 1 : 0) 277 278 /*! 279 * imb_port_add 280 * 281 * @brief Add new IMB (Interface Management Block) port 282 * 283 * @param [in] unit - unit id 284 * @param [in] port - logical port 285 * @param [in] flags - Which pass through port add. see IMB_PORT_ADD_F_INIT_... 286 */ 287 int imb_port_add( 288 int unit, 289 bcm_port_t port, 290 uint32 flags); 291 292 /*! 293 * imb_port_remove 294 * 295 * @brief Remove an existing IMB (Interface Management Block) port 296 * 297 * @param [in] unit - unit id 298 * @param [in] port - logical port 299 */ 300 int imb_port_remove( 301 int unit, 302 bcm_port_t port); 303 304 /*! 305 * imb_port_attach 306 * 307 * @brief Add new IMB (Interface Management Block) port 308 * 309 * @param [in] unit - unit id 310 * @param [in] port - logical port 311 * @param [in] flags - Which pass through port add. see IMB_PORT_ADD_F_INIT_... 312 */ 313 int imb_port_attach( 314 int unit, 315 bcm_port_t port, 316 uint32 flags); 317 318 /*! 319 * imb_port_detach 320 * 321 * @brief Remove an existing IMB (Interface Management Block) port 322 * 323 * @param [in] unit - unit id 324 * @param [in] port - logical port 325 */ 326 int imb_port_detach( 327 int unit, 328 bcm_port_t port); 329 330 /*! 331 * @brief Port Add Flags 332 */ 333 #define IMB_PORT_ENABLE_F_SKIP_PORTMOD 0x1 /**< Skip portmod enable */ 334 335 #define IMB_PORT_ENABLE_F_SKIP_PORTMOD_SET(flags) (flags |= IMB_PORT_ENABLE_F_SKIP_PORTMOD) 336 337 #define IMB_PORT_ENABLE_F_SKIP_PORTMOD_CLR(flags) (flags &= ~IMB_PORT_ENABLE_F_SKIP_PORTMOD) 338 339 #define IMB_PORT_ENABLE_F_SKIP_PORTMOD_GET(flags) (flags & IMB_PORT_ENABLE_F_SKIP_PORTMOD ? 1 : 0) 340 341 /*! 342 * imb_port_enable_set 343 * 344 * @brief Enable / disable a port 345 * 346 * @param [in] unit - unit id 347 * @param [in] port - logical port 348 * @param [in] flags - flags 349 * @param [in] enable - Port enable/disable indication 350 */ 351 int imb_port_enable_set( 352 int unit, 353 bcm_port_t port, 354 uint32 flags, 355 int enable); 356 /*! 357 * imb_port_enable_get 358 * 359 * @brief Enable / disable a port 360 * 361 * @param [in] unit - unit id 362 * @param [in] port - logical port 363 * @param [out] enable - Port enabled indication 364 */ 365 int imb_port_enable_get( 366 int unit, 367 bcm_port_t port, 368 int *enable); 369 370 /*! 371 * imb_port_rx_data_enable_set 372 * 373 * @brief Enable / disable port RX 374 * 375 * @param [in] unit - unit id 376 * @param [in] port - logical port 377 * @param [in] enable - Port Rx enable/disable 378 */ 379 int imb_port_rx_data_enable_set( 380 int unit, 381 bcm_port_t port, 382 int enable); 383 384 /*! 385 * imb_port_loopback_set 386 * 387 * @brief Enable / disable loopback on a port 388 * 389 * @param [in] unit - unit id 390 * @param [in] port - logical port 391 * @param [in] loopback - Port loopback indication 392 */ 393 int imb_port_loopback_set( 394 int unit, 395 bcm_port_t port, 396 int loopback); 397 /*! 398 * imb_port_loopback_get 399 * 400 * @brief Enable / disable loopback on a port 401 * 402 * @param [in] unit - unit id 403 * @param [in] port - logical port 404 * @param [out] loopback - Port loopback enabled indication 405 */ 406 int imb_port_loopback_get( 407 int unit, 408 bcm_port_t port, 409 int *loopback); 410 411 /*! 412 * imb_port_link_state_get 413 * 414 * @brief Get port link state 415 * 416 * @param [in] unit - unit id 417 * @param [in] port - logical port 418 * @param [in] clear_status - clear latch down indication 419 * @param [out] link_state - Port link state 420 */ 421 int imb_port_link_state_get( 422 int unit, 423 bcm_port_t port, 424 int clear_status, 425 bcm_port_link_state_t * link_state); 426 427 /*! 428 * imb_port_eee_enable_set 429 * 430 * @brief Enable / disable EEE for a port 431 * 432 * @param [in] unit - unit id 433 * @param [in] port - logical port 434 * @param [in] enable - Port EEE enable/disable indication 435 */ 436 int imb_port_eee_enable_set( 437 int unit, 438 bcm_port_t port, 439 int enable); 440 /*! 441 * imb_port_eee_enable_get 442 * 443 * @brief Enable / disable EEE for a port 444 * 445 * @param [in] unit - unit id 446 * @param [in] port - logical port 447 * @param [out] enable - Port EEE enabled indication 448 */ 449 int imb_port_eee_enable_get( 450 int unit, 451 bcm_port_t port, 452 int *enable); 453 454 /*! 455 * imb_port_link_up_mac_update 456 * 457 * @brief Set Mac link according to Phy status 458 * 459 * @param [in] unit - unit id 460 * @param [in] port - logical port 461 * @param [in] link - link status info 462 */ 463 int imb_port_link_up_mac_update( 464 int unit, 465 bcm_port_t port, 466 int link); 467 468 /*! 469 * imb_port_priority_config_set 470 * 471 * @brief Set / get priority configuration for the port 472 * 473 * @param [in] unit - unit id 474 * @param [in] port - logical port 475 * @param [in] priority_config - Priority config info 476 */ 477 int imb_port_priority_config_set( 478 int unit, 479 bcm_port_t port, 480 const bcm_port_prio_config_t * priority_config); 481 /*! 482 * imb_port_priority_config_get 483 * 484 * @brief Set / get priority configuration for the port 485 * 486 * @param [in] unit - unit id 487 * @param [in] port - logical port 488 * @param [out] priority_config - Priority config info 489 */ 490 int imb_port_priority_config_get( 491 int unit, 492 bcm_port_t port, 493 bcm_port_prio_config_t * priority_config); 494 495 /*! 496 * imb_port_phy_measure_get 497 * 498 * @brief We can't measure the serdes freq directly, but we can measure the sync_eth counter, 499 and reconstruct the serdes freq from it by multiplying it with the blocks dividers. 500 In PML and PMH GSMII the dividers are: 501 VCO Sync_eth counter 502 _ --> PM synce_div --> NBIL/H synce div --> _ 503 _| |_ _| |_ 504 So 505 VCO = Fsynce * PMH_40_PML_20 * PM_1_7_11 506 and we need to do: 507 SerDes_rate = VCO/Oversample = Fsynce * PMH_40_PML_20 * PM_1_7_11 / Oversample 508 509 In PMH which is not GSMII the dividers are: 510 Serdes freq Sync_eth counter 511 _ --> PM synce_div --> NBIL/H synce div --> _ 512 _| |_ _| |_ 513 So we need to do: 514 SerDes_rate = Fsynce * PMH_40_PML_20 * PM_1_7_11 515 * 516 * @param [in] unit - unit id 517 * @param [in] port - logical port 518 * @param [in] is_rx - use RX or TX FIFO to measure Serdes rate, only relevant for Fabric Serdes. 519 * @param [out] phy_measure - PHY measure structure 520 */ 521 int imb_port_phy_measure_get( 522 int unit, 523 bcm_port_t port, 524 int is_rx, 525 soc_dnxc_port_phy_measure_t * phy_measure); 526 527 /*! 528 * imb_port_over_sampling_get 529 * 530 * @brief Get the over-sampling factor for the port 531 * 532 * @param [in] unit - unit id 533 * @param [in] port - logical port 534 * @param [out] os_int - Over-sampling integer 535 * @param [out] os_remainder - Over-sampling remainder after the decimal point 536 */ 537 int imb_port_over_sampling_get( 538 int unit, 539 bcm_port_t port, 540 uint32 *os_int, 541 uint32 *os_remainder); 542 543 /*! 544 * imb_port_autoneg_set 545 * 546 * @brief Set/Get autoneg properties 547 * 548 * @param [in] unit - unit id 549 * @param [in] port - logical port 550 * @param [in] phy_flags - Which phy in the chain should be affected. see PORTMOD_INIT_F... 551 * @param [in] an - Auto Negotioation properties 552 */ 553 int imb_port_autoneg_set( 554 int unit, 555 bcm_port_t port, 556 uint32 phy_flags, 557 const phymod_autoneg_control_t * an); 558 /*! 559 * imb_port_autoneg_get 560 * 561 * @brief Set/Get autoneg properties 562 * 563 * @param [in] unit - unit id 564 * @param [in] port - logical port 565 * @param [in] phy_flags - Which phy in the chain should be affected. see PORTMOD_INIT_F... 566 * @param [out] an - Auto Negotioation properties 567 */ 568 int imb_port_autoneg_get( 569 int unit, 570 bcm_port_t port, 571 uint32 phy_flags, 572 phymod_autoneg_control_t * an); 573 574 /*! 575 * imb_port_link_get 576 * 577 * @brief Get link status 578 * 579 * @param [in] unit - unit id 580 * @param [in] port - logical port 581 * @param [in] flags - Which phy in the chain should be affected. see PORTMOD_INIT_F... 582 * @param [out] link - Link status indication up/down 583 */ 584 int imb_port_link_get( 585 int unit, 586 bcm_port_t port, 587 int flags, 588 int *link); 589 590 /*! 591 * imb_port_max_packet_size_set 592 * 593 * @brief Filter packets bigger than the specified value 594 * 595 * @param [in] unit - unit id 596 * @param [in] port - logical port 597 * @param [in] value - Max packet size 598 */ 599 int imb_port_max_packet_size_set( 600 int unit, 601 bcm_port_t port, 602 int value); 603 /*! 604 * imb_port_max_packet_size_get 605 * 606 * @brief Filter packets bigger than the specified value 607 * 608 * @param [in] unit - unit id 609 * @param [in] port - logical port 610 * @param [out] value - Max packet size 611 */ 612 int imb_port_max_packet_size_get( 613 int unit, 614 bcm_port_t port, 615 int *value); 616 617 /*! 618 * imb_port_tx_average_ipg_set 619 * 620 * @brief Set/get Average inter-packet gap 621 * 622 * @param [in] unit - unit id 623 * @param [in] port - logical port 624 * @param [in] ipg_value - Inter-packet gap to set 625 */ 626 int imb_port_tx_average_ipg_set( 627 int unit, 628 bcm_port_t port, 629 int ipg_value); 630 /*! 631 * imb_port_tx_average_ipg_get 632 * 633 * @brief Set/get Average inter-packet gap 634 * 635 * @param [in] unit - unit id 636 * @param [in] port - logical port 637 * @param [out] ipg_value - Get inter-packet gap 638 */ 639 int imb_port_tx_average_ipg_get( 640 int unit, 641 bcm_port_t port, 642 int *ipg_value); 643 644 /*! 645 * imb_port_duplex_set 646 * 647 * @brief Port duplex set/get 648 * 649 * @param [in] unit - unit id 650 * @param [in] port - logical port 651 * @param [in] enable - Enable / disable port duplex. true=full duplex, false=half duplex 652 */ 653 int imb_port_duplex_set( 654 int unit, 655 bcm_port_t port, 656 int enable); 657 /*! 658 * imb_port_duplex_get 659 * 660 * @brief Port duplex set/get 661 * 662 * @param [in] unit - unit id 663 * @param [in] port - logical port 664 * @param [out] enable - Get port duplex. true=full duplex, false=half duplex 665 */ 666 int imb_port_duplex_get( 667 int unit, 668 bcm_port_t port, 669 int *enable); 670 671 /*! 672 * imb_port_cntmaxsize_set 673 * 674 * @brief Config MIB counter max size. 675 * 676 * @param [in] unit - unit id 677 * @param [in] port - logical port 678 * @param [in] val - Set max packet size that is used in statistics counter updates. 679 */ 680 int imb_port_cntmaxsize_set( 681 int unit, 682 bcm_port_t port, 683 int val); 684 /*! 685 * imb_port_cntmaxsize_get 686 * 687 * @brief Config MIB counter max size. 688 * 689 * @param [in] unit - unit id 690 * @param [in] port - logical port 691 * @param [out] val - Get max packet size that is used in statistics counter updates. 692 */ 693 int imb_port_cntmaxsize_get( 694 int unit, 695 bcm_port_t port, 696 int *val); 697 698 /*! 699 * imb_port_local_fault_status_get 700 * 701 * @brief Local fault steatus get 702 * 703 * @param [in] unit - unit id 704 * @param [in] port - logical port 705 * @param [out] local_fault - Get local fault status 706 */ 707 int imb_port_local_fault_status_get( 708 int unit, 709 bcm_port_t port, 710 int *local_fault); 711 712 /*! 713 * imb_port_local_fault_status_clear 714 * 715 * @brief Clear Local fault steatus 716 * 717 * @param [in] unit - unit id 718 * @param [in] port - logical port 719 */ 720 int imb_port_local_fault_status_clear( 721 int unit, 722 bcm_port_t port); 723 724 /*! 725 * imb_port_remote_fault_status_get 726 * 727 * @brief Remote fault status get 728 * 729 * @param [in] unit - unit id 730 * @param [in] port - logical port 731 * @param [out] remote_fault - Get remote fault status 732 */ 733 int imb_port_remote_fault_status_get( 734 int unit, 735 bcm_port_t port, 736 int *remote_fault); 737 738 /*! 739 * imb_port_remote_fault_status_clear 740 * 741 * @brief Clear Remote fault status 742 * 743 * @param [in] unit - unit id 744 * @param [in] port - logical port 745 */ 746 int imb_port_remote_fault_status_clear( 747 int unit, 748 bcm_port_t port); 749 750 /*! 751 * imb_port_local_fault_enable_set 752 * 753 * @brief local fault enable set/get 754 * 755 * @param [in] unit - unit id 756 * @param [in] port - logical port 757 * @param [in] enable - 758 */ 759 int imb_port_local_fault_enable_set( 760 int unit, 761 bcm_port_t port, 762 int enable); 763 /*! 764 * imb_port_local_fault_enable_get 765 * 766 * @brief local fault enable set/get 767 * 768 * @param [in] unit - unit id 769 * @param [in] port - logical port 770 * @param [out] enable - 771 */ 772 int imb_port_local_fault_enable_get( 773 int unit, 774 bcm_port_t port, 775 int *enable); 776 777 /*! 778 * imb_port_remote_fault_enable_set 779 * 780 * @brief remote fault enable set/get 781 * 782 * @param [in] unit - unit id 783 * @param [in] port - logical port 784 * @param [in] enable - 785 */ 786 int imb_port_remote_fault_enable_set( 787 int unit, 788 bcm_port_t port, 789 int enable); 790 /*! 791 * imb_port_remote_fault_enable_get 792 * 793 * @brief remote fault enable set/get 794 * 795 * @param [in] unit - unit id 796 * @param [in] port - logical port 797 * @param [out] enable - 798 */ 799 int imb_port_remote_fault_enable_get( 800 int unit, 801 bcm_port_t port, 802 int *enable); 803 804 /*! 805 * imb_port_tx_mac_sa_set 806 * 807 * @brief Set/get the MAC source address that will be sent in case of Pause/LLFC 808 * 809 * @param [in] unit - unit id 810 * @param [in] port - logical port 811 * @param [in] mac_sa - Source address for PAUSE/PFC packets generated by the MAC 812 */ 813 int imb_port_tx_mac_sa_set( 814 int unit, 815 bcm_port_t port, 816 sal_mac_addr_t mac_sa); 817 /*! 818 * imb_port_tx_mac_sa_get 819 * 820 * @brief Set/get the MAC source address that will be sent in case of Pause/LLFC 821 * 822 * @param [in] unit - unit id 823 * @param [in] port - logical port 824 * @param [out] mac_sa - Source address for PAUSE/PFC packets generated by the MAC 825 */ 826 int imb_port_tx_mac_sa_get( 827 int unit, 828 bcm_port_t port, 829 sal_mac_addr_t mac_sa); 830 831 /*! 832 * imb_port_rx_mac_sa_set 833 * 834 * @brief Set/get SA recognized for MAC control packets in addition to the standard 0x0180C2000001 835 * 836 * @param [in] unit - unit id 837 * @param [in] port - logical port 838 * @param [in] mac_sa - Source Address recognized for MAC control packets in addition to the standard 0x0180C2000001 839 */ 840 int imb_port_rx_mac_sa_set( 841 int unit, 842 bcm_port_t port, 843 sal_mac_addr_t mac_sa); 844 /*! 845 * imb_port_rx_mac_sa_get 846 * 847 * @brief Set/get SA recognized for MAC control packets in addition to the standard 0x0180C2000001 848 * 849 * @param [in] unit - unit id 850 * @param [in] port - logical port 851 * @param [out] mac_sa - Source Address recognized for MAC control packets in addition to the standard 0x0180C2000001 852 */ 853 int imb_port_rx_mac_sa_get( 854 int unit, 855 bcm_port_t port, 856 sal_mac_addr_t mac_sa); 857 858 /*! 859 * imb_port_reset_set 860 * 861 * @brief Port Reset set/get - [this is not really supported in PHYMOD layer] 862 * 863 * @param [in] unit - unit id 864 * @param [in] port - logical port 865 * @param [in] mode - Phy reset mode. see phymod_reset_mode_t 866 * @param [in] opcode - TBD 867 * @param [in] direction - Phy reset direction. see phymod_reset_direction_t 868 */ 869 int imb_port_reset_set( 870 int unit, 871 bcm_port_t port, 872 int mode, 873 int opcode, 874 int direction); 875 /*! 876 * imb_port_reset_get 877 * 878 * @brief Port Reset set/get - [this is not really supported in PHYMOD layer] 879 * 880 * @param [in] unit - unit id 881 * @param [in] port - logical port 882 * @param [in] mode - Phy reset mode. see phymod_reset_mode_t 883 * @param [in] opcode - TBD 884 * @param [out] direction - Phy reset direction. see phymod_reset_direction_t 885 */ 886 int imb_port_reset_get( 887 int unit, 888 bcm_port_t port, 889 int mode, 890 int opcode, 891 int *direction); 892 893 /*! 894 * imb_port_pfc_control_set 895 * 896 * @brief Set/get PFC FC configuration 897 * 898 * @param [in] unit - unit id 899 * @param [in] port - logical port 900 * @param [in] control - Priority flow control configuration 901 */ 902 int imb_port_pfc_control_set( 903 int unit, 904 bcm_port_t port, 905 const portmod_pfc_control_t * control); 906 /*! 907 * imb_port_pfc_control_get 908 * 909 * @brief Set/get PFC FC configuration 910 * 911 * @param [in] unit - unit id 912 * @param [in] port - logical port 913 * @param [out] control - Priority flow control configuration 914 */ 915 int imb_port_pfc_control_get( 916 int unit, 917 bcm_port_t port, 918 portmod_pfc_control_t * control); 919 920 /*! 921 * imb_port_eee_set 922 * 923 * @brief Set/get EEE Config. 924 * 925 * @param [in] unit - unit id 926 * @param [in] port - logical port 927 * @param [in] eee - EEE (Energy Eficient Ethernet) Timer Information. 928 */ 929 int imb_port_eee_set( 930 int unit, 931 bcm_port_t port, 932 const portmod_eee_t * eee); 933 /*! 934 * imb_port_eee_get 935 * 936 * @brief Set/get EEE Config. 937 * 938 * @param [in] unit - unit id 939 * @param [in] port - logical port 940 * @param [out] eee - EEE (Energy Eficient Ethernet) Timer Information. 941 */ 942 int imb_port_eee_get( 943 int unit, 944 bcm_port_t port, 945 portmod_eee_t * eee); 946 947 /*! 948 * imb_bandwidth_get 949 * 950 * @brief Get the Bandwidth for the CDU. 951 * 952 * @param [in] unit - unit id 953 * @param [in] port - logical port 954 * @param [in] is_port_include - indication wether to include the specified port in the BW calculation 955 * @param [out] bandwidth - bandwidth for all ports in CDU. 956 */ 957 int imb_bandwidth_get( 958 int unit, 959 bcm_port_t port, 960 int is_port_include, 961 int *bandwidth); 962 963 /*! 964 * imb_port_tx_start_thr_set 965 * 966 * @brief Set the Start TX threshold. 967 * 968 * @param [in] unit - unit id 969 * @param [in] port - logical port 970 * @param [in] speed - Port interface rate 971 */ 972 int imb_port_tx_start_thr_set( 973 int unit, 974 bcm_port_t port, 975 int speed); 976 977 /*! 978 * imb_prd_port_profile_map_is_supported 979 * 980 * @brief Is port profile map supported for this port dispatch type. 981 * 982 * @param [in] unit - unit id 983 * @param [in] port - logical port 984 * @param [out] is_supported - is supported 985 */ 986 int imb_prd_port_profile_map_is_supported( 987 int unit, 988 bcm_port_t port, 989 int *is_supported); 990 991 /*! 992 * imb_prd_nof_port_profiles_get 993 * 994 * @brief Get the number of prfiles for this port dispatch type.. 995 * 996 * @param [in] unit - unit id 997 * @param [in] port - logical port 998 * @param [out] nof_port_profiles - number of port profiles 999 */ 1000 int imb_prd_nof_port_profiles_get( 1001 int unit, 1002 bcm_port_t port, 1003 int *nof_port_profiles); 1004 1005 /*! 1006 * imb_prd_enable_set 1007 * 1008 * @brief Set/get the PRD Enable mode. 1009 * 1010 * @param [in] unit - unit id 1011 * @param [in] port - logical port 1012 * @param [in] enable_mode - PRD enable mode (0=>disable, 1=>only hard stage, 2=>hard and soft stgae) 1013 */ 1014 int imb_prd_enable_set( 1015 int unit, 1016 bcm_port_t port, 1017 int enable_mode); 1018 /*! 1019 * imb_prd_enable_get 1020 * 1021 * @brief Set/get the PRD Enable mode. 1022 * 1023 * @param [in] unit - unit id 1024 * @param [in] port - logical port 1025 * @param [out] enable_mode - PRD enable mode (0=>disable, 1=>only hard stage, 2=>hard and soft stgae) 1026 */ 1027 int imb_prd_enable_get( 1028 int unit, 1029 bcm_port_t port, 1030 int *enable_mode); 1031 1032 /*! 1033 * @enum imb_prd_properties_e 1034 * @brief PRD properties 1035 */ 1036 typedef enum imb_prd_properties_e 1037 { 1038 imbImbPrdIgnoreIpDscp = 0, 1039 imbImbPrdIgnoreMplsExp = 1, 1040 imbImbPrdIgnoreInnerTag = 2, 1041 imbImbPrdIgnoreOuterTag = 3, 1042 imbImbPrdDefaultPriority = 4, 1043 imbImbPrdCount 1044 } imb_prd_properties_t; 1045 1046 extern const enum_mapping_t imb_prd_properties_t_mapping[]; 1047 /* imb_prd_properties_t validation */ 1048 int imb_prd_properties_t_validate( 1049 int unit, 1050 imb_prd_properties_t imb_prd_properties); 1051 /*! 1052 * imb_prd_properties_set 1053 * 1054 * @brief Set/get PRD Properties. 1055 * 1056 * @param [in] unit - unit id 1057 * @param [in] port - logical port 1058 * @param [in] property - PRD property to configure 1059 * @param [in] val - PRD Proeprty value 1060 */ 1061 int imb_prd_properties_set( 1062 int unit, 1063 bcm_port_t port, 1064 imb_prd_properties_t property, 1065 uint32 val); 1066 /*! 1067 * imb_prd_properties_get 1068 * 1069 * @brief Set/get PRD Properties. 1070 * 1071 * @param [in] unit - unit id 1072 * @param [in] port - logical port 1073 * @param [in] property - PRD property to configure 1074 * @param [out] val - PRD Proeprty value 1075 */ 1076 int imb_prd_properties_get( 1077 int unit, 1078 bcm_port_t port, 1079 imb_prd_properties_t property, 1080 uint32 *val); 1081 1082 /*! 1083 * imb_prd_port_profile_map_set 1084 * 1085 * @brief Set/get PRD Port Profile. 1086 * 1087 * @param [in] unit - unit id 1088 * @param [in] port - logical port 1089 * @param [in] profile - PRD Port Profile value 1090 */ 1091 int imb_prd_port_profile_map_set( 1092 int unit, 1093 bcm_port_t port, 1094 uint32 profile); 1095 /*! 1096 * imb_prd_port_profile_map_get 1097 * 1098 * @brief Set/get PRD Port Profile. 1099 * 1100 * @param [in] unit - unit id 1101 * @param [in] port - logical port 1102 * @param [out] profile - PRD Port Profile value 1103 */ 1104 int imb_prd_port_profile_map_get( 1105 int unit, 1106 bcm_port_t port, 1107 uint32 *profile); 1108 1109 /*! 1110 * imb_prd_map_set 1111 * 1112 * @brief Configure PRD priority maps. 1113 * 1114 * @param [in] unit - unit id 1115 * @param [in] port - logical port 1116 * @param [in] map - PRD Map to configure 1117 * @param [in] key - Map key. composed differently according to the map type. should be set by the user using the following MACROs: BCM_COSQ_INGRESS_PORT_DROP_ETH_MAP_KEY(pcp, dei) BCM_COSQ_INGRESS_PORT_DROP_TM_MAP_KEY(tc, dp) BCM_COSQ_INGRESS_PORT_DROP_IP_MAP_KEY(dscp) BCM_COSQ_INGRESS_PORT_DROP_MPLS_MAP_KEY(exp) 1118 * @param [in] priority - PRD priority value 1119 * @param [in] is_tdm - PRD is_tdm indication 1120 */ 1121 int imb_prd_map_set( 1122 int unit, 1123 bcm_port_t port, 1124 bcm_cosq_ingress_port_drop_map_t map, 1125 uint32 key, 1126 uint32 priority, 1127 uint32 is_tdm); 1128 /*! 1129 * imb_prd_map_get 1130 * 1131 * @brief Configure PRD priority maps. 1132 * 1133 * @param [in] unit - unit id 1134 * @param [in] port - logical port 1135 * @param [in] map - PRD Map to configure 1136 * @param [in] key - Map key. composed differently according to the map type. should be set by the user using the following MACROs: BCM_COSQ_INGRESS_PORT_DROP_ETH_MAP_KEY(pcp, dei) BCM_COSQ_INGRESS_PORT_DROP_TM_MAP_KEY(tc, dp) BCM_COSQ_INGRESS_PORT_DROP_IP_MAP_KEY(dscp) BCM_COSQ_INGRESS_PORT_DROP_MPLS_MAP_KEY(exp) 1137 * @param [out] priority - PRD priority value 1138 * @param [out] is_tdm - PRD is_tdm indication 1139 */ 1140 int imb_prd_map_get( 1141 int unit, 1142 bcm_port_t port, 1143 bcm_cosq_ingress_port_drop_map_t map, 1144 uint32 key, 1145 uint32 *priority, 1146 uint32 *is_tdm); 1147 1148 /*! 1149 * imb_prd_threshold_set 1150 * 1151 * @brief Configure PRD thresholds. 1152 * 1153 * @param [in] unit - unit id 1154 * @param [in] port - logical port 1155 * @param [in] priority - PRD priority 1156 * @param [in] threshold - PRD threshols value (in entries) for the priority. threshold will be set for the RMC for which the priority is mapped. 1157 */ 1158 int imb_prd_threshold_set( 1159 int unit, 1160 bcm_port_t port, 1161 uint32 priority, 1162 uint32 threshold); 1163 /*! 1164 * imb_prd_threshold_get 1165 * 1166 * @brief Configure PRD thresholds. 1167 * 1168 * @param [in] unit - unit id 1169 * @param [in] port - logical port 1170 * @param [in] priority - PRD priority 1171 * @param [out] threshold - PRD priority value (in entries) for the priority. threshold will be taken from the RMC for which the priority is mapped. 1172 */ 1173 int imb_prd_threshold_get( 1174 int unit, 1175 bcm_port_t port, 1176 uint32 priority, 1177 uint32 *threshold); 1178 1179 /*! 1180 * imb_prd_threshold_max_get 1181 * 1182 * @brief Get maximum PRD threshold value. 1183 * 1184 * @param [in] unit - unit id 1185 * @param [in] port - logical port 1186 * @param [out] threshold - PRD threshold max value. 1187 */ 1188 int imb_prd_threshold_max_get( 1189 int unit, 1190 bcm_port_t port, 1191 uint32 *threshold); 1192 1193 /*! 1194 * imb_prd_tpid_set 1195 * 1196 * @brief Configure PRD TPIDs per port. 1197 * 1198 * @param [in] unit - unit id 1199 * @param [in] port - logical port 1200 * @param [in] tpid_index - TPID index to set (0-3) 1201 * @param [in] tpid_value - TPID to be recognized by the port 1202 */ 1203 int imb_prd_tpid_set( 1204 int unit, 1205 bcm_port_t port, 1206 uint32 tpid_index, 1207 uint32 tpid_value); 1208 /*! 1209 * imb_prd_tpid_get 1210 * 1211 * @brief Configure PRD TPIDs per port. 1212 * 1213 * @param [in] unit - unit id 1214 * @param [in] port - logical port 1215 * @param [in] tpid_index - TPID index to set (0-3) 1216 * @param [out] tpid_value - TPID recognized by the port 1217 */ 1218 int imb_prd_tpid_get( 1219 int unit, 1220 bcm_port_t port, 1221 uint32 tpid_index, 1222 uint32 *tpid_value); 1223 1224 /*! 1225 * imb_prd_drop_count_get 1226 * 1227 * @brief Get PRD counter for the corresponding FIFO (RMC). 1228 * 1229 * @param [in] unit - unit id 1230 * @param [in] port - logical port 1231 * @param [in] sch_priority - which scheduler is the PRD fifo mapped to 1232 * @param [out] count - PRD counter value 1233 */ 1234 int imb_prd_drop_count_get( 1235 int unit, 1236 bcm_port_t port, 1237 bcm_port_nif_scheduler_t sch_priority, 1238 uint64 *count); 1239 1240 /*! 1241 * imb_prd_custom_ether_type_set 1242 * 1243 * @brief Set/Get PRD Configurable Ether types. 1244 * 1245 * @param [in] unit - unit id 1246 * @param [in] port - logical port 1247 * @param [in] ether_type_code - Custom Ether type code to assign to the Ether type(1-6) 1248 * @param [in] ether_type_val - Ether type value 1249 */ 1250 int imb_prd_custom_ether_type_set( 1251 int unit, 1252 bcm_port_t port, 1253 uint32 ether_type_code, 1254 uint32 ether_type_val); 1255 /*! 1256 * imb_prd_custom_ether_type_get 1257 * 1258 * @brief Set/Get PRD Configurable Ether types. 1259 * 1260 * @param [in] unit - unit id 1261 * @param [in] port - logical port 1262 * @param [in] ether_type_code - Custom Ether type code to assign to the Ether type(1-6) 1263 * @param [out] ether_type_val - Ether type value 1264 */ 1265 int imb_prd_custom_ether_type_get( 1266 int unit, 1267 bcm_port_t port, 1268 uint32 ether_type_code, 1269 uint32 *ether_type_val); 1270 1271 /*! 1272 * imb_prd_flex_key_entry_set 1273 * 1274 * @brief Set/Get PRD TCAM entries (for the soft stage). 1275 * 1276 * @param [in] unit - unit id 1277 * @param [in] port - logical port 1278 * @param [in] key_index - TCAM index to configure 1279 * @param [in] entry_info - TCAM entry information 1280 */ 1281 int imb_prd_flex_key_entry_set( 1282 int unit, 1283 bcm_port_t port, 1284 uint32 key_index, 1285 const dnx_cosq_prd_tcam_entry_info_t * entry_info); 1286 /*! 1287 * imb_prd_flex_key_entry_get 1288 * 1289 * @brief Set/Get PRD TCAM entries (for the soft stage). 1290 * 1291 * @param [in] unit - unit id 1292 * @param [in] port - logical port 1293 * @param [in] key_index - TCAM index to configure 1294 * @param [out] entry_info - TCAM entry information 1295 */ 1296 int imb_prd_flex_key_entry_get( 1297 int unit, 1298 bcm_port_t port, 1299 uint32 key_index, 1300 dnx_cosq_prd_tcam_entry_info_t * entry_info); 1301 1302 /*! 1303 * imb_prd_ether_type_size_set 1304 * 1305 * @brief Set/Get PRD TCAM key size per Ether type (for the soft stage). 1306 * 1307 * @param [in] unit - unit id 1308 * @param [in] port - logical port 1309 * @param [in] ether_type_code - Ether type code of the key 1310 * @param [in] ether_type_size - Ether type size 1311 */ 1312 int imb_prd_ether_type_size_set( 1313 int unit, 1314 bcm_port_t port, 1315 uint32 ether_type_code, 1316 uint32 ether_type_size); 1317 /*! 1318 * imb_prd_ether_type_size_get 1319 * 1320 * @brief Set/Get PRD TCAM key size per Ether type (for the soft stage). 1321 * 1322 * @param [in] unit - unit id 1323 * @param [in] port - logical port 1324 * @param [in] ether_type_code - Ether type code of the key 1325 * @param [out] ether_type_size - Ether type size 1326 */ 1327 int imb_prd_ether_type_size_get( 1328 int unit, 1329 bcm_port_t port, 1330 uint32 ether_type_code, 1331 uint32 *ether_type_size); 1332 1333 /*! 1334 * imb_prd_tcam_entry_key_offset_base_set 1335 * 1336 * @brief Set/Get PRD TCAM key offset base per Ether type (for the soft stage). 1337 * 1338 * @param [in] unit - unit id 1339 * @param [in] port - logical port 1340 * @param [in] ether_type_code - Ether type code of the key 1341 * @param [in] offset_base - Ether type offset base 1342 */ 1343 int imb_prd_tcam_entry_key_offset_base_set( 1344 int unit, 1345 bcm_port_t port, 1346 uint32 ether_type_code, 1347 uint32 offset_base); 1348 /*! 1349 * imb_prd_tcam_entry_key_offset_base_get 1350 * 1351 * @brief Set/Get PRD TCAM key offset base per Ether type (for the soft stage). 1352 * 1353 * @param [in] unit - unit id 1354 * @param [in] port - logical port 1355 * @param [in] ether_type_code - Ether type code of the key 1356 * @param [out] offset_base - Ether type offset base 1357 */ 1358 int imb_prd_tcam_entry_key_offset_base_get( 1359 int unit, 1360 bcm_port_t port, 1361 uint32 ether_type_code, 1362 uint32 *offset_base); 1363 1364 /*! 1365 * imb_prd_tcam_entry_key_offset_set 1366 * 1367 * @brief Set/Get PRD TCAM key offset value per Ether type (for the soft stage). 1368 * 1369 * @param [in] unit - unit id 1370 * @param [in] port - logical port 1371 * @param [in] ether_type_code - Ether type code of the key 1372 * @param [in] offset_index - Ether type offset index 1373 * @param [in] offset_value - Ether type offset value 1374 */ 1375 int imb_prd_tcam_entry_key_offset_set( 1376 int unit, 1377 bcm_port_t port, 1378 uint32 ether_type_code, 1379 uint32 offset_index, 1380 uint32 offset_value); 1381 /*! 1382 * imb_prd_tcam_entry_key_offset_get 1383 * 1384 * @brief Set/Get PRD TCAM key offset value per Ether type (for the soft stage). 1385 * 1386 * @param [in] unit - unit id 1387 * @param [in] port - logical port 1388 * @param [in] ether_type_code - Ether type code of the key 1389 * @param [in] offset_index - Ether type offset index 1390 * @param [out] offset_value - Ether type offset value 1391 */ 1392 int imb_prd_tcam_entry_key_offset_get( 1393 int unit, 1394 bcm_port_t port, 1395 uint32 ether_type_code, 1396 uint32 offset_index, 1397 uint32 *offset_value); 1398 1399 /*! 1400 * imb_prd_control_frame_set 1401 * 1402 * @brief Set/Get PRD Control Frame proeprties. if a packet is identified as control frame, it will automatically get the highest priority. 1403 * 1404 * @param [in] unit - unit id 1405 * @param [in] port - logical port 1406 * @param [in] control_frame_index - Index of the control frame. 1407 * @param [in] control_frame_config - Control Frame properties 1408 */ 1409 int imb_prd_control_frame_set( 1410 int unit, 1411 bcm_port_t port, 1412 uint32 control_frame_index, 1413 const bcm_cosq_ingress_drop_control_frame_config_t * control_frame_config); 1414 /*! 1415 * imb_prd_control_frame_get 1416 * 1417 * @brief Set/Get PRD Control Frame proeprties. if a packet is identified as control frame, it will automatically get the highest priority. 1418 * 1419 * @param [in] unit - unit id 1420 * @param [in] port - logical port 1421 * @param [in] control_frame_index - Index of the control frame. 1422 * @param [out] control_frame_config - Control Frame properties 1423 */ 1424 int imb_prd_control_frame_get( 1425 int unit, 1426 bcm_port_t port, 1427 uint32 control_frame_index, 1428 bcm_cosq_ingress_drop_control_frame_config_t * control_frame_config); 1429 1430 /*! 1431 * imb_prd_mpls_special_label_set 1432 * 1433 * @brief Set/Get PRD MPLS special label proeprties. if a packet is identified as MPLS special label and the label value matches to one of the saved special labels, the priority and TDM indication will be taken from the label properties. 1434 * 1435 * @param [in] unit - unit id 1436 * @param [in] port - logical port 1437 * @param [in] label_index - Index of the control frame. 1438 * @param [in] label_config - MPLS special label properties 1439 */ 1440 int imb_prd_mpls_special_label_set( 1441 int unit, 1442 bcm_port_t port, 1443 uint32 label_index, 1444 const bcm_cosq_ingress_port_drop_mpls_special_label_config_t * label_config); 1445 /*! 1446 * imb_prd_mpls_special_label_get 1447 * 1448 * @brief Set/Get PRD MPLS special label proeprties. if a packet is identified as MPLS special label and the label value matches to one of the saved special labels, the priority and TDM indication will be taken from the label properties. 1449 * 1450 * @param [in] unit - unit id 1451 * @param [in] port - logical port 1452 * @param [in] label_index - Index of the control frame. 1453 * @param [out] label_config - MPLS special label properties 1454 */ 1455 int imb_prd_mpls_special_label_get( 1456 int unit, 1457 bcm_port_t port, 1458 uint32 label_index, 1459 bcm_cosq_ingress_port_drop_mpls_special_label_config_t * label_config); 1460 1461 /*! 1462 * imb_port_logical_lane_order_set 1463 * 1464 * @brief Set/Get the logical lane order for ILKN ports 1465 * 1466 * @param [in] unit - unit id 1467 * @param [in] port - logical port 1468 * @param [in] lane_order - ILKN Logical lane order. For pmOsILKN_50G, lane_order[N] is represent for the Nth lane; otherwise it is represent for logical lane N 1469 * @param [in] lane_order_size - Nof lanes of the ILKN port 1470 */ 1471 int imb_port_logical_lane_order_set( 1472 int unit, 1473 bcm_port_t port, 1474 const int *lane_order, 1475 int lane_order_size); 1476 /*! 1477 * imb_port_logical_lane_order_get 1478 * 1479 * @brief Set/Get the logical lane order for ILKN ports 1480 * 1481 * @param [in] unit - unit id 1482 * @param [in] port - logical port 1483 * @param [in] lane_order_max_size - Max lane numbers when get ILKN lane order 1484 * @param [out] lane_order - Logical lane order, lane_order[N] is represent for the Nth lane 1485 * @param [out] lane_order_actual_size - The actual lane numbers when get ILKN lane order 1486 */ 1487 int imb_port_logical_lane_order_get( 1488 int unit, 1489 bcm_port_t port, 1490 int lane_order_max_size, 1491 int *lane_order, 1492 int *lane_order_actual_size); 1493 1494 /*! 1495 * imb_port_prbs_polynomial_set 1496 * 1497 * @brief Set/Get prbs polnomial value 1498 * 1499 * @param [in] unit - unit id 1500 * @param [in] port - logical port 1501 * @param [in] prbs_mode - prbs mode 1502 * @param [in] value - prbs polynomial value 1503 */ 1504 int imb_port_prbs_polynomial_set( 1505 int unit, 1506 bcm_port_t port, 1507 portmod_prbs_mode_t prbs_mode, 1508 bcm_port_prbs_t value); 1509 /*! 1510 * imb_port_prbs_polynomial_get 1511 * 1512 * @brief Set/Get prbs polnomial value 1513 * 1514 * @param [in] unit - unit id 1515 * @param [in] port - logical port 1516 * @param [in] prbs_mode - prbs mode 1517 * @param [out] value - prbs polynomial value 1518 */ 1519 int imb_port_prbs_polynomial_get( 1520 int unit, 1521 bcm_port_t port, 1522 portmod_prbs_mode_t prbs_mode, 1523 bcm_port_prbs_t * value); 1524 1525 /*! 1526 * imb_port_prbs_invert_data_set 1527 * 1528 * @brief Set/Get prbs rx or tx data inversion status 1529 * 1530 * @param [in] unit - unit id 1531 * @param [in] port - logical port 1532 * @param [in] type - indicate rx or tx prbs 1533 * @param [in] prbs_mode - prbs mode 1534 * @param [in] invert - Enable or disable data inversion 1535 */ 1536 int imb_port_prbs_invert_data_set( 1537 int unit, 1538 bcm_port_t port, 1539 int type, 1540 portmod_prbs_mode_t prbs_mode, 1541 int invert); 1542 /*! 1543 * imb_port_prbs_invert_data_get 1544 * 1545 * @brief Set/Get prbs rx or tx data inversion status 1546 * 1547 * @param [in] unit - unit id 1548 * @param [in] port - logical port 1549 * @param [in] type - indicate rx or tx prbs 1550 * @param [in] prbs_mode - prbs mode 1551 * @param [out] invert - Enable or disablei data inversion 1552 */ 1553 int imb_port_prbs_invert_data_get( 1554 int unit, 1555 bcm_port_t port, 1556 int type, 1557 portmod_prbs_mode_t prbs_mode, 1558 int *invert); 1559 1560 /*! 1561 * imb_port_prbs_enable_set 1562 * 1563 * @brief Set prbs rx or tx enable status 1564 * 1565 * @param [in] unit - unit id 1566 * @param [in] port - logical port 1567 * @param [in] type - indicate rx or tx prbs 1568 * @param [in] prbs_mode - prbs mode 1569 * @param [in] enable - Enable or disable prbs 1570 */ 1571 int imb_port_prbs_enable_set( 1572 int unit, 1573 bcm_port_t port, 1574 int type, 1575 portmod_prbs_mode_t prbs_mode, 1576 int enable); 1577 1578 /*! 1579 * imb_port_prbs_enable_get 1580 * 1581 * @brief Get prbs rx or tx enable status 1582 * 1583 * @param [in] unit - unit id 1584 * @param [in] port - logical port 1585 * @param [in] type - indicate rx or tx prbs 1586 * @param [in] prbs_mode - prbs mode 1587 * @param [out] enable - Enable or disable prbs 1588 */ 1589 int imb_port_prbs_enable_get( 1590 int unit, 1591 bcm_port_t port, 1592 int type, 1593 portmod_prbs_mode_t prbs_mode, 1594 int *enable); 1595 1596 /*! 1597 * imb_port_prbs_rx_status_get 1598 * 1599 * @brief Set/Get prbs status 1600 * 1601 * @param [in] unit - unit id 1602 * @param [in] port - logical port 1603 * @param [in] prbs_mode - prbs mode 1604 * @param [out] status - Prbs status 1605 */ 1606 int imb_port_prbs_rx_status_get( 1607 int unit, 1608 bcm_port_t port, 1609 portmod_prbs_mode_t prbs_mode, 1610 int *status); 1611 1612 /*! 1613 * imb_port_phy_reg_set 1614 * 1615 * @brief Read or write PHY registers associated with a port 1616 * 1617 * @param [in] unit - unit id 1618 * @param [in] port - logical port 1619 * @param [in] flags - Indicate how to access the PHY, and which PHY if the port has an internal serdes 1620 * @param [in] phy_reg_addr - Register address in the PHY 1621 * @param [in] phy_data - Data to be written or data read 1622 */ 1623 int imb_port_phy_reg_set( 1624 int unit, 1625 bcm_port_t port, 1626 uint32 flags, 1627 uint32 phy_reg_addr, 1628 uint32 phy_data); 1629 /*! 1630 * imb_port_phy_reg_get 1631 * 1632 * @brief Read or write PHY registers associated with a port 1633 * 1634 * @param [in] unit - unit id 1635 * @param [in] port - logical port 1636 * @param [in] flags - Indicate how to access the PHY, and which PHY if the port has an internal serdes 1637 * @param [in] phy_reg_addr - Register address in the PHY 1638 * @param [out] phy_data - Data to be written or data read 1639 */ 1640 int imb_port_phy_reg_get( 1641 int unit, 1642 bcm_port_t port, 1643 uint32 flags, 1644 uint32 phy_reg_addr, 1645 uint32 *phy_data); 1646 1647 /*! 1648 * imb_port_rx_fifo_status_get 1649 * 1650 * @brief Get rx fifo status 1651 * 1652 * @param [in] unit - unit id 1653 * @param [in] port - logical port 1654 * @param [in] sch_priority - which scheduler is the PRD fifo mapped to 1655 * @param [out] max_occupancy - Indicates the corresponding lane MLF MAX fullness level of the FIFO 1656 * @param [out] fifo_level - Indicates the corresponding lane MLF fullness level of the FIFO 1657 */ 1658 int imb_port_rx_fifo_status_get( 1659 int unit, 1660 bcm_port_t port, 1661 bcm_port_nif_scheduler_t sch_priority, 1662 uint32 *max_occupancy, 1663 uint32 *fifo_level); 1664 1665 /*! 1666 * imb_port_tx_fifo_status_get 1667 * 1668 * @brief Get tx fifo status 1669 * 1670 * @param [in] unit - unit id 1671 * @param [in] port - logical port 1672 * @param [out] max_occupancy - Indicates the corresponding lane MLF MAX fullness level of the FIFO 1673 * @param [out] fifo_level - Indicates the corresponding lane MLF fullness level of the FIFO 1674 * @param [out] pm_credits - the number of credits received from the port-macro Tx buffer 1675 */ 1676 int imb_port_tx_fifo_status_get( 1677 int unit, 1678 bcm_port_t port, 1679 uint32 *max_occupancy, 1680 uint32 *fifo_level, 1681 uint32 *pm_credits); 1682 1683 /*! 1684 * imb_port_low_latency_llfc_enable_set 1685 * 1686 * @brief Enable/Disable Low Latency LLFC 1687 * 1688 * @param [in] unit - unit id 1689 * @param [in] port - logical port 1690 * @param [in] value - Enable/Disable Low Latency LLFC 1691 */ 1692 int imb_port_low_latency_llfc_enable_set( 1693 int unit, 1694 bcm_port_t port, 1695 int value); 1696 /*! 1697 * imb_port_low_latency_llfc_enable_get 1698 * 1699 * @brief Enable/Disable Low Latency LLFC 1700 * 1701 * @param [in] unit - unit id 1702 * @param [in] port - logical port 1703 * @param [out] value - Enable/Disable Low Latency LLFC 1704 */ 1705 int imb_port_low_latency_llfc_enable_get( 1706 int unit, 1707 bcm_port_t port, 1708 int *value); 1709 1710 /*! 1711 * imb_port_fec_error_detect_enable_set 1712 * 1713 * @brief Enable/Disable FEC error detect 1714 * 1715 * @param [in] unit - unit id 1716 * @param [in] port - logical port 1717 * @param [in] value - Enable/Disable Low Latency LLFC 1718 */ 1719 int imb_port_fec_error_detect_enable_set( 1720 int unit, 1721 bcm_port_t port, 1722 int value); 1723 /*! 1724 * imb_port_fec_error_detect_enable_get 1725 * 1726 * @brief Enable/Disable FEC error detect 1727 * 1728 * @param [in] unit - unit id 1729 * @param [in] port - logical port 1730 * @param [out] value - Enable/Disable FEC error detect 1731 */ 1732 int imb_port_fec_error_detect_enable_get( 1733 int unit, 1734 bcm_port_t port, 1735 int *value); 1736 1737 /*! 1738 * imb_port_llfc_after_fec_enable_set 1739 * 1740 * @brief Enable/Disable LLFC after FEC 1741 * 1742 * @param [in] unit - unit id 1743 * @param [in] port - logical port 1744 * @param [in] value - Enable/Disable LLFC after FEC 1745 */ 1746 int imb_port_llfc_after_fec_enable_set( 1747 int unit, 1748 bcm_port_t port, 1749 int value); 1750 /*! 1751 * imb_port_llfc_after_fec_enable_get 1752 * 1753 * @brief Enable/Disable LLFC after FEC 1754 * 1755 * @param [in] unit - unit id 1756 * @param [in] port - logical port 1757 * @param [out] value - Enable/Disable LLFC after FEC 1758 */ 1759 int imb_port_llfc_after_fec_enable_get( 1760 int unit, 1761 bcm_port_t port, 1762 int *value); 1763 1764 /*! 1765 * imb_port_extract_congestion_indication_from_llfc_enable_set 1766 * 1767 * @brief Enable/Disable extract congestion indication from LLFC cells 1768 * 1769 * @param [in] unit - unit id 1770 * @param [in] port - logical port 1771 * @param [in] value - Enable/Disable extract congestion indication from LLFC cells 1772 */ 1773 int imb_port_extract_congestion_indication_from_llfc_enable_set( 1774 int unit, 1775 bcm_port_t port, 1776 int value); 1777 /*! 1778 * imb_port_extract_congestion_indication_from_llfc_enable_get 1779 * 1780 * @brief Enable/Disable extract congestion indication from LLFC cells 1781 * 1782 * @param [in] unit - unit id 1783 * @param [in] port - logical port 1784 * @param [out] value - Enable/Disable extract congestion indication from LLFC cells 1785 */ 1786 int imb_port_extract_congestion_indication_from_llfc_enable_get( 1787 int unit, 1788 bcm_port_t port, 1789 int *value); 1790 1791 /*! 1792 * imb_port_control_cells_fec_bypass_enable_set 1793 * 1794 * @brief Enable/Disable FEC bypass on control cells 1795 * 1796 * @param [in] unit - unit id 1797 * @param [in] port - logical port 1798 * @param [in] value - Enable/Disable FEC bypass on control cells 1799 */ 1800 int imb_port_control_cells_fec_bypass_enable_set( 1801 int unit, 1802 bcm_port_t port, 1803 int value); 1804 /*! 1805 * imb_port_control_cells_fec_bypass_enable_get 1806 * 1807 * @brief Enable/Disable FEC bypass on control cells 1808 * 1809 * @param [in] unit - unit id 1810 * @param [in] port - logical port 1811 * @param [out] value - Enable/Disable FEC bypass on control cells 1812 */ 1813 int imb_port_control_cells_fec_bypass_enable_get( 1814 int unit, 1815 bcm_port_t port, 1816 int *value); 1817 1818 /*! 1819 * imb_port_speed_config_set 1820 * 1821 * @brief Port speed configuration 1822 * 1823 * @param [in] unit - unit id 1824 * @param [in] port - logical port 1825 * @param [in] speed_config - Port speed configuration 1826 */ 1827 int imb_port_speed_config_set( 1828 int unit, 1829 bcm_port_t port, 1830 const portmod_speed_config_t * speed_config); 1831 /*! 1832 * imb_port_speed_config_get 1833 * 1834 * @brief Port speed configuration 1835 * 1836 * @param [in] unit - unit id 1837 * @param [in] port - logical port 1838 * @param [out] speed_config - Port speed configuration 1839 */ 1840 int imb_port_speed_config_get( 1841 int unit, 1842 bcm_port_t port, 1843 portmod_speed_config_t * speed_config); 1844 1845 /*! 1846 * imb_port_mib_counter_get 1847 * 1848 * @brief Get mib counter 1849 * 1850 * @param [in] unit - unit id 1851 * @param [in] port - logical port 1852 * @param [in] counter_type - counter type 1853 * @param [out] counter_val - counter value 1854 */ 1855 int imb_port_mib_counter_get( 1856 int unit, 1857 bcm_port_t port, 1858 int counter_type, 1859 uint64 *counter_val); 1860 1861 /*! 1862 * imb_port_mib_counter_set 1863 * 1864 * @brief Set mib counter 1865 * 1866 * @param [in] unit - unit id 1867 * @param [in] port - logical port 1868 * @param [in] counter_type - counter type 1869 * @param [in] counter_val - counter value 1870 */ 1871 int imb_port_mib_counter_set( 1872 int unit, 1873 bcm_port_t port, 1874 int counter_type, 1875 const uint64 *counter_val); 1876 1877 /*! 1878 * imb_port_mib_counter_clear 1879 * 1880 * @brief Clear mib counter 1881 * 1882 * @param [in] unit - unit id 1883 * @param [in] port - logical port 1884 */ 1885 int imb_port_mib_counter_clear( 1886 int unit, 1887 bcm_port_t port); 1888 1889 /*! 1890 * imb_port_autoneg_ability_advert_set 1891 * 1892 * @brief Set/Get port advertise abilities 1893 * 1894 * @param [in] unit - unit id 1895 * @param [in] port - logical port 1896 * @param [in] num_ability - number of ability the port will advertise 1897 * @param [in] abilities - local advertisement for each ability 1898 */ 1899 int imb_port_autoneg_ability_advert_set( 1900 int unit, 1901 bcm_port_t port, 1902 int num_ability, 1903 const bcm_port_speed_ability_t * abilities); 1904 /*! 1905 * imb_port_autoneg_ability_advert_get 1906 * 1907 * @brief Set/Get port advertise abilities 1908 * 1909 * @param [in] unit - unit id 1910 * @param [in] port - logical port 1911 * @param [in] max_num_ability - the max num of autoneg ability this port can advertise 1912 * @param [out] abilities - indicate the ability this port can advertise 1913 * @param [out] actual_num_ability - the actual num of ability that this port can advertise 1914 */ 1915 int imb_port_autoneg_ability_advert_get( 1916 int unit, 1917 bcm_port_t port, 1918 int max_num_ability, 1919 bcm_port_speed_ability_t * abilities, 1920 int *actual_num_ability); 1921 1922 /*! 1923 * imb_port_speed_ability_local_get 1924 * 1925 * @brief Get the local speed abilities 1926 * 1927 * @param [in] unit - unit id 1928 * @param [in] port - logical port 1929 * @param [in] max_num_ability - the max num of autoneg ability this port can advertise 1930 * @param [out] abilities - indicate the ability this port can advertise 1931 * @param [out] actual_num_ability - the actual num of ability that this port can advertise 1932 */ 1933 int imb_port_speed_ability_local_get( 1934 int unit, 1935 bcm_port_t port, 1936 int max_num_ability, 1937 bcm_port_speed_ability_t * abilities, 1938 int *actual_num_ability); 1939 1940 /*! 1941 * imb_port_autoneg_ability_remote_get 1942 * 1943 * @brief Get the remote abilities 1944 * 1945 * @param [in] unit - unit id 1946 * @param [in] port - logical port 1947 * @param [in] max_num_ability - the max num of autoneg ability this port can advertise 1948 * @param [out] abilities - indicate the ability this port can advertise 1949 * @param [out] actual_num_ability - the actual num of ability that this port can advertise 1950 */ 1951 int imb_port_autoneg_ability_remote_get( 1952 int unit, 1953 bcm_port_t port, 1954 int max_num_ability, 1955 bcm_port_speed_ability_t * abilities, 1956 int *actual_num_ability); 1957 1958 /*! 1959 * imb_port_scheduler_config_set 1960 * 1961 * @brief Set port scheduler 1962 * 1963 * @param [in] unit - unit id 1964 * @param [in] port - logical port 1965 * @param [in] enable - enable port scheduler 1966 */ 1967 int imb_port_scheduler_config_set( 1968 int unit, 1969 bcm_port_t port, 1970 int enable); 1971 1972 /*! 1973 * imb_port_scheduler_priority_update 1974 * 1975 * @brief Update scheduler reset for High/Low priority 1976 * 1977 * @param [in] unit - unit id 1978 * @param [in] port - logical port 1979 */ 1980 int imb_port_scheduler_priority_update( 1981 int unit, 1982 bcm_port_t port); 1983 1984 /*! 1985 * imb_port_resource_default_get 1986 * 1987 * @brief Get port's default resource configurations 1988 * 1989 * @param [in] unit - unit id 1990 * @param [in] port - logical port 1991 * @param [in] flags - Flags 1992 * @param [out] resource - Port default resource configurations 1993 */ 1994 int imb_port_resource_default_get( 1995 int unit, 1996 bcm_port_t port, 1997 uint32 flags, 1998 bcm_port_resource_t * resource); 1999 2000 /*! 2001 * imb_port_to_stif_instance_map_set 2002 * 2003 * @brief Map STIF instance ID with given port. 2004 * 2005 * @param [in] unit - unit id 2006 * @param [in] port - logical port 2007 * @param [in] instace_id - STIF instance id to map 2008 * @param [in] instace_core - STIF instance core to map 2009 * @param [in] connect - if TRUE connect the SIF instance to the port, if FALSE, disconnect the SIF instance 2010 */ 2011 int imb_port_to_stif_instance_map_set( 2012 int unit, 2013 bcm_port_t port, 2014 int instace_id, 2015 int instace_core, 2016 int connect); 2017 2018 /*! 2019 * imb_phys_get 2020 * 2021 * @brief Get phys associated with imb instance 2022 * 2023 * @param [in] unit - unit id 2024 * @param [in] imb_id - imb instance id 2025 * @param [out] phys - phys associated with imb instance 2026 */ 2027 int imb_phys_get( 2028 int unit, 2029 int imb_id, 2030 bcm_pbmp_t * phys); 2031 2032 /*! 2033 * imb_port_gen_pfc_from_rmc_enable_set 2034 * 2035 * @brief Enable / disable a port's RMCs to produce PFC for the specified priority 2036 * 2037 * @param [in] unit - unit id 2038 * @param [in] port - logical port 2039 * @param [in] priority - Priority for the PFC that will be produced from the RMCs 2040 * @param [in] enable - Port RMCs to produce PFC enable/disable indication 2041 */ 2042 int imb_port_gen_pfc_from_rmc_enable_set( 2043 int unit, 2044 bcm_port_t port, 2045 uint32 priority, 2046 uint32 enable); 2047 /*! 2048 * imb_port_gen_pfc_from_rmc_enable_get 2049 * 2050 * @brief Enable / disable a port's RMCs to produce PFC for the specified priority 2051 * 2052 * @param [in] unit - unit id 2053 * @param [in] port - logical port 2054 * @param [in] priority - Priority for the PFC that will be produced from the RMCs 2055 * @param [out] enable - Port RMCs to produce PFC enabled indication 2056 */ 2057 int imb_port_gen_pfc_from_rmc_enable_get( 2058 int unit, 2059 bcm_port_t port, 2060 uint32 priority, 2061 uint32 *enable); 2062 2063 /*! 2064 * imb_port_gen_llfc_from_rmc_enable_set 2065 * 2066 * @brief Enable / disable port's RMCs(all lanes) to generate LLFC 2067 * 2068 * @param [in] unit - unit id 2069 * @param [in] port - logical port 2070 * @param [in] enable - Port's RMCs(all lanes) to generate LLFC enable/disable indication 2071 */ 2072 int imb_port_gen_llfc_from_rmc_enable_set( 2073 int unit, 2074 bcm_port_t port, 2075 uint32 enable); 2076 2077 /*! 2078 * imb_port_stop_pm_from_cfc_llfc_enable_set 2079 * 2080 * @brief Enable / disable PM to stop TX on all of a port's lanes according to a LLFC signal from CFC 2081 * 2082 * @param [in] unit - unit id 2083 * @param [in] port - logical port 2084 * @param [in] enable - PM to stop TX on all of a port's lanes enable/disable indication 2085 */ 2086 int imb_port_stop_pm_from_cfc_llfc_enable_set( 2087 int unit, 2088 bcm_port_t port, 2089 uint32 enable); 2090 2091 /*! 2092 * imb_port_stop_pm_from_pfc_enable_set 2093 * 2094 * @brief Enable / disable PM to stop TX on a NIF port according to received PFC signal 2095 * 2096 * @param [in] unit - unit id 2097 * @param [in] port - logical port 2098 * @param [in] pfc - PFC that is enabled/disabled to stop the PM 2099 * @param [in] enable - PM to stop TX on a NIF port enable/disable indication 2100 */ 2101 int imb_port_stop_pm_from_pfc_enable_set( 2102 int unit, 2103 bcm_port_t port, 2104 int pfc, 2105 uint32 enable); 2106 /*! 2107 * imb_port_stop_pm_from_pfc_enable_get 2108 * 2109 * @brief Enable / disable PM to stop TX on a NIF port according to received PFC signal 2110 * 2111 * @param [in] unit - unit id 2112 * @param [in] port - logical port 2113 * @param [in] pfc - PFC that is enabled/disabled to stop the PM 2114 * @param [out] enable - PM to stop TX on a NIF port enable/disable indication 2115 */ 2116 int imb_port_stop_pm_from_pfc_enable_get( 2117 int unit, 2118 bcm_port_t port, 2119 int pfc, 2120 uint32 *enable); 2121 2122 /*! 2123 * imb_port_gen_pfc_from_llfc_thresh_enable_set 2124 * 2125 * @brief Enable / disable LLFC RMC threshold to generate PFC on the specified port. 2126 * 2127 * @param [in] unit - unit id 2128 * @param [in] port - logical port 2129 * @param [in] enable - Enable/disable LLFC RMC threshold to generate PFC on the specified port. 2130 */ 2131 int imb_port_gen_pfc_from_llfc_thresh_enable_set( 2132 int unit, 2133 bcm_port_t port, 2134 uint32 enable); 2135 /*! 2136 * imb_port_gen_pfc_from_llfc_thresh_enable_get 2137 * 2138 * @brief Enable / disable LLFC RMC threshold to generate PFC on the specified port. 2139 * 2140 * @param [in] unit - unit id 2141 * @param [in] port - logical port 2142 * @param [out] enable - Get enable indication for LLFC RMC threshold to generate PFC on the specified port. 2143 */ 2144 int imb_port_gen_pfc_from_llfc_thresh_enable_get( 2145 int unit, 2146 bcm_port_t port, 2147 uint32 *enable); 2148 2149 /*! 2150 * imb_port_fc_rx_qmlf_threshold_set 2151 * 2152 * @brief Set / get a port's Rx Quad MAC Lane FIFO (QMLF) Flow Control generation thresholds. 2153 * 2154 * @param [in] unit - unit id 2155 * @param [in] port - logical port 2156 * @param [in] flags - Flags to determine the threshold type (set/clear for PFC of set/clear for LLFC) 2157 * @param [in] threshold - Rx Quad MAC Lane FIFO (QMLF) Flow Control generation threshold value 2158 */ 2159 int imb_port_fc_rx_qmlf_threshold_set( 2160 int unit, 2161 bcm_port_t port, 2162 uint32 flags, 2163 uint32 threshold); 2164 /*! 2165 * imb_port_fc_rx_qmlf_threshold_get 2166 * 2167 * @brief Set / get a port's Rx Quad MAC Lane FIFO (QMLF) Flow Control generation thresholds. 2168 * 2169 * @param [in] unit - unit id 2170 * @param [in] port - logical port 2171 * @param [in] flags - Flags to determine the threshold type (set/clear for PFC of set/clear for LLFC) 2172 * @param [out] threshold - Rx Quad MAC Lane FIFO (QMLF) Flow Control generation threshold value 2173 */ 2174 int imb_port_fc_rx_qmlf_threshold_get( 2175 int unit, 2176 bcm_port_t port, 2177 uint32 flags, 2178 uint32 *threshold); 2179 2180 /*! 2181 * imb_fc_reset_all 2182 * 2183 * @brief Set the Flow Control Interface in/out of reset for all CDUs. 2184 * 2185 * @param [in] unit - Unit ID 2186 * @param [in] in_reset - 1 - reset, 0 - out of reset 2187 */ 2188 int imb_fc_reset_all( 2189 int unit, 2190 uint32 in_reset); 2191 2192 /*! 2193 * imb_fc_reset_set 2194 * 2195 * @brief Set the Flow Control Interface in/out of reset for a specified CDU. 2196 * 2197 * @param [in] unit - Unit ID 2198 * @param [in] imb_info - IMB info structure for IMB to retrieve the IMB type and CDU 2199 * @param [in] in_reset - 1 - reset, 0 - out of reset 2200 */ 2201 int imb_fc_reset_set( 2202 int unit, 2203 const imb_create_info_t * imb_info, 2204 uint32 in_reset); 2205 2206 /*! 2207 * imb_llfc_from_glb_rsc_enable_all 2208 * 2209 * @brief Enable / disable the generation of a LLFC based on a signal from Global Resources thresholds for all CDUs 2210 * 2211 * @param [in] unit - Unit ID 2212 * @param [in] enable - PM to stop TX on all of a port's lanes enable/disable indication 2213 */ 2214 int imb_llfc_from_glb_rsc_enable_all( 2215 int unit, 2216 uint32 enable); 2217 2218 /*! 2219 * imb_llfc_from_glb_rsc_enable_set 2220 * 2221 * @brief Enable / disable the generation of a LLFC based on a signal from Global Resources thresholds for a specified CDU 2222 * 2223 * @param [in] unit - Unit ID 2224 * @param [in] imb_info - IMB info structure for IMB to retrieve the IMB type and CDU 2225 * @param [in] enable - PM to stop TX on all of a port's lanes enable/disable indication 2226 */ 2227 int imb_llfc_from_glb_rsc_enable_set( 2228 int unit, 2229 const imb_create_info_t * imb_info, 2230 uint32 enable); 2231 2232 /*! 2233 * imb_pfc_rec_priority_map 2234 * 2235 * @brief Per CDU map the received PFC - each priority received by NIF should be mapped to a priority that will be sent to EGQ in order to stop a Q-pair 2236 * 2237 * @param [in] unit - unit id 2238 * @param [in] imb_id - imb instance id 2239 * @param [in] nif_priority - Priority of the PFC received by NIF 2240 * @param [in] egq_priority - Priority of the PFC sent to EGQ 2241 */ 2242 int imb_pfc_rec_priority_map( 2243 int unit, 2244 int imb_id, 2245 uint32 nif_priority, 2246 uint32 egq_priority); 2247 2248 /*! 2249 * imb_pfc_rec_priority_unmap 2250 * 2251 * @brief Per CDU unmap all priorities of the received PFC 2252 * 2253 * @param [in] unit - unit id 2254 * @param [in] imb_id - imb instance id 2255 */ 2256 int imb_pfc_rec_priority_unmap( 2257 int unit, 2258 int imb_id); 2259 2260 /*! 2261 * imb_port_fec_speed_validate 2262 * 2263 * @brief Validate the FEC+SPEED combinations 2264 * 2265 * @param [in] unit - unit id 2266 * @param [in] port - logical port 2267 * @param [in] fec_type - fec type 2268 * @param [in] speed - speed 2269 */ 2270 int imb_port_fec_speed_validate( 2271 int unit, 2272 bcm_port_t port, 2273 bcm_port_phy_fec_t fec_type, 2274 int speed); 2275 2276 /*! 2277 * imb_inband_ilkn_fc_init 2278 * 2279 * @brief Configure the specified ILKN core's Inband Flow Control parameters. 2280 * 2281 * @param [in] unit - Unit ID 2282 * @param [in] imb_info - IMB info structure for IMB to retrieve the IMB type and CDU 2283 */ 2284 int imb_inband_ilkn_fc_init( 2285 int unit, 2286 const imb_create_info_t * imb_info); 2287 2288 /*! 2289 * imb_inband_ilkn_fc_init_all 2290 * 2291 * @brief Configure all ILKN interfaces' Inband Flow Control parameters. 2292 * 2293 * @param [in] unit - Unit ID 2294 */ 2295 int imb_inband_ilkn_fc_init_all( 2296 int unit); 2297 2298 /*! 2299 * @brief IMB FlexE related defines 2300 */ 2301 #define IMB_FLEXE_DIRECTION_RX_ONLY 0x1 /**< Rx direction */ 2302 #define IMB_FLEXE_DIRECTION_TX_ONLY 0x2 /**< Tx direction */ 2303 #define IMB_FLEXE_SINGLE_NB_TDM_SLOT 0x4 /**< USE SINGLE TMD slots for in NB calendar for specific port */ 2304 #define IMB_FLEXE_DOUBLE_NB_TDM_SLOT 0x8 /**< USE DOUBLE TMD slots for in NB calendar for specific port */ 2305 2306 #define IMB_FLEXE_DIRECTION_RX_ONLY_SET(flags) (flags |= IMB_FLEXE_DIRECTION_RX_ONLY) 2307 #define IMB_FLEXE_DIRECTION_TX_ONLY_SET(flags) (flags |= IMB_FLEXE_DIRECTION_TX_ONLY) 2308 #define IMB_FLEXE_SINGLE_NB_TDM_SLOT_SET(flags) (flags |= IMB_FLEXE_SINGLE_NB_TDM_SLOT) 2309 #define IMB_FLEXE_DOUBLE_NB_TDM_SLOT_SET(flags) (flags |= IMB_FLEXE_DOUBLE_NB_TDM_SLOT) 2310 2311 #define IMB_FLEXE_DIRECTION_RX_ONLY_CLR(flags) (flags &= ~IMB_FLEXE_DIRECTION_RX_ONLY) 2312 #define IMB_FLEXE_DIRECTION_TX_ONLY_CLR(flags) (flags &= ~IMB_FLEXE_DIRECTION_TX_ONLY) 2313 #define IMB_FLEXE_SINGLE_NB_TDM_SLOT_CLR(flags) (flags &= ~IMB_FLEXE_SINGLE_NB_TDM_SLOT) 2314 #define IMB_FLEXE_DOUBLE_NB_TDM_SLOT_CLR(flags) (flags &= ~IMB_FLEXE_DOUBLE_NB_TDM_SLOT) 2315 2316 #define IMB_FLEXE_DIRECTION_RX_ONLY_GET(flags) (flags & IMB_FLEXE_DIRECTION_RX_ONLY ? 1 : 0) 2317 #define IMB_FLEXE_DIRECTION_TX_ONLY_GET(flags) (flags & IMB_FLEXE_DIRECTION_TX_ONLY ? 1 : 0) 2318 #define IMB_FLEXE_SINGLE_NB_TDM_SLOT_GET(flags) (flags & IMB_FLEXE_SINGLE_NB_TDM_SLOT ? 1 : 0) 2319 #define IMB_FLEXE_DOUBLE_NB_TDM_SLOT_GET(flags) (flags & IMB_FLEXE_DOUBLE_NB_TDM_SLOT ? 1 : 0) 2320 2321 /*! 2322 * imb_calendar_set 2323 * 2324 * @brief Configure calendar for FlexE related ports 2325 * 2326 * @param [in] unit - unit id 2327 * @param [in] port - logical port 2328 * @param [in] flags - flags for resource set API 2329 */ 2330 int imb_calendar_set( 2331 int unit, 2332 bcm_port_t port, 2333 uint32 flags); 2334 2335 /*! 2336 * imb_port_fifo_resource_set 2337 * 2338 * @brief Configure FIFO resources for flexe client 2339 * 2340 * @param [in] unit - unit id 2341 * @param [in] port - logical port 2342 * @param [in] flags - flags for resource set API 2343 */ 2344 int imb_port_fifo_resource_set( 2345 int unit, 2346 bcm_port_t port, 2347 uint32 flags); 2348 2349 /*! 2350 * imb_post_init 2351 * 2352 * @brief IMB post init after speed configuration is ready 2353 * 2354 * @param [in] unit - unit id 2355 * @param [in] imb_id - imb instance id 2356 */ 2357 int imb_post_init( 2358 int unit, 2359 int imb_id); 2360 2361 /*! 2362 * imb_instru_counters_reset_all 2363 * 2364 * @brief Reset per IMB instrumentation counters for all IMBs. 2365 * 2366 * @param [in] unit - Unit ID 2367 */ 2368 int imb_instru_counters_reset_all( 2369 int unit); 2370 2371 /*! 2372 * imb_instru_counters_reset 2373 * 2374 * @brief Reset per IMB instrumentation counters 2375 * 2376 * @param [in] unit - Unit ID 2377 * @param [in] imb_info - IMB info structure for IMB to retrieve the IMB type 2378 */ 2379 int imb_instru_counters_reset( 2380 int unit, 2381 const imb_create_info_t * imb_info); 2382 2383 /*! 2384 * imb_pfc_deadlock_counters_reset_all 2385 * 2386 * @brief Reset per IMB instrumentation counters for all IMBs. 2387 * 2388 * @param [in] unit - Unit ID 2389 */ 2390 int imb_pfc_deadlock_counters_reset_all( 2391 int unit); 2392 2393 /*! 2394 * imb_pfc_deadlock_counters_reset 2395 * 2396 * @brief Reset per IMB counters for PFC Deadlock detection 2397 * 2398 * @param [in] unit - Unit ID 2399 * @param [in] imb_info - IMB info structure for IMB to retrieve the IMB type 2400 */ 2401 int imb_pfc_deadlock_counters_reset( 2402 int unit, 2403 const imb_create_info_t * imb_info); 2404 2405 /*! 2406 * imb_port_pfc_deadlock_counters_reset 2407 * 2408 * @brief Reset per port counters for PFC Deadlock detection 2409 * 2410 * @param [in] unit - unit id 2411 * @param [in] port - logical port 2412 */ 2413 int imb_port_pfc_deadlock_counters_reset( 2414 int unit, 2415 bcm_port_t port); 2416 2417 /*! 2418 * imb_pfc_deadlock_debug_info_get 2419 * 2420 * @brief Get PFC Deadlock mechanism debug info 2421 * 2422 * @param [in] unit - unit id 2423 * @param [in] ethu_id - Ethrnet unit ID 2424 * @param [out] ethu_port_num - Port internal for the ETHU that is currently in deadlock 2425 * @param [out] pfc_num - PFC that is currently in deadlock 2426 */ 2427 int imb_pfc_deadlock_debug_info_get( 2428 int unit, 2429 int ethu_id, 2430 int *ethu_port_num, 2431 int *pfc_num); 2432 2433 /*! 2434 * imb_pfc_deadlock_max_duration_set 2435 * 2436 * @brief PFC Deadlock recovery mechanism max duration of PFC set/get 2437 * 2438 * @param [in] unit - unit id 2439 * @param [in] ethu_id - Ethrnet unit ID 2440 * @param [in] max_duration - PFC duration that will trigger the Deadlock breaking mechanism 2441 */ 2442 int imb_pfc_deadlock_max_duration_set( 2443 int unit, 2444 int ethu_id, 2445 uint32 max_duration); 2446 /*! 2447 * imb_pfc_deadlock_max_duration_get 2448 * 2449 * @brief PFC Deadlock recovery mechanism max duration of PFC set/get 2450 * 2451 * @param [in] unit - unit id 2452 * @param [in] ethu_id - Ethrnet unit ID 2453 * @param [out] max_duration - PFC duration that will trigger the Deadlock breaking mechanism 2454 */ 2455 int imb_pfc_deadlock_max_duration_get( 2456 int unit, 2457 int ethu_id, 2458 uint32 *max_duration); 2459 2460 /*! 2461 * imb_port_phy_control_validate 2462 * 2463 * @brief Check if phy control is supported for current PM. 2464 * 2465 * @param [in] unit - unit id 2466 * @param [in] port - logical port 2467 * @param [in] type - Phy Control type 2468 * @param [in] is_set - if this fuction is called by set function 2469 */ 2470 int imb_port_phy_control_validate( 2471 int unit, 2472 bcm_port_t port, 2473 bcm_port_phy_control_t type, 2474 int is_set); 2475 2476 /*! 2477 * imb_port_pre_add_validate_wrap 2478 * 2479 * @brief Finds port relevant IMB info and dispatches. 2480 * 2481 * @param [in] unit - unit id 2482 * @param [in] port - logical port 2483 * @param [in] phys - port phys 2484 */ 2485 int imb_port_pre_add_validate_wrap( 2486 int unit, 2487 bcm_port_t port, 2488 bcm_pbmp_t phys); 2489 2490 /*! 2491 * imb_port_pre_add_validate 2492 * 2493 * @brief Checks port validaity in a early stage before any DB is modified 2494 * 2495 * @param [in] unit - unit id 2496 * @param [in] port - logical port 2497 * @param [in] phys - port phys 2498 */ 2499 int imb_port_pre_add_validate( 2500 int unit, 2501 bcm_port_t port, 2502 bcm_pbmp_t phys); 2503 2504 /*! 2505 * imb_port_autoneg_ability_verify 2506 * 2507 * @brief Verify input AN abilities. 2508 * 2509 * @param [in] unit - unit id 2510 * @param [in] port - logical port 2511 * @param [in] num_ability - number of abilities 2512 * @param [in] abilities - array of abilities 2513 */ 2514 int imb_port_autoneg_ability_verify( 2515 int unit, 2516 bcm_port_t port, 2517 int num_ability, 2518 const bcm_port_speed_ability_t * abilities); 2519 2520 /*! 2521 * imb_port_pcs_lane_map_set 2522 * 2523 * @brief Configure PCS lane map. 2524 * 2525 * @param [in] unit - unit id 2526 * @param [in] port - logical port 2527 * @param [in] tx_lane_swap - Tx lane map 2528 * @param [in] rx_lane_swap - Rx lane map 2529 */ 2530 int imb_port_pcs_lane_map_set( 2531 int unit, 2532 bcm_port_t port, 2533 uint32 tx_lane_swap, 2534 uint32 rx_lane_swap); 2535 2536 /*! 2537 * imb_port_link_status_change_event 2538 * 2539 * @brief Action on link status change 2540 * 2541 * @param [in] unit - unit id 2542 * @param [in] port - logical port 2543 */ 2544 int imb_port_link_status_change_event( 2545 int unit, 2546 bcm_port_t port); 2547 2548 /*! 2549 * imb_alternative_port_set 2550 * 2551 * @brief Configure alternative ports for FlexE PHY ports. 2552 * 2553 * @param [in] unit - unit id 2554 * @param [in] port - logical port 2555 * @param [in] alter_ports - phys associated with imb instance 2556 */ 2557 int imb_alternative_port_set( 2558 int unit, 2559 bcm_port_t port, 2560 const bcm_pbmp_t * alter_ports); 2561 2562 /*! 2563 * imb_port_l1_mismatch_rate_rx_config_set 2564 * 2565 * @brief Configure L1 Mismatch rate configuration for RMC. 2566 * 2567 * @param [in] unit - unit id 2568 * @param [in] port - logical port 2569 * @param [in] tx_speed - the Tx speed 2570 * @param [in] enable - enable or disable the L1 mismatch rate config in Rx 2571 */ 2572 int imb_port_l1_mismatch_rate_rx_config_set( 2573 int unit, 2574 bcm_port_t port, 2575 int tx_speed, 2576 int enable); 2577 2578 /*! 2579 * imb_port_post_ber_proj_get 2580 * 2581 * @brief Get th BER histogram and port-FEC estimation values 2582 * 2583 * @param [in] unit - unit id 2584 * @param [in] port - logical port 2585 * @param [in] lane - lane number 2586 * @param [in] ber_proj - pointer to the BER projection parameters 2587 * @param [in] max_errcnt - size of max_errcnt 2588 * @param [out] errcnt_array - pointer to the errcnt_array array for storing post-FEC estimation values 2589 * @param [out] actual_errcnt - actual number of errcnt in errcnt_array 2590 */ 2591 int imb_port_post_ber_proj_get( 2592 int unit, 2593 bcm_port_t port, 2594 int lane, 2595 const bcm_port_ber_proj_params_t * ber_proj, 2596 int max_errcnt, 2597 bcm_port_ber_proj_analyzer_errcnt_t * errcnt_array, 2598 int *actual_errcnt); 2599 2600 /*! 2601 * imb_flexe_core_port_config_set 2602 * 2603 * @brief FlexE core port related configuration. 2604 * 2605 * @param [in] unit - unit id 2606 * @param [in] port - logical port 2607 * @param [in] flexe_core_port - flexe_core_port 2608 * @param [in] speed - flexe physical port speed 2609 */ 2610 int imb_flexe_core_port_config_set( 2611 int unit, 2612 bcm_port_t port, 2613 int flexe_core_port, 2614 int speed); 2615 2616 /*! 2617 * imb_portmod_add_info_config 2618 * 2619 * @brief Initialize Portmod add_info before calling portmod_port_add. 2620 * 2621 * @param [in] unit - unit id 2622 * @param [in] port - logical port 2623 * @param [out] add_info - Portmod port add info 2624 */ 2625 int imb_portmod_add_info_config( 2626 int unit, 2627 bcm_port_t port, 2628 portmod_port_add_info_t * add_info); 2629 2630 #endif /*_IMB_H_*/