mediatek: mt7622: add Linux 5.10 support
[openwrt/staging/rmilecki.git] / target / linux / mediatek / files-5.10 / drivers / net / phy / rtk / rtl8367c / include / rtk_error.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 (週三, 08 三月 2017) $
12 *
13 * Purpose : Definition the error number in the SDK.
14 * Feature : error definition
15 *
16 */
17
18 #ifndef __COMMON_RT_ERROR_H__
19 #define __COMMON_RT_ERROR_H__
20
21 /*
22 * Include Files
23 */
24
25 /*
26 * Data Type Declaration
27 */
28 typedef enum rt_error_code_e
29 {
30 RT_ERR_FAILED = -1, /* General Error */
31
32 /* 0x0000xxxx for common error code */
33 RT_ERR_OK = 0, /* 0x00000000, OK */
34 RT_ERR_INPUT, /* 0x00000001, invalid input parameter */
35 RT_ERR_UNIT_ID, /* 0x00000002, invalid unit id */
36 RT_ERR_PORT_ID, /* 0x00000003, invalid port id */
37 RT_ERR_PORT_MASK, /* 0x00000004, invalid port mask */
38 RT_ERR_PORT_LINKDOWN, /* 0x00000005, link down port status */
39 RT_ERR_ENTRY_INDEX, /* 0x00000006, invalid entry index */
40 RT_ERR_NULL_POINTER, /* 0x00000007, input parameter is null pointer */
41 RT_ERR_QUEUE_ID, /* 0x00000008, invalid queue id */
42 RT_ERR_QUEUE_NUM, /* 0x00000009, invalid queue number */
43 RT_ERR_BUSYWAIT_TIMEOUT, /* 0x0000000a, busy watting time out */
44 RT_ERR_MAC, /* 0x0000000b, invalid mac address */
45 RT_ERR_OUT_OF_RANGE, /* 0x0000000c, input parameter out of range */
46 RT_ERR_CHIP_NOT_SUPPORTED, /* 0x0000000d, functions not supported by this chip model */
47 RT_ERR_SMI, /* 0x0000000e, SMI error */
48 RT_ERR_NOT_INIT, /* 0x0000000f, The module is not initial */
49 RT_ERR_CHIP_NOT_FOUND, /* 0x00000010, The chip can not found */
50 RT_ERR_NOT_ALLOWED, /* 0x00000011, actions not allowed by the function */
51 RT_ERR_DRIVER_NOT_FOUND, /* 0x00000012, The driver can not found */
52 RT_ERR_SEM_LOCK_FAILED, /* 0x00000013, Failed to lock semaphore */
53 RT_ERR_SEM_UNLOCK_FAILED, /* 0x00000014, Failed to unlock semaphore */
54 RT_ERR_ENABLE, /* 0x00000015, invalid enable parameter */
55 RT_ERR_TBL_FULL, /* 0x00000016, input table full */
56
57 /* 0x0001xxxx for vlan */
58 RT_ERR_VLAN_VID = 0x00010000, /* 0x00010000, invalid vid */
59 RT_ERR_VLAN_PRIORITY, /* 0x00010001, invalid 1p priority */
60 RT_ERR_VLAN_EMPTY_ENTRY, /* 0x00010002, emtpy entry of vlan table */
61 RT_ERR_VLAN_ACCEPT_FRAME_TYPE, /* 0x00010003, invalid accept frame type */
62 RT_ERR_VLAN_EXIST, /* 0x00010004, vlan is exist */
63 RT_ERR_VLAN_ENTRY_NOT_FOUND, /* 0x00010005, specified vlan entry not found */
64 RT_ERR_VLAN_PORT_MBR_EXIST, /* 0x00010006, member port exist in the specified vlan */
65 RT_ERR_VLAN_PROTO_AND_PORT, /* 0x00010008, invalid protocol and port based vlan */
66
67 /* 0x0002xxxx for svlan */
68 RT_ERR_SVLAN_ENTRY_INDEX = 0x00020000, /* 0x00020000, invalid svid entry no */
69 RT_ERR_SVLAN_ETHER_TYPE, /* 0x00020001, invalid SVLAN ether type */
70 RT_ERR_SVLAN_TABLE_FULL, /* 0x00020002, no empty entry in SVLAN table */
71 RT_ERR_SVLAN_ENTRY_NOT_FOUND, /* 0x00020003, specified svlan entry not found */
72 RT_ERR_SVLAN_EXIST, /* 0x00020004, SVLAN entry is exist */
73 RT_ERR_SVLAN_VID, /* 0x00020005, invalid svid */
74
75 /* 0x0003xxxx for MSTP */
76 RT_ERR_MSTI = 0x00030000, /* 0x00030000, invalid msti */
77 RT_ERR_MSTP_STATE, /* 0x00030001, invalid spanning tree status */
78 RT_ERR_MSTI_EXIST, /* 0x00030002, MSTI exist */
79 RT_ERR_MSTI_NOT_EXIST, /* 0x00030003, MSTI not exist */
80
81 /* 0x0004xxxx for BUCKET */
82 RT_ERR_TIMESLOT = 0x00040000, /* 0x00040000, invalid time slot */
83 RT_ERR_TOKEN, /* 0x00040001, invalid token amount */
84 RT_ERR_RATE, /* 0x00040002, invalid rate */
85 RT_ERR_TICK, /* 0x00040003, invalid tick */
86
87 /* 0x0005xxxx for RMA */
88 RT_ERR_RMA_ADDR = 0x00050000, /* 0x00050000, invalid rma mac address */
89 RT_ERR_RMA_ACTION, /* 0x00050001, invalid rma action */
90
91 /* 0x0006xxxx for L2 */
92 RT_ERR_L2_HASH_KEY = 0x00060000, /* 0x00060000, invalid L2 Hash key */
93 RT_ERR_L2_HASH_INDEX, /* 0x00060001, invalid L2 Hash index */
94 RT_ERR_L2_CAM_INDEX, /* 0x00060002, invalid L2 CAM index */
95 RT_ERR_L2_ENRTYSEL, /* 0x00060003, invalid EntrySel */
96 RT_ERR_L2_INDEXTABLE_INDEX, /* 0x00060004, invalid L2 index table(=portMask table) index */
97 RT_ERR_LIMITED_L2ENTRY_NUM, /* 0x00060005, invalid limited L2 entry number */
98 RT_ERR_L2_AGGREG_PORT, /* 0x00060006, this aggregated port is not the lowest physical
99 port of its aggregation group */
100 RT_ERR_L2_FID, /* 0x00060007, invalid fid */
101 RT_ERR_L2_VID, /* 0x00060008, invalid cvid */
102 RT_ERR_L2_NO_EMPTY_ENTRY, /* 0x00060009, no empty entry in L2 table */
103 RT_ERR_L2_ENTRY_NOTFOUND, /* 0x0006000a, specified entry not found */
104 RT_ERR_L2_INDEXTBL_FULL, /* 0x0006000b, the L2 index table is full */
105 RT_ERR_L2_INVALID_FLOWTYPE, /* 0x0006000c, invalid L2 flow type */
106 RT_ERR_L2_L2UNI_PARAM, /* 0x0006000d, invalid L2 unicast parameter */
107 RT_ERR_L2_L2MULTI_PARAM, /* 0x0006000e, invalid L2 multicast parameter */
108 RT_ERR_L2_IPMULTI_PARAM, /* 0x0006000f, invalid L2 ip multicast parameter */
109 RT_ERR_L2_PARTIAL_HASH_KEY, /* 0x00060010, invalid L2 partial Hash key */
110 RT_ERR_L2_EMPTY_ENTRY, /* 0x00060011, the entry is empty(invalid) */
111 RT_ERR_L2_FLUSH_TYPE, /* 0x00060012, the flush type is invalid */
112 RT_ERR_L2_NO_CPU_PORT, /* 0x00060013, CPU port not exist */
113
114 /* 0x0007xxxx for FILTER (PIE) */
115 RT_ERR_FILTER_BLOCKNUM = 0x00070000, /* 0x00070000, invalid block number */
116 RT_ERR_FILTER_ENTRYIDX, /* 0x00070001, invalid entry index */
117 RT_ERR_FILTER_CUTLINE, /* 0x00070002, invalid cutline value */
118 RT_ERR_FILTER_FLOWTBLBLOCK, /* 0x00070003, block belongs to flow table */
119 RT_ERR_FILTER_INACLBLOCK, /* 0x00070004, block belongs to ingress ACL */
120 RT_ERR_FILTER_ACTION, /* 0x00070005, action doesn't consist to entry type */
121 RT_ERR_FILTER_INACL_RULENUM, /* 0x00070006, invalid ACL rulenum */
122 RT_ERR_FILTER_INACL_TYPE, /* 0x00070007, entry type isn't an ingress ACL rule */
123 RT_ERR_FILTER_INACL_EXIST, /* 0x00070008, ACL entry is already exit */
124 RT_ERR_FILTER_INACL_EMPTY, /* 0x00070009, ACL entry is empty */
125 RT_ERR_FILTER_FLOWTBL_TYPE, /* 0x0007000a, entry type isn't an flow table rule */
126 RT_ERR_FILTER_FLOWTBL_RULENUM, /* 0x0007000b, invalid flow table rulenum */
127 RT_ERR_FILTER_FLOWTBL_EMPTY, /* 0x0007000c, flow table entry is empty */
128 RT_ERR_FILTER_FLOWTBL_EXIST, /* 0x0007000d, flow table entry is already exist */
129 RT_ERR_FILTER_METER_ID, /* 0x0007000e, invalid metering id */
130 RT_ERR_FILTER_LOG_ID, /* 0x0007000f, invalid log id */
131 RT_ERR_FILTER_INACL_NONE_BEGIN_IDX, /* 0x00070010, entry index is not starting index of a group of rules */
132 RT_ERR_FILTER_INACL_ACT_NOT_SUPPORT, /* 0x00070011, action not support */
133 RT_ERR_FILTER_INACL_RULE_NOT_SUPPORT, /* 0x00070012, rule not support */
134
135 /* 0x0008xxxx for ACL Rate Limit */
136 RT_ERR_ACLRL_HTHR = 0x00080000, /* 0x00080000, invalid high threshold */
137 RT_ERR_ACLRL_TIMESLOT, /* 0x00080001, invalid time slot */
138 RT_ERR_ACLRL_TOKEN, /* 0x00080002, invalid token amount */
139 RT_ERR_ACLRL_RATE, /* 0x00080003, invalid rate */
140
141 /* 0x0009xxxx for Link aggregation */
142 RT_ERR_LA_CPUPORT = 0x00090000, /* 0x00090000, CPU port can not be aggregated port */
143 RT_ERR_LA_TRUNK_ID, /* 0x00090001, invalid trunk id */
144 RT_ERR_LA_PORTMASK, /* 0x00090002, invalid port mask */
145 RT_ERR_LA_HASHMASK, /* 0x00090003, invalid hash mask */
146 RT_ERR_LA_DUMB, /* 0x00090004, this API should be used in 802.1ad dumb mode */
147 RT_ERR_LA_PORTNUM_DUMB, /* 0x00090005, it can only aggregate at most four ports when 802.1ad dumb mode */
148 RT_ERR_LA_PORTNUM_NORMAL, /* 0x00090006, it can only aggregate at most eight ports when 802.1ad normal mode */
149 RT_ERR_LA_MEMBER_OVERLAP, /* 0x00090007, the specified port mask is overlapped with other group */
150 RT_ERR_LA_NOT_MEMBER_PORT, /* 0x00090008, the port is not a member port of the trunk */
151 RT_ERR_LA_TRUNK_NOT_EXIST, /* 0x00090009, the trunk doesn't exist */
152
153
154 /* 0x000axxxx for storm filter */
155 RT_ERR_SFC_TICK_PERIOD = 0x000a0000, /* 0x000a0000, invalid SFC tick period */
156 RT_ERR_SFC_UNKNOWN_GROUP, /* 0x000a0001, Unknown Storm filter group */
157
158 /* 0x000bxxxx for pattern match */
159 RT_ERR_PM_MASK = 0x000b0000, /* 0x000b0000, invalid pattern length. Pattern length should be 8 */
160 RT_ERR_PM_LENGTH, /* 0x000b0001, invalid pattern match mask, first byte must care */
161 RT_ERR_PM_MODE, /* 0x000b0002, invalid pattern match mode */
162
163 /* 0x000cxxxx for input bandwidth control */
164 RT_ERR_INBW_TICK_PERIOD = 0x000c0000, /* 0x000c0000, invalid tick period for input bandwidth control */
165 RT_ERR_INBW_TOKEN_AMOUNT, /* 0x000c0001, invalid amount of token for input bandwidth control */
166 RT_ERR_INBW_FCON_VALUE, /* 0x000c0002, invalid flow control ON threshold value for input bandwidth control */
167 RT_ERR_INBW_FCOFF_VALUE, /* 0x000c0003, invalid flow control OFF threshold value for input bandwidth control */
168 RT_ERR_INBW_FC_ALLOWANCE, /* 0x000c0004, invalid allowance of incomming packet for input bandwidth control */
169 RT_ERR_INBW_RATE, /* 0x000c0005, invalid input bandwidth */
170
171 /* 0x000dxxxx for QoS */
172 RT_ERR_QOS_1P_PRIORITY = 0x000d0000, /* 0x000d0000, invalid 802.1P priority */
173 RT_ERR_QOS_DSCP_VALUE, /* 0x000d0001, invalid DSCP value */
174 RT_ERR_QOS_INT_PRIORITY, /* 0x000d0002, invalid internal priority */
175 RT_ERR_QOS_SEL_DSCP_PRI, /* 0x000d0003, invalid DSCP selection priority */
176 RT_ERR_QOS_SEL_PORT_PRI, /* 0x000d0004, invalid port selection priority */
177 RT_ERR_QOS_SEL_IN_ACL_PRI, /* 0x000d0005, invalid ingress ACL selection priority */
178 RT_ERR_QOS_SEL_CLASS_PRI, /* 0x000d0006, invalid classifier selection priority */
179 RT_ERR_QOS_EBW_RATE, /* 0x000d0007, invalid egress bandwidth rate */
180 RT_ERR_QOS_SCHE_TYPE, /* 0x000d0008, invalid QoS scheduling type */
181 RT_ERR_QOS_QUEUE_WEIGHT, /* 0x000d0009, invalid Queue weight */
182 RT_ERR_QOS_SEL_PRI_SOURCE, /* 0x000d000a, invalid selection of priority source */
183
184 /* 0x000exxxx for port ability */
185 RT_ERR_PHY_PAGE_ID = 0x000e0000, /* 0x000e0000, invalid PHY page id */
186 RT_ERR_PHY_REG_ID, /* 0x000e0001, invalid PHY reg id */
187 RT_ERR_PHY_DATAMASK, /* 0x000e0002, invalid PHY data mask */
188 RT_ERR_PHY_AUTO_NEGO_MODE, /* 0x000e0003, invalid PHY auto-negotiation mode*/
189 RT_ERR_PHY_SPEED, /* 0x000e0004, invalid PHY speed setting */
190 RT_ERR_PHY_DUPLEX, /* 0x000e0005, invalid PHY duplex setting */
191 RT_ERR_PHY_FORCE_ABILITY, /* 0x000e0006, invalid PHY force mode ability parameter */
192 RT_ERR_PHY_FORCE_1000, /* 0x000e0007, invalid PHY force mode 1G speed setting */
193 RT_ERR_PHY_TXRX, /* 0x000e0008, invalid PHY tx/rx */
194 RT_ERR_PHY_ID, /* 0x000e0009, invalid PHY id */
195 RT_ERR_PHY_RTCT_NOT_FINISH, /* 0x000e000a, PHY RTCT in progress */
196
197 /* 0x000fxxxx for mirror */
198 RT_ERR_MIRROR_DIRECTION = 0x000f0000, /* 0x000f0000, invalid error mirror direction */
199 RT_ERR_MIRROR_SESSION_FULL, /* 0x000f0001, mirroring session is full */
200 RT_ERR_MIRROR_SESSION_NOEXIST, /* 0x000f0002, mirroring session not exist */
201 RT_ERR_MIRROR_PORT_EXIST, /* 0x000f0003, mirroring port already exists */
202 RT_ERR_MIRROR_PORT_NOT_EXIST, /* 0x000f0004, mirroring port does not exists */
203 RT_ERR_MIRROR_PORT_FULL, /* 0x000f0005, Exceeds maximum number of supported mirroring port */
204
205 /* 0x0010xxxx for stat */
206 RT_ERR_STAT_INVALID_GLOBAL_CNTR = 0x00100000, /* 0x00100000, Invalid Global Counter */
207 RT_ERR_STAT_INVALID_PORT_CNTR, /* 0x00100001, Invalid Port Counter */
208 RT_ERR_STAT_GLOBAL_CNTR_FAIL, /* 0x00100002, Could not retrieve/reset Global Counter */
209 RT_ERR_STAT_PORT_CNTR_FAIL, /* 0x00100003, Could not retrieve/reset Port Counter */
210 RT_ERR_STAT_INVALID_CNTR, /* 0x00100004, Invalid Counter */
211 RT_ERR_STAT_CNTR_FAIL, /* 0x00100005, Could not retrieve/reset Counter */
212
213 /* 0x0011xxxx for dot1x */
214 RT_ERR_DOT1X_INVALID_DIRECTION = 0x00110000, /* 0x00110000, Invalid Authentication Direction */
215 RT_ERR_DOT1X_PORTBASEDPNEN, /* 0x00110001, Port-based enable port error */
216 RT_ERR_DOT1X_PORTBASEDAUTH, /* 0x00110002, Port-based auth port error */
217 RT_ERR_DOT1X_PORTBASEDOPDIR, /* 0x00110003, Port-based opdir error */
218 RT_ERR_DOT1X_MACBASEDPNEN, /* 0x00110004, MAC-based enable port error */
219 RT_ERR_DOT1X_MACBASEDOPDIR, /* 0x00110005, MAC-based opdir error */
220 RT_ERR_DOT1X_PROC, /* 0x00110006, unauthorized behavior error */
221 RT_ERR_DOT1X_GVLANIDX, /* 0x00110007, guest vlan index error */
222 RT_ERR_DOT1X_GVLANTALK, /* 0x00110008, guest vlan OPDIR error */
223 RT_ERR_DOT1X_MAC_PORT_MISMATCH, /* 0x00110009, Auth MAC and port mismatch eror */
224
225 RT_ERR_END /* The symbol is the latest symbol */
226 } rt_error_code_t;
227
228
229 #endif /* __COMMON_RT_ERROR_H__ */