13ef60df838a2fc9789aae1747143248936496f8
[openwrt/staging/stintel.git] / target / linux / mediatek / files / drivers / net / phy / rtk / rtl8367c / include / leaky.h
1 /*
2 * Copyright (C) 2013 Realtek Semiconductor Corp.
3 * All Rights Reserved.
4 *
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
9 *
10 * Purpose : RTL8367/RTL8367C switch high-level API
11 *
12 * Feature : The file includes Leaky module high-layer API defination
13 *
14 */
15
16 #ifndef __RTK_API_LEAKY_H__
17 #define __RTK_API_LEAKY_H__
18
19
20 typedef enum rtk_leaky_type_e
21 {
22 LEAKY_BRG_GROUP = 0,
23 LEAKY_FD_PAUSE,
24 LEAKY_SP_MCAST,
25 LEAKY_1X_PAE,
26 LEAKY_UNDEF_BRG_04,
27 LEAKY_UNDEF_BRG_05,
28 LEAKY_UNDEF_BRG_06,
29 LEAKY_UNDEF_BRG_07,
30 LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
31 LEAKY_UNDEF_BRG_09,
32 LEAKY_UNDEF_BRG_0A,
33 LEAKY_UNDEF_BRG_0B,
34 LEAKY_UNDEF_BRG_0C,
35 LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
36 LEAKY_8021AB,
37 LEAKY_UNDEF_BRG_0F,
38 LEAKY_BRG_MNGEMENT,
39 LEAKY_UNDEFINED_11,
40 LEAKY_UNDEFINED_12,
41 LEAKY_UNDEFINED_13,
42 LEAKY_UNDEFINED_14,
43 LEAKY_UNDEFINED_15,
44 LEAKY_UNDEFINED_16,
45 LEAKY_UNDEFINED_17,
46 LEAKY_UNDEFINED_18,
47 LEAKY_UNDEFINED_19,
48 LEAKY_UNDEFINED_1A,
49 LEAKY_UNDEFINED_1B,
50 LEAKY_UNDEFINED_1C,
51 LEAKY_UNDEFINED_1D,
52 LEAKY_UNDEFINED_1E,
53 LEAKY_UNDEFINED_1F,
54 LEAKY_GMRP,
55 LEAKY_GVRP,
56 LEAKY_UNDEF_GARP_22,
57 LEAKY_UNDEF_GARP_23,
58 LEAKY_UNDEF_GARP_24,
59 LEAKY_UNDEF_GARP_25,
60 LEAKY_UNDEF_GARP_26,
61 LEAKY_UNDEF_GARP_27,
62 LEAKY_UNDEF_GARP_28,
63 LEAKY_UNDEF_GARP_29,
64 LEAKY_UNDEF_GARP_2A,
65 LEAKY_UNDEF_GARP_2B,
66 LEAKY_UNDEF_GARP_2C,
67 LEAKY_UNDEF_GARP_2D,
68 LEAKY_UNDEF_GARP_2E,
69 LEAKY_UNDEF_GARP_2F,
70 LEAKY_IGMP,
71 LEAKY_IPMULTICAST,
72 LEAKY_CDP,
73 LEAKY_CSSTP,
74 LEAKY_LLDP,
75 LEAKY_END,
76 }rtk_leaky_type_t;
77
78 /* Function Name:
79 * rtk_leaky_vlan_set
80 * Description:
81 * Set VLAN leaky.
82 * Input:
83 * type - Packet type for VLAN leaky.
84 * enable - Leaky status.
85 * Output:
86 * None
87 * Return:
88 * RT_ERR_OK - OK
89 * RT_ERR_FAILED - Failed
90 * RT_ERR_SMI - SMI access error
91 * RT_ERR_INPUT - Invalid input parameters.
92 * RT_ERR_ENABLE - Invalid enable input
93 * Note:
94 * This API can set VLAN leaky for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets.
95 * The leaky frame types are as following:
96 * - LEAKY_BRG_GROUP,
97 * - LEAKY_FD_PAUSE,
98 * - LEAKY_SP_MCAST,
99 * - LEAKY_1X_PAE,
100 * - LEAKY_UNDEF_BRG_04,
101 * - LEAKY_UNDEF_BRG_05,
102 * - LEAKY_UNDEF_BRG_06,
103 * - LEAKY_UNDEF_BRG_07,
104 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
105 * - LEAKY_UNDEF_BRG_09,
106 * - LEAKY_UNDEF_BRG_0A,
107 * - LEAKY_UNDEF_BRG_0B,
108 * - LEAKY_UNDEF_BRG_0C,
109 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
110 * - LEAKY_8021AB,
111 * - LEAKY_UNDEF_BRG_0F,
112 * - LEAKY_BRG_MNGEMENT,
113 * - LEAKY_UNDEFINED_11,
114 * - LEAKY_UNDEFINED_12,
115 * - LEAKY_UNDEFINED_13,
116 * - LEAKY_UNDEFINED_14,
117 * - LEAKY_UNDEFINED_15,
118 * - LEAKY_UNDEFINED_16,
119 * - LEAKY_UNDEFINED_17,
120 * - LEAKY_UNDEFINED_18,
121 * - LEAKY_UNDEFINED_19,
122 * - LEAKY_UNDEFINED_1A,
123 * - LEAKY_UNDEFINED_1B,
124 * - LEAKY_UNDEFINED_1C,
125 * - LEAKY_UNDEFINED_1D,
126 * - LEAKY_UNDEFINED_1E,
127 * - LEAKY_UNDEFINED_1F,
128 * - LEAKY_GMRP,
129 * - LEAKY_GVRP,
130 * - LEAKY_UNDEF_GARP_22,
131 * - LEAKY_UNDEF_GARP_23,
132 * - LEAKY_UNDEF_GARP_24,
133 * - LEAKY_UNDEF_GARP_25,
134 * - LEAKY_UNDEF_GARP_26,
135 * - LEAKY_UNDEF_GARP_27,
136 * - LEAKY_UNDEF_GARP_28,
137 * - LEAKY_UNDEF_GARP_29,
138 * - LEAKY_UNDEF_GARP_2A,
139 * - LEAKY_UNDEF_GARP_2B,
140 * - LEAKY_UNDEF_GARP_2C,
141 * - LEAKY_UNDEF_GARP_2D,
142 * - LEAKY_UNDEF_GARP_2E,
143 * - LEAKY_UNDEF_GARP_2F,
144 * - LEAKY_IGMP,
145 * - LEAKY_IPMULTICAST.
146 * - LEAKY_CDP,
147 * - LEAKY_CSSTP,
148 * - LEAKY_LLDP.
149 */
150 extern rtk_api_ret_t rtk_leaky_vlan_set(rtk_leaky_type_t type, rtk_enable_t enable);
151
152 /* Function Name:
153 * rtk_leaky_vlan_get
154 * Description:
155 * Get VLAN leaky.
156 * Input:
157 * type - Packet type for VLAN leaky.
158 * Output:
159 * pEnable - Leaky status.
160 * Return:
161 * RT_ERR_OK - OK
162 * RT_ERR_FAILED - Failed
163 * RT_ERR_SMI - SMI access error
164 * RT_ERR_INPUT - Invalid input parameters.
165 * Note:
166 * This API can get VLAN leaky status for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets.
167 * The leaky frame types are as following:
168 * - LEAKY_BRG_GROUP,
169 * - LEAKY_FD_PAUSE,
170 * - LEAKY_SP_MCAST,
171 * - LEAKY_1X_PAE,
172 * - LEAKY_UNDEF_BRG_04,
173 * - LEAKY_UNDEF_BRG_05,
174 * - LEAKY_UNDEF_BRG_06,
175 * - LEAKY_UNDEF_BRG_07,
176 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
177 * - LEAKY_UNDEF_BRG_09,
178 * - LEAKY_UNDEF_BRG_0A,
179 * - LEAKY_UNDEF_BRG_0B,
180 * - LEAKY_UNDEF_BRG_0C,
181 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
182 * - LEAKY_8021AB,
183 * - LEAKY_UNDEF_BRG_0F,
184 * - LEAKY_BRG_MNGEMENT,
185 * - LEAKY_UNDEFINED_11,
186 * - LEAKY_UNDEFINED_12,
187 * - LEAKY_UNDEFINED_13,
188 * - LEAKY_UNDEFINED_14,
189 * - LEAKY_UNDEFINED_15,
190 * - LEAKY_UNDEFINED_16,
191 * - LEAKY_UNDEFINED_17,
192 * - LEAKY_UNDEFINED_18,
193 * - LEAKY_UNDEFINED_19,
194 * - LEAKY_UNDEFINED_1A,
195 * - LEAKY_UNDEFINED_1B,
196 * - LEAKY_UNDEFINED_1C,
197 * - LEAKY_UNDEFINED_1D,
198 * - LEAKY_UNDEFINED_1E,
199 * - LEAKY_UNDEFINED_1F,
200 * - LEAKY_GMRP,
201 * - LEAKY_GVRP,
202 * - LEAKY_UNDEF_GARP_22,
203 * - LEAKY_UNDEF_GARP_23,
204 * - LEAKY_UNDEF_GARP_24,
205 * - LEAKY_UNDEF_GARP_25,
206 * - LEAKY_UNDEF_GARP_26,
207 * - LEAKY_UNDEF_GARP_27,
208 * - LEAKY_UNDEF_GARP_28,
209 * - LEAKY_UNDEF_GARP_29,
210 * - LEAKY_UNDEF_GARP_2A,
211 * - LEAKY_UNDEF_GARP_2B,
212 * - LEAKY_UNDEF_GARP_2C,
213 * - LEAKY_UNDEF_GARP_2D,
214 * - LEAKY_UNDEF_GARP_2E,
215 * - LEAKY_UNDEF_GARP_2F,
216 * - LEAKY_IGMP,
217 * - LEAKY_IPMULTICAST.
218 * - LEAKY_CDP,
219 * - LEAKY_CSSTP,
220 * - LEAKY_LLDP.
221 */
222 extern rtk_api_ret_t rtk_leaky_vlan_get(rtk_leaky_type_t type, rtk_enable_t *pEnable);
223
224 /* Function Name:
225 * rtk_leaky_portIsolation_set
226 * Description:
227 * Set port isolation leaky.
228 * Input:
229 * type - Packet type for port isolation leaky.
230 * enable - Leaky status.
231 * Output:
232 * None
233 * Return:
234 * RT_ERR_OK - OK
235 * RT_ERR_FAILED - Failed
236 * RT_ERR_SMI - SMI access error
237 * RT_ERR_INPUT - Invalid input parameters.
238 * RT_ERR_ENABLE - Invalid enable input
239 * Note:
240 * This API can set port isolation leaky for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets.
241 * The leaky frame types are as following:
242 * - LEAKY_BRG_GROUP,
243 * - LEAKY_FD_PAUSE,
244 * - LEAKY_SP_MCAST,
245 * - LEAKY_1X_PAE,
246 * - LEAKY_UNDEF_BRG_04,
247 * - LEAKY_UNDEF_BRG_05,
248 * - LEAKY_UNDEF_BRG_06,
249 * - LEAKY_UNDEF_BRG_07,
250 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
251 * - LEAKY_UNDEF_BRG_09,
252 * - LEAKY_UNDEF_BRG_0A,
253 * - LEAKY_UNDEF_BRG_0B,
254 * - LEAKY_UNDEF_BRG_0C,
255 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
256 * - LEAKY_8021AB,
257 * - LEAKY_UNDEF_BRG_0F,
258 * - LEAKY_BRG_MNGEMENT,
259 * - LEAKY_UNDEFINED_11,
260 * - LEAKY_UNDEFINED_12,
261 * - LEAKY_UNDEFINED_13,
262 * - LEAKY_UNDEFINED_14,
263 * - LEAKY_UNDEFINED_15,
264 * - LEAKY_UNDEFINED_16,
265 * - LEAKY_UNDEFINED_17,
266 * - LEAKY_UNDEFINED_18,
267 * - LEAKY_UNDEFINED_19,
268 * - LEAKY_UNDEFINED_1A,
269 * - LEAKY_UNDEFINED_1B,
270 * - LEAKY_UNDEFINED_1C,
271 * - LEAKY_UNDEFINED_1D,
272 * - LEAKY_UNDEFINED_1E,
273 * - LEAKY_UNDEFINED_1F,
274 * - LEAKY_GMRP,
275 * - LEAKY_GVRP,
276 * - LEAKY_UNDEF_GARP_22,
277 * - LEAKY_UNDEF_GARP_23,
278 * - LEAKY_UNDEF_GARP_24,
279 * - LEAKY_UNDEF_GARP_25,
280 * - LEAKY_UNDEF_GARP_26,
281 * - LEAKY_UNDEF_GARP_27,
282 * - LEAKY_UNDEF_GARP_28,
283 * - LEAKY_UNDEF_GARP_29,
284 * - LEAKY_UNDEF_GARP_2A,
285 * - LEAKY_UNDEF_GARP_2B,
286 * - LEAKY_UNDEF_GARP_2C,
287 * - LEAKY_UNDEF_GARP_2D,
288 * - LEAKY_UNDEF_GARP_2E,
289 * - LEAKY_UNDEF_GARP_2F,
290 * - LEAKY_IGMP,
291 * - LEAKY_IPMULTICAST.
292 * - LEAKY_CDP,
293 * - LEAKY_CSSTP,
294 * - LEAKY_LLDP.
295 */
296 extern rtk_api_ret_t rtk_leaky_portIsolation_set(rtk_leaky_type_t type, rtk_enable_t enable);
297
298 /* Function Name:
299 * rtk_leaky_portIsolation_get
300 * Description:
301 * Get port isolation leaky.
302 * Input:
303 * type - Packet type for port isolation leaky.
304 * Output:
305 * pEnable - Leaky status.
306 * Return:
307 * RT_ERR_OK - OK
308 * RT_ERR_FAILED - Failed
309 * RT_ERR_SMI - SMI access error
310 * RT_ERR_INPUT - Invalid input parameters.
311 * Note:
312 * This API can get port isolation leaky status for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets.
313 * The leaky frame types are as following:
314 * - LEAKY_BRG_GROUP,
315 * - LEAKY_FD_PAUSE,
316 * - LEAKY_SP_MCAST,
317 * - LEAKY_1X_PAE,
318 * - LEAKY_UNDEF_BRG_04,
319 * - LEAKY_UNDEF_BRG_05,
320 * - LEAKY_UNDEF_BRG_06,
321 * - LEAKY_UNDEF_BRG_07,
322 * - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
323 * - LEAKY_UNDEF_BRG_09,
324 * - LEAKY_UNDEF_BRG_0A,
325 * - LEAKY_UNDEF_BRG_0B,
326 * - LEAKY_UNDEF_BRG_0C,
327 * - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
328 * - LEAKY_8021AB,
329 * - LEAKY_UNDEF_BRG_0F,
330 * - LEAKY_BRG_MNGEMENT,
331 * - LEAKY_UNDEFINED_11,
332 * - LEAKY_UNDEFINED_12,
333 * - LEAKY_UNDEFINED_13,
334 * - LEAKY_UNDEFINED_14,
335 * - LEAKY_UNDEFINED_15,
336 * - LEAKY_UNDEFINED_16,
337 * - LEAKY_UNDEFINED_17,
338 * - LEAKY_UNDEFINED_18,
339 * - LEAKY_UNDEFINED_19,
340 * - LEAKY_UNDEFINED_1A,
341 * - LEAKY_UNDEFINED_1B,
342 * - LEAKY_UNDEFINED_1C,
343 * - LEAKY_UNDEFINED_1D,
344 * - LEAKY_UNDEFINED_1E,
345 * - LEAKY_UNDEFINED_1F,
346 * - LEAKY_GMRP,
347 * - LEAKY_GVRP,
348 * - LEAKY_UNDEF_GARP_22,
349 * - LEAKY_UNDEF_GARP_23,
350 * - LEAKY_UNDEF_GARP_24,
351 * - LEAKY_UNDEF_GARP_25,
352 * - LEAKY_UNDEF_GARP_26,
353 * - LEAKY_UNDEF_GARP_27,
354 * - LEAKY_UNDEF_GARP_28,
355 * - LEAKY_UNDEF_GARP_29,
356 * - LEAKY_UNDEF_GARP_2A,
357 * - LEAKY_UNDEF_GARP_2B,
358 * - LEAKY_UNDEF_GARP_2C,
359 * - LEAKY_UNDEF_GARP_2D,
360 * - LEAKY_UNDEF_GARP_2E,
361 * - LEAKY_UNDEF_GARP_2F,
362 * - LEAKY_IGMP,
363 * - LEAKY_IPMULTICAST.
364 * - LEAKY_CDP,
365 * - LEAKY_CSSTP,
366 * - LEAKY_LLDP.
367 */
368 extern rtk_api_ret_t rtk_leaky_portIsolation_get(rtk_leaky_type_t type, rtk_enable_t *pEnable);
369
370 #endif /* __RTK_API_LEAKY_H__ */
371