mediatek: add support for rtl8367c
[openwrt/openwrt.git] / target / linux / mediatek / files-5.4 / drivers / net / phy / rtk / rtl8367c / include / rtl8367c_asicdrv_qos.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 * $Revision: 76306 $
11 * $Date: 2017-03-08 15:13:58 +0800 (¶g¤T, 08 ¤T¤ë 2017) $
12 *
13 * Purpose : RTL8367C switch high-level API for RTL8367C
14 * Feature : Qos related functions
15 *
16 */
17
18 #ifndef _RTL8367C_ASICDRV_QOS_H_
19 #define _RTL8367C_ASICDRV_QOS_H_
20
21 #include <rtl8367c_asicdrv.h>
22
23 #define RTL8367C_DECISIONPRIMAX 0xFF
24
25 /* enum Priority Selection Types */
26 enum PRIDECISION
27 {
28 PRIDEC_PORT = 0,
29 PRIDEC_ACL,
30 PRIDEC_DSCP,
31 PRIDEC_1Q,
32 PRIDEC_1AD,
33 PRIDEC_CVLAN,
34 PRIDEC_DA,
35 PRIDEC_SA,
36 PRIDEC_END,
37 };
38
39 /* enum Priority Selection Index */
40 enum RTL8367C_PRIDEC_TABLE
41 {
42 PRIDEC_IDX0 = 0,
43 PRIDEC_IDX1,
44 PRIDEC_IDX_END,
45 };
46
47 enum RTL8367C_DOT1P_PRISEL
48 {
49 DOT1P_PRISEL_USER = 0,
50 DOT1P_PRISEL_TAG,
51 DOT1P_PRISEL_END
52 };
53
54 enum RTL8367C_DSCP_PRISEL
55 {
56 DSCP_PRISEL_INTERNAL = 0,
57 DSCP_PRISEL_DSCP,
58 DSCP_PRISEL_USER ,
59 DSCP_PRISEL_END
60 };
61
62
63 extern ret_t rtl8367c_setAsicRemarkingDot1pAbility(rtk_uint32 port, rtk_uint32 enabled);
64 extern ret_t rtl8367c_getAsicRemarkingDot1pAbility(rtk_uint32 port, rtk_uint32* pEnabled);
65 extern ret_t rtl8367c_setAsicRemarkingDot1pParameter(rtk_uint32 priority, rtk_uint32 newPriority );
66 extern ret_t rtl8367c_getAsicRemarkingDot1pParameter(rtk_uint32 priority, rtk_uint32 *pNewPriority );
67 extern ret_t rtl8367c_setAsicRemarkingDot1pSrc(rtk_uint32 type);
68 extern ret_t rtl8367c_getAsicRemarkingDot1pSrc(rtk_uint32 *pType);
69 extern ret_t rtl8367c_setAsicRemarkingDscpAbility(rtk_uint32 enabled);
70 extern ret_t rtl8367c_getAsicRemarkingDscpAbility(rtk_uint32* pEnabled);
71 extern ret_t rtl8367c_setAsicRemarkingDscpParameter(rtk_uint32 priority, rtk_uint32 newDscp );
72 extern ret_t rtl8367c_getAsicRemarkingDscpParameter(rtk_uint32 priority, rtk_uint32* pNewDscp );
73
74 extern ret_t rtl8367c_setAsicPriorityDot1qRemapping(rtk_uint32 srcpriority, rtk_uint32 priority );
75 extern ret_t rtl8367c_getAsicPriorityDot1qRemapping(rtk_uint32 srcpriority, rtk_uint32 *pPriority );
76 extern ret_t rtl8367c_setAsicPriorityDscpBased(rtk_uint32 dscp, rtk_uint32 priority );
77 extern ret_t rtl8367c_getAsicPriorityDscpBased(rtk_uint32 dscp, rtk_uint32 *pPriority );
78 extern ret_t rtl8367c_setAsicPriorityPortBased(rtk_uint32 port, rtk_uint32 priority );
79 extern ret_t rtl8367c_getAsicPriorityPortBased(rtk_uint32 port, rtk_uint32 *pPriority );
80 extern ret_t rtl8367c_setAsicPriorityDecision(rtk_uint32 index, rtk_uint32 prisrc, rtk_uint32 decisionPri);
81 extern ret_t rtl8367c_getAsicPriorityDecision(rtk_uint32 index, rtk_uint32 prisrc, rtk_uint32* pDecisionPri);
82 extern ret_t rtl8367c_setAsicPriorityToQIDMappingTable(rtk_uint32 qnum, rtk_uint32 priority, rtk_uint32 qid );
83 extern ret_t rtl8367c_getAsicPriorityToQIDMappingTable(rtk_uint32 qnum, rtk_uint32 priority, rtk_uint32* pQid);
84 extern ret_t rtl8367c_setAsicOutputQueueMappingIndex(rtk_uint32 port, rtk_uint32 qnum );
85 extern ret_t rtl8367c_getAsicOutputQueueMappingIndex(rtk_uint32 port, rtk_uint32 *pQnum );
86
87 extern ret_t rtl8367c_setAsicRemarkingDscpSrc(rtk_uint32 type);
88 extern ret_t rtl8367c_getAsicRemarkingDscpSrc(rtk_uint32 *pType);
89 extern ret_t rtl8367c_setAsicRemarkingDscp2Dscp(rtk_uint32 dscp, rtk_uint32 rmkDscp);
90 extern ret_t rtl8367c_getAsicRemarkingDscp2Dscp(rtk_uint32 dscp, rtk_uint32 *pRmkDscp);
91
92 extern ret_t rtl8367c_setAsicPortPriorityDecisionIndex(rtk_uint32 port, rtk_uint32 index );
93 extern ret_t rtl8367c_getAsicPortPriorityDecisionIndex(rtk_uint32 port, rtk_uint32 *pIndex );
94
95 #endif /*#ifndef _RTL8367C_ASICDRV_QOS_H_*/
96