• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/char/rtl8365mb/
1/*
2 * Copyright (C) 2013 Realtek Semiconductor Corp.
3 * All Rights Reserved.
4 *
5 * This program is the proprietary software of Realtek Semiconductor
6 * Corporation and/or its licensors, and only be used, duplicated,
7 * modified or distributed under the authorized license from Realtek.
8 *
9 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
10 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
11 *
12 * $Revision: 41080 $
13 * $Date: 2013-07-11 17:57:45 +0800 (������, 11 ������ 2013) $
14 *
15 * Purpose : RTK switch high-level API for RTL8367/RTL8367C
16 * Feature : Here is a list of all functions and variables in Leaky module.
17 *
18 */
19
20#include <rtk_switch.h>
21#include <rtk_error.h>
22#include <leaky.h>
23#ifndef __KERNEL__
24#include <string.h>
25#else
26#include <linux/string.h>
27#endif
28
29#include <rtl8367c_asicdrv.h>
30#include <rtl8367c_asicdrv_portIsolation.h>
31#include <rtl8367c_asicdrv_rma.h>
32#include <rtl8367c_asicdrv_igmp.h>
33
34
35/* Function Name:
36 *      rtk_leaky_vlan_set
37 * Description:
38 *      Set VLAN leaky.
39 * Input:
40 *      type - Packet type for VLAN leaky.
41 *      enable - Leaky status.
42 * Output:
43 *      None
44 * Return:
45 *      RT_ERR_OK           - OK
46 *      RT_ERR_FAILED       - Failed
47 *      RT_ERR_SMI          - SMI access error
48 *      RT_ERR_INPUT 		- Invalid input parameters.
49 *      RT_ERR_ENABLE       - Invalid enable input
50 * Note:
51 *      This API can set VLAN leaky for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP packets.
52 *      The leaky frame types are as following:
53 *      - LEAKY_BRG_GROUP,
54 *      - LEAKY_FD_PAUSE,
55 *      - LEAKY_SP_MCAST,
56 *      - LEAKY_1X_PAE,
57 *      - LEAKY_UNDEF_BRG_04,
58 *      - LEAKY_UNDEF_BRG_05,
59 *      - LEAKY_UNDEF_BRG_06,
60 *      - LEAKY_UNDEF_BRG_07,
61 *      - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
62 *      - LEAKY_UNDEF_BRG_09,
63 *      - LEAKY_UNDEF_BRG_0A,
64 *      - LEAKY_UNDEF_BRG_0B,
65 *      - LEAKY_UNDEF_BRG_0C,
66 *      - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
67 *      - LEAKY_8021AB,
68 *      - LEAKY_UNDEF_BRG_0F,
69 *      - LEAKY_BRG_MNGEMENT,
70 *      - LEAKY_UNDEFINED_11,
71 *      - LEAKY_UNDEFINED_12,
72 *      - LEAKY_UNDEFINED_13,
73 *      - LEAKY_UNDEFINED_14,
74 *      - LEAKY_UNDEFINED_15,
75 *      - LEAKY_UNDEFINED_16,
76 *      - LEAKY_UNDEFINED_17,
77 *      - LEAKY_UNDEFINED_18,
78 *      - LEAKY_UNDEFINED_19,
79 *      - LEAKY_UNDEFINED_1A,
80 *      - LEAKY_UNDEFINED_1B,
81 *      - LEAKY_UNDEFINED_1C,
82 *      - LEAKY_UNDEFINED_1D,
83 *      - LEAKY_UNDEFINED_1E,
84 *      - LEAKY_UNDEFINED_1F,
85 *      - LEAKY_GMRP,
86 *      - LEAKY_GVRP,
87 *      - LEAKY_UNDEF_GARP_22,
88 *      - LEAKY_UNDEF_GARP_23,
89 *      - LEAKY_UNDEF_GARP_24,
90 *      - LEAKY_UNDEF_GARP_25,
91 *      - LEAKY_UNDEF_GARP_26,
92 *      - LEAKY_UNDEF_GARP_27,
93 *      - LEAKY_UNDEF_GARP_28,
94 *      - LEAKY_UNDEF_GARP_29,
95 *      - LEAKY_UNDEF_GARP_2A,
96 *      - LEAKY_UNDEF_GARP_2B,
97 *      - LEAKY_UNDEF_GARP_2C,
98 *      - LEAKY_UNDEF_GARP_2D,
99 *      - LEAKY_UNDEF_GARP_2E,
100 *      - LEAKY_UNDEF_GARP_2F,
101 *      - LEAKY_IGMP,
102 *      - LEAKY_IPMULTICAST.
103 *      - LEAKY_CDP,
104 *      - LEAKY_CSSTP,
105 *      - LEAKY_LLDP.
106 */
107rtk_api_ret_t rtk_leaky_vlan_set(rtk_leaky_type_t type, rtk_enable_t enable)
108{
109    rtk_api_ret_t retVal;
110    rtk_uint32 port;
111    rtl8367c_rma_t rmacfg;
112    rtk_uint32 tmp;
113
114    /* Check initialization state */
115    RTK_CHK_INIT_STATE();
116
117    if (type >= LEAKY_END)
118        return RT_ERR_INPUT;
119
120    if (enable >= RTK_ENABLE_END)
121        return RT_ERR_INPUT;
122
123    if (type >= 0 && type <= LEAKY_UNDEF_GARP_2F)
124    {
125        if ((retVal = rtl8367c_getAsicRma(type, &rmacfg)) != RT_ERR_OK)
126            return retVal;
127
128        rmacfg.vlan_leaky = enable;
129
130        if ((retVal = rtl8367c_setAsicRma(type, &rmacfg)) != RT_ERR_OK)
131            return retVal;
132    }
133    else if (LEAKY_IPMULTICAST == type)
134    {
135        for (port = 0; port <= RTK_PORT_ID_MAX; port++)
136        {
137            if ((retVal = rtl8367c_setAsicIpMulticastVlanLeaky(port,enable)) != RT_ERR_OK)
138                return retVal;
139        }
140    }
141    else if (LEAKY_IGMP == type)
142    {
143        if ((retVal = rtl8367c_setAsicIGMPVLANLeaky(enable)) != RT_ERR_OK)
144            return retVal;
145    }
146    else if (LEAKY_CDP == type)
147    {
148        if ((retVal = rtl8367c_getAsicRmaCdp(&rmacfg)) != RT_ERR_OK)
149            return retVal;
150
151        rmacfg.vlan_leaky = enable;
152
153        if ((retVal = rtl8367c_setAsicRmaCdp(&rmacfg)) != RT_ERR_OK)
154            return retVal;
155    }
156    else if (LEAKY_CSSTP == type)
157    {
158        if ((retVal = rtl8367c_getAsicRmaCsstp(&rmacfg)) != RT_ERR_OK)
159            return retVal;
160
161        rmacfg.vlan_leaky = enable;
162
163        if ((retVal = rtl8367c_setAsicRmaCsstp(&rmacfg)) != RT_ERR_OK)
164            return retVal;
165    }
166    else if (LEAKY_LLDP == type)
167    {
168        if ((retVal = rtl8367c_getAsicRmaLldp(&tmp,&rmacfg)) != RT_ERR_OK)
169            return retVal;
170
171        rmacfg.vlan_leaky = enable;
172
173        if ((retVal = rtl8367c_setAsicRmaLldp(tmp, &rmacfg)) != RT_ERR_OK)
174            return retVal;
175    }
176
177    return RT_ERR_OK;
178}
179
180/* Function Name:
181 *      rtk_leaky_vlan_get
182 * Description:
183 *      Get VLAN leaky.
184 * Input:
185 *      type - Packet type for VLAN leaky.
186 * Output:
187 *      pEnable - Leaky status.
188 * Return:
189 *      RT_ERR_OK           - OK
190 *      RT_ERR_FAILED       - Failed
191 *      RT_ERR_SMI          - SMI access error
192 *      RT_ERR_INPUT 		- Invalid input parameters.
193 * Note:
194 *      This API can get VLAN leaky status for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP  packets.
195 *      The leaky frame types are as following:
196 *      - LEAKY_BRG_GROUP,
197 *      - LEAKY_FD_PAUSE,
198 *      - LEAKY_SP_MCAST,
199 *      - LEAKY_1X_PAE,
200 *      - LEAKY_UNDEF_BRG_04,
201 *      - LEAKY_UNDEF_BRG_05,
202 *      - LEAKY_UNDEF_BRG_06,
203 *      - LEAKY_UNDEF_BRG_07,
204 *      - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
205 *      - LEAKY_UNDEF_BRG_09,
206 *      - LEAKY_UNDEF_BRG_0A,
207 *      - LEAKY_UNDEF_BRG_0B,
208 *      - LEAKY_UNDEF_BRG_0C,
209 *      - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
210 *      - LEAKY_8021AB,
211 *      - LEAKY_UNDEF_BRG_0F,
212 *      - LEAKY_BRG_MNGEMENT,
213 *      - LEAKY_UNDEFINED_11,
214 *      - LEAKY_UNDEFINED_12,
215 *      - LEAKY_UNDEFINED_13,
216 *      - LEAKY_UNDEFINED_14,
217 *      - LEAKY_UNDEFINED_15,
218 *      - LEAKY_UNDEFINED_16,
219 *      - LEAKY_UNDEFINED_17,
220 *      - LEAKY_UNDEFINED_18,
221 *      - LEAKY_UNDEFINED_19,
222 *      - LEAKY_UNDEFINED_1A,
223 *      - LEAKY_UNDEFINED_1B,
224 *      - LEAKY_UNDEFINED_1C,
225 *      - LEAKY_UNDEFINED_1D,
226 *      - LEAKY_UNDEFINED_1E,
227 *      - LEAKY_UNDEFINED_1F,
228 *      - LEAKY_GMRP,
229 *      - LEAKY_GVRP,
230 *      - LEAKY_UNDEF_GARP_22,
231 *      - LEAKY_UNDEF_GARP_23,
232 *      - LEAKY_UNDEF_GARP_24,
233 *      - LEAKY_UNDEF_GARP_25,
234 *      - LEAKY_UNDEF_GARP_26,
235 *      - LEAKY_UNDEF_GARP_27,
236 *      - LEAKY_UNDEF_GARP_28,
237 *      - LEAKY_UNDEF_GARP_29,
238 *      - LEAKY_UNDEF_GARP_2A,
239 *      - LEAKY_UNDEF_GARP_2B,
240 *      - LEAKY_UNDEF_GARP_2C,
241 *      - LEAKY_UNDEF_GARP_2D,
242 *      - LEAKY_UNDEF_GARP_2E,
243 *      - LEAKY_UNDEF_GARP_2F,
244 *      - LEAKY_IGMP,
245 *      - LEAKY_IPMULTICAST.
246 *      - LEAKY_CDP,
247 *      - LEAKY_CSSTP,
248 *      - LEAKY_LLDP.
249 */
250rtk_api_ret_t rtk_leaky_vlan_get(rtk_leaky_type_t type, rtk_enable_t *pEnable)
251{
252    rtk_api_ret_t retVal;
253    rtk_uint32 port,tmp;
254    rtl8367c_rma_t rmacfg;
255
256    /* Check initialization state */
257    RTK_CHK_INIT_STATE();
258
259    if (type >= LEAKY_END)
260        return RT_ERR_INPUT;
261
262    if(NULL == pEnable)
263        return RT_ERR_NULL_POINTER;
264
265    if (type >= 0 && type <= LEAKY_UNDEF_GARP_2F)
266    {
267        if ((retVal = rtl8367c_getAsicRma(type, &rmacfg)) != RT_ERR_OK)
268            return retVal;
269
270        *pEnable = rmacfg.vlan_leaky;
271
272    }
273    else if (LEAKY_IPMULTICAST == type)
274    {
275        for (port = 0; port <= RTK_PORT_ID_MAX; port++)
276        {
277            if ((retVal = rtl8367c_getAsicIpMulticastVlanLeaky(port, &tmp)) != RT_ERR_OK)
278                return retVal;
279            if (port>0&&(tmp!=*pEnable))
280                return RT_ERR_FAILED;
281            *pEnable = tmp;
282        }
283    }
284    else if (LEAKY_IGMP == type)
285    {
286        if ((retVal = rtl8367c_getAsicIGMPVLANLeaky(&tmp)) != RT_ERR_OK)
287            return retVal;
288
289        *pEnable = tmp;
290    }
291    else if (LEAKY_CDP == type)
292    {
293        if ((retVal = rtl8367c_getAsicRmaCdp(&rmacfg)) != RT_ERR_OK)
294            return retVal;
295
296        *pEnable = rmacfg.vlan_leaky;
297    }
298    else if (LEAKY_CSSTP == type)
299    {
300        if ((retVal = rtl8367c_getAsicRmaCsstp(&rmacfg)) != RT_ERR_OK)
301            return retVal;
302
303        *pEnable = rmacfg.vlan_leaky;
304    }
305    else if (LEAKY_LLDP == type)
306    {
307        if ((retVal = rtl8367c_getAsicRmaLldp(&tmp, &rmacfg)) != RT_ERR_OK)
308            return retVal;
309
310        *pEnable = rmacfg.vlan_leaky;
311    }
312
313    return RT_ERR_OK;
314}
315
316/* Function Name:
317 *      rtk_leaky_portIsolation_set
318 * Description:
319 *      Set port isolation leaky.
320 * Input:
321 *      type - Packet type for port isolation leaky.
322 *      enable - Leaky status.
323 * Output:
324 *      None
325 * Return:
326 *      RT_ERR_OK           - OK
327 *      RT_ERR_FAILED       - Failed
328 *      RT_ERR_SMI          - SMI access error
329 *      RT_ERR_INPUT 		- Invalid input parameters.
330 *      RT_ERR_ENABLE       - Invalid enable input
331 * Note:
332 *      This API can set port isolation leaky for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP  packets.
333 *      The leaky frame types are as following:
334 *      - LEAKY_BRG_GROUP,
335 *      - LEAKY_FD_PAUSE,
336 *      - LEAKY_SP_MCAST,
337 *      - LEAKY_1X_PAE,
338 *      - LEAKY_UNDEF_BRG_04,
339 *      - LEAKY_UNDEF_BRG_05,
340 *      - LEAKY_UNDEF_BRG_06,
341 *      - LEAKY_UNDEF_BRG_07,
342 *      - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
343 *      - LEAKY_UNDEF_BRG_09,
344 *      - LEAKY_UNDEF_BRG_0A,
345 *      - LEAKY_UNDEF_BRG_0B,
346 *      - LEAKY_UNDEF_BRG_0C,
347 *      - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
348 *      - LEAKY_8021AB,
349 *      - LEAKY_UNDEF_BRG_0F,
350 *      - LEAKY_BRG_MNGEMENT,
351 *      - LEAKY_UNDEFINED_11,
352 *      - LEAKY_UNDEFINED_12,
353 *      - LEAKY_UNDEFINED_13,
354 *      - LEAKY_UNDEFINED_14,
355 *      - LEAKY_UNDEFINED_15,
356 *      - LEAKY_UNDEFINED_16,
357 *      - LEAKY_UNDEFINED_17,
358 *      - LEAKY_UNDEFINED_18,
359 *      - LEAKY_UNDEFINED_19,
360 *      - LEAKY_UNDEFINED_1A,
361 *      - LEAKY_UNDEFINED_1B,
362 *      - LEAKY_UNDEFINED_1C,
363 *      - LEAKY_UNDEFINED_1D,
364 *      - LEAKY_UNDEFINED_1E,
365 *      - LEAKY_UNDEFINED_1F,
366 *      - LEAKY_GMRP,
367 *      - LEAKY_GVRP,
368 *      - LEAKY_UNDEF_GARP_22,
369 *      - LEAKY_UNDEF_GARP_23,
370 *      - LEAKY_UNDEF_GARP_24,
371 *      - LEAKY_UNDEF_GARP_25,
372 *      - LEAKY_UNDEF_GARP_26,
373 *      - LEAKY_UNDEF_GARP_27,
374 *      - LEAKY_UNDEF_GARP_28,
375 *      - LEAKY_UNDEF_GARP_29,
376 *      - LEAKY_UNDEF_GARP_2A,
377 *      - LEAKY_UNDEF_GARP_2B,
378 *      - LEAKY_UNDEF_GARP_2C,
379 *      - LEAKY_UNDEF_GARP_2D,
380 *      - LEAKY_UNDEF_GARP_2E,
381 *      - LEAKY_UNDEF_GARP_2F,
382 *      - LEAKY_IGMP,
383 *      - LEAKY_IPMULTICAST.
384 *      - LEAKY_CDP,
385 *      - LEAKY_CSSTP,
386 *      - LEAKY_LLDP.
387 */
388rtk_api_ret_t rtk_leaky_portIsolation_set(rtk_leaky_type_t type, rtk_enable_t enable)
389{
390    rtk_api_ret_t retVal;
391    rtk_uint32 port;
392    rtl8367c_rma_t rmacfg;
393    rtk_uint32 tmp;
394
395    /* Check initialization state */
396    RTK_CHK_INIT_STATE();
397
398    if (type >= LEAKY_END)
399        return RT_ERR_INPUT;
400
401    if (enable >= RTK_ENABLE_END)
402        return RT_ERR_INPUT;
403
404    if (type >= 0 && type <= LEAKY_UNDEF_GARP_2F)
405    {
406        if ((retVal = rtl8367c_getAsicRma(type, &rmacfg)) != RT_ERR_OK)
407            return retVal;
408
409        rmacfg.portiso_leaky = enable;
410
411        if ((retVal = rtl8367c_setAsicRma(type, &rmacfg)) != RT_ERR_OK)
412            return retVal;
413    }
414    else if (LEAKY_IPMULTICAST == type)
415    {
416        for (port = 0; port < RTK_MAX_NUM_OF_PORT; port++)
417        {
418            if ((retVal = rtl8367c_setAsicIpMulticastPortIsoLeaky(port,enable)) != RT_ERR_OK)
419                return retVal;
420        }
421    }
422    else if (LEAKY_IGMP == type)
423    {
424        if ((retVal = rtl8367c_setAsicIGMPIsoLeaky(enable)) != RT_ERR_OK)
425            return retVal;
426    }
427    else if (LEAKY_CDP == type)
428    {
429        if ((retVal = rtl8367c_getAsicRmaCdp(&rmacfg)) != RT_ERR_OK)
430            return retVal;
431
432        rmacfg.portiso_leaky = enable;
433
434        if ((retVal = rtl8367c_setAsicRmaCdp(&rmacfg)) != RT_ERR_OK)
435            return retVal;
436    }
437    else if (LEAKY_CSSTP == type)
438    {
439        if ((retVal = rtl8367c_getAsicRmaCsstp(&rmacfg)) != RT_ERR_OK)
440            return retVal;
441
442        rmacfg.portiso_leaky = enable;
443
444        if ((retVal = rtl8367c_setAsicRmaCsstp(&rmacfg)) != RT_ERR_OK)
445            return retVal;
446    }
447    else if (LEAKY_LLDP == type)
448    {
449        if ((retVal = rtl8367c_getAsicRmaLldp(&tmp, &rmacfg)) != RT_ERR_OK)
450            return retVal;
451
452        rmacfg.portiso_leaky = enable;
453
454        if ((retVal = rtl8367c_setAsicRmaLldp(tmp, &rmacfg)) != RT_ERR_OK)
455            return retVal;
456    }
457
458    return RT_ERR_OK;
459}
460
461/* Function Name:
462 *      rtk_leaky_portIsolation_get
463 * Description:
464 *      Get port isolation leaky.
465 * Input:
466 *      type - Packet type for port isolation leaky.
467 * Output:
468 *      pEnable - Leaky status.
469 * Return:
470 *      RT_ERR_OK           - OK
471 *      RT_ERR_FAILED       - Failed
472 *      RT_ERR_SMI          - SMI access error
473 *      RT_ERR_INPUT 		- Invalid input parameters.
474 * Note:
475 *      This API can get port isolation leaky status for RMA ,IGMP/MLD, CDP, CSSTP, and LLDP  packets.
476 *      The leaky frame types are as following:
477 *      - LEAKY_BRG_GROUP,
478 *      - LEAKY_FD_PAUSE,
479 *      - LEAKY_SP_MCAST,
480 *      - LEAKY_1X_PAE,
481 *      - LEAKY_UNDEF_BRG_04,
482 *      - LEAKY_UNDEF_BRG_05,
483 *      - LEAKY_UNDEF_BRG_06,
484 *      - LEAKY_UNDEF_BRG_07,
485 *      - LEAKY_PROVIDER_BRIDGE_GROUP_ADDRESS,
486 *      - LEAKY_UNDEF_BRG_09,
487 *      - LEAKY_UNDEF_BRG_0A,
488 *      - LEAKY_UNDEF_BRG_0B,
489 *      - LEAKY_UNDEF_BRG_0C,
490 *      - LEAKY_PROVIDER_BRIDGE_GVRP_ADDRESS,
491 *      - LEAKY_8021AB,
492 *      - LEAKY_UNDEF_BRG_0F,
493 *      - LEAKY_BRG_MNGEMENT,
494 *      - LEAKY_UNDEFINED_11,
495 *      - LEAKY_UNDEFINED_12,
496 *      - LEAKY_UNDEFINED_13,
497 *      - LEAKY_UNDEFINED_14,
498 *      - LEAKY_UNDEFINED_15,
499 *      - LEAKY_UNDEFINED_16,
500 *      - LEAKY_UNDEFINED_17,
501 *      - LEAKY_UNDEFINED_18,
502 *      - LEAKY_UNDEFINED_19,
503 *      - LEAKY_UNDEFINED_1A,
504 *      - LEAKY_UNDEFINED_1B,
505 *      - LEAKY_UNDEFINED_1C,
506 *      - LEAKY_UNDEFINED_1D,
507 *      - LEAKY_UNDEFINED_1E,
508 *      - LEAKY_UNDEFINED_1F,
509 *      - LEAKY_GMRP,
510 *      - LEAKY_GVRP,
511 *      - LEAKY_UNDEF_GARP_22,
512 *      - LEAKY_UNDEF_GARP_23,
513 *      - LEAKY_UNDEF_GARP_24,
514 *      - LEAKY_UNDEF_GARP_25,
515 *      - LEAKY_UNDEF_GARP_26,
516 *      - LEAKY_UNDEF_GARP_27,
517 *      - LEAKY_UNDEF_GARP_28,
518 *      - LEAKY_UNDEF_GARP_29,
519 *      - LEAKY_UNDEF_GARP_2A,
520 *      - LEAKY_UNDEF_GARP_2B,
521 *      - LEAKY_UNDEF_GARP_2C,
522 *      - LEAKY_UNDEF_GARP_2D,
523 *      - LEAKY_UNDEF_GARP_2E,
524 *      - LEAKY_UNDEF_GARP_2F,
525 *      - LEAKY_IGMP,
526 *      - LEAKY_IPMULTICAST.
527 *      - LEAKY_CDP,
528 *      - LEAKY_CSSTP,
529 *      - LEAKY_LLDP.
530 */
531rtk_api_ret_t rtk_leaky_portIsolation_get(rtk_leaky_type_t type, rtk_enable_t *pEnable)
532{
533    rtk_api_ret_t retVal;
534    rtk_uint32 port, tmp;
535    rtl8367c_rma_t rmacfg;
536
537    /* Check initialization state */
538    RTK_CHK_INIT_STATE();
539
540    if (type >= LEAKY_END)
541        return RT_ERR_INPUT;
542
543    if(NULL == pEnable)
544        return RT_ERR_NULL_POINTER;
545
546    if (type >= 0 && type <= LEAKY_UNDEF_GARP_2F)
547    {
548        if ((retVal = rtl8367c_getAsicRma(type, &rmacfg)) != RT_ERR_OK)
549            return retVal;
550
551        *pEnable = rmacfg.portiso_leaky;
552
553    }
554    else if (LEAKY_IPMULTICAST == type)
555    {
556        for (port = 0; port < RTK_MAX_NUM_OF_PORT; port++)
557        {
558            if ((retVal = rtl8367c_getAsicIpMulticastPortIsoLeaky(port, &tmp)) != RT_ERR_OK)
559                return retVal;
560            if (port > 0 &&(tmp != *pEnable))
561                return RT_ERR_FAILED;
562            *pEnable = tmp;
563        }
564    }
565    else if (LEAKY_IGMP == type)
566    {
567        if ((retVal = rtl8367c_getAsicIGMPIsoLeaky(&tmp)) != RT_ERR_OK)
568            return retVal;
569
570        *pEnable = tmp;
571    }
572    else if (LEAKY_CDP == type)
573    {
574        if ((retVal = rtl8367c_getAsicRmaCdp(&rmacfg)) != RT_ERR_OK)
575            return retVal;
576
577        *pEnable = rmacfg.portiso_leaky;
578    }
579    else if (LEAKY_CSSTP == type)
580    {
581        if ((retVal = rtl8367c_getAsicRmaCsstp(&rmacfg)) != RT_ERR_OK)
582            return retVal;
583
584        *pEnable = rmacfg.portiso_leaky;
585    }
586    else if (LEAKY_LLDP == type)
587    {
588        if ((retVal = rtl8367c_getAsicRmaLldp(&tmp, &rmacfg)) != RT_ERR_OK)
589            return retVal;
590
591        *pEnable = rmacfg.portiso_leaky;
592    }
593
594
595    return RT_ERR_OK;
596}
597