tdm.h (3984B)
1 /** 2 * \file bcm_int/dnx/tdm/tdm.h 3 * 4 * Internal DNX TDM APIs 5 */ 6 /* 7 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 8 * 9 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 10 */ 11 12 #ifndef TDM_H_INCLUDED 13 /* 14 * { 15 */ 16 #define TDM_H_INCLUDED 17 18 #ifndef BCM_DNX_SUPPORT 19 #error "This file is for use by DNX (JR2) family only!" 20 #endif 21 22 /* 23 * Include files. 24 * { 25 */ 26 #include <shared/bslenum.h> 27 28 #include <bcm/error.h> 29 #include <bcm/types.h> 30 #include <bcm/fabric.h> 31 32 #include <soc/dnx/dnx_data/auto_generated/dnx_data_tdm.h> 33 /* 34 * } 35 */ 36 /* 37 * DEFINES 38 * { 39 */ 40 /* 41 * } 42 */ 43 /* 44 * MACROS 45 * { 46 */ 47 #define DNX_TDM_BYPASS_MODE_VERIFY(unit) \ 48 if(dnx_data_tdm.params.mode_get(unit) != TDM_MODE_OPTIMIZED) \ 49 { \ 50 SHR_ERR_EXIT(_SHR_E_PARAM, "Ingress TDM Configuration is available only in TDM_OPTIMIZED mode\n"); \ 51 } 52 53 /* 54 * } 55 */ 56 57 /* 58 * Typedefs 59 * { 60 */ 61 62 /** 63 * \brief 64 * Enum for TDM modes 65 */ 66 typedef enum dnx_tdm_mode_e 67 { 68 /* 69 * TDM mode NONE - TDM disabled 70 */ 71 TDM_MODE_NONE = 0, 72 73 /* 74 * TDM mode OPTIMIZED 75 */ 76 TDM_MODE_OPTIMIZED = 1, 77 78 /* 79 * TDM mode STANDARD 80 */ 81 TDM_MODE_STANDARD = 2, 82 83 /* 84 * TDM mode PACKET 85 */ 86 TDM_MODE_PACKET = 3, 87 88 /* 89 * Number of TDM modes 90 */ 91 TDM_MODES_COUNT = 4 92 } dnx_tdm_mode_t; 93 94 /* 95 * } 96 */ 97 /* 98 * Internal functions 99 * { 100 */ 101 102 /** 103 * \brief - Configure switch tdm out header type 104 * 105 * \param [in] unit - Relevant unit 106 * \param [in] switch_tdm_header_type - Switch tdm header type 107 * It could be one of BCM_SWITCH_CONTROL_TDM_OUT_HEADER_XXX 108 * 109 * \return 110 * int 111 * 112 * \remark 113 * * None 114 * \see 115 * * None 116 */ 117 shr_error_e dnx_tdm_out_header_type_set( 118 int unit, 119 int switch_tdm_header_type); 120 121 /** 122 * \brief - Get switch tdm out header type 123 * 124 * \param [in] unit - Relevant unit 125 * \param [out] switch_tdm_header_type - Switch tdm header type 126 * 127 * \return 128 * shr_error_e 129 * 130 * \remark 131 * * None 132 * \see 133 * * None 134 */ 135 shr_error_e dnx_tdm_out_header_type_get( 136 int unit, 137 int *switch_tdm_header_type); 138 139 /** 140 * \brief - Configure TDM system FTMH mode 141 * 142 * \param [in] unit - Relevant unit 143 * \param [in] use_optimized_ftmh - If TRUE TDM will use optimized FTMH, FALSE - STANDARD 144 * 145 * \return 146 * standard shr_error_e 147 * 148 * \see 149 * * dnx_tdm_ftmh_type_get 150 */ 151 shr_error_e dnx_tdm_system_ftmh_type_set( 152 int unit, 153 uint32 use_optimized_ftmh); 154 155 /** 156 * \brief - Get TDM system FTMH mode 157 * 158 * \param [in] unit - Relevant unit 159 * \param [out] use_optimized_ftmh_p - pointer where current system setting of Optimized TDM FTMH is returned 160 * 161 * \return 162 * standard shr_error_e 163 * 164 * \see 165 * * dnx_tdm_ftmh_type_set 166 */ 167 shr_error_e dnx_tdm_system_ftmh_type_get( 168 int unit, 169 uint32 *use_optimized_ftmh_p); 170 171 /** 172 * \brief - Set MC Prefix to make MC ID from Stream ID 173 * 174 * \param [in] unit - Relevant unit 175 * \param [in] stream_mc_prefix - multicast prefix 176 * 177 * \return 178 * standard shr_error_e 179 * 180 * \see 181 * * dnx_tdm_ftmh_type_get 182 */ 183 shr_error_e dnx_tdm_stream_mc_prefix_set( 184 int unit, 185 int stream_mc_prefix); 186 187 /** 188 * \brief - Get TDM system FTMH mode 189 * 190 * \param [in] unit - Relevant unit 191 * \param [out] stream_mc_prefix_p - pointer where multicast prefix is returned 192 * 193 * \return 194 * standard shr_error_e 195 * 196 * \see 197 * * dnx_tdm_ftmh_type_set 198 */ 199 shr_error_e dnx_tdm_stream_mc_prefix_get( 200 int unit, 201 int *stream_mc_prefix_p); 202 203 /** 204 * \brief - Initialize all TDM related resources 205 * 206 * 207 * \param [in] unit - Relevant unit 208 * 209 * \return 210 * shr_error_e 211 * 212 * \remark 213 * * None 214 * \see 215 * * None 216 */ 217 shr_error_e dnx_tdm_init( 218 int unit); 219 /* } */ 220 /* } */ 221 #endif /** TDM_H_INCLUDED */