greyhound.h (6475B)
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: greyhound.h 8 * Purpose: Function declarations for Greyhound bcm functions 9 */ 10 11 #ifndef _BCM_INT_GREYHOUND_H_ 12 #define _BCM_INT_GREYHOUND_H_ 13 #ifdef BCM_FIELD_SUPPORT 14 #include <bcm_int/esw/field.h> 15 #endif /* BCM_FIELD_SUPPORT */ 16 #if defined(INCLUDE_L3) 17 #include <bcm/extender.h> 18 #include <bcm/niv.h> 19 #endif 20 #include <bcm/qos.h> 21 22 #if defined(BCM_GREYHOUND_SUPPORT) 23 #include <bcm_int/esw/mbcm.h> 24 #include <bcm_int/esw/oam.h> 25 #include <bcm_int/esw/cosq.h> 26 #include <soc/greyhound.h> 27 28 #ifdef BCM_FIELD_SUPPORT 29 extern int _bcm_field_gh_init(int unit, _field_control_t *fc); 30 extern int _bcm_field_gh_write_slice_map(int unit, _field_stage_t *stage_fc, 31 _field_group_t *fg); 32 #endif 33 extern int bcm_gh_port_niv_type_set(int unit, bcm_port_t port, int value); 34 extern int bcm_gh_port_niv_type_get(int unit, bcm_port_t port, int *value); 35 extern int bcm_gh_port_extender_type_set(int unit, bcm_port_t port, int value); 36 extern int bcm_gh_port_extender_type_get(int unit, bcm_port_t port, int *value); 37 extern int 38 bcm_gh_port_priority_group_mapping_set(int unit, bcm_gport_t gport, 39 int prio, int priority_group); 40 extern int 41 bcm_gh_port_priority_group_mapping_get(int unit, bcm_gport_t gport, 42 int prio, int *priority_group); 43 extern int 44 bcm_gh_port_priority_group_config_set(int unit, bcm_gport_t gport, int priority_group, 45 bcm_port_priority_group_config_t *prigrp_config); 46 extern int 47 bcm_gh_port_priority_group_config_get(int unit, bcm_gport_t gport, int priority_group, 48 bcm_port_priority_group_config_t *prigrp_config); 49 extern int bcm_gh_qos_init(int unit); 50 extern int bcm_gh_qos_detach(int unit); 51 extern int bcm_gh_qos_map_create(int unit, uint32 flags, int *map_id); 52 extern int bcm_gh_qos_map_destroy(int unit, int map_id); 53 extern int bcm_gh_qos_map_add(int unit, uint32 flags, bcm_qos_map_t *map, 54 int map_id); 55 extern int bcm_gh_qos_map_delete(int unit, uint32 flags, bcm_qos_map_t *map, 56 int map_id); 57 extern int bcm_gh_qos_port_map_set(int unit, bcm_gport_t port, int ing_map, 58 int egr_map); 59 extern int bcm_gh_qos_map_multi_get(int unit, uint32 flags, 60 int map_id, int array_size, 61 bcm_qos_map_t *array, int *array_count); 62 63 #if defined(INCLUDE_L3) 64 65 /* NIV */ 66 #define GH_L2_HASH_KEY_TYPE_VIF 5 /* Key type of L2X table for NIV */ 67 68 extern int bcm_gh_niv_forward_add(int unit, bcm_niv_forward_t *iv_fwd_entry); 69 extern int bcm_gh_niv_forward_delete(int unit, bcm_niv_forward_t *iv_fwd_entry); 70 extern int bcm_gh_niv_forward_delete_all(int unit); 71 extern int bcm_gh_niv_forward_get(int unit, bcm_niv_forward_t *iv_fwd_entry); 72 extern int bcm_gh_niv_forward_traverse(int unit, 73 bcm_niv_forward_traverse_cb cb, 74 void *user_data); 75 76 extern int bcm_gh_niv_ethertype_set(int unit, int ethertype); 77 extern int bcm_gh_niv_ethertype_get(int unit, int *ethertype); 78 79 /* Port Extender */ 80 #define GH_L2_HASH_KEY_TYPE_PE_VID 6 /* Key type of L2X table for Port Extender */ 81 82 extern int bcm_gh_extender_forward_add(int unit, bcm_extender_forward_t *forward_entry); 83 extern int bcm_gh_extender_forward_delete(int unit, bcm_extender_forward_t *forward_entry); 84 extern int bcm_gh_extender_forward_delete_all(int unit); 85 extern int bcm_gh_extender_forward_get(int unit, bcm_extender_forward_t *forward_entry); 86 extern int bcm_gh_extender_forward_traverse(int unit, 87 bcm_extender_forward_traverse_cb cb, 88 void *user_data); 89 90 extern int bcm_gh_port_etag_pcp_de_source_set(int unit, bcm_port_t port, int value); 91 extern int bcm_gh_port_etag_pcp_de_source_get(int unit, bcm_port_t port, int *value); 92 93 94 extern int bcm_gh_etag_ethertype_set(int unit, int ethertype); 95 extern int bcm_gh_etag_ethertype_get(int unit, int *ethertype); 96 #endif /* INCLUDE_L3 */ 97 98 99 /* WRED */ 100 extern int 101 bcm_gh_cosq_discard_set(int unit, uint32 flags); 102 103 extern int 104 bcm_gh_cosq_discard_get(int unit, uint32 *flags); 105 106 extern int 107 bcm_gh_cosq_discard_port_set(int unit, bcm_port_t port, 108 bcm_cos_queue_t cosq, 109 uint32 color, 110 int drop_start, 111 int drop_slope, 112 int average_time); 113 extern int 114 bcm_gh_cosq_discard_port_get(int unit, bcm_port_t port, 115 bcm_cos_queue_t cosq, 116 uint32 color, 117 int *drop_start, 118 int *drop_slope, 119 int *average_time); 120 121 extern int 122 bcm_gh_cosq_gport_discard_set(int unit, bcm_gport_t port, 123 bcm_cos_queue_t cosq, 124 bcm_cosq_gport_discard_t *discard); 125 126 extern int 127 bcm_gh_cosq_gport_discard_get(int unit, bcm_gport_t port, 128 bcm_cos_queue_t cosq, 129 bcm_cosq_gport_discard_t *discard); 130 131 extern int 132 bcm_gh_cosq_port_pfc_op(int unit, bcm_port_t port, 133 bcm_switch_control_t sctype, _bcm_cosq_op_t op, 134 bcm_cos_queue_t cosq); 135 extern int 136 bcm_gh_cosq_port_pfc_get(int unit, bcm_port_t port, 137 bcm_switch_control_t sctype, 138 bcm_cos_queue_t *cosq); 139 extern int 140 bcm_gh_port_init(int unit); 141 142 extern int 143 bcm_gh_cosq_control_set(int unit, bcm_gport_t gport, bcm_cos_queue_t cosq, 144 bcm_cosq_control_t type, int arg); 145 extern int 146 bcm_gh_cosq_control_get(int unit, bcm_gport_t gport, bcm_cos_queue_t cosq, 147 bcm_cosq_control_t type, int *arg); 148 149 /* 150 * 8 Priority Groups supported. 151 */ 152 #define GH_PRIOROTY_GROUP_ID_MIN 0 153 #define GH_PRIOROTY_GROUP_ID_MAX 7 154 /* 155 * Inpur priority range. 156 * PFC : 0-7 157 * SAFC : 0-15 158 */ 159 #define GH_PFC_INPUT_PRIORITY_MIN 0 160 #define GH_PFC_INPUT_PRIORITY_MAX 7 161 #define GH_SAFC_INPUT_PRIORITY_MIN GH_PFC_INPUT_PRIORITY_MIN 162 #define GH_SAFC_INPUT_PRIORITY_MAX 15 163 164 #endif /* BCM_GREYHOUND_SUPPORT */ 165 #endif /* !_BCM_INT_GREYHOUND_H_ */