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 SVLAN module high-layer API defination
16 #ifndef __RTK_API_SVLAN_H__
17 #define __RTK_API_SVLAN_H__
19 typedef rtk_uint32 rtk_svlan_index_t
;
21 typedef struct rtk_svlan_memberCfg_s
{
23 rtk_portmask_t memberport
;
24 rtk_portmask_t untagport
;
30 }rtk_svlan_memberCfg_t
;
32 typedef enum rtk_svlan_pri_ref_e
39 } rtk_svlan_pri_ref_t
;
42 typedef rtk_uint32 rtk_svlan_tpid_t
;
44 typedef enum rtk_svlan_untag_action_e
50 } rtk_svlan_untag_action_t
;
52 typedef enum rtk_svlan_unmatch_action_e
58 } rtk_svlan_unmatch_action_t
;
60 typedef enum rtk_svlan_unassign_action_e
65 } rtk_svlan_unassign_action_t
;
68 typedef enum rtk_svlan_lookupType_e
70 SVLAN_LOOKUP_S64MBRCGF
= 0,
74 } rtk_svlan_lookupType_t
;
79 * Initialize SVLAN Configuration
86 * RT_ERR_FAILED - Failed
87 * RT_ERR_SMI - SMI access error
89 * Ether type of S-tag in 802.1ad is 0x88a8 and there are existed ether type 0x9100 and 0x9200 for Q-in-Q SLAN design.
90 * User can set mathced ether type as service provider supported protocol.
92 extern rtk_api_ret_t
rtk_svlan_init(void);
95 * rtk_svlan_servicePort_add
97 * Add one service port in the specified device
104 * RT_ERR_FAILED - Failed
105 * RT_ERR_SMI - SMI access error
106 * RT_ERR_PORT_ID - Invalid port number.
107 * RT_ERR_INPUT - Invalid input parameters.
109 * This API is setting which port is connected to provider switch. All frames receiving from this port must
110 * contain accept SVID in S-tag field.
112 extern rtk_api_ret_t
rtk_svlan_servicePort_add(rtk_port_t port
);
115 * rtk_svlan_servicePort_get
117 * Get service ports in the specified device.
121 * pSvlan_portmask - pointer buffer of svlan ports.
124 * RT_ERR_FAILED - Failed
125 * RT_ERR_SMI - SMI access error
127 * This API is setting which port is connected to provider switch. All frames receiving from this port must
128 * contain accept SVID in S-tag field.
130 extern rtk_api_ret_t
rtk_svlan_servicePort_get(rtk_portmask_t
*pSvlan_portmask
);
133 * rtk_svlan_servicePort_del
135 * Delete one service port in the specified device
142 * RT_ERR_FAILED - Failed
143 * RT_ERR_SMI - SMI access error
144 * RT_ERR_PORT_ID - Invalid port number.
146 * This API is removing SVLAN service port in the specified device.
148 extern rtk_api_ret_t
rtk_svlan_servicePort_del(rtk_port_t port
);
151 * rtk_svlan_tpidEntry_set
153 * Configure accepted S-VLAN ether type.
155 * svlan_tag_id - Ether type of S-tag frame parsing in uplink ports.
160 * RT_ERR_FAILED - Failed
161 * RT_ERR_SMI - SMI access error
162 * RT_ERR_INPUT - Invalid input parameter.
164 * Ether type of S-tag in 802.1ad is 0x88a8 and there are existed ether type 0x9100 and 0x9200 for Q-in-Q SLAN design.
165 * User can set mathced ether type as service provider supported protocol.
167 extern rtk_api_ret_t
rtk_svlan_tpidEntry_set(rtk_uint32 svlan_tag_id
);
170 * rtk_svlan_tpidEntry_get
172 * Get accepted S-VLAN ether type setting.
176 * pSvlan_tag_id - Ether type of S-tag frame parsing in uplink ports.
179 * RT_ERR_FAILED - Failed
180 * RT_ERR_SMI - SMI access error
182 * This API is setting which port is connected to provider switch. All frames receiving from this port must
183 * contain accept SVID in S-tag field.
185 extern rtk_api_ret_t
rtk_svlan_tpidEntry_get(rtk_uint32
*pSvlan_tag_id
);
188 * rtk_svlan_priorityRef_set
190 * Set S-VLAN upstream priority reference setting.
192 * ref - reference selection parameter.
197 * RT_ERR_FAILED - Failed
198 * RT_ERR_SMI - SMI access error
199 * RT_ERR_INPUT - Invalid input parameter.
201 * The API can set the upstream SVLAN tag priority reference source. The related priority
202 * sources are as following:
203 * - REF_INTERNAL_PRI,
208 extern rtk_api_ret_t
rtk_svlan_priorityRef_set(rtk_svlan_pri_ref_t ref
);
211 * rtk_svlan_priorityRef_get
213 * Get S-VLAN upstream priority reference setting.
217 * pRef - reference selection parameter.
220 * RT_ERR_FAILED - Failed
221 * RT_ERR_SMI - SMI access error
223 * The API can get the upstream SVLAN tag priority reference source. The related priority
224 * sources are as following:
225 * - REF_INTERNAL_PRI,
230 extern rtk_api_ret_t
rtk_svlan_priorityRef_get(rtk_svlan_pri_ref_t
*pRef
);
233 * rtk_svlan_memberPortEntry_set
235 * Configure system SVLAN member content
238 * psvlan_cfg - SVLAN member configuration
243 * RT_ERR_FAILED - Failed
244 * RT_ERR_SMI - SMI access error
245 * RT_ERR_INPUT - Invalid input parameter.
246 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
247 * RT_ERR_PORT_MASK - Invalid portmask.
248 * RT_ERR_SVLAN_TABLE_FULL - SVLAN configuration is full.
250 * The API can set system 64 accepted s-tag frame format. Only 64 SVID S-tag frame will be accpeted
251 * to receiving from uplink ports. Other SVID S-tag frame or S-untagged frame will be droped by default setup.
252 * - rtk_svlan_memberCfg_t->svid is SVID of SVLAN member configuration.
253 * - rtk_svlan_memberCfg_t->memberport is member port mask of SVLAN member configuration.
254 * - rtk_svlan_memberCfg_t->fid is filtering database of SVLAN member configuration.
255 * - rtk_svlan_memberCfg_t->priority is priority of SVLAN member configuration.
257 extern rtk_api_ret_t
rtk_svlan_memberPortEntry_set(rtk_uint32 svid_idx
, rtk_svlan_memberCfg_t
*psvlan_cfg
);
260 * rtk_svlan_memberPortEntry_get
262 * Get SVLAN member Configure.
266 * pSvlan_cfg - SVLAN member configuration
269 * RT_ERR_FAILED - Failed
270 * RT_ERR_SMI - SMI access error
271 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
272 * RT_ERR_INPUT - Invalid input parameters.
274 * The API can get system 64 accepted s-tag frame format. Only 64 SVID S-tag frame will be accpeted
275 * to receiving from uplink ports. Other SVID S-tag frame or S-untagged frame will be droped.
277 extern rtk_api_ret_t
rtk_svlan_memberPortEntry_get(rtk_uint32 svid_idx
, rtk_svlan_memberCfg_t
*pSvlan_cfg
);
280 * rtk_svlan_memberPortEntry_adv_set
282 * Configure system SVLAN member by index
284 * idx - Index (0 ~ 63)
285 * psvlan_cfg - SVLAN member configuration
290 * RT_ERR_FAILED - Failed
291 * RT_ERR_SMI - SMI access error
292 * RT_ERR_INPUT - Invalid input parameter.
293 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
294 * RT_ERR_PORT_MASK - Invalid portmask.
295 * RT_ERR_SVLAN_TABLE_FULL - SVLAN configuration is full.
297 * The API can set system 64 accepted s-tag frame format by index.
298 * - rtk_svlan_memberCfg_t->svid is SVID of SVLAN member configuration.
299 * - rtk_svlan_memberCfg_t->memberport is member port mask of SVLAN member configuration.
300 * - rtk_svlan_memberCfg_t->fid is filtering database of SVLAN member configuration.
301 * - rtk_svlan_memberCfg_t->priority is priority of SVLAN member configuration.
303 extern rtk_api_ret_t
rtk_svlan_memberPortEntry_adv_set(rtk_uint32 idx
, rtk_svlan_memberCfg_t
*pSvlan_cfg
);
306 * rtk_svlan_memberPortEntry_adv_get
308 * Get SVLAN member Configure by index.
310 * idx - Index (0 ~ 63)
312 * pSvlan_cfg - SVLAN member configuration
315 * RT_ERR_FAILED - Failed
316 * RT_ERR_SMI - SMI access error
317 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
318 * RT_ERR_INPUT - Invalid input parameters.
320 * The API can get system 64 accepted s-tag frame format. Only 64 SVID S-tag frame will be accpeted
321 * to receiving from uplink ports. Other SVID S-tag frame or S-untagged frame will be droped.
323 extern rtk_api_ret_t
rtk_svlan_memberPortEntry_adv_get(rtk_uint32 idx
, rtk_svlan_memberCfg_t
*pSvlan_cfg
);
326 * rtk_svlan_defaultSvlan_set
328 * Configure default egress SVLAN.
336 * RT_ERR_FAILED - Failed
337 * RT_ERR_SMI - SMI access error
338 * RT_ERR_INPUT - Invalid input parameter.
339 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
340 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
342 * The API can set port n S-tag format index while receiving frame from port n
343 * is transmit through uplink port with s-tag field
345 extern rtk_api_ret_t
rtk_svlan_defaultSvlan_set(rtk_port_t port
, rtk_vlan_t svid
);
348 * rtk_svlan_defaultSvlan_get
350 * Get the configure default egress SVLAN.
357 * RT_ERR_FAILED - Failed
358 * RT_ERR_SMI - SMI access error
359 * RT_ERR_INPUT - Invalid input parameters.
361 * The API can get port n S-tag format index while receiving frame from port n
362 * is transmit through uplink port with s-tag field
364 extern rtk_api_ret_t
rtk_svlan_defaultSvlan_get(rtk_port_t port
, rtk_vlan_t
*pSvid
);
369 * Configure SVLAN C2S table
372 * src_port - Ingress Port
378 * RT_ERR_FAILED - Failed
379 * RT_ERR_SMI - SMI access error
380 * RT_ERR_PORT_ID - Invalid port ID.
381 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
382 * RT_ERR_VLAN_VID - Invalid VID parameter.
383 * RT_ERR_OUT_OF_RANGE - input out of range.
384 * RT_ERR_INPUT - Invalid input parameters.
386 * The API can set system C2S configuration. ASIC will check upstream's VID and assign related
387 * SVID to mathed packet. There are 128 SVLAN C2S configurations.
389 extern rtk_api_ret_t
rtk_svlan_c2s_add(rtk_vlan_t vid
, rtk_port_t src_port
, rtk_vlan_t svid
);
394 * Delete one C2S entry
397 * src_port - Ingress Port
403 * RT_ERR_FAILED - Failed
404 * RT_ERR_SMI - SMI access error
405 * RT_ERR_VLAN_VID - Invalid VID parameter.
406 * RT_ERR_PORT_ID - Invalid port ID.
407 * RT_ERR_OUT_OF_RANGE - input out of range.
409 * The API can delete system C2S configuration. There are 128 SVLAN C2S configurations.
411 extern rtk_api_ret_t
rtk_svlan_c2s_del(rtk_vlan_t vid
, rtk_port_t src_port
);
416 * Get configure SVLAN C2S table
419 * src_port - Ingress Port
424 * RT_ERR_FAILED - Failed
425 * RT_ERR_SMI - SMI access error
426 * RT_ERR_INPUT - Invalid input parameters.
427 * RT_ERR_PORT_ID - Invalid port ID.
428 * RT_ERR_OUT_OF_RANGE - input out of range.
430 * The API can get system C2S configuration. There are 128 SVLAN C2S configurations.
432 extern rtk_api_ret_t
rtk_svlan_c2s_get(rtk_vlan_t vid
, rtk_port_t src_port
, rtk_vlan_t
*pSvid
);
435 * rtk_svlan_untag_action_set
437 * Configure Action of downstream Un-Stag packet
439 * action - Action for UnStag
440 * svid - The SVID assigned to UnStag packet
445 * RT_ERR_FAILED - Failed
446 * RT_ERR_SMI - SMI access error
447 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
448 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
449 * RT_ERR_OUT_OF_RANGE - input out of range.
450 * RT_ERR_INPUT - Invalid input parameters.
452 * The API can configure action of downstream Un-Stag packet. A SVID assigned
453 * to the un-stag is also supported by this API. The parameter of svid is
454 * only referenced when the action is set to UNTAG_ASSIGN
456 extern rtk_api_ret_t
rtk_svlan_untag_action_set(rtk_svlan_untag_action_t action
, rtk_vlan_t svid
);
459 * rtk_svlan_untag_action_get
461 * Get Action of downstream Un-Stag packet
465 * pAction - Action for UnStag
466 * pSvid - The SVID assigned to UnStag packet
469 * RT_ERR_FAILED - Failed
470 * RT_ERR_SMI - SMI access error
471 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
472 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
473 * RT_ERR_OUT_OF_RANGE - input out of range.
474 * RT_ERR_INPUT - Invalid input parameters.
476 * The API can Get action of downstream Un-Stag packet. A SVID assigned
477 * to the un-stag is also retrieved by this API. The parameter pSvid is
478 * only refernced when the action is UNTAG_ASSIGN
480 extern rtk_api_ret_t
rtk_svlan_untag_action_get(rtk_svlan_untag_action_t
*pAction
, rtk_vlan_t
*pSvid
);
483 * rtk_svlan_unmatch_action_set
485 * Configure Action of downstream Unmatch packet
487 * action - Action for Unmatch
488 * svid - The SVID assigned to Unmatch packet
493 * RT_ERR_FAILED - Failed
494 * RT_ERR_SMI - SMI access error
495 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
496 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
497 * RT_ERR_OUT_OF_RANGE - input out of range.
498 * RT_ERR_INPUT - Invalid input parameters.
500 * The API can configure action of downstream Un-match packet. A SVID assigned
501 * to the un-match is also supported by this API. The parameter od svid is
502 * only refernced when the action is set to UNMATCH_ASSIGN
504 extern rtk_api_ret_t
rtk_svlan_unmatch_action_set(rtk_svlan_unmatch_action_t action
, rtk_vlan_t svid
);
507 * rtk_svlan_unmatch_action_get
509 * Get Action of downstream Unmatch packet
513 * pAction - Action for Unmatch
514 * pSvid - The SVID assigned to Unmatch packet
517 * RT_ERR_FAILED - Failed
518 * RT_ERR_SMI - SMI access error
519 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
520 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
521 * RT_ERR_OUT_OF_RANGE - input out of range.
522 * RT_ERR_INPUT - Invalid input parameters.
524 * The API can Get action of downstream Un-match packet. A SVID assigned
525 * to the un-match is also retrieved by this API. The parameter pSvid is
526 * only refernced when the action is UNMATCH_ASSIGN
528 extern rtk_api_ret_t
rtk_svlan_unmatch_action_get(rtk_svlan_unmatch_action_t
*pAction
, rtk_vlan_t
*pSvid
);
531 * rtk_svlan_dmac_vidsel_set
533 * Set DMAC CVID selection
536 * enable - state of DMAC CVID Selection
541 * RT_ERR_FAILED - Failed
542 * RT_ERR_SMI - SMI access error
543 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
544 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
545 * RT_ERR_OUT_OF_RANGE - input out of range.
546 * RT_ERR_INPUT - Invalid input parameters.
548 * This API can set DMAC CVID Selection state
550 extern rtk_api_ret_t
rtk_svlan_dmac_vidsel_set(rtk_port_t port
, rtk_enable_t enable
);
553 * rtk_svlan_dmac_vidsel_get
555 * Get DMAC CVID selection
559 * pEnable - state of DMAC CVID Selection
562 * RT_ERR_FAILED - Failed
563 * RT_ERR_SMI - SMI access error
564 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
565 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
566 * RT_ERR_OUT_OF_RANGE - input out of range.
567 * RT_ERR_INPUT - Invalid input parameters.
569 * This API can get DMAC CVID Selection state
571 extern rtk_api_ret_t
rtk_svlan_dmac_vidsel_get(rtk_port_t port
, rtk_enable_t
*pEnable
);
574 * rtk_svlan_ipmc2s_add
576 * add ip multicast address to SVLAN
579 * ipmc - ip multicast address
580 * ipmcMsk - ip multicast mask
585 * RT_ERR_FAILED - Failed
586 * RT_ERR_SMI - SMI access error
587 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
588 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
589 * RT_ERR_OUT_OF_RANGE - input out of range.
590 * RT_ERR_INPUT - Invalid input parameters.
592 * The API can set IP mutlicast to SVID configuration. If upstream packet is IPv4 multicast
593 * packet and DIP is matched MC2S configuration, ASIC will assign egress SVID to the packet.
594 * There are 32 SVLAN multicast configurations for IP and L2 multicast.
596 extern rtk_api_ret_t
rtk_svlan_ipmc2s_add(ipaddr_t ipmc
, ipaddr_t ipmcMsk
, rtk_vlan_t svid
);
599 * rtk_svlan_ipmc2s_del
601 * delete ip multicast address to SVLAN
603 * ipmc - ip multicast address
604 * ipmcMsk - ip multicast mask
609 * RT_ERR_FAILED - Failed
610 * RT_ERR_SMI - SMI access error
611 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
612 * RT_ERR_OUT_OF_RANGE - input out of range.
614 * The API can delete IP mutlicast to SVID configuration. There are 32 SVLAN multicast configurations for IP and L2 multicast.
616 extern rtk_api_ret_t
rtk_svlan_ipmc2s_del(ipaddr_t ipmc
, ipaddr_t ipmcMsk
);
619 * rtk_svlan_ipmc2s_get
621 * Get ip multicast address to SVLAN
623 * ipmc - ip multicast address
624 * ipmcMsk - ip multicast mask
629 * RT_ERR_FAILED - Failed
630 * RT_ERR_SMI - SMI access error
631 * RT_ERR_INPUT - Invalid input parameters.
632 * RT_ERR_OUT_OF_RANGE - input out of range.
634 * The API can get IP mutlicast to SVID configuration. There are 32 SVLAN multicast configurations for IP and L2 multicast.
636 extern rtk_api_ret_t
rtk_svlan_ipmc2s_get(ipaddr_t ipmc
, ipaddr_t ipmcMsk
, rtk_vlan_t
*pSvid
);
639 * rtk_svlan_l2mc2s_add
641 * Add L2 multicast address to SVLAN
643 * mac - L2 multicast address
644 * macMsk - L2 multicast address mask
650 * RT_ERR_FAILED - Failed
651 * RT_ERR_SMI - SMI access error
652 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
653 * RT_ERR_SVLAN_ENTRY_NOT_FOUND - specified svlan entry not found.
654 * RT_ERR_OUT_OF_RANGE - input out of range.
655 * RT_ERR_INPUT - Invalid input parameters.
657 * The API can set L2 Mutlicast to SVID configuration. If upstream packet is L2 multicast
658 * packet and DMAC is matched, ASIC will assign egress SVID to the packet. There are 32
659 * SVLAN multicast configurations for IP and L2 multicast.
661 extern rtk_api_ret_t
rtk_svlan_l2mc2s_add(rtk_mac_t mac
, rtk_mac_t macMsk
, rtk_vlan_t svid
);
664 * rtk_svlan_l2mc2s_del
666 * delete L2 multicast address to SVLAN
668 * mac - L2 multicast address
669 * macMsk - L2 multicast address mask
674 * RT_ERR_FAILED - Failed
675 * RT_ERR_SMI - SMI access error
676 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
677 * RT_ERR_OUT_OF_RANGE - input out of range.
679 * The API can delete Mutlicast to SVID configuration. There are 32 SVLAN multicast configurations for IP and L2 multicast.
681 extern rtk_api_ret_t
rtk_svlan_l2mc2s_del(rtk_mac_t mac
, rtk_mac_t macMsk
);
684 * rtk_svlan_l2mc2s_get
686 * Get L2 multicast address to SVLAN
688 * mac - L2 multicast address
689 * macMsk - L2 multicast address mask
694 * RT_ERR_FAILED - Failed
695 * RT_ERR_SMI - SMI access error
696 * RT_ERR_INPUT - Invalid input parameters.
697 * RT_ERR_OUT_OF_RANGE - input out of range.
699 * The API can get L2 mutlicast to SVID configuration. There are 32 SVLAN multicast configurations for IP and L2 multicast.
701 extern rtk_api_ret_t
rtk_svlan_l2mc2s_get(rtk_mac_t mac
, rtk_mac_t macMsk
, rtk_vlan_t
*pSvid
);
706 * Add system SP2C configuration
709 * dst_port - Destination port of SVLAN to CVLAN configuration
716 * RT_ERR_FAILED - Failed
717 * RT_ERR_SMI - SMI access error
718 * RT_ERR_PORT_ID - Invalid port number.
719 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
720 * RT_ERR_VLAN_VID - Invalid VID parameter.
721 * RT_ERR_OUT_OF_RANGE - input out of range.
722 * RT_ERR_INPUT - Invalid input parameters.
724 * The API can add SVID & Destination Port to CVLAN configuration. The downstream frames with assigned
725 * SVID will be add C-tag with assigned CVID if the output port is the assigned destination port.
726 * There are 128 SP2C configurations.
728 extern rtk_api_ret_t
rtk_svlan_sp2c_add(rtk_vlan_t svid
, rtk_port_t dst_port
, rtk_vlan_t cvid
);
733 * Get configure system SP2C content
736 * dst_port - Destination port of SVLAN to CVLAN configuration
741 * RT_ERR_FAILED - Failed
742 * RT_ERR_SMI - SMI access error
743 * RT_ERR_INPUT - Invalid input parameters.
744 * RT_ERR_OUT_OF_RANGE - input out of range.
745 * RT_ERR_PORT_ID - Invalid port number.
746 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
748 * The API can get SVID & Destination Port to CVLAN configuration. There are 128 SP2C configurations.
750 extern rtk_api_ret_t
rtk_svlan_sp2c_get(rtk_vlan_t svid
, rtk_port_t dst_port
, rtk_vlan_t
*pCvid
);
755 * Delete system SP2C configuration
758 * dst_port - Destination port of SVLAN to CVLAN configuration
763 * RT_ERR_FAILED - Failed
764 * RT_ERR_SMI - SMI access error
765 * RT_ERR_PORT_ID - Invalid port number.
766 * RT_ERR_SVLAN_VID - Invalid SVLAN VID parameter.
767 * RT_ERR_OUT_OF_RANGE - input out of range.
769 * The API can delete SVID & Destination Port to CVLAN configuration. There are 128 SP2C configurations.
771 extern rtk_api_ret_t
rtk_svlan_sp2c_del(rtk_vlan_t svid
, rtk_port_t dst_port
);
775 * rtk_svlan_lookupType_set
777 * Set lookup type of SVLAN
788 extern rtk_api_ret_t
rtk_svlan_lookupType_set(rtk_svlan_lookupType_t type
);
791 * rtk_svlan_lookupType_get
793 * Get lookup type of SVLAN
795 * pType - lookup type
804 extern rtk_api_ret_t
rtk_svlan_lookupType_get(rtk_svlan_lookupType_t
*pType
);
807 * rtk_svlan_trapPri_set
809 * Set svlan trap priority
811 * priority - priority for trap packets
817 * RT_ERR_QOS_INT_PRIORITY
821 extern rtk_api_ret_t
rtk_svlan_trapPri_set(rtk_pri_t priority
);
824 * rtk_svlan_trapPri_get
826 * Get svlan trap priority
830 * pPriority - priority for trap packets
834 * RT_ERR_NULL_POINTER - input parameter may be null pointer
838 extern rtk_api_ret_t
rtk_svlan_trapPri_get(rtk_pri_t
*pPriority
);
841 * rtk_svlan_unassign_action_set
843 * Configure Action of upstream without svid assign action
845 * action - Action for Un-assign
850 * RT_ERR_FAILED - Failed
851 * RT_ERR_OUT_OF_RANGE - input out of range.
852 * RT_ERR_INPUT - Invalid input parameters.
854 * The API can configure action of upstream Un-assign svid packet. If action is not
855 * trap to CPU, the port-based SVID sure be assign as system need
857 extern rtk_api_ret_t
rtk_svlan_unassign_action_set(rtk_svlan_unassign_action_t action
);
860 * rtk_svlan_unassign_action_get
862 * Get action of upstream without svid assignment
866 * pAction - Action for Un-assign
869 * RT_ERR_FAILED - Failed
873 extern rtk_api_ret_t
rtk_svlan_unassign_action_get(rtk_svlan_unassign_action_t
*pAction
);
877 * rtk_svlan_checkAndCreateMbr
879 * Check and create Member configuration and return index
883 * pIndex - Member configuration index
886 * RT_ERR_FAILED - Failed
887 * RT_ERR_SMI - SMI access error
888 * RT_ERR_VLAN_VID - Invalid VLAN ID.
889 * RT_ERR_TBL_FULL - Member Configuration table full
893 extern rtk_api_ret_t
rtk_svlan_checkAndCreateMbr(rtk_vlan_t vid
, rtk_uint32
*pIndex
);
896 #endif /* __RTK_API_SVLAN_H__ */