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

trunk.h (4677B)


      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_TRUNK_H__
     14 #define __BCMX_TRUNK_H__
     15 
     16 #include <bcm/types.h>
     17 #include <bcmx/bcmx.h>
     18 #include <bcmx/lplist.h>
     19 #include <bcm/trunk.h>
     20 
     21 /* 
     22  * Trunk group port addition structure, describes all the ports to be
     23  * added to a trunk group.
     24  */
     25 typedef struct bcmx_trunk_add_info_s {
     26     int psc;                /* Port selection criteria. */
     27     int ipmc_psc;           /* Port selection criteria for software IPMC trunk
     28                                resolution. */
     29     bcmx_lport_t dlf_port;  /* DLF/broadcast port for trunk group. */
     30     bcmx_lport_t mc_port;   /* Multicast port for trunk group. */
     31     bcmx_lport_t ipmc_port; /* IPMC port for trunk group. */
     32     bcmx_lplist_t ports;    /* Ports in trunk. */
     33 } bcmx_trunk_add_info_t;
     34 
     35 /* Trunk Member structure */
     36 typedef bcm_trunk_member_t bcmx_trunk_member_t;
     37 
     38 /* Initialize bcmx_trunk_add_info_t and allocate port list. */
     39 extern void bcmx_trunk_add_info_t_init(
     40     bcmx_trunk_add_info_t *trunk_add_info);
     41 
     42 /* Deallocate port list in bcmx_trunk_add_info_t. */
     43 extern void bcmx_trunk_add_info_t_free(
     44     bcmx_trunk_add_info_t *trunk_add_info);
     45 
     46 /* Initialize the Trunk Member structure. */
     47 extern void bcmx_trunk_member_t_init(
     48     bcmx_trunk_member_t *trunk_member);
     49 
     50 /* Initialize the Trunk module. */
     51 extern int bcmx_trunk_init(void);
     52 
     53 /* Shut down the Trunk module. */
     54 extern int bcmx_trunk_detach(void);
     55 
     56 /* 
     57  * Create the software data structure for a new trunk, using next
     58  * available trunk ID.
     59  */
     60 extern int bcmx_trunk_create(
     61     bcm_trunk_t *tid);
     62 
     63 /* 
     64  * Create the software data structure for a new trunk, using the
     65  * specified trunk ID.
     66  */
     67 extern int bcmx_trunk_create_id(
     68     bcm_trunk_t tid);
     69 
     70 /* Backward compatibility. */
     71 #define bcmx_trunk_create_with_tid  bcmx_trunk_create_id 
     72 
     73 /* Get a trunk's Port Selection Criteria (PSC). */
     74 extern int bcmx_trunk_psc_get(
     75     bcm_trunk_t tid, 
     76     int *psc);
     77 
     78 /* Set a trunk's Port Selection Criteria (PSC). */
     79 extern int bcmx_trunk_psc_set(
     80     bcm_trunk_t tid, 
     81     int psc);
     82 
     83 /* Gets the system trunk limits. */
     84 extern int bcmx_trunk_chip_info_get(
     85     bcm_trunk_chip_info_t *ta_info);
     86 
     87 /* Get the current parameters for the specified trunk group. */
     88 extern int bcmx_trunk_get(
     89     bcm_trunk_t tid, 
     90     bcmx_trunk_add_info_t *t_data);
     91 
     92 /* Add ports to a trunk group. */
     93 extern int bcmx_trunk_set(
     94     bcm_trunk_t tid, 
     95     bcmx_trunk_add_info_t *add_info);
     96 
     97 /* Removes a trunk group. */
     98 extern int bcmx_trunk_destroy(
     99     bcm_trunk_t tid);
    100 
    101 /* Add the specified trunk group to an existing MAC multicast entry. */
    102 extern int bcmx_trunk_mcast_join(
    103     bcm_trunk_t tid, 
    104     bcm_vlan_t vid, 
    105     bcm_mac_t mac);
    106 
    107 /* 
    108  * Retrieve the current bitmap of ports for which switching is enabled
    109  * for trunking.
    110  */
    111 extern int bcmx_trunk_egress_get(
    112     bcm_trunk_t tid, 
    113     bcmx_lplist_t *lplist);
    114 
    115 /* Restrict trunk traffic only to specified trunk member ports. */
    116 extern int bcmx_trunk_egress_set(
    117     bcm_trunk_t tid, 
    118     bcmx_lplist_t lplist);
    119 
    120 /* Get the trunk group ID for a given system port. */
    121 extern int bcmx_trunk_find(
    122     bcmx_lport_t port, 
    123     bcm_trunk_t *tid);
    124 
    125 /* Assign the failover port list for a specific trunk port. */
    126 extern int bcmx_trunk_failover_set(
    127     bcm_trunk_t tid, 
    128     bcm_gport_t failport, 
    129     int psc, 
    130     uint32 flags, 
    131     int count, 
    132     bcm_gport_t *fail_to_array);
    133 
    134 /* Retrieve the failover port list for a specific trunk port. */
    135 extern int bcmx_trunk_failover_get(
    136     bcm_trunk_t tid, 
    137     bcm_gport_t failport, 
    138     int *psc, 
    139     uint32 *flags, 
    140     int array_size, 
    141     bcm_gport_t *fail_to_array, 
    142     int *array_count);
    143 
    144 /* Add a member to a trunk group */
    145 extern int bcmx_trunk_member_add(
    146     bcm_trunk_t tid, 
    147     bcmx_trunk_member_t *member);
    148 
    149 /* Delete a member from a trunk group */
    150 extern int bcmx_trunk_member_delete(
    151     bcm_trunk_t tid, 
    152     bcmx_trunk_member_t *member);
    153 
    154 /* Delete all members from a trunk group */
    155 extern int bcmx_trunk_member_delete_all(
    156     bcm_trunk_t tid);
    157 
    158 /* Assign a set of members to a trunk group */
    159 extern int bcmx_trunk_member_set(
    160     bcm_trunk_t tid, 
    161     int member_count, 
    162     bcmx_trunk_member_t *member_array);
    163 
    164 /* Get members of a trunk group */
    165 extern int bcmx_trunk_member_get(
    166     bcm_trunk_t tid, 
    167     int member_max, 
    168     bcmx_trunk_member_t *member_array, 
    169     int *member_count);
    170 
    171 #endif /* __BCMX_TRUNK_H__ */