openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

port.h (30123B)


      1 /*
      2  * 
      3  * 
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      7  * 
      8  * DO NOT EDIT THIS FILE!
      9  * This file is auto-generated.
     10  * Edits to this file will be lost when it is regenerated.
     11  */
     12 
     13 #ifndef __BCMX_PORT_H__
     14 #define __BCMX_PORT_H__
     15 
     16 #include <bcm/types.h>
     17 #include <bcmx/bcmx.h>
     18 #include <bcmx/lplist.h>
     19 #include <bcm/port.h>
     20 
     21 /* BCMX LPORT Flags */
     22 #define BCMX_PORT_LP_ALL        (1 << 0)   /* 0x00000001 */
     23 #define BCMX_PORT_LP_FE         (1 << 1)   /* 0x00000002 */
     24 #define BCMX_PORT_LP_GE         (1 << 2)   /* 0x00000004 */
     25 #define BCMX_PORT_LP_XE         (1 << 3)   /* 0x00000008 */
     26 #define BCMX_PORT_LP_HG         (1 << 4)   /* 0x00000010 */
     27 #define BCMX_PORT_LP_E          (1 << 5)   /* 0x00000020 */
     28 #define BCMX_PORT_LP_PORT       (1 << 6)   /* 0x00000040 */
     29 #define BCMX_PORT_LP_CPU        (1 << 7)   /* 0x00000080 */
     30 #define BCMX_PORT_LP_STACK_INT  (1 << 8)   /* 0x00000100 */
     31 #define BCMX_PORT_LP_STACK_EXT  (1 << 9)   /* 0x00000200 */
     32 #define BCMX_PORT_LP_CE         (1 << 10)  /* 0x00000400 */
     33 
     34 /* Port Configuration structure. */
     35 typedef struct bcmx_port_config_s {
     36     bcmx_lplist_t fe;           /* List of FE ports. */
     37     bcmx_lplist_t ge;           /* List of GE ports. */
     38     bcmx_lplist_t xe;           /* List of 10-Gig ports. */
     39     bcmx_lplist_t ce;           /* List of 100-Gig ports. */
     40     bcmx_lplist_t e;            /* List of Ethernet ports. */
     41     bcmx_lplist_t hg;           /* List of Higig ports. */
     42     bcmx_lplist_t port;         /* List of all front panel ports. */
     43     bcmx_lplist_t cpu;          /* List of CPU ports. */
     44     bcmx_lplist_t all;          /* List of all ports. */
     45     bcmx_lplist_t stack_int;    /* Deprecated - unused. */
     46     bcmx_lplist_t stack_ext;    /* List of Stack ports. */
     47 } bcmx_port_config_t;
     48 
     49 /* Port Ability structure */
     50 typedef bcm_port_ability_t bcmx_port_ability_t;
     51 
     52 /* Port Encapsulation Configuration structure */
     53 typedef bcm_port_encap_config_t bcmx_port_encap_config_t;
     54 
     55 /* Port Congestion Configuration structure */
     56 typedef bcm_port_congestion_config_t bcmx_port_congestion_config_t;
     57 
     58 /* Port Match Attribute structure */
     59 typedef bcm_port_match_info_t bcmx_port_match_info_t;
     60 
     61 /* Port Timesync Configuration structure */
     62 typedef bcm_port_phy_timesync_config_t bcmx_port_phy_timesync_config_t;
     63 
     64 /* Port Timesync Enhanced Capture structure */
     65 typedef bcm_port_phy_timesync_enhanced_capture_t bcmx_port_phy_timesync_enhanced_capture_t;
     66 
     67 /* Initialize a Port Configuration structure. */
     68 extern void bcmx_port_config_t_init(
     69     bcmx_port_config_t *pconfig);
     70 
     71 extern void bcmx_port_ability_t_init(
     72     bcmx_port_ability_t *ability);
     73 
     74 /* Initialize a Port Encapsulation Configuration structure. */
     75 extern void bcmx_port_encap_config_t_init(
     76     bcmx_port_encap_config_t *encap_config);
     77 
     78 /* Initialize a Port Congestion Configuration structure. */
     79 extern void bcmx_port_congestion_config_t_init(
     80     bcmx_port_congestion_config_t *config);
     81 
     82 /* Initialize the port match structure. */
     83 extern void bcmx_port_match_info_t_init(
     84     bcmx_port_match_info_t *port_match_info);
     85 
     86 extern void bcmx_port_phy_timesync_config_t_init(
     87     bcmx_port_phy_timesync_config_t *conf);
     88 
     89 /* 
     90  * Retrieved the port configuration for the specified device or for all
     91  * ports known to bcmx.
     92  */
     93 extern int bcmx_port_config_get(
     94     bcmx_port_config_t *config);
     95 
     96 /* Enable or disable a port. */
     97 extern int bcmx_port_enable_set(
     98     bcmx_lport_t port, 
     99     int enable);
    100 
    101 /* Enable or disable a port. */
    102 extern int bcmx_port_enable_get(
    103     bcmx_lport_t port, 
    104     int *enable);
    105 
    106 /* Set or retrieve autonegotiation settings for a port. */
    107 extern int bcmx_port_advert_set(
    108     bcmx_lport_t port, 
    109     bcm_port_abil_t ability_mask);
    110 
    111 /* Set or retrieve autonegotiation settings for a port. */
    112 extern int bcmx_port_ability_advert_set(
    113     bcmx_lport_t port, 
    114     bcmx_port_ability_t *ability_mask);
    115 
    116 /* Set or retrieve autonegotiation settings for a port. */
    117 extern int bcmx_port_advert_get(
    118     bcmx_lport_t port, 
    119     bcm_port_abil_t *ability_mask);
    120 
    121 /* Set or retrieve autonegotiation settings for a port. */
    122 extern int bcmx_port_ability_advert_get(
    123     bcmx_lport_t port, 
    124     bcmx_port_ability_t *ability_mask);
    125 
    126 /* Set or retrieve autonegotiation settings for a port. */
    127 extern int bcmx_port_advert_remote_get(
    128     bcmx_lport_t port, 
    129     bcm_port_abil_t *ability_mask);
    130 
    131 /* Set or retrieve autonegotiation settings for a port. */
    132 extern int bcmx_port_ability_remote_get(
    133     bcmx_lport_t port, 
    134     bcmx_port_ability_t *ability_mask);
    135 
    136 /* 
    137  * Retrieve the valid operating modes of a port including speed and
    138  * duplex.
    139  */
    140 extern int bcmx_port_ability_get(
    141     bcmx_lport_t port, 
    142     bcm_port_abil_t *local_ability_mask);
    143 
    144 /* 
    145  * Retrieve the valid operating modes of a port including speed and
    146  * duplex.
    147  */
    148 extern int bcmx_port_ability_local_get(
    149     bcmx_lport_t port, 
    150     bcmx_port_ability_t *local_ability_mask);
    151 
    152 /* Get or set the default vlan for packets that ingress untagged. */
    153 extern int bcmx_port_untagged_vlan_set(
    154     bcmx_lport_t port, 
    155     bcm_vlan_t vid);
    156 
    157 /* Get or set the default vlan for packets that ingress untagged. */
    158 extern int bcmx_port_untagged_vlan_get(
    159     bcmx_lport_t port, 
    160     bcm_vlan_t *vid_ptr);
    161 
    162 /* Get or set the default priority for packets that ingress untagged. */
    163 extern int bcmx_port_untagged_priority_set(
    164     bcmx_lport_t port, 
    165     int priority);
    166 
    167 /* Get or set the default priority for packets that ingress untagged. */
    168 extern int bcmx_port_untagged_priority_get(
    169     bcmx_lport_t port, 
    170     int *priority);
    171 
    172 /* Control mapping of Differentiated Services Code Points (DSCP). */
    173 extern int bcmx_port_dscp_map_mode_set(
    174     bcmx_lport_t port, 
    175     int mode);
    176 
    177 /* Control mapping of Differentiated Services Code Points (DSCP). */
    178 extern int bcmx_port_dscp_map_mode_get(
    179     bcmx_lport_t port, 
    180     int *mode);
    181 
    182 /* Control mapping of Differentiated Services Code Points (DSCP). */
    183 extern int bcmx_port_dscp_map_set(
    184     bcmx_lport_t port, 
    185     int srccp, 
    186     int mapcp, 
    187     int prio);
    188 
    189 /* Control mapping of Differentiated Services Code Points (DSCP). */
    190 extern int bcmx_port_dscp_map_get(
    191     bcmx_lport_t port, 
    192     int srccp, 
    193     int *mapcp, 
    194     int *prio);
    195 
    196 /* Get or set the current linkscan mode for the specified port. */
    197 extern int bcmx_port_linkscan_set(
    198     bcmx_lport_t port, 
    199     int linkscan);
    200 
    201 /* Get or set the current linkscan mode for the specified port. */
    202 extern int bcmx_port_linkscan_get(
    203     bcmx_lport_t port, 
    204     int *linkscan);
    205 
    206 /* 
    207  * Configure or retrieve the current autonegotiation settings for a port,
    208  * or restart autonegotiation if already enabled.
    209  */
    210 extern int bcmx_port_autoneg_set(
    211     bcmx_lport_t port, 
    212     int autoneg);
    213 
    214 /* 
    215  * Configure or retrieve the current autonegotiation settings for a port,
    216  * or restart autonegotiation if already enabled.
    217  */
    218 extern int bcmx_port_autoneg_get(
    219     bcmx_lport_t port, 
    220     int *autoneg);
    221 
    222 /* Get or set the current operating speed of a port. */
    223 extern int bcmx_port_speed_max(
    224     bcmx_lport_t port, 
    225     int *speed);
    226 
    227 /* Get or set the current operating speed of a port. */
    228 extern int bcmx_port_speed_set(
    229     bcmx_lport_t port, 
    230     int speed);
    231 
    232 /* Get or set the current operating speed of a port. */
    233 extern int bcmx_port_speed_get(
    234     bcmx_lport_t port, 
    235     int *speed);
    236 
    237 /* Set or get the Master mode on the PHY attached to the specified port. */
    238 extern int bcmx_port_master_set(
    239     bcmx_lport_t port, 
    240     int ms);
    241 
    242 /* Set or get the Master mode on the PHY attached to the specified port. */
    243 extern int bcmx_port_master_get(
    244     bcmx_lport_t port, 
    245     int *ms);
    246 
    247 /* 
    248  * Configure the physical interface between the MAC and the PHY for the
    249  * specified port.
    250  */
    251 extern int bcmx_port_interface_set(
    252     bcmx_lport_t port, 
    253     bcm_port_if_t intf);
    254 
    255 /* 
    256  * Configure the physical interface between the MAC and the PHY for the
    257  * specified port.
    258  */
    259 extern int bcmx_port_interface_get(
    260     bcmx_lport_t port, 
    261     bcm_port_if_t *intf);
    262 
    263 /* Get or set the current duplex mode of a port. */
    264 extern int bcmx_port_duplex_set(
    265     bcmx_lport_t port, 
    266     int duplex);
    267 
    268 /* Get or set the current duplex mode of a port. */
    269 extern int bcmx_port_duplex_get(
    270     bcmx_lport_t port, 
    271     int *duplex);
    272 
    273 /* 
    274  * Enable or disable transmission of pause frames and honoring received
    275  * pause frames on a port.
    276  */
    277 extern int bcmx_port_pause_set(
    278     bcmx_lport_t port, 
    279     int pause_tx, 
    280     int pause_rx);
    281 
    282 /* 
    283  * Enable or disable transmission of pause frames and honoring received
    284  * pause frames on a port.
    285  */
    286 extern int bcmx_port_pause_get(
    287     bcmx_lport_t port, 
    288     int *pause_tx, 
    289     int *pause_rx);
    290 
    291 /* 
    292  * Get or set the source MAC address transmitted in MAC control pause
    293  * frames.
    294  */
    295 extern int bcmx_port_pause_addr_set(
    296     bcmx_lport_t port, 
    297     bcm_mac_t mac);
    298 
    299 /* 
    300  * Get or set the source MAC address transmitted in MAC control pause
    301  * frames.
    302  */
    303 extern int bcmx_port_pause_addr_get(
    304     bcmx_lport_t port, 
    305     bcm_mac_t mac);
    306 
    307 /* Configure or retrieve asymmetric pause setting for a port. */
    308 extern int bcmx_port_pause_sym_set(
    309     bcmx_lport_t port, 
    310     int pause);
    311 
    312 /* Configure or retrieve asymmetric pause setting for a port. */
    313 extern int bcmx_port_pause_sym_get(
    314     bcmx_lport_t port, 
    315     int *pause);
    316 
    317 /* Process a link change event and perform required device configuration. */
    318 extern int bcmx_port_update(
    319     bcmx_lport_t port, 
    320     int link);
    321 
    322 /* Set or retrieve the current maximum packet size permitted on a port. */
    323 extern int bcmx_port_frame_max_set(
    324     bcmx_lport_t port, 
    325     int size);
    326 
    327 /* Set or retrieve the current maximum packet size permitted on a port. */
    328 extern int bcmx_port_frame_max_get(
    329     bcmx_lport_t port, 
    330     int *size);
    331 
    332 /* 
    333  * Set or retrieve the current maximum L3 packet size permitted on a
    334  * port.
    335  */
    336 extern int bcmx_port_l3_mtu_set(
    337     bcmx_lport_t port, 
    338     int size);
    339 
    340 /* 
    341  * Set or retrieve the current maximum L3 packet size permitted on a
    342  * port.
    343  */
    344 extern int bcmx_port_l3_mtu_get(
    345     bcmx_lport_t port, 
    346     int *size);
    347 
    348 /* Get or set half duplex flow control (jam) for a port. */
    349 extern int bcmx_port_jam_set(
    350     bcmx_lport_t port, 
    351     int enable);
    352 
    353 /* Get or set half duplex flow control (jam) for a port. */
    354 extern int bcmx_port_jam_get(
    355     bcmx_lport_t port, 
    356     int *enable);
    357 
    358 /* Get or set the interframe gap settings for the specified port. */
    359 extern int bcmx_port_ifg_set(
    360     bcmx_lport_t port, 
    361     int speed, 
    362     bcm_port_duplex_t duplex, 
    363     int bit_times);
    364 
    365 /* Get or set the interframe gap settings for the specified port. */
    366 extern int bcmx_port_ifg_get(
    367     bcmx_lport_t port, 
    368     int speed, 
    369     bcm_port_duplex_t duplex, 
    370     int *bit_times);
    371 
    372 /* Set/Get force vlan attribute of a port. */
    373 extern int bcmx_port_force_vlan_set(
    374     bcmx_lport_t port, 
    375     bcm_vlan_t vlan, 
    376     int pkt_prio, 
    377     uint32 flags);
    378 
    379 /* Set/Get force vlan attribute of a port. */
    380 extern int bcmx_port_force_vlan_get(
    381     bcmx_lport_t port, 
    382     bcm_vlan_t *vlan, 
    383     int *pkt_prio, 
    384     uint32 *flags);
    385 
    386 /* Write phy registers associated with a port. */
    387 extern int bcmx_port_phy_set(
    388     bcmx_lport_t port, 
    389     uint32 flags, 
    390     uint32 phy_reg_addr, 
    391     uint32 phy_data);
    392 
    393 /* Read phy registers associated with a port. */
    394 extern int bcmx_port_phy_get(
    395     bcmx_lport_t port, 
    396     uint32 flags, 
    397     uint32 phy_reg_addr, 
    398     uint32 *phy_data);
    399 
    400 /* Modify phy registers associated with a port. */
    401 extern int bcmx_port_phy_modify(
    402     bcmx_lport_t port, 
    403     uint32 flags, 
    404     uint32 phy_reg_addr, 
    405     uint32 phy_data, 
    406     uint32 phy_mask);
    407 
    408 /* Get or set the Auto MDIX mode for a port. */
    409 extern int bcmx_port_mdix_set(
    410     bcmx_lport_t port, 
    411     bcm_port_mdix_t mode);
    412 
    413 /* Get or set the Auto MDIX mode for a port. */
    414 extern int bcmx_port_mdix_get(
    415     bcmx_lport_t port, 
    416     bcm_port_mdix_t *mode);
    417 
    418 /* Get or set the Auto MDIX mode for a port. */
    419 extern int bcmx_port_mdix_status_get(
    420     bcmx_lport_t port, 
    421     bcm_port_mdix_status_t *status);
    422 
    423 /* Get or set medium preferences for combination ports. */
    424 extern int bcmx_port_medium_config_set(
    425     bcmx_lport_t port, 
    426     bcm_port_medium_t medium, 
    427     bcm_phy_config_t *config);
    428 
    429 /* Get or set medium preferences for combination ports. */
    430 extern int bcmx_port_medium_config_get(
    431     bcmx_lport_t port, 
    432     bcm_port_medium_t medium, 
    433     bcm_phy_config_t *config);
    434 
    435 /* Get or set medium preferences for combination ports. */
    436 extern int bcmx_port_medium_get(
    437     bcmx_lport_t port, 
    438     bcm_port_medium_t *medium);
    439 
    440 /* Set the current loopback mode of a port. */
    441 extern int bcmx_port_loopback_set(
    442     bcmx_lport_t port, 
    443     int loopback);
    444 
    445 /* Retrieve the current loopback mode of a port. */
    446 extern int bcmx_port_loopback_get(
    447     bcmx_lport_t port, 
    448     int *loopback);
    449 
    450 /* 
    451  * Set the spanning tree state for a port (single instance spanning tree
    452  * only).
    453  */
    454 extern int bcmx_port_stp_set(
    455     bcmx_lport_t port, 
    456     int state);
    457 
    458 /* 
    459  * Get the spanning tree state for a port (single instance spanning tree
    460  * only).
    461  */
    462 extern int bcmx_port_stp_get(
    463     bcmx_lport_t port, 
    464     int *state);
    465 
    466 /* 
    467  * Configure port discard mode for packets ingressing tagged and
    468  * untagged.
    469  */
    470 extern int bcmx_port_discard_set(
    471     bcmx_lport_t port, 
    472     int mode);
    473 
    474 /* Get the port discard mode for packets ingressing tagged and untagged. */
    475 extern int bcmx_port_discard_get(
    476     bcmx_lport_t port, 
    477     int *mode);
    478 
    479 /* Control the hardware and software learning support on a port. */
    480 extern int bcmx_port_learn_set(
    481     bcmx_lport_t port, 
    482     uint32 flags);
    483 
    484 /* Get the hardware and software learning support on a port. */
    485 extern int bcmx_port_learn_get(
    486     bcmx_lport_t port, 
    487     uint32 *flags);
    488 
    489 /* Control the hardware and software learning support on a port. */
    490 extern int bcmx_port_learn_modify(
    491     bcmx_lport_t port, 
    492     uint32 add, 
    493     uint32 remove);
    494 
    495 /* Retrieve the current link status of a port. */
    496 extern int bcmx_port_link_status_get(
    497     bcmx_lport_t port, 
    498     int *status);
    499 
    500 /* 
    501  * Clear failed link status from a port which has undergone LAG failover.
    502  *  The port is moved to down status.  The application is responsible for
    503  * removing the port from all trunk memberships before calling this
    504  * function.
    505  */
    506 extern int bcmx_port_link_failed_clear(
    507     bcm_gport_t port);
    508 
    509 /* 
    510  * Set current behavior of tagged packets arriving on a port not a member
    511  * of the specified VLAN.
    512  */
    513 extern int bcmx_port_ifilter_set(
    514     bcmx_lport_t port, 
    515     int mode);
    516 
    517 /* 
    518  * Retrieve current behavior of tagged packets arriving on a port not a
    519  * member of the specified VLAN.
    520  */
    521 extern int bcmx_port_ifilter_get(
    522     bcmx_lport_t port, 
    523     int *mode);
    524 
    525 /* 
    526  * Set current behavior of tagged packets arriving/leaving on a port not
    527  * a member of the specified VLAN.
    528  */
    529 extern int bcmx_port_vlan_member_set(
    530     bcmx_lport_t port, 
    531     uint32 flags);
    532 
    533 /* 
    534  * Retrieve current behavior of tagged packets arriving/leaving on a port
    535  * not a member of the specified VLAN.
    536  */
    537 extern int bcmx_port_vlan_member_get(
    538     bcmx_lport_t port, 
    539     uint32 *flags);
    540 
    541 /* Enable or disable BPDU processing on a port. */
    542 extern int bcmx_port_bpdu_enable_set(
    543     bcmx_lport_t port, 
    544     int enable);
    545 
    546 /* Enable or disable BPDU processing on a port. */
    547 extern int bcmx_port_bpdu_enable_get(
    548     bcmx_lport_t port, 
    549     int *enable);
    550 
    551 /* Enable or disable l3 switching on an ingress port. */
    552 extern int bcmx_port_l3_enable_set(
    553     bcmx_lport_t port, 
    554     int enable);
    555 
    556 /* Enable or disable l3 switching on an ingress port. */
    557 extern int bcmx_port_l3_enable_get(
    558     bcmx_lport_t port, 
    559     int *enable);
    560 
    561 extern int bcmx_port_tgid_set(
    562     bcmx_lport_t port, 
    563     int tgid, 
    564     int psc);
    565 
    566 extern int bcmx_port_tgid_get(
    567     bcmx_lport_t port, 
    568     int *tgid, 
    569     int *psc);
    570 
    571 /* Set or retrieve the current unknown multicast behavior. */
    572 extern int bcmx_port_pfm_set(
    573     bcmx_lport_t port, 
    574     int mode);
    575 
    576 /* Set or retrieve the current unknown multicast behavior. */
    577 extern int bcmx_port_pfm_get(
    578     bcmx_lport_t port, 
    579     int *mode);
    580 
    581 /* Set the encapsulation of the given port. */
    582 extern int bcmx_port_encap_config_set(
    583     bcm_gport_t gport, 
    584     bcmx_port_encap_config_t *encap_config);
    585 
    586 /* Get the encapsulation of the given port. */
    587 extern int bcmx_port_encap_config_get(
    588     bcm_gport_t gport, 
    589     bcmx_port_encap_config_t *encap_config);
    590 
    591 /* Set or get the link level encapsulation mode. */
    592 extern int bcmx_port_encap_set(
    593     bcmx_lport_t port, 
    594     int mode);
    595 
    596 /* Set or get the link level encapsulation mode. */
    597 extern int bcmx_port_encap_get(
    598     bcmx_lport_t port, 
    599     int *mode);
    600 
    601 /* 
    602  * Get the current count of cells or packets queued on a port for
    603  * transmission.
    604  */
    605 extern int bcmx_port_queued_count_get(
    606     bcmx_lport_t port, 
    607     uint32 *count);
    608 
    609 /* Add or delete a protocol based vlan. */
    610 extern int bcmx_port_protocol_vlan_add(
    611     bcmx_lport_t port, 
    612     bcm_port_frametype_t frame, 
    613     bcm_port_ethertype_t ether, 
    614     bcm_vlan_t vid);
    615 
    616 /* Add or delete a protocol based vlan. */
    617 extern int bcmx_port_protocol_vlan_delete(
    618     bcmx_lport_t port, 
    619     bcm_port_frametype_t frame, 
    620     bcm_port_ethertype_t ether);
    621 
    622 /* Add or delete a protocol based vlan. */
    623 extern int bcmx_port_protocol_vlan_delete_all(
    624     bcmx_lport_t port);
    625 
    626 /* 
    627  * Configure ports to block or allow packets from a given ingress port
    628  * for egressing.
    629  */
    630 extern int bcmx_port_egress_set(
    631     bcmx_lport_t port, 
    632     int modid, 
    633     bcmx_lplist_t lplist);
    634 
    635 /* 
    636  * Get list of ports to block or allow packets from a given ingress port
    637  * for egressing.
    638  */
    639 extern int bcmx_port_egress_get(
    640     bcmx_lport_t port, 
    641     int modid, 
    642     bcmx_lplist_t *lplist);
    643 
    644 /* 
    645  * Configure which egress ports an ingress port is permitted to forward
    646  * packets to.
    647  */
    648 extern int bcmx_port_modid_enable_set(
    649     bcmx_lport_t port, 
    650     int modid, 
    651     int enable);
    652 
    653 /* 
    654  * Configure which egress ports an ingress port is permitted to forward
    655  * packets to.
    656  */
    657 extern int bcmx_port_modid_enable_get(
    658     bcmx_lport_t port, 
    659     int modid, 
    660     int *enable);
    661 
    662 /* Selectively block flooding traffic. */
    663 extern int bcmx_port_flood_block_set(
    664     bcmx_lport_t ingress_port, 
    665     bcmx_lport_t egress_port, 
    666     uint32 flags);
    667 
    668 /* Selectively block flooding traffic. */
    669 extern int bcmx_port_flood_block_get(
    670     bcmx_lport_t ingress_port, 
    671     bcmx_lport_t egress_port, 
    672     uint32 *flags);
    673 
    674 /* Configure a port for egress rate shaping. */
    675 extern int bcmx_port_rate_egress_set(
    676     bcmx_lport_t port, 
    677     uint32 kbits_sec, 
    678     uint32 kbits_burst);
    679 
    680 /* Get a port's egress rate shaping parameters. */
    681 extern int bcmx_port_rate_egress_get(
    682     bcmx_lport_t port, 
    683     uint32 *kbits_sec, 
    684     uint32 *kbits_burst);
    685 
    686 /* Configure a port for ingress rate policing. */
    687 extern int bcmx_port_rate_ingress_set(
    688     bcmx_lport_t port, 
    689     uint32 kbits_sec, 
    690     uint32 kbits_burst);
    691 
    692 /* Configure a port for ingress rate policing. */
    693 extern int bcmx_port_rate_ingress_get(
    694     bcmx_lport_t port, 
    695     uint32 *kbits_sec, 
    696     uint32 *kbits_burst);
    697 
    698 /* 
    699  * Configure a port's ingress rate limiting pause frame control
    700  * parameters.
    701  */
    702 extern int bcmx_port_rate_pause_set(
    703     bcmx_lport_t port, 
    704     uint32 kbits_pause, 
    705     uint32 kbits_resume);
    706 
    707 /* 
    708  * Configure a port's ingress rate limiting pause frame control
    709  * parameters.
    710  */
    711 extern int bcmx_port_rate_pause_get(
    712     bcmx_lport_t port, 
    713     uint32 *kbits_pause, 
    714     uint32 *kbits_resume);
    715 
    716 /* Control the sampling of packets ingressing or egressing a port. */
    717 extern int bcmx_port_sample_rate_set(
    718     bcm_port_t port, 
    719     int ingress_rate, 
    720     int egress_rate);
    721 
    722 /* Control the sampling of packets ingressing or egressing a port. */
    723 extern int bcmx_port_sample_rate_get(
    724     bcm_port_t port, 
    725     int *ingress_rate, 
    726     int *egress_rate);
    727 
    728 /* Set or retrieve the current double tagging mode for a port. */
    729 extern int bcmx_port_dtag_mode_set(
    730     bcmx_lport_t port, 
    731     int mode);
    732 
    733 /* Set or retrieve the current double tagging mode for a port. */
    734 extern int bcmx_port_dtag_mode_get(
    735     bcmx_lport_t port, 
    736     int *mode);
    737 
    738 /* Set the default tag protocol ID (TPID) for the specified port. */
    739 extern int bcmx_port_tpid_set(
    740     bcmx_lport_t port, 
    741     uint16 tpid);
    742 
    743 /* Set the default tag protocol ID (TPID) for the specified port. */
    744 extern int bcmx_port_tpid_get(
    745     bcmx_lport_t port, 
    746     uint16 *tpid);
    747 
    748 /* Add an allowed outer tag protocol ID (TPID) for the specified port. */
    749 extern int bcmx_port_tpid_add(
    750     bcmx_lport_t port, 
    751     uint16 tpid, 
    752     int color_select);
    753 
    754 /* Delete allowed outer tag protocol ID (TPID) for the specified port. */
    755 extern int bcmx_port_tpid_delete(
    756     bcmx_lport_t port, 
    757     uint16 tpid);
    758 
    759 /* Delete allowed outer tag protocol ID (TPID) for the specified port. */
    760 extern int bcmx_port_tpid_delete_all(
    761     bcmx_lport_t port);
    762 
    763 /* Set the default tag protocol ID (TPID) for the specified port. */
    764 extern int bcmx_port_inner_tpid_set(
    765     bcmx_lport_t port, 
    766     uint16 tpid);
    767 
    768 /* Set the default tag protocol ID (TPID) for the specified port. */
    769 extern int bcmx_port_inner_tpid_get(
    770     bcmx_lport_t port, 
    771     uint16 *tpid);
    772 
    773 /* Perform cable diagnostics on the specified port. */
    774 extern int bcmx_port_cable_diag(
    775     bcmx_lport_t port, 
    776     bcm_port_cable_diag_t *status);
    777 
    778 /* Get or set the L3 unicast packet modification operations of a port. */
    779 extern int bcmx_port_l3_modify_set(
    780     bcmx_lport_t port, 
    781     uint32 flags);
    782 
    783 /* Get or set the L3 unicast packet modification operations of a port. */
    784 extern int bcmx_port_l3_modify_get(
    785     bcmx_lport_t port, 
    786     uint32 *flags);
    787 
    788 /* Get or set the L3 multicast packet modification operations of a port. */
    789 extern int bcmx_port_ipmc_modify_set(
    790     bcmx_lport_t port, 
    791     uint32 flags);
    792 
    793 /* Get or set the L3 multicast packet modification operations of a port. */
    794 extern int bcmx_port_ipmc_modify_get(
    795     bcmx_lport_t port, 
    796     uint32 *flags);
    797 
    798 /* Get or set multiple port characteristics. */
    799 extern int bcmx_port_info_get(
    800     bcmx_lport_t port, 
    801     bcm_port_info_t *info);
    802 
    803 /* Get or set multiple port characteristics. */
    804 extern int bcmx_port_info_set(
    805     bcmx_lport_t port, 
    806     bcm_port_info_t *info);
    807 
    808 /* Get or set multiple port characteristics. */
    809 extern int bcmx_port_selective_get(
    810     bcmx_lport_t port, 
    811     bcm_port_info_t *info);
    812 
    813 /* Get or set multiple port characteristics. */
    814 extern int bcmx_port_selective_set(
    815     bcmx_lport_t port, 
    816     bcm_port_info_t *info);
    817 
    818 /* Get or set multiple port characteristics. */
    819 extern int bcmx_port_info_restore(
    820     bcmx_lport_t port, 
    821     bcm_port_info_t *info);
    822 
    823 /* Get or set multiple port characteristics. */
    824 extern int bcmx_port_info_save(
    825     bcmx_lport_t port, 
    826     bcm_port_info_t *info);
    827 
    828 /* Get link fault type. */
    829 extern int bcmx_port_fault_get(
    830     bcmx_lport_t port, 
    831     uint32 *flags);
    832 
    833 /* Populate the port list based on flags. */
    834 extern int bcmx_port_lplist_populate(
    835     bcmx_lplist_t *list, 
    836     uint32 flags);
    837 
    838 /* Set or retrieve color assignment for a given port and priority. */
    839 extern int bcmx_port_priority_color_set(
    840     bcmx_lport_t port, 
    841     int prio, 
    842     bcm_color_t color);
    843 
    844 /* Set or retrieve color assignment for a given port and priority. */
    845 extern int bcmx_port_priority_color_get(
    846     bcmx_lport_t port, 
    847     int prio, 
    848     bcm_color_t *color);
    849 
    850 /* Set or retrieve color assignment for a given port and CFI. */
    851 extern int bcmx_port_cfi_color_set(
    852     bcmx_lport_t port, 
    853     int cfi, 
    854     bcm_color_t color);
    855 
    856 /* Set or retrieve color assignment for a given port and CFI. */
    857 extern int bcmx_port_cfi_color_get(
    858     bcmx_lport_t port, 
    859     int cfi, 
    860     bcm_color_t *color);
    861 
    862 /* 
    863  * Map the incoming packet priority and CFI to internal priority and
    864  * color.
    865  */
    866 extern int bcmx_port_vlan_priority_map_set(
    867     bcmx_lport_t port, 
    868     int pkt_pri, 
    869     int cfi, 
    870     int internal_pri, 
    871     bcm_color_t color);
    872 
    873 /* 
    874  * Map the incoming packet priority and CFI to internal priority and
    875  * color.
    876  */
    877 extern int bcmx_port_vlan_priority_map_get(
    878     bcmx_lport_t port, 
    879     int pkt_pri, 
    880     int cfi, 
    881     int *internal_pri, 
    882     bcm_color_t *color);
    883 
    884 /* 
    885  * Map the internal priority and color to outgoing packet priority and
    886  * CFI.
    887  */
    888 extern int bcmx_port_vlan_priority_unmap_set(
    889     bcmx_lport_t port, 
    890     int internal_pri, 
    891     bcm_color_t color, 
    892     int pkt_pri, 
    893     int cfi);
    894 
    895 /* 
    896  * Map the internal priority and color to outgoing packet priority and
    897  * CFI.
    898  */
    899 extern int bcmx_port_vlan_priority_unmap_get(
    900     bcmx_lport_t port, 
    901     int internal_pri, 
    902     bcm_color_t color, 
    903     int *pkt_pri, 
    904     int *cfi);
    905 
    906 /* Set the inner tag value to be added to the outgoing packet. */
    907 extern int bcmx_port_vlan_inner_tag_set(
    908     bcmx_lport_t port, 
    909     uint16 inner_tag);
    910 
    911 /* Set the inner tag value to be added to the outgoing packet. */
    912 extern int bcmx_port_vlan_inner_tag_get(
    913     bcmx_lport_t port, 
    914     uint16 *inner_tag);
    915 
    916 /* 
    917  * Set or get port classification ID to aggregate a group of ports for
    918  * further processing such as Vlan translation and field processing.
    919  */
    920 extern int bcmx_port_class_set(
    921     bcmx_lport_t port, 
    922     bcm_port_class_t pclass, 
    923     uint32 class_id);
    924 
    925 /* 
    926  * Set or get port classification ID to aggregate a group of ports for
    927  * further processing such as Vlan translation and field processing.
    928  */
    929 extern int bcmx_port_class_get(
    930     bcmx_lport_t port, 
    931     bcm_port_class_t pclass, 
    932     uint32 *class_id);
    933 
    934 /* Get or set various features at the port level. */
    935 extern int bcmx_port_control_set(
    936     bcmx_lport_t port, 
    937     bcm_port_control_t type, 
    938     int value);
    939 
    940 /* Get or set various features at the port level. */
    941 extern int bcmx_port_control_get(
    942     bcmx_lport_t port, 
    943     bcm_port_control_t type, 
    944     int *value);
    945 
    946 /* 
    947  * Given a controlling port, this API returns the set of ancillary
    948  * ports belonging to the group (port block) that can be configured to
    949  * operate
    950  * either as a single high-speed port or multiple GE ports. If the input
    951  * port is
    952  * not a controlling port BCM_E_PORT error will be returned.
    953  */
    954 extern int bcmx_port_subsidiary_ports_get(
    955     bcm_gport_t port, 
    956     bcmx_lplist_t *lplist);
    957 
    958 /* Set congestion mode. */
    959 extern int bcmx_port_congestion_config_set(
    960     bcm_gport_t port, 
    961     bcmx_port_congestion_config_t *config);
    962 
    963 /* Get congestion mode. */
    964 extern int bcmx_port_congestion_config_get(
    965     bcm_gport_t port, 
    966     bcmx_port_congestion_config_t *config);
    967 
    968 /* Set/Get PHY specific configurations. */
    969 extern int bcmx_port_phy_control_set(
    970     bcmx_lport_t port, 
    971     bcm_port_phy_control_t type, 
    972     uint32 value);
    973 
    974 /* Set/Get PHY specific configurations. */
    975 extern int bcmx_port_phy_control_get(
    976     bcmx_lport_t port, 
    977     bcm_port_phy_control_t type, 
    978     uint32 *value);
    979 
    980 /* Get the GPORT ID for the specified physical port. */
    981 extern int bcmx_port_gport_get(
    982     bcmx_lport_t port, 
    983     bcm_gport_t *gport);
    984 
    985 /* Enable/disable packet and byte counters for the selected gport. */
    986 extern int bcmx_port_stat_enable_set(
    987     bcm_gport_t port, 
    988     int enable);
    989 
    990 /* Get 64-bit counter value for specified port statistic type. */
    991 extern int bcmx_port_stat_get(
    992     bcm_gport_t port, 
    993     bcm_port_stat_t stat, 
    994     uint64 *val);
    995 
    996 /* Get lower 32-bit counter value for specified port statistic type. */
    997 extern int bcmx_port_stat_get32(
    998     bcm_gport_t port, 
    999     bcm_port_stat_t stat, 
   1000     uint32 *val);
   1001 
   1002 /* Set 64-bit counter value for specified port statistic type. */
   1003 extern int bcmx_port_stat_set(
   1004     bcm_gport_t port, 
   1005     bcm_port_stat_t stat, 
   1006     uint64 val);
   1007 
   1008 /* Set lower 32-bit counter value for specified port statistic type. */
   1009 extern int bcmx_port_stat_set32(
   1010     bcm_gport_t port, 
   1011     bcm_port_stat_t stat, 
   1012     uint32 val);
   1013 
   1014 /* Get 64-bit counter value for multiple port statistic types. */
   1015 extern int bcmx_port_stat_multi_get(
   1016     bcm_gport_t port, 
   1017     int nstat, 
   1018     bcm_port_stat_t *stat_arr, 
   1019     uint64 *value_arr);
   1020 
   1021 /* Get lower 32-bit counter value for multiple port statistic types. */
   1022 extern int bcmx_port_stat_multi_get32(
   1023     bcm_gport_t port, 
   1024     int nstat, 
   1025     bcm_port_stat_t *stat_arr, 
   1026     uint32 *value_arr);
   1027 
   1028 /* Set 64-bit counter value for multiple port statistic types. */
   1029 extern int bcmx_port_stat_multi_set(
   1030     bcm_gport_t port, 
   1031     int nstat, 
   1032     bcm_port_stat_t *stat_arr, 
   1033     uint64 *value_arr);
   1034 
   1035 /* Set lower 32-bit counter value for multiple port statistic types. */
   1036 extern int bcmx_port_stat_multi_set32(
   1037     bcm_gport_t port, 
   1038     int nstat, 
   1039     bcm_port_stat_t *stat_arr, 
   1040     uint32 *value_arr);
   1041 
   1042 /* Add a match to an existing port */
   1043 extern int bcmx_port_match_add(
   1044     bcm_gport_t port, 
   1045     bcmx_port_match_info_t *match);
   1046 
   1047 /* Remove a match from an existing port */
   1048 extern int bcmx_port_match_delete(
   1049     bcm_gport_t port, 
   1050     bcmx_port_match_info_t *match);
   1051 
   1052 /* Replace an old match with a new one for an existing port */
   1053 extern int bcmx_port_match_replace(
   1054     bcm_gport_t port, 
   1055     bcmx_port_match_info_t *old_match, 
   1056     bcmx_port_match_info_t *new_match);
   1057 
   1058 /* Get all the matches for an existing port */
   1059 extern int bcmx_port_match_multi_get(
   1060     bcm_gport_t port, 
   1061     int size, 
   1062     bcmx_port_match_info_t *match_array, 
   1063     int *count);
   1064 
   1065 /* Assign a set of matches to an existing port */
   1066 extern int bcmx_port_match_set(
   1067     bcm_gport_t port, 
   1068     int size, 
   1069     bcmx_port_match_info_t *match_array);
   1070 
   1071 /* Delete all matches for an existing port */
   1072 extern int bcmx_port_match_delete_all(
   1073     bcm_gport_t port);
   1074 
   1075 extern int bcmx_port_phy_timesync_config_set(
   1076     bcm_gport_t port, 
   1077     bcmx_port_phy_timesync_config_t *conf);
   1078 
   1079 extern int bcmx_port_phy_timesync_config_get(
   1080     bcm_gport_t port, 
   1081     bcmx_port_phy_timesync_config_t *conf);
   1082 
   1083 extern int bcmx_port_control_phy_timesync_set(
   1084     bcm_gport_t port, 
   1085     bcm_port_control_phy_timesync_t type, 
   1086     uint64 value);
   1087 
   1088 extern int bcmx_port_control_phy_timesync_get(
   1089     bcm_gport_t port, 
   1090     bcm_port_control_phy_timesync_t type, 
   1091     uint64 *value);
   1092 
   1093 extern int bcmx_port_phy_timesync_enhanced_capture_get(
   1094     bcm_gport_t port, 
   1095     bcmx_port_phy_timesync_enhanced_capture_t *conf);
   1096 
   1097 #endif /* __BCMX_PORT_H__ */