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

l2u.h (2070B)


      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-2019 Broadcom Inc. All rights reserved.
      6  *
      7  * File:        l2u.h
      8  * Purpose:     XGS3 L2 User table manipulation support
      9  */
     10 
     11 #ifndef _L2U_H_
     12 #define _L2U_H_
     13 
     14 #if defined(BCM_ESW_SUPPORT) || defined(BCM_SAND_SUPPORT)
     15 /* Provide a more reasonably named type from auto-generated type */
     16 #define l2u_entry_t l2_user_entry_entry_t
     17 
     18 /* More convenience */
     19 #define _l2u_field_get soc_L2_USER_ENTRYm_field_get
     20 #define _l2u_field_set soc_L2_USER_ENTRYm_field_set
     21 #define _l2u_field32_get soc_L2_USER_ENTRYm_field32_get
     22 #define _l2u_field32_set soc_L2_USER_ENTRYm_field32_set
     23 #define _l2u_mac_addr_get soc_L2_USER_ENTRYm_mac_addr_get
     24 #define _l2u_mac_addr_set soc_L2_USER_ENTRYm_mac_addr_set
     25 
     26 /* Maximum number of BPDU addresses */
     27 #define L2U_BPDU_COUNT 6
     28 
     29 /* Valid fields in search key */
     30 #define L2U_KEY_MAC             0x00000001
     31 #define L2U_KEY_VLAN            0x00000002
     32 #define L2U_KEY_PORT            0x00000004
     33 #define L2U_KEY_MODID           0x00000008
     34 #define L2U_KEY_MAC_MASK        0x00000010
     35 #define L2U_KEY_VLAN_MASK       0x00000020
     36 
     37 typedef struct l2u_key_s {
     38     uint32      flags;
     39     sal_mac_addr_t mac;
     40     int         vlan;
     41     int         port;
     42     int         modid;
     43     sal_mac_addr_t mac_mask;
     44     int         vlan_mask;
     45 } l2u_key_t;
     46 
     47 extern int soc_l2u_overlap_check(int unit, l2u_entry_t *entry, int *index);
     48 extern int soc_l2u_search(int unit, l2u_entry_t *key, l2u_entry_t *result, int *index);
     49 extern int soc_l2u_find_free_entry(int unit, l2u_entry_t *key, int *free_index);
     50 extern int soc_l2u_insert(int unit, l2u_entry_t *entry, int index, int *index_used);
     51 extern int soc_l2u_get(int unit, l2u_entry_t *entry, int index);
     52 extern int soc_l2u_delete(int unit, l2u_entry_t *entry, int index, int *index_deleted);
     53 extern int soc_l2u_delete_by_key(int unit, l2u_key_t *key);
     54 extern int soc_l2u_delete_all(int unit);
     55 #endif /* BCM_ESW_SUPPORT || BCM_SAND_SUPPORT */
     56 #endif /* _L2U_H_ */