mediatek: add support for rtl8367c
[openwrt/staging/rmilecki.git] / target / linux / mediatek / files-5.4 / drivers / net / phy / rtk / rtl8367c / include / rtk_types.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 type enum definition.
14 * Feature :
15 *
16 */
17
18 #ifndef _RTL8367C_TYPES_H_
19 #define _RTL8367C_TYPES_H_
20
21 //#include <stdio.h>
22
23 typedef unsigned long long rtk_uint64;
24 typedef long long rtk_int64;
25 typedef unsigned int rtk_uint32;
26 typedef int rtk_int32;
27 typedef unsigned short rtk_uint16;
28 typedef short rtk_int16;
29 typedef unsigned char rtk_uint8;
30 typedef char rtk_int8;
31
32 #define CONST_T const
33
34 #define RTK_TOTAL_NUM_OF_WORD_FOR_1BIT_PORT_LIST 1
35
36 #define RTK_MAX_NUM_OF_PORT 8
37 #define RTK_PORT_ID_MAX (RTK_MAX_NUM_OF_PORT-1)
38 #define RTK_PHY_ID_MAX (RTK_MAX_NUM_OF_PORT-4)
39 #define RTK_MAX_PORT_MASK 0xFF
40
41 #define RTK_WHOLE_SYSTEM 0xFF
42
43 typedef struct rtk_portmask_s
44 {
45 rtk_uint32 bits[RTK_TOTAL_NUM_OF_WORD_FOR_1BIT_PORT_LIST];
46 } rtk_portmask_t;
47
48 typedef enum rtk_enable_e
49 {
50 DISABLED = 0,
51 ENABLED,
52 RTK_ENABLE_END
53 } rtk_enable_t;
54
55 #ifndef ETHER_ADDR_LEN
56 #define ETHER_ADDR_LEN 6
57 #endif
58
59 /* ethernet address type */
60 typedef struct rtk_mac_s
61 {
62 rtk_uint8 octet[ETHER_ADDR_LEN];
63 } rtk_mac_t;
64
65 typedef rtk_uint32 rtk_pri_t; /* priority vlaue */
66 typedef rtk_uint32 rtk_qid_t; /* queue id type */
67 typedef rtk_uint32 rtk_data_t;
68 typedef rtk_uint32 rtk_dscp_t; /* dscp vlaue */
69 typedef rtk_uint32 rtk_fid_t; /* filter id type */
70 typedef rtk_uint32 rtk_vlan_t; /* vlan id type */
71 typedef rtk_uint32 rtk_mac_cnt_t; /* MAC count type */
72 typedef rtk_uint32 rtk_meter_id_t; /* meter id type */
73 typedef rtk_uint32 rtk_rate_t; /* rate type */
74
75 typedef enum rtk_port_e
76 {
77 UTP_PORT0 = 0,
78 UTP_PORT1,
79 UTP_PORT2,
80 UTP_PORT3,
81 UTP_PORT4,
82 UTP_PORT5,
83 UTP_PORT6,
84 UTP_PORT7,
85
86 EXT_PORT0 = 16,
87 EXT_PORT1,
88 EXT_PORT2,
89
90 UNDEFINE_PORT = 30,
91 RTK_PORT_MAX = 31
92 } rtk_port_t;
93
94
95 #ifndef _RTL_TYPES_H
96
97 #if 0
98 typedef unsigned long long uint64;
99 typedef long long int64;
100 typedef unsigned int uint32;
101 typedef int int32;
102 typedef unsigned short uint16;
103 typedef short int16;
104 typedef unsigned char uint8;
105 typedef char int8;
106 #endif
107
108 typedef rtk_uint32 ipaddr_t;
109 typedef rtk_uint32 memaddr;
110
111 #ifndef ETHER_ADDR_LEN
112 #define ETHER_ADDR_LEN 6
113 #endif
114
115 typedef struct ether_addr_s {
116 rtk_uint8 octet[ETHER_ADDR_LEN];
117 } ether_addr_t;
118
119 #ifdef __KERNEL__
120 #define rtlglue_printf printk
121 #else
122 #define rtlglue_printf printf
123 #endif
124 #define PRINT rtlglue_printf
125 #endif /*_RTL_TYPES_H*/
126
127 /* type abstraction */
128 #ifdef EMBEDDED_SUPPORT
129
130 typedef rtk_int16 rtk_api_ret_t;
131 typedef rtk_int16 ret_t;
132 typedef rtk_uint32 rtk_u_long;
133
134 #else
135
136 typedef rtk_int32 rtk_api_ret_t;
137 typedef rtk_int32 ret_t;
138 typedef rtk_uint64 rtk_u_long_t;
139
140 #endif
141
142 #ifndef NULL
143 #define NULL 0
144 #endif
145
146 #ifndef TRUE
147 #define TRUE 1
148 #endif
149
150 #ifndef FALSE
151 #define FALSE 0
152 #endif
153
154 #define CONST const
155 #endif /* _RTL8367C_TYPES_H_ */