compat_659.h (8141B)
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 * RPC Compatibility with sdk-6.5.9 routines 8 */ 9 10 #ifndef _COMPAT_659_H_ 11 #define _COMPAT_659_H_ 12 13 #ifdef BCM_RPC_SUPPORT 14 #include <bcm/types.h> 15 #include <bcm/field.h> 16 #include <bcm/cosq.h> 17 18 #if defined(INCLUDE_L3) 19 #include <bcm/vlan.h> 20 21 /* Layer 2 Logical port type */ 22 typedef struct bcm_compat659_vlan_port_s { 23 bcm_vlan_port_match_t criteria; /* Match criteria. */ 24 uint32 flags; /* BCM_VLAN_PORT_xxx. */ 25 bcm_vlan_t vsi; /* Populated for bcm_vlan_port_find only */ 26 bcm_vlan_t match_vlan; /* Outer VLAN ID to match. */ 27 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match. */ 28 int match_pcp; /* Outer PCP ID to match. */ 29 bcm_tunnel_id_t match_tunnel_value; /* Tunnel value to match. */ 30 bcm_port_ethertype_t match_ethertype; /* Ethernet type value to match. */ 31 bcm_gport_t port; /* Gport: local or remote Physical or 32 logical gport. */ 33 uint8 pkt_pri; /* Service tag priority. */ 34 uint8 pkt_cfi; /* Service tag cfi. */ 35 uint16 egress_service_tpid; /* Service VLAN TPID value. */ 36 bcm_vlan_t egress_vlan; /* Egress Outer VLAN or SD-TAG VLAN ID. */ 37 bcm_vlan_t egress_inner_vlan; /* Egress Inner VLAN. */ 38 bcm_tunnel_id_t egress_tunnel_value; /* Egress Tunnel value. */ 39 bcm_if_t encap_id; /* Encapsulation Index. */ 40 int qos_map_id; /* QoS Map Index. */ 41 bcm_policer_t policer_id; /* Policer ID */ 42 bcm_policer_t egress_policer_id; /* Egress Policer ID */ 43 bcm_failover_t failover_id; /* Failover Object Index. */ 44 bcm_gport_t failover_port_id; /* Failover VLAN Port Identifier. */ 45 bcm_gport_t vlan_port_id; /* GPORT identifier */ 46 bcm_multicast_t failover_mc_group; /* MC group used for bi-cast. */ 47 bcm_failover_t ingress_failover_id; /* 1+1 protection. */ 48 bcm_failover_t egress_failover_id; /* Failover object index for Egress 49 Protection */ 50 bcm_gport_t egress_failover_port_id; /* Failover VLAN Port Identifier for 51 Egress Protection */ 52 bcm_switch_network_group_t ingress_network_group_id; /* Split Horizon ingress network group 53 identifier */ 54 bcm_switch_network_group_t egress_network_group_id; /* Split Horizon egress network group 55 identifier */ 56 int inlif_counting_profile; /* In LIF counting profile */ 57 int outlif_counting_profile; /* Out LIF counting profile */ 58 } bcm_compat659_vlan_port_t; 59 60 /* 61 * Create a layer 2 logical port. Places the ID in the logical port 62 * descriptor if WITH_ID flag is not provided, uses the ID in the logical 63 * port descriptor if WITH_ID flag specified. 64 */ 65 extern int bcm_compat659_vlan_port_create(int unit, 66 bcm_compat659_vlan_port_t *vlan_port); 67 68 /* Get/find a layer 2 logical port given the GPORT id or match criteria. */ 69 extern int bcm_compat659_vlan_port_find(int unit, 70 bcm_compat659_vlan_port_t *vlan_port); 71 72 73 #endif /* INCLUDE_L3 */ 74 75 /* This structure contains the configuration of a VLAN. */ 76 typedef struct bcm_compat659_vlan_control_vlan_s { 77 bcm_vrf_t vrf; 78 bcm_vlan_t forwarding_vlan; /* Shared VLAN ID. */ 79 bcm_if_t ingress_if; /* Mapped Ingress interface. */ 80 uint16 outer_tpid; 81 uint32 flags; 82 bcm_vlan_mcast_flood_t ip6_mcast_flood_mode; 83 bcm_vlan_mcast_flood_t ip4_mcast_flood_mode; 84 bcm_vlan_mcast_flood_t l2_mcast_flood_mode; 85 int if_class; 86 bcm_vlan_forward_t forwarding_mode; 87 bcm_vlan_urpf_mode_t urpf_mode; 88 bcm_cos_queue_t cosq; 89 int qos_map_id; /* index to int_pri->queue offset 90 mapping profile */ 91 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 92 bcm_multicast_t broadcast_group; /* Group to handle broadcast frames */ 93 bcm_multicast_t unknown_multicast_group; /* Group to handle unknown multicast 94 frames */ 95 bcm_multicast_t unknown_unicast_group; /* Group to handle unknown unicast 96 frames */ 97 bcm_multicast_t trill_nonunicast_group; /* Group to handle trill-domain 98 nonunicast frames */ 99 bcm_trill_name_t source_trill_name; /* Source RBridge nickname per VLAN */ 100 int trunk_index; /* Trunk index for static PSC */ 101 bcm_vlan_protocol_packet_ctrl_t protocol_pkt; /* Protocol packet control per VLAN */ 102 int nat_realm_id; /* Realm id of interface that this vlan 103 maps to */ 104 int l3_if_class; /* L3IIF class id. */ 105 bcm_vlan_vp_mc_ctrl_t vp_mc_ctrl; /* VP replication control, Auto, Enable, 106 Disable */ 107 int aging_cycles; /* number of aging meta-cycles */ 108 int entropy_id; /* aging profile ID */ 109 bcm_vpn_t vpn; /* vpn */ 110 bcm_vlan_t egress_vlan; /* egress outer vlan */ 111 uint32 learn_flags; /* Learn control flags for VLAN-based 112 (BCM_VLAN_LEARN_CONTROL_XXX) */ 113 uint32 sr_flags; /* Flags for Seamless Redundancy: 114 BCM_VLAN_CONTROL_SR_FLAG_xxx */ 115 } bcm_compat659_vlan_control_vlan_t; 116 117 /* Set per VLAN configuration */ 118 extern int bcm_compat659_vlan_control_vlan_selective_set(int unit, 119 bcm_vlan_t vlan, uint32 valid_fields, 120 bcm_compat659_vlan_control_vlan_t *control); 121 /* Get per VLAN configuration */ 122 extern int bcm_compat659_vlan_control_vlan_selective_get(int unit, 123 bcm_vlan_t vlan, uint32 valid_fields, 124 bcm_compat659_vlan_control_vlan_t *control); 125 126 extern int bcm_compat659_vlan_control_vlan_set(int unit, bcm_vlan_t vlan, 127 bcm_compat659_vlan_control_vlan_t control); 128 129 extern int bcm_compat659_vlan_control_vlan_get(int unit, bcm_vlan_t vlan, 130 bcm_compat659_vlan_control_vlan_t *control); 131 132 133 /* For Virtual output queues (system ports) */ 134 typedef struct bcm_compat659_cosq_gport_discard_s { 135 uint32 flags; 136 int min_thresh; /* Queue depth in bytes to begin dropping. */ 137 int max_thresh; /* Queue depth in bytes to drop all packets. */ 138 int drop_probability; /* Drop probability at max threshold. */ 139 int gain; /* Determines the smoothing that should be applied. */ 140 int ecn_thresh; /* Queue depth in bytes to stop marking and start 141 dropping. */ 142 int refresh_time; /* Actual average refresh time. */ 143 } bcm_compat659_cosq_gport_discard_t; 144 145 extern int bcm_compat659_cosq_gport_discard_set( 146 int unit, 147 bcm_gport_t gport, 148 bcm_cos_queue_t cosq, 149 bcm_compat659_cosq_gport_discard_t *discard); 150 151 extern int bcm_compat659_cosq_gport_discard_get( 152 int unit, 153 bcm_gport_t gport, 154 bcm_cos_queue_t cosq, 155 bcm_compat659_cosq_gport_discard_t *discard); 156 157 extern int bcm_compat659_cosq_gport_discard_extended_set( 158 int unit, 159 bcm_cosq_object_id_t *id, 160 bcm_compat659_cosq_gport_discard_t *discard); 161 162 extern int bcm_compat659_cosq_gport_discard_extended_get( 163 int unit, 164 bcm_cosq_object_id_t *id, 165 bcm_compat659_cosq_gport_discard_t *discard); 166 167 #endif 168 #endif /* !_COMPAT_659_H */