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 (2076B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      6  *
      7  * IPMC Internal header
      8  */
      9 
     10 #ifndef _BCM_INT_DPP_STG_H_
     11 #define _BCM_INT_DPP_STG_H_
     12 
     13 #include <sal/types.h>
     14 #include <bcm/types.h>
     15 #include <shared/swstate/sw_state.h>
     16 
     17 /*
     18  * The STG info structure is protected by STG_DB_LOCK. The hardware PTABLE and
     19  * hardware STG table are protected by memory locks in the lower level.
     20  */
     21 typedef struct bcm_stg_info_s {
     22                     int         init;       /* TRUE if STG module has been initialized */
     23                     bcm_stg_t   stg_min;    /* STG table min index */
     24                     bcm_stg_t   stg_max;    /* STG table max index */
     25                     bcm_stg_t   stg_defl;   /* Default STG */
     26     PARSER_HINT_ARR SHR_BITDCL *stg_bitmap; /* Bitmap of allocated STGs */
     27     PARSER_HINT_ARR bcm_pbmp_t *stg_enable; /* array of port bitmaps indicating whether the
     28                                                port+stg has STP enabled */
     29     PARSER_HINT_ARR bcm_pbmp_t *stg_state_h;/* array of port bitmaps indicating STP state for the */
     30     PARSER_HINT_ARR bcm_pbmp_t *stg_state_l;/* port+stg combo. Only valid if stg_enable = TRUE */
     31                     int         stg_count;  /* Number STGs allocated */
     32                     /* STG reverse map - keep a linked list of VLANs in each STG */
     33     PARSER_HINT_ARR bcm_vlan_t *vlan_first; /* Indexed by STG (also links free list) */
     34     PARSER_HINT_ARR bcm_vlan_t *vlan_next;  /* Indexed by VLAN ID */
     35 } bcm_stg_info_t;
     36 
     37 /* Convert STG to PPD stg topology id */
     38 #define BCM_DPP_STG_TO_TOPOLOGY_ID(stg) \
     39             (stg - 1)
     40 
     41 /* Convert PPD stg topology id to STG */
     42 #define BCM_DPP_STG_FROM_TOPOLOGY_ID(topology_id) \
     43             (topology_id + 1)
     44 
     45 extern bcm_stg_info_t  stg_info[BCM_MAX_NUM_UNITS];
     46 
     47 extern int _bcm_petra_stg_vlan_destroy(int unit, bcm_stg_t stg, bcm_vlan_t vid);
     48 
     49 extern int bcm_petra_stg_detach(int unit);
     50 
     51 #endif /* _BCM_INT_DPP_IPMC_H_ */
     52