algo_vlan.h (2954B)
1 /** 2 * \file algo_vlan.h Internal DNX VLAN Management APIs 3 PIs This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 PIs 5 PIs Copyright 2007-2020 Broadcom Inc. All rights reserved. 6 */ 7 8 #ifndef ALGO_VLAN_H_INCLUDED 9 /* 10 * { 11 */ 12 #define ALGO_VLAN_H_INCLUDED 13 14 #include <shared/shrextend/shrextend_debug.h> 15 #include <bcm_int/dnx/algo/template_mngr/template_manager_types.h> 16 17 #ifndef BCM_DNX_SUPPORT 18 #error "This file is for use by DNX (JR2) family only!" 19 #endif 20 21 /** 22 * Resource name defines for algo vlan 23 * { 24 */ 25 #define DNX_ALGO_VLAN_VSI_RESOURCE "VSI" 26 #define DNX_VLAN_PORT_INGRESS_VIRTUAL_GPORT_ID_RESOURCE_NAME "VLAN-PORT INGRESS VIRTUAL GPORT ID" 27 #define DNX_VLAN_PORT_EGRESS_VIRTUAL_GPORT_ID_RESOURCE_NAME "VLAN-PORT EGRESS VIRTUAL GPORT ID" 28 #define DNX_ALGO_VLAN_TRANSLATE_ACTION_ID_INGRESS "ACTION_ID_INGRESS" 29 #define DNX_ALGO_VLAN_TRANSLATE_ACTION_ID_EGRESS "ACTION_ID_EGRESS" 30 #define DNX_ALGO_VLAN_RANGE_TEMPLATE_OUTER "Vlan range outer" 31 #define DNX_ALGO_VLAN_RANGE_TEMPLATE_INNER "Vlan range inner" 32 #define VLAN_RANGE_DEFAULT (BCM_VLAN_NONE) 33 /** 34 * } 35 */ 36 /** 37 * \brief 38 * allocate resource pool for all VLAN profiles types 39 * \param [in] unit - 40 * The unit number. 41 * \return 42 * \retval Negative in case of an error. 43 * \retval Zero in case of NO ERROR 44 */ 45 shr_error_e dnx_algo_vlan_init( 46 int unit); 47 48 /** 49 * \brief 50 * deallocate resource pool for all VLAN profiles types 51 * \param [in] unit - 52 * The unit number. 53 * \return 54 * \retval Negative in case of an error. 55 * \retval Zero in case of NO ERROR 56 */ 57 shr_error_e dnx_algo_vlan_deinit( 58 int unit); 59 60 /** 61 * \brief - Initialize VLAN resources. \n 62 * The function will initialize and create all required VLAN res-manager. 63 * 64 * \par DIRECT_INPUT: 65 * \param [in] unit - Unit-ID 66 * \par INDIRECT INPUT: 67 * * DNX-Data information such as nof VSIs , which features are enabled. 68 * \par DIRECT OUTPUT: 69 * shr_error_e 70 * \par INDIRECT OUTPUT 71 * * Initialize Res manager pools of VLAN module see the dnx_vlan_algo_res_init .c file which pools are initialized. 72 * \remark 73 * * Assume Resource Manager is initialized \see dnx_algo_res_init 74 * \see 75 * * None 76 */ 77 shr_error_e dnx_algo_vlan_res_init( 78 int unit); 79 80 /** 81 * \brief - 82 * Print the inner vlan range profile template content. 83 * \param [in] unit - relevant unit 84 * \param [in] data - template data 85 * \return 86 * shr_error_e 87 * 88 * \remark 89 * * None 90 * \see 91 */ 92 void dnx_vlan_range_template_inner_print_cb( 93 int unit, 94 const void *data); 95 /** 96 * \brief - 97 * Print the outer vlan range profile template content. 98 * \param [in] unit - relevant unit 99 * \param [in] data - template data 100 * \return 101 * shr_error_e 102 * 103 * \remark 104 * * None 105 * \see 106 */ 107 void dnx_vlan_range_template_outer_print_cb( 108 int unit, 109 const void *data); 110 /* 111 * } 112 */ 113 #endif/*_ALGO_VLAN_API_INCLUDED__*/