2 * Copyright (C) 2013 Realtek Semiconductor Corp.
5 * Unless you and Realtek execute a separate written software license
6 * agreement governing use of this software, this software is licensed
7 * to you under the terms of the GNU General Public License version 2,
8 * available at https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
10 * Purpose : RTL8367/RTL8367C switch high-level API
12 * Feature : The file includes Storm module high-layer API defination
16 #ifndef __RTK_API_STORM_H__
17 #define __RTK_API_STORM_H__
19 #define STORM_UNUC_INDEX 28
20 #define STORM_UNMC_INDEX 29
21 #define STORM_MC_INDEX 30
22 #define STORM_BC_INDEX 31
24 typedef enum rtk_rate_storm_group_e
26 STORM_GROUP_UNKNOWN_UNICAST
= 0,
27 STORM_GROUP_UNKNOWN_MULTICAST
,
28 STORM_GROUP_MULTICAST
,
29 STORM_GROUP_BROADCAST
,
31 } rtk_rate_storm_group_t
;
33 typedef enum rtk_storm_bypass_e
43 BYPASS_PROVIDER_BRIDGE_GROUP_ADDRESS
,
48 BYPASS_PROVIDER_BRIDGE_GVRP_ADDRESS
,
91 * rtk_rate_stormControlMeterIdx_set
93 * Set the storm control meter index.
96 * storm_type - storm group type
97 * index - storm control meter index.
103 * RT_ERR_PORT_ID - Invalid port id
104 * RT_ERR_FILTER_METER_ID - Invalid meter
108 extern rtk_api_ret_t
rtk_rate_stormControlMeterIdx_set(rtk_port_t port
, rtk_rate_storm_group_t stormType
, rtk_uint32 index
);
111 * rtk_rate_stormControlMeterIdx_get
113 * Get the storm control meter index.
116 * storm_type - storm group type
118 * pIndex - storm control meter index.
122 * RT_ERR_PORT_ID - Invalid port id
123 * RT_ERR_FILTER_METER_ID - Invalid meter
127 extern rtk_api_ret_t
rtk_rate_stormControlMeterIdx_get(rtk_port_t port
, rtk_rate_storm_group_t stormType
, rtk_uint32
*pIndex
);
130 * rtk_rate_stormControlPortEnable_set
132 * Set enable status of storm control on specified port.
135 * stormType - storm group type
136 * enable - enable status of storm control
142 * RT_ERR_NOT_INIT - The module is not initial
143 * RT_ERR_PORT_ID - invalid port id
144 * RT_ERR_INPUT - invalid input parameter
148 extern rtk_api_ret_t
rtk_rate_stormControlPortEnable_set(rtk_port_t port
, rtk_rate_storm_group_t stormType
, rtk_enable_t enable
);
151 * rtk_rate_stormControlPortEnable_set
153 * Set enable status of storm control on specified port.
156 * stormType - storm group type
158 * pEnable - enable status of storm control
162 * RT_ERR_NOT_INIT - The module is not initial
163 * RT_ERR_PORT_ID - invalid port id
164 * RT_ERR_INPUT - invalid input parameter
168 extern rtk_api_ret_t
rtk_rate_stormControlPortEnable_get(rtk_port_t port
, rtk_rate_storm_group_t stormType
, rtk_enable_t
*pEnable
);
171 * rtk_storm_bypass_set
173 * Set bypass storm filter control configuration.
175 * type - Bypass storm filter control type.
176 * enable - Bypass status.
181 * RT_ERR_FAILED - Failed
182 * RT_ERR_SMI - SMI access error
183 * RT_ERR_INPUT - Invalid input parameters.
184 * RT_ERR_ENABLE - Invalid IFG parameter
187 * This API can set per-port bypass stomr filter control frame type including RMA and igmp.
188 * The bypass frame type is as following:
189 * - BYPASS_BRG_GROUP,
193 * - BYPASS_UNDEF_BRG_04,
194 * - BYPASS_UNDEF_BRG_05,
195 * - BYPASS_UNDEF_BRG_06,
196 * - BYPASS_UNDEF_BRG_07,
197 * - BYPASS_PROVIDER_BRIDGE_GROUP_ADDRESS,
198 * - BYPASS_UNDEF_BRG_09,
199 * - BYPASS_UNDEF_BRG_0A,
200 * - BYPASS_UNDEF_BRG_0B,
201 * - BYPASS_UNDEF_BRG_0C,
202 * - BYPASS_PROVIDER_BRIDGE_GVRP_ADDRESS,
204 * - BYPASS_UNDEF_BRG_0F,
205 * - BYPASS_BRG_MNGEMENT,
206 * - BYPASS_UNDEFINED_11,
207 * - BYPASS_UNDEFINED_12,
208 * - BYPASS_UNDEFINED_13,
209 * - BYPASS_UNDEFINED_14,
210 * - BYPASS_UNDEFINED_15,
211 * - BYPASS_UNDEFINED_16,
212 * - BYPASS_UNDEFINED_17,
213 * - BYPASS_UNDEFINED_18,
214 * - BYPASS_UNDEFINED_19,
215 * - BYPASS_UNDEFINED_1A,
216 * - BYPASS_UNDEFINED_1B,
217 * - BYPASS_UNDEFINED_1C,
218 * - BYPASS_UNDEFINED_1D,
219 * - BYPASS_UNDEFINED_1E,
220 * - BYPASS_UNDEFINED_1F,
223 * - BYPASS_UNDEF_GARP_22,
224 * - BYPASS_UNDEF_GARP_23,
225 * - BYPASS_UNDEF_GARP_24,
226 * - BYPASS_UNDEF_GARP_25,
227 * - BYPASS_UNDEF_GARP_26,
228 * - BYPASS_UNDEF_GARP_27,
229 * - BYPASS_UNDEF_GARP_28,
230 * - BYPASS_UNDEF_GARP_29,
231 * - BYPASS_UNDEF_GARP_2A,
232 * - BYPASS_UNDEF_GARP_2B,
233 * - BYPASS_UNDEF_GARP_2C,
234 * - BYPASS_UNDEF_GARP_2D,
235 * - BYPASS_UNDEF_GARP_2E,
236 * - BYPASS_UNDEF_GARP_2F,
239 extern rtk_api_ret_t
rtk_storm_bypass_set(rtk_storm_bypass_t type
, rtk_enable_t enable
);
242 * rtk_storm_bypass_get
244 * Get bypass storm filter control configuration.
246 * type - Bypass storm filter control type.
248 * pEnable - Bypass status.
251 * RT_ERR_FAILED - Failed
252 * RT_ERR_SMI - SMI access error
253 * RT_ERR_INPUT - Invalid input parameters.
255 * This API can get per-port bypass stomr filter control frame type including RMA and igmp.
256 * The bypass frame type is as following:
257 * - BYPASS_BRG_GROUP,
261 * - BYPASS_UNDEF_BRG_04,
262 * - BYPASS_UNDEF_BRG_05,
263 * - BYPASS_UNDEF_BRG_06,
264 * - BYPASS_UNDEF_BRG_07,
265 * - BYPASS_PROVIDER_BRIDGE_GROUP_ADDRESS,
266 * - BYPASS_UNDEF_BRG_09,
267 * - BYPASS_UNDEF_BRG_0A,
268 * - BYPASS_UNDEF_BRG_0B,
269 * - BYPASS_UNDEF_BRG_0C,
270 * - BYPASS_PROVIDER_BRIDGE_GVRP_ADDRESS,
272 * - BYPASS_UNDEF_BRG_0F,
273 * - BYPASS_BRG_MNGEMENT,
274 * - BYPASS_UNDEFINED_11,
275 * - BYPASS_UNDEFINED_12,
276 * - BYPASS_UNDEFINED_13,
277 * - BYPASS_UNDEFINED_14,
278 * - BYPASS_UNDEFINED_15,
279 * - BYPASS_UNDEFINED_16,
280 * - BYPASS_UNDEFINED_17,
281 * - BYPASS_UNDEFINED_18,
282 * - BYPASS_UNDEFINED_19,
283 * - BYPASS_UNDEFINED_1A,
284 * - BYPASS_UNDEFINED_1B,
285 * - BYPASS_UNDEFINED_1C,
286 * - BYPASS_UNDEFINED_1D,
287 * - BYPASS_UNDEFINED_1E,
288 * - BYPASS_UNDEFINED_1F,
291 * - BYPASS_UNDEF_GARP_22,
292 * - BYPASS_UNDEF_GARP_23,
293 * - BYPASS_UNDEF_GARP_24,
294 * - BYPASS_UNDEF_GARP_25,
295 * - BYPASS_UNDEF_GARP_26,
296 * - BYPASS_UNDEF_GARP_27,
297 * - BYPASS_UNDEF_GARP_28,
298 * - BYPASS_UNDEF_GARP_29,
299 * - BYPASS_UNDEF_GARP_2A,
300 * - BYPASS_UNDEF_GARP_2B,
301 * - BYPASS_UNDEF_GARP_2C,
302 * - BYPASS_UNDEF_GARP_2D,
303 * - BYPASS_UNDEF_GARP_2E,
304 * - BYPASS_UNDEF_GARP_2F,
307 extern rtk_api_ret_t
rtk_storm_bypass_get(rtk_storm_bypass_t type
, rtk_enable_t
*pEnable
);
310 * rtk_rate_stormControlExtPortmask_set
312 * Set externsion storm control port mask
314 * pPortmask - port mask
320 * RT_ERR_NOT_INIT - The module is not initial
321 * RT_ERR_INPUT - invalid input parameter
325 extern rtk_api_ret_t
rtk_rate_stormControlExtPortmask_set(rtk_portmask_t
*pPortmask
);
328 * rtk_rate_stormControlExtPortmask_get
330 * Set externsion storm control port mask
334 * pPortmask - port mask
338 * RT_ERR_NOT_INIT - The module is not initial
339 * RT_ERR_INPUT - invalid input parameter
343 extern rtk_api_ret_t
rtk_rate_stormControlExtPortmask_get(rtk_portmask_t
*pPortmask
);
346 * rtk_rate_stormControlExtEnable_set
348 * Set externsion storm control state
350 * stormType - storm group type
351 * enable - externsion storm control state
357 * RT_ERR_NOT_INIT - The module is not initial
358 * RT_ERR_INPUT - invalid input parameter
362 extern rtk_api_ret_t
rtk_rate_stormControlExtEnable_set(rtk_rate_storm_group_t stormType
, rtk_enable_t enable
);
365 * rtk_rate_stormControlExtEnable_get
367 * Get externsion storm control state
369 * stormType - storm group type
371 * pEnable - externsion storm control state
375 * RT_ERR_NOT_INIT - The module is not initial
376 * RT_ERR_INPUT - invalid input parameter
380 extern rtk_api_ret_t
rtk_rate_stormControlExtEnable_get(rtk_rate_storm_group_t stormType
, rtk_enable_t
*pEnable
);
383 * rtk_rate_stormControlExtMeterIdx_set
385 * Set externsion storm control meter index
387 * stormType - storm group type
388 * index - externsion storm control state
394 * RT_ERR_NOT_INIT - The module is not initial
395 * RT_ERR_INPUT - invalid input parameter
399 extern rtk_api_ret_t
rtk_rate_stormControlExtMeterIdx_set(rtk_rate_storm_group_t stormType
, rtk_uint32 index
);
402 * rtk_rate_stormControlExtMeterIdx_get
404 * Get externsion storm control meter index
406 * stormType - storm group type
407 * pIndex - externsion storm control state
413 * RT_ERR_NOT_INIT - The module is not initial
414 * RT_ERR_INPUT - invalid input parameter
418 extern rtk_api_ret_t
rtk_rate_stormControlExtMeterIdx_get(rtk_rate_storm_group_t stormType
, rtk_uint32
*pIndex
);
422 #endif /* __RTK_API_STORM_H__ */