-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrtl8367c_asicdrv.h
107 lines (81 loc) · 2.96 KB
/
rtl8367c_asicdrv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef _RTL8367C_ASICDRV_H_
#define _RTL8367C_ASICDRV_H_
#include "rtk_types.h"
#include "rtk_error.h"
#include "rtl8367c_reg.h"
#include "rtl8367c_base.h"
#define RTL8367C_REGBITLENGTH 16
#define RTL8367C_REGDATAMAX 0xFFFF
#define RTL8367C_VIDMAX 0xFFF
#define RTL8367C_EVIDMAX 0x1FFF
#define RTL8367C_CVIDXNO 32
#define RTL8367C_CVIDXMAX (RTL8367C_CVIDXNO - 1)
#define RTL8367C_PRIMAX 7
#define RTL8367C_DSCPMAX 63
#define RTL8367C_PORTNO 11
#define RTL8367C_PORTIDMAX (RTL8367C_PORTNO - 1)
#define RTL8367C_PMSKMAX ((1 << (RTL8367C_PORTNO)) - 1)
#define RTL8367C_PORTMASK 0x7FF
#define RTL8367C_PHYNO 5
#define RTL8367C_PHYIDMAX (RTL8367C_PHYNO - 1)
#define RTL8367C_SVIDXNO 64
#define RTL8367C_SVIDXMAX (RTL8367C_SVIDXNO - 1)
#define RTL8367C_MSTIMAX 15
#define RTL8367C_METERNO 64
#define RTL8367C_METERMAX (RTL8367C_METERNO - 1)
#define RTL8367C_METERBUCKETSIZEMAX 0xFFFF
#define RTL8367C_QUEUENO 8
#define RTL8367C_QIDMAX (RTL8367C_QUEUENO - 1)
#define RTL8367C_PHY_BUSY_CHECK_COUNTER 1000
#define RTL8367C_QOS_GRANULARTY_MAX 0x7FFFF
#define RTL8367C_QOS_GRANULARTY_LSB_MASK 0xFFFF
#define RTL8367C_QOS_GRANULARTY_LSB_OFFSET 0
#define RTL8367C_QOS_GRANULARTY_MSB_MASK 0x70000
#define RTL8367C_QOS_GRANULARTY_MSB_OFFSET 16
#define RTL8367C_QOS_GRANULARTY_UNIT_KBPS 8
#define RTL8367C_QOS_RATE_INPUT_MAX (0x1FFFF * 8)
#define RTL8367C_QOS_RATE_INPUT_MAX_HSG (0x7FFFF * 8)
#define RTL8367C_QOS_RATE_INPUT_MIN 8
#define RTL8367C_QOS_PPS_INPUT_MAX (0x7FFFF)
#define RTL8367C_QOS_PPS_INPUT_MIN 1
#define RTL8367C_QUEUE_MASK 0xFF
#define RTL8367C_EFIDMAX 0x7
#define RTL8367C_FIDMAX 0xF
#define RTL8367C_EAV_SECONDMAX 0xFFFFFFFF
#define RTL8367C_EAV_NANOSECONDMAX 0x3B9AC9FF
/* the above macro is generated by genDotH */
#define RTL8367C_VALID_REG_NO 3869
/*=======================================================================
* Enum
*========================================================================*/
enum RTL8367C_TABLE_ACCESS_OP
{
TB_OP_READ = 0,
TB_OP_WRITE
};
enum RTL8367C_TABLE_ACCESS_TARGET
{
TB_TARGET_ACLRULE = 1,
TB_TARGET_ACLACT,
TB_TARGET_CVLAN,
TB_TARGET_L2,
TB_TARGET_IGMP_GROUP
};
#define RTL8367C_TABLE_ACCESS_REG_DATA(op, target) ((op << 3) | target)
/*=======================================================================
* Structures
*========================================================================*/
#ifdef __cplusplus
extern "C"
{
#endif
extern ret_t rtl8367c_setAsicRegBit(rtk_uint32 reg, rtk_uint32 bit, rtk_uint32 value);
extern ret_t rtl8367c_getAsicRegBit(rtk_uint32 reg, rtk_uint32 bit, rtk_uint32 *pValue);
extern ret_t rtl8367c_setAsicRegBits(rtk_uint32 reg, rtk_uint32 bits, rtk_uint32 value);
extern ret_t rtl8367c_getAsicRegBits(rtk_uint32 reg, rtk_uint32 bits, rtk_uint32 *pValue);
extern ret_t rtl8367c_setAsicReg(rtk_uint32 reg, rtk_uint32 value);
extern ret_t rtl8367c_getAsicReg(rtk_uint32 reg, rtk_uint32 *pValue);
#ifdef __cplusplus
}
#endif
#endif /*#ifndef _RTL8367C_ASICDRV_H_*/