summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files/drivers/net/rtl819x/common/rtl865x_vlan.h
blob: 6222928a365c7e8efe7e06495ecdaa8adafbff52 (plain)
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
/*
* Copyright c                  Realtek Semiconductor Corporation, 2008  
* All rights reserved.
* 
* Program : Vlan driver
* Abstract : 
* Author : hyking (hyking_liu@realsil.com.cn)  
*/
#ifndef	RTL865X_VLAN_H
#define	RTL865X_VLAN_H

//#include "rtl_types.h"

#if !defined(REDUCE_MEMORY_SIZE_FOR_16M)
#define REDUCE_MEMORY_SIZE_FOR_16M
#endif



#define VLAN_NUMBER			4096
#define RTL865X_FDB_NUMBER	4

#define RTL865X_PPTP_HWACC_PORTMASK		0x80
#define RTL865X_PPTP_HWACC_VLANID		10


typedef struct rtl865x_vlan_entry_s {
	uint32	memberPortMask; /*extension ports [rtl8651_totalExtPortNum-1:0] are located at bits [RTL8651_PORT_NUMBER+rtl8651_totalExtPortNum-1:RTL8651_PORT_NUMBER]*/
	uint32	untagPortMask; /*extension ports [rtl8651_totalExtPortNum-1:0] are located at bits [RTL8651_PORT_NUMBER+rtl8651_totalExtPortNum-1:RTL8651_PORT_NUMBER]*/
	uint32	valid:1,
			fid:2,	/*there are 4 fdbs in 865x*/
			vid:12,
			refCnt:5; /*reference count: this vlan entry is referenced by networkInterface...*/
}rtl865x_vlan_entry_t;

int32 rtl865x_initVlanTable(void);
int32 rtl865x_reinitVlantable(void);
int32 rtl865x_addVlan(uint16 vid);
int32 rtl865x_delVlan(uint16 vid);
int32 rtl865x_addVlanPortMember(uint16 vid, uint32 portMask);
int32 rtl865x_delVlanPortMember(uint16 vid,uint32 portMask);

#if defined (CONFIG_RTL_HARDWARE_MULTICAST)
uint32 rtl865x_getVlanPortMask(uint32 vid); 
#endif

int32 rtl865x_setVlanPortTag(uint16 vid,uint32 portMask,uint8 tag);
int32 rtl865x_setVlanFilterDatabase(uint16 vid, uint32 fid);
int32 rtl865x_getVlanFilterDatabaseId(uint16 vid, uint32 *fid);
rtl865x_vlan_entry_t *_rtl8651_getVlanTableEntry(uint16 vid);
int32 rtl865x_referVlan(uint16 vid);
int32 rtl865x_deReferVlan(uint16 vid);

#endif