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

stg.h (3375B)


      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 __BCM_STG_H__
     14 #define __BCM_STG_H__
     15 
     16 #include <shared/port.h>
     17 #include <bcm/types.h>
     18 
     19 /* bcm_stg_stp_e */
     20 typedef enum bcm_stg_stp_e {
     21     BCM_STG_STP_DISABLE = _SHR_PORT_STP_DISABLE, /* Disabled. */
     22     BCM_STG_STP_BLOCK = _SHR_PORT_STP_BLOCK, /* BPDUs/no learns. */
     23     BCM_STG_STP_LISTEN = _SHR_PORT_STP_LISTEN, /* BPDUs/no learns. */
     24     BCM_STG_STP_LEARN = _SHR_PORT_STP_LEARN, /* BPDUs/learns. */
     25     BCM_STG_STP_FORWARD = _SHR_PORT_STP_FORWARD, /* Normal operation. */
     26     BCM_STG_STP_COUNT = _SHR_PORT_STP_COUNT 
     27 } bcm_stg_stp_t;
     28 
     29 #ifndef BCM_HIDE_DISPATCHABLE
     30 
     31 /* 
     32  * Initialize the Spanning Tree Group (STG) module to its initial
     33  * configuration.
     34  */
     35 extern int bcm_stg_init(
     36     int unit);
     37 
     38 /* 
     39  * Destroy all STGs and initialize the Spanning Tree Group (STG) module
     40  * to its initial configuration.
     41  */
     42 extern int bcm_stg_clear(
     43     int unit);
     44 
     45 /* Designate the default STG ID for the chip. */
     46 extern int bcm_stg_default_set(
     47     int unit, 
     48     bcm_stg_t stg);
     49 
     50 /* Return the current default STG ID for the chip. */
     51 extern int bcm_stg_default_get(
     52     int unit, 
     53     bcm_stg_t *stg_ptr);
     54 
     55 /* Add a VLAN to a specified STG. */
     56 extern int bcm_stg_vlan_add(
     57     int unit, 
     58     bcm_stg_t stg, 
     59     bcm_vlan_t vid);
     60 
     61 /* Remove a VLAN from a Spanning Tree Group. */
     62 extern int bcm_stg_vlan_remove(
     63     int unit, 
     64     bcm_stg_t stg, 
     65     bcm_vlan_t vid);
     66 
     67 /* Remove all VLANs from a Spanning Tree Group. */
     68 extern int bcm_stg_vlan_remove_all(
     69     int unit, 
     70     bcm_stg_t stg);
     71 
     72 /* Generates a list of VLANs in a specified STG. */
     73 extern int bcm_stg_vlan_list(
     74     int unit, 
     75     bcm_stg_t stg, 
     76     bcm_vlan_t **list, 
     77     int *count);
     78 
     79 /* Destroy a list returned by =bcm_stg_vlan_list. */
     80 extern int bcm_stg_vlan_list_destroy(
     81     int unit, 
     82     bcm_vlan_t *list, 
     83     int count);
     84 
     85 /* Create a new STG, using a new STG ID. */
     86 extern int bcm_stg_create(
     87     int unit, 
     88     bcm_stg_t *stg_ptr);
     89 
     90 /* Create a new STG, using a specific STG ID. */
     91 extern int bcm_stg_create_id(
     92     int unit, 
     93     bcm_stg_t stg);
     94 
     95 /* Destroys the specified STG. */
     96 extern int bcm_stg_destroy(
     97     int unit, 
     98     bcm_stg_t stg);
     99 
    100 /* Generates a list of IDs for currently defined STGs. */
    101 extern int bcm_stg_list(
    102     int unit, 
    103     bcm_stg_t **list, 
    104     int *count);
    105 
    106 /* 
    107  * Destroys a previously returned list of STG IDs; the STGs themselves
    108  * are not affected.
    109  */
    110 extern int bcm_stg_list_destroy(
    111     int unit, 
    112     bcm_stg_t *list, 
    113     int count);
    114 
    115 /* Set the Spanning Tree Protocol state of a port in the specified STG. */
    116 extern int bcm_stg_stp_set(
    117     int unit, 
    118     bcm_stg_t stg, 
    119     bcm_port_t port, 
    120     int stp_state);
    121 
    122 /* 
    123  * Return the Spanning Tree Protocol state of a port in the specified
    124  * STG.
    125  */
    126 extern int bcm_stg_stp_get(
    127     int unit, 
    128     bcm_stg_t stg, 
    129     bcm_port_t port, 
    130     int *stp_state);
    131 
    132 /* 
    133  * Return the maximum number of STGs that the underlying hardware can
    134  * support.
    135  */
    136 extern int bcm_stg_count_get(
    137     int unit, 
    138     int *max_stg);
    139 
    140 #endif /* BCM_HIDE_DISPATCHABLE */
    141 
    142 #endif /* __BCM_STG_H__ */