diff options
author | Patrick McHardy <kaber@trash.net> | 2008-07-08 06:23:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-08 06:23:57 -0400 |
commit | 22d1ba74bbafa96d3f425cc12714d3fe8675183f (patch) | |
tree | 5fdc18001037a667e95229dbc34130b7210e8c8c /net/8021q/vlan.h | |
parent | 7750f403cbe56971336d575b354365190b4e3227 (diff) |
vlan: move struct vlan_dev_info to private header
Hide struct vlan_dev_info from drivers to prevent them from growing
more creative ways to use it. Provide accessors for the two drivers
that currently use it.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.h')
-rw-r--r-- | net/8021q/vlan.h | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index 7cc1a97c42fc..14c421e033f2 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h | |||
@@ -3,6 +3,55 @@ | |||
3 | 3 | ||
4 | #include <linux/if_vlan.h> | 4 | #include <linux/if_vlan.h> |
5 | 5 | ||
6 | |||
7 | /** | ||
8 | * struct vlan_priority_tci_mapping - vlan egress priority mappings | ||
9 | * @priority: skb priority | ||
10 | * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000 | ||
11 | * @next: pointer to next struct | ||
12 | */ | ||
13 | struct vlan_priority_tci_mapping { | ||
14 | u32 priority; | ||
15 | unsigned short vlan_qos; | ||
16 | struct vlan_priority_tci_mapping *next; | ||
17 | }; | ||
18 | |||
19 | /** | ||
20 | * struct vlan_dev_info - VLAN private device data | ||
21 | * @nr_ingress_mappings: number of ingress priority mappings | ||
22 | * @ingress_priority_map: ingress priority mappings | ||
23 | * @nr_egress_mappings: number of egress priority mappings | ||
24 | * @egress_priority_map: hash of egress priority mappings | ||
25 | * @vlan_id: VLAN identifier | ||
26 | * @flags: device flags | ||
27 | * @real_dev: underlying netdevice | ||
28 | * @real_dev_addr: address of underlying netdevice | ||
29 | * @dent: proc dir entry | ||
30 | * @cnt_inc_headroom_on_tx: statistic - number of skb expansions on TX | ||
31 | * @cnt_encap_on_xmit: statistic - number of skb encapsulations on TX | ||
32 | */ | ||
33 | struct vlan_dev_info { | ||
34 | unsigned int nr_ingress_mappings; | ||
35 | u32 ingress_priority_map[8]; | ||
36 | unsigned int nr_egress_mappings; | ||
37 | struct vlan_priority_tci_mapping *egress_priority_map[16]; | ||
38 | |||
39 | unsigned short vlan_id; | ||
40 | unsigned short flags; | ||
41 | |||
42 | struct net_device *real_dev; | ||
43 | unsigned char real_dev_addr[ETH_ALEN]; | ||
44 | |||
45 | struct proc_dir_entry *dent; | ||
46 | unsigned long cnt_inc_headroom_on_tx; | ||
47 | unsigned long cnt_encap_on_xmit; | ||
48 | }; | ||
49 | |||
50 | static inline struct vlan_dev_info *vlan_dev_info(const struct net_device *dev) | ||
51 | { | ||
52 | return netdev_priv(dev); | ||
53 | } | ||
54 | |||
6 | #define VLAN_GRP_HASH_SHIFT 5 | 55 | #define VLAN_GRP_HASH_SHIFT 5 |
7 | #define VLAN_GRP_HASH_SIZE (1 << VLAN_GRP_HASH_SHIFT) | 56 | #define VLAN_GRP_HASH_SIZE (1 << VLAN_GRP_HASH_SHIFT) |
8 | #define VLAN_GRP_HASH_MASK (VLAN_GRP_HASH_SIZE - 1) | 57 | #define VLAN_GRP_HASH_MASK (VLAN_GRP_HASH_SIZE - 1) |
@@ -30,7 +79,6 @@ int vlan_dev_set_egress_priority(const struct net_device *dev, | |||
30 | u32 skb_prio, short vlan_prio); | 79 | u32 skb_prio, short vlan_prio); |
31 | int vlan_dev_change_flags(const struct net_device *dev, u32 flag, u32 mask); | 80 | int vlan_dev_change_flags(const struct net_device *dev, u32 flag, u32 mask); |
32 | void vlan_dev_get_realdev_name(const struct net_device *dev, char *result); | 81 | void vlan_dev_get_realdev_name(const struct net_device *dev, char *result); |
33 | void vlan_dev_get_vid(const struct net_device *dev, unsigned short *result); | ||
34 | 82 | ||
35 | int vlan_check_real_dev(struct net_device *real_dev, unsigned short vlan_id); | 83 | int vlan_check_real_dev(struct net_device *real_dev, unsigned short vlan_id); |
36 | void vlan_setup(struct net_device *dev); | 84 | void vlan_setup(struct net_device *dev); |