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

vlan.h (22840B)


      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_VLAN_H__
     14 #define __BCMX_VLAN_H__
     15 
     16 #include <bcm/types.h>
     17 #include <bcmx/bcmx.h>
     18 #include <bcmx/lplist.h>
     19 #include <bcm/vlan.h>
     20 
     21 typedef struct bcmx_vlan_data_s {
     22     bcm_vlan_t vlan_tag; 
     23     bcmx_lplist_t port_bitmap; 
     24     bcmx_lplist_t ut_port_bitmap; 
     25 } bcmx_vlan_data_t;
     26 
     27 typedef struct bcmx_vlan_block_s {
     28     bcmx_lplist_t known_multicast; 
     29     bcmx_lplist_t unknown_multicast; 
     30     bcmx_lplist_t unknown_unicast; 
     31     bcmx_lplist_t broadcast; 
     32 } bcmx_vlan_block_t;
     33 
     34 typedef bcm_vlan_port_t bcmx_vlan_port_t;
     35 
     36 /* Initialize a VLAN block structure. */
     37 extern void bcmx_vlan_block_t_init(
     38     bcmx_vlan_block_t *data);
     39 
     40 /* Initialize the VLAN port structure. */
     41 extern void bcmx_vlan_port_t_init(
     42     bcmx_vlan_port_t *vlan_port);
     43 
     44 /* Allocate and configure a VLAN on the BCM device. */
     45 extern int bcmx_vlan_create(
     46     bcm_vlan_t vid);
     47 
     48 /* Deallocate VLAN from the BCM device. */
     49 extern int bcmx_vlan_destroy(
     50     bcm_vlan_t vid);
     51 
     52 /* Destroy all VLANs except the default VLAN. */
     53 extern int bcmx_vlan_destroy_all(void);
     54 
     55 /* Add ports to the specified vlan. */
     56 extern int bcmx_vlan_port_add(
     57     bcm_vlan_t vid, 
     58     bcmx_lplist_t lplist, 
     59     bcmx_lplist_t ubmp);
     60 
     61 /* Remove ports from a specified vlan. */
     62 extern int bcmx_vlan_port_remove(
     63     bcm_vlan_t vid, 
     64     bcmx_lplist_t lplist);
     65 
     66 /* Retrieves a list of the member ports of an existing VLAN. */
     67 extern int bcmx_vlan_port_get(
     68     bcm_vlan_t vid, 
     69     bcmx_lplist_t *lplist, 
     70     bcmx_lplist_t *ubmp);
     71 
     72 /* Get the default VLAN ID. */
     73 extern int bcmx_vlan_default_get(
     74     bcm_vlan_t *vid_ptr);
     75 
     76 /* Set the default VLAN ID. */
     77 extern int bcmx_vlan_default_set(
     78     bcm_vlan_t vid);
     79 
     80 /* Retrieve the VTABLE STG for the specified vlan. */
     81 extern int bcmx_vlan_stg_get(
     82     bcm_vlan_t vid, 
     83     bcm_stg_t *stg_ptr);
     84 
     85 /* Update the VTABLE STG for the specified vlan. */
     86 extern int bcmx_vlan_stg_set(
     87     bcm_vlan_t vid, 
     88     bcm_stg_t stg);
     89 
     90 /* Add a Gport to the specified vlan. */
     91 extern int bcmx_vlan_gport_add(
     92     bcm_vlan_t vlan, 
     93     bcm_gport_t port, 
     94     int flags);
     95 
     96 /* Remove a Gport from the specified vlan. */
     97 extern int bcmx_vlan_gport_delete(
     98     bcm_vlan_t vlan, 
     99     bcm_gport_t port);
    100 
    101 /* Remove all ports from the specified vlan. */
    102 extern int bcmx_vlan_gport_delete_all(
    103     bcm_vlan_t vlan);
    104 
    105 /* Get a Gport from the specified vlan. */
    106 extern int bcmx_vlan_gport_get(
    107     bcm_vlan_t vlan, 
    108     bcm_gport_t port, 
    109     int *flags);
    110 
    111 /* Get all Gports from the specified vlan. */
    112 extern int bcmx_vlan_gport_get_all(
    113     bcm_vlan_t vlan, 
    114     int array_max, 
    115     bcm_gport_t *gport_array, 
    116     int *flags_array, 
    117     int *array_size);
    118 
    119 /* Get or set the port's default VLAN tag actions. */
    120 extern int bcmx_vlan_port_default_action_get(
    121     bcmx_lport_t port, 
    122     bcm_vlan_action_set_t *action);
    123 
    124 /* Get or set the port's default VLAN tag actions. */
    125 extern int bcmx_vlan_port_default_action_set(
    126     bcmx_lport_t port, 
    127     bcm_vlan_action_set_t *action);
    128 
    129 /* Delete the port's default VLAN tag action. */
    130 extern int bcmx_vlan_port_default_action_delete(
    131     bcmx_lport_t port);
    132 
    133 /* Get or set the egress default VLAN tag actions. */
    134 extern int bcmx_vlan_port_egress_default_action_get(
    135     bcmx_lport_t port, 
    136     bcm_vlan_action_set_t *action);
    137 
    138 /* Get or set the egress default VLAN tag actions. */
    139 extern int bcmx_vlan_port_egress_default_action_set(
    140     bcmx_lport_t port, 
    141     bcm_vlan_action_set_t *action);
    142 
    143 /* Deletes the egress default VLAN tag actions. */
    144 extern int bcmx_vlan_port_egress_default_action_delete(
    145     bcmx_lport_t port);
    146 
    147 /* 
    148  * Add protocol based VLAN with specified action. If the entry already
    149  * exists, update the action.
    150  */
    151 extern int bcmx_vlan_port_protocol_action_add(
    152     bcmx_lport_t port, 
    153     bcm_port_frametype_t frame, 
    154     bcm_port_ethertype_t ether, 
    155     bcm_vlan_action_set_t *action);
    156 
    157 /* Get protocol based VLAN action. */
    158 extern int bcmx_vlan_port_protocol_action_get(
    159     bcmx_lport_t port, 
    160     bcm_port_frametype_t frame, 
    161     bcm_port_ethertype_t ether, 
    162     bcm_vlan_action_set_t *action);
    163 
    164 /* Delete protocol based VLAN action. */
    165 extern int bcmx_vlan_port_protocol_action_delete(
    166     bcmx_lport_t port, 
    167     bcm_port_frametype_t frame, 
    168     bcm_port_ethertype_t ether);
    169 
    170 /* Delete all protocol based VLAN actions. */
    171 extern int bcmx_vlan_port_protocol_action_delete_all(
    172     bcmx_lport_t port);
    173 
    174 /* 
    175  * Add an association from MAC address to VLAN, used  for VLAN tag
    176  *             assignment to untagged packets.
    177  */
    178 extern int bcmx_vlan_mac_add(
    179     bcm_mac_t mac, 
    180     bcm_vlan_t vid, 
    181     int prio);
    182 
    183 /* Remove an association from MAC address to VLAN. */
    184 extern int bcmx_vlan_mac_delete(
    185     bcm_mac_t mac);
    186 
    187 /* Remove all associations from MAC addresses to VLAN. */
    188 extern int bcmx_vlan_mac_delete_all(void);
    189 
    190 /* 
    191  * Add an association from MAC address to VLAN actions, which are
    192  *             used for VLAN tag/s assignment to untagged packets.
    193  */
    194 extern int bcmx_vlan_mac_action_add(
    195     bcm_mac_t mac, 
    196     bcm_vlan_action_set_t *action);
    197 
    198 /* 
    199  * Retrive an association from MAC address to VLAN actions, which
    200  *             are used for VLAN tag assignment to untagged packets.
    201  */
    202 extern int bcmx_vlan_mac_action_get(
    203     bcm_mac_t mac, 
    204     bcm_vlan_action_set_t *action);
    205 
    206 /* 
    207  * Remove an association from MAC address to VLAN actions, which
    208  *             are used for VLAN tag assignment to untagged packets.
    209  */
    210 extern int bcmx_vlan_mac_action_delete(
    211     bcm_mac_t mac);
    212 
    213 /* 
    214  * Remove all MAC addresses to VLAN actions associations.
    215  *             Mac to VLAN actions are used for VLAN tag assignment
    216  *             to untagged packets.
    217  */
    218 extern int bcmx_vlan_mac_action_delete_all(void);
    219 
    220 /* Add an entry to the VLAN Translation table. */
    221 extern int bcmx_vlan_translate_add(
    222     bcmx_lport_t port, 
    223     bcm_vlan_t old_vid, 
    224     bcm_vlan_t new_vid, 
    225     int prio);
    226 
    227 /* Add an entry to the VLAN Translation table. */
    228 extern int bcmx_vlan_translate_get(
    229     bcmx_lport_t port, 
    230     bcm_vlan_t old_vid, 
    231     bcm_vlan_t *new_vid, 
    232     int *prio);
    233 
    234 /* Delete an entry or entries from the VLAN Translation table. */
    235 extern int bcmx_vlan_translate_delete(
    236     bcmx_lport_t port, 
    237     bcm_vlan_t old_vid);
    238 
    239 /* Remove all entries from the VLAN Translation table. */
    240 extern int bcmx_vlan_translate_delete_all(void);
    241 
    242 /* Add an entry to the VLAN Translation table and assign VLAN actions. */
    243 extern int bcmx_vlan_translate_action_add(
    244     bcm_gport_t port, 
    245     bcm_vlan_translate_key_t key_type, 
    246     bcm_vlan_t outer_vlan, 
    247     bcm_vlan_t inner_vlan, 
    248     bcm_vlan_action_set_t *action);
    249 
    250 /* Get an entry to the VLAN Translation table and assign VLAN actions. */
    251 extern int bcmx_vlan_translate_action_get(
    252     bcm_gport_t port, 
    253     bcm_vlan_translate_key_t key_type, 
    254     bcm_vlan_t outer_vlan, 
    255     bcm_vlan_t inner_vlan, 
    256     bcm_vlan_action_set_t *action);
    257 
    258 /* Delete an entry from the VLAN Translation table. */
    259 extern int bcmx_vlan_translate_action_delete(
    260     bcm_gport_t port, 
    261     bcm_vlan_translate_key_t key_type, 
    262     bcm_vlan_t outer_vlan, 
    263     bcm_vlan_t inner_vlan);
    264 
    265 /* Add an entry to the egress VLAN Translation table. */
    266 extern int bcmx_vlan_translate_egress_add(
    267     bcmx_lport_t port, 
    268     bcm_vlan_t old_vid, 
    269     bcm_vlan_t new_vid, 
    270     int prio);
    271 
    272 /* Get an entry to the egress VLAN Translation table. */
    273 extern int bcmx_vlan_translate_egress_get(
    274     bcmx_lport_t port, 
    275     bcm_vlan_t old_vid, 
    276     bcm_vlan_t *new_vid, 
    277     int *prio);
    278 
    279 /* Remove an entry or entries from the VLAN egress Translation table. */
    280 extern int bcmx_vlan_translate_egress_delete(
    281     bcmx_lport_t port, 
    282     bcm_vlan_t old_vid);
    283 
    284 /* Remove all entries from the egress VLAN Translation table. */
    285 extern int bcmx_vlan_translate_egress_delete_all(void);
    286 
    287 /* 
    288  * Add an entry to the egress VLAN Translation table and assign VLAN
    289  * actions.
    290  */
    291 extern int bcmx_vlan_translate_egress_action_add(
    292     int port_class, 
    293     bcm_vlan_t outer_vlan, 
    294     bcm_vlan_t inner_vlan, 
    295     bcm_vlan_action_set_t *action);
    296 
    297 /* 
    298  * Get an entry to the egress VLAN Translation table and assign VLAN
    299  * actions.
    300  */
    301 extern int bcmx_vlan_translate_egress_action_get(
    302     int port_class, 
    303     bcm_vlan_t outer_vlan, 
    304     bcm_vlan_t inner_vlan, 
    305     bcm_vlan_action_set_t *action);
    306 
    307 /* Delete an entry from the egress VLAN Translation table. */
    308 extern int bcmx_vlan_translate_egress_action_delete(
    309     int port_class, 
    310     bcm_vlan_t outer_vlan, 
    311     bcm_vlan_t inner_vlan);
    312 
    313 /* Add an entry to the VLAN Translation table for double-tagging. */
    314 extern int bcmx_vlan_dtag_add(
    315     bcmx_lport_t port, 
    316     bcm_vlan_t old_vid, 
    317     bcm_vlan_t new_vid, 
    318     int prio);
    319 
    320 /* Get an entry to the VLAN Translation table for double-tagging. */
    321 extern int bcmx_vlan_dtag_get(
    322     bcmx_lport_t port, 
    323     bcm_vlan_t old_vid, 
    324     bcm_vlan_t *new_vid, 
    325     int *prio);
    326 
    327 /* Remove an entry from the VLAN Translation table for double-tagging. */
    328 extern int bcmx_vlan_dtag_delete(
    329     bcmx_lport_t port, 
    330     bcm_vlan_t old_vid);
    331 
    332 /* Remove all entries from the VLAN Translation table for double-tagging. */
    333 extern int bcmx_vlan_dtag_delete_all(void);
    334 
    335 /* Add a VLAN range to the VLAN Translation table. */
    336 extern int bcmx_vlan_translate_range_add(
    337     bcmx_lport_t port, 
    338     bcm_vlan_t old_vid_low, 
    339     bcm_vlan_t old_vid_high, 
    340     bcm_vlan_t new_vid, 
    341     int int_prio);
    342 
    343 /* Get a VLAN range to the VLAN Translation table. */
    344 extern int bcmx_vlan_translate_range_get(
    345     bcmx_lport_t port, 
    346     bcm_vlan_t old_vid_low, 
    347     bcm_vlan_t old_vid_high, 
    348     bcm_vlan_t *new_vid, 
    349     int *int_prio);
    350 
    351 /* Delete a VLAN range from the VLAN Translation table. */
    352 extern int bcmx_vlan_translate_range_delete(
    353     bcmx_lport_t port, 
    354     bcm_vlan_t old_vid_low, 
    355     bcm_vlan_t old_vid_high);
    356 
    357 /* Remove all VLAN ranges from the VLAN Translation table. */
    358 extern int bcmx_vlan_translate_range_delete_all(void);
    359 
    360 /* Add VLAN range to the VLAN Translation table for double-tagging. */
    361 extern int bcmx_vlan_dtag_range_add(
    362     bcmx_lport_t port, 
    363     bcm_vlan_t old_vid_low, 
    364     bcm_vlan_t old_vid_high, 
    365     bcm_vlan_t new_vid, 
    366     int int_prio);
    367 
    368 /* Get VLAN range to the VLAN Translation table for double-tagging. */
    369 extern int bcmx_vlan_dtag_range_get(
    370     bcmx_lport_t port, 
    371     bcm_vlan_t old_vid_low, 
    372     bcm_vlan_t old_vid_high, 
    373     bcm_vlan_t *new_vid, 
    374     int *prio);
    375 
    376 /* 
    377  * Remove a VLAN range from the VLAN Translation table for
    378  * double-tagging.
    379  */
    380 extern int bcmx_vlan_dtag_range_delete(
    381     bcmx_lport_t port, 
    382     bcm_vlan_t old_vid_low, 
    383     bcm_vlan_t old_vid_high);
    384 
    385 /* 
    386  * Remove all VLAN ranges from the VLAN Translation table for
    387  * double-tagging.
    388  */
    389 extern int bcmx_vlan_dtag_range_delete_all(void);
    390 
    391 extern int bcmx_vlan_translate_action_range_add(
    392     bcm_gport_t port, 
    393     bcm_vlan_t outer_vlan_low, 
    394     bcm_vlan_t outer_vlan_high, 
    395     bcm_vlan_t inner_vlan_low, 
    396     bcm_vlan_t inner_vlan_high, 
    397     bcm_vlan_action_set_t *action);
    398 
    399 extern int bcmx_vlan_translate_action_range_get(
    400     bcm_gport_t port, 
    401     bcm_vlan_t outer_vlan_low, 
    402     bcm_vlan_t outer_vlan_high, 
    403     bcm_vlan_t inner_vlan_low, 
    404     bcm_vlan_t inner_vlan_high, 
    405     bcm_vlan_action_set_t *action);
    406 
    407 extern int bcmx_vlan_translate_action_range_delete(
    408     bcm_gport_t port, 
    409     bcm_vlan_t outer_vlan_low, 
    410     bcm_vlan_t outer_vlan_high, 
    411     bcm_vlan_t inner_vlan_low, 
    412     bcm_vlan_t inner_vlan_high);
    413 
    414 extern int bcmx_vlan_translate_action_range_delete_all(void);
    415 
    416 /* 
    417  * Add an association from IP subnet to VLAN to use for assigning a VLAN
    418  * tag to untagged packets.
    419  */
    420 extern int bcmx_vlan_ip_add(
    421     bcm_vlan_ip_t *vlan_ip);
    422 
    423 /* Remove an association from IP subnet to VLAN. */
    424 extern int bcmx_vlan_ip_delete(
    425     bcm_vlan_ip_t *vlan_ip);
    426 
    427 /* Remove all associations from IP subnet to VLAN. */
    428 extern int bcmx_vlan_ip_delete_all(void);
    429 
    430 /* 
    431  * Add an association from IP subnet to VLAN actions to use for assigning
    432  * VLAN tag actions to untagged packets.
    433  */
    434 extern int bcmx_vlan_ip_action_add(
    435     bcm_vlan_ip_t *vlan_ip, 
    436     bcm_vlan_action_set_t *action);
    437 
    438 /* 
    439  * Get an association from IP subnet to VLAN actions to use for assigning
    440  * VLAN tag actions to untagged packets.
    441  */
    442 extern int bcmx_vlan_ip_action_get(
    443     bcm_vlan_ip_t *vlan_ip, 
    444     bcm_vlan_action_set_t *action);
    445 
    446 /* 
    447  * Delete an association from IP subnet to VLAN actions to use for
    448  * assigning VLAN tag actions to untagged packets.
    449  */
    450 extern int bcmx_vlan_ip_action_delete(
    451     bcm_vlan_ip_t *vlan_ip);
    452 
    453 /* 
    454  * Delete all associations from IP subnet to VLAN actions to use for
    455  * assigning VLAN tag actions to untagged packets.
    456  */
    457 extern int bcmx_vlan_ip_action_delete_all(void);
    458 
    459 /* Set/get miscellaneous VLAN-specific chip options. */
    460 extern int bcmx_vlan_control_get(
    461     bcm_vlan_control_t type, 
    462     int *arg);
    463 
    464 /* Set/get miscellaneous VLAN-specific chip options. */
    465 extern int bcmx_vlan_control_set(
    466     bcm_vlan_control_t type, 
    467     int arg);
    468 
    469 /* Set/get miscellaneous port-specific VLAN options. */
    470 extern int bcmx_vlan_control_port_get(
    471     bcmx_lport_t port, 
    472     bcm_vlan_control_port_t type, 
    473     int *arg);
    474 
    475 /* Set/get miscellaneous port-specific VLAN options. */
    476 extern int bcmx_vlan_control_port_set(
    477     bcmx_lport_t port, 
    478     bcm_vlan_control_port_t type, 
    479     int arg);
    480 
    481 /* Set or retrieve the current vlan multicast flood behavior. */
    482 extern int bcmx_vlan_mcast_flood_get(
    483     bcm_vlan_t vlan, 
    484     bcm_vlan_mcast_flood_t *mode);
    485 
    486 /* Set or retrieve the current vlan multicast flood behavior. */
    487 extern int bcmx_vlan_mcast_flood_set(
    488     bcm_vlan_t vlan, 
    489     bcm_vlan_mcast_flood_t mode);
    490 
    491 /* Set or retrieve current vlan properties. */
    492 extern int bcmx_vlan_control_vlan_get(
    493     bcm_vlan_t vlan, 
    494     bcm_vlan_control_vlan_t *control);
    495 
    496 /* Set or retrieve current vlan properties. */
    497 extern int bcmx_vlan_control_vlan_set(
    498     bcm_vlan_t vlan, 
    499     bcm_vlan_control_vlan_t control);
    500 
    501 /* Set vlan_control_vlan flags over a vlan vector. */
    502 extern int bcmx_vlan_vector_flags_set(
    503     bcm_vlan_vector_t vlan_vector, 
    504     uint32 flags_mask, 
    505     uint32 flags_value);
    506 
    507 /* Retrieve vlan block properties. */
    508 extern int bcmx_vlan_block_get(
    509     bcm_vlan_t vlan, 
    510     bcmx_vlan_block_t *vlan_block);
    511 
    512 /* Set vlan block properties. */
    513 extern int bcmx_vlan_block_set(
    514     bcm_vlan_t vlan, 
    515     bcmx_vlan_block_t *vlan_block);
    516 
    517 extern int bcmx_vlan_cross_connect_add(
    518     bcm_vlan_t outer_vlan, 
    519     bcm_vlan_t inner_vlan, 
    520     bcm_gport_t port_1, 
    521     bcm_gport_t port_2);
    522 
    523 extern int bcmx_vlan_cross_connect_delete(
    524     bcm_vlan_t outer_vlan, 
    525     bcm_vlan_t inner_vlan);
    526 
    527 extern int bcmx_vlan_cross_connect_delete_all(void);
    528 
    529 /* Enable/disable collection of statistics on the indicated VLAN. */
    530 extern int bcmx_vlan_stat_enable_set(
    531     bcm_vlan_t vlan, 
    532     int enable);
    533 
    534 /* Get 64-bit counter value for multiple VLAN statistic types. */
    535 extern int bcmx_vlan_stat_multi_get(
    536     bcm_vlan_t vlan, 
    537     bcm_cos_t cos, 
    538     int nstat, 
    539     bcm_vlan_stat_t *stat_arr, 
    540     uint64 *value_arr);
    541 
    542 /* Get lower 32-bit counter value for multiple VLAN statistic types. */
    543 extern int bcmx_vlan_stat_multi_get32(
    544     bcm_vlan_t vlan, 
    545     bcm_cos_t cos, 
    546     int nstat, 
    547     bcm_vlan_stat_t *stat_arr, 
    548     uint32 *value_arr);
    549 
    550 /* Set 64-bit counter value for multiple VLAN statistic types. */
    551 extern int bcmx_vlan_stat_multi_set(
    552     bcm_vlan_t vlan, 
    553     bcm_cos_t cos, 
    554     int nstat, 
    555     bcm_vlan_stat_t *stat_arr, 
    556     uint64 *value_arr);
    557 
    558 /* Set lower 32-bit counter value for multiple VLAN statistic types. */
    559 extern int bcmx_vlan_stat_multi_set32(
    560     bcm_vlan_t vlan, 
    561     bcm_cos_t cos, 
    562     int nstat, 
    563     bcm_vlan_stat_t *stat_arr, 
    564     uint32 *value_arr);
    565 
    566 /* Extract ingress VLAN translation statistics from the chip. */
    567 extern int bcmx_vlan_translate_stat_get(
    568     bcm_gport_t port, 
    569     bcm_vlan_translate_key_t key_type, 
    570     bcm_vlan_t outer_vlan, 
    571     bcm_vlan_t inner_vlan, 
    572     bcm_vlan_stat_t stat, 
    573     uint64 *val);
    574 
    575 /* Extract ingress VLAN translation statistics from the chip. */
    576 extern int bcmx_vlan_translate_stat_get32(
    577     bcm_gport_t port, 
    578     bcm_vlan_translate_key_t key_type, 
    579     bcm_vlan_t outer_vlan, 
    580     bcm_vlan_t inner_vlan, 
    581     bcm_vlan_stat_t stat, 
    582     uint32 *val);
    583 
    584 /* 
    585  * Set the specified statistic to the indicated value for the specified
    586  * ingress VLAN translation.
    587  */
    588 extern int bcmx_vlan_translate_stat_set(
    589     bcm_gport_t port, 
    590     bcm_vlan_translate_key_t key_type, 
    591     bcm_vlan_t outer_vlan, 
    592     bcm_vlan_t inner_vlan, 
    593     bcm_vlan_stat_t stat, 
    594     uint64 val);
    595 
    596 /* 
    597  * Set the specified statistic to the indicated value for the specified
    598  * ingress VLAN translation.
    599  */
    600 extern int bcmx_vlan_translate_stat_set32(
    601     bcm_gport_t port, 
    602     bcm_vlan_translate_key_t key_type, 
    603     bcm_vlan_t outer_vlan, 
    604     bcm_vlan_t inner_vlan, 
    605     bcm_vlan_stat_t stat, 
    606     uint32 val);
    607 
    608 /* 
    609  * Enable/disable collection of statistics on the indicated ingress VLAN
    610  * translation.
    611  */
    612 extern int bcmx_vlan_translate_stat_enable_set(
    613     bcm_gport_t port, 
    614     bcm_vlan_translate_key_t key_type, 
    615     bcm_vlan_t outer_vlan, 
    616     bcm_vlan_t inner_vlan, 
    617     int enable);
    618 
    619 /* 
    620  * Get 64-bit counter value for multiple ingress VLAN translation
    621  * statistic types.
    622  */
    623 extern int bcmx_vlan_translate_stat_multi_get(
    624     bcm_gport_t port, 
    625     bcm_vlan_translate_key_t key_type, 
    626     bcm_vlan_t outer_vlan, 
    627     bcm_vlan_t inner_vlan, 
    628     int nstat, 
    629     bcm_vlan_stat_t *stat_arr, 
    630     uint64 *value_arr);
    631 
    632 /* 
    633  * Get lower 32-bit counter value for multiple ingress VLAN translation
    634  * statistic types.
    635  */
    636 extern int bcmx_vlan_translate_stat_multi_get32(
    637     bcm_gport_t port, 
    638     bcm_vlan_translate_key_t key_type, 
    639     bcm_vlan_t outer_vlan, 
    640     bcm_vlan_t inner_vlan, 
    641     int nstat, 
    642     bcm_vlan_stat_t *stat_arr, 
    643     uint32 *value_arr);
    644 
    645 /* 
    646  * Set 64-bit counter value for multiple ingress VLAN translation
    647  * statistic types.
    648  */
    649 extern int bcmx_vlan_translate_stat_multi_set(
    650     bcm_gport_t port, 
    651     bcm_vlan_translate_key_t key_type, 
    652     bcm_vlan_t outer_vlan, 
    653     bcm_vlan_t inner_vlan, 
    654     int nstat, 
    655     bcm_vlan_stat_t *stat_arr, 
    656     uint64 *value_arr);
    657 
    658 /* 
    659  * Set lower 32-bit counter value for multiple ingress VLAN translation
    660  * statistic types.
    661  */
    662 extern int bcmx_vlan_translate_stat_multi_set32(
    663     bcm_gport_t port, 
    664     bcm_vlan_translate_key_t key_type, 
    665     bcm_vlan_t outer_vlan, 
    666     bcm_vlan_t inner_vlan, 
    667     int nstat, 
    668     bcm_vlan_stat_t *stat_arr, 
    669     uint32 *value_arr);
    670 
    671 /* Extract egress VLAN translation statistics from the chip. */
    672 extern int bcmx_vlan_translate_egress_stat_get(
    673     int port_class, 
    674     bcm_vlan_t outer_vlan, 
    675     bcm_vlan_t inner_vlan, 
    676     bcm_vlan_stat_t stat, 
    677     uint64 *val);
    678 
    679 /* Extract egress VLAN translation statistics from the chip. */
    680 extern int bcmx_vlan_translate_egress_stat_get32(
    681     int port_class, 
    682     bcm_vlan_t outer_vlan, 
    683     bcm_vlan_t inner_vlan, 
    684     bcm_vlan_stat_t stat, 
    685     uint32 *val);
    686 
    687 /* 
    688  * Set the specified statistic to the indicated value for the specified
    689  * egress VLAN translation.
    690  */
    691 extern int bcmx_vlan_translate_egress_stat_set(
    692     int port_class, 
    693     bcm_vlan_t outer_vlan, 
    694     bcm_vlan_t inner_vlan, 
    695     bcm_vlan_stat_t stat, 
    696     uint64 val);
    697 
    698 /* 
    699  * Set the specified statistic to the indicated value for the specified
    700  * egress VLAN translation.
    701  */
    702 extern int bcmx_vlan_translate_egress_stat_set32(
    703     int port_class, 
    704     bcm_vlan_t outer_vlan, 
    705     bcm_vlan_t inner_vlan, 
    706     bcm_vlan_stat_t stat, 
    707     uint32 val);
    708 
    709 /* 
    710  * Enable/disable collection of statistics on the indicated egress VLAN
    711  * translation.
    712  */
    713 extern int bcmx_vlan_translate_egress_stat_enable_set(
    714     int port_class, 
    715     bcm_vlan_t outer_vlan, 
    716     bcm_vlan_t inner_vlan, 
    717     int enable);
    718 
    719 /* 
    720  * Get 64-bit counter value for multiple egress VLAN translation
    721  * statistic types.
    722  */
    723 extern int bcmx_vlan_translate_egress_stat_multi_get(
    724     int port_class, 
    725     bcm_vlan_t outer_vlan, 
    726     bcm_vlan_t inner_vlan, 
    727     int nstat, 
    728     bcm_vlan_stat_t *stat_arr, 
    729     uint64 *value_arr);
    730 
    731 /* 
    732  * Get lower 32-bit counter value for multiple egress VLAN translation
    733  * statistic types.
    734  */
    735 extern int bcmx_vlan_translate_egress_stat_multi_get32(
    736     int port_class, 
    737     bcm_vlan_t outer_vlan, 
    738     bcm_vlan_t inner_vlan, 
    739     int nstat, 
    740     bcm_vlan_stat_t *stat_arr, 
    741     uint32 *value_arr);
    742 
    743 /* 
    744  * Set 64-bit counter value for multiple egress VLAN translation
    745  * statistic types.
    746  */
    747 extern int bcmx_vlan_translate_egress_stat_multi_set(
    748     int port_class, 
    749     bcm_vlan_t outer_vlan, 
    750     bcm_vlan_t inner_vlan, 
    751     int nstat, 
    752     bcm_vlan_stat_t *stat_arr, 
    753     uint64 *value_arr);
    754 
    755 /* 
    756  * Set lower 32-bit counter value for multiple egress VLAN translation
    757  * statistic types.
    758  */
    759 extern int bcmx_vlan_translate_egress_stat_multi_set32(
    760     int port_class, 
    761     bcm_vlan_t outer_vlan, 
    762     bcm_vlan_t inner_vlan, 
    763     int nstat, 
    764     bcm_vlan_stat_t *stat_arr, 
    765     uint32 *value_arr);
    766 
    767 /* Create a VLAN queue map entry. */
    768 extern int bcmx_vlan_queue_map_create(
    769     uint32 flags, 
    770     int *qmid);
    771 
    772 /* Delete a VLAN queue map entry. */
    773 extern int bcmx_vlan_queue_map_destroy(
    774     int qmid);
    775 
    776 /* Delete all VLAN queue map entries. */
    777 extern int bcmx_vlan_queue_map_destroy_all(void);
    778 
    779 /* Set a VLAN queue map entry. */
    780 extern int bcmx_vlan_queue_map_set(
    781     int qmid, 
    782     int pkt_pri, 
    783     int cfi, 
    784     int queue, 
    785     int color);
    786 
    787 /* Get a VLAN queue map entry. */
    788 extern int bcmx_vlan_queue_map_get(
    789     int qmid, 
    790     int pkt_pri, 
    791     int cfi, 
    792     int *queue, 
    793     int *color);
    794 
    795 /* Attach a queue map object to a VLAN or VFI. */
    796 extern int bcmx_vlan_queue_map_attach(
    797     bcm_vlan_t vlan, 
    798     int qmid);
    799 
    800 /* Get the queue map object which is attached to a VLAN or VFI. */
    801 extern int bcmx_vlan_queue_map_attach_get(
    802     bcm_vlan_t vlan, 
    803     int *qmid);
    804 
    805 /* Detach a queue map object from a VLAN or VFI. */
    806 extern int bcmx_vlan_queue_map_detach(
    807     bcm_vlan_t vlan);
    808 
    809 /* Detach queue map objects from all VLAN or VFI. */
    810 extern int bcmx_vlan_queue_map_detach_all(void);
    811 
    812 /* 
    813  * Create a layer 2 logical port.  Places the ID in the logical port
    814  * descriptor if WITH_ID flag is not provided, uses the ID in the logical
    815  * port descriptor if WITH_ID flag specified.
    816  */
    817 extern int bcmx_vlan_port_create(
    818     bcmx_vlan_port_t *vlan_port);
    819 
    820 /* Destroy a layer 2 logical port. */
    821 extern int bcmx_vlan_port_destroy(
    822     bcm_gport_t gport);
    823 
    824 /* Get/find a layer 2 logical port given the GPORT id or match criteria. */
    825 extern int bcmx_vlan_port_find(
    826     bcmx_vlan_port_t *vlan_port);
    827 
    828 #endif /* __BCMX_VLAN_H__ */