aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_vlan.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 7ff9af1d0f05..8898cbebcf34 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -63,7 +63,11 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
63 return (struct vlan_ethhdr *)skb_mac_header(skb); 63 return (struct vlan_ethhdr *)skb_mac_header(skb);
64} 64}
65 65
66#define VLAN_VID_MASK 0xfff 66#define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */
67#define VLAN_PRIO_SHIFT 13
68#define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */
69#define VLAN_TAG_PRESENT VLAN_CFI_MASK
70#define VLAN_VID_MASK 0x0fff /* VLAN Identifier */
67 71
68/* found in socket.c */ 72/* found in socket.c */
69extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); 73extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
@@ -105,8 +109,8 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
105 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; 109 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
106} 110}
107 111
108#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci) 112#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
109#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci) 113#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
110 114
111#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 115#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
112extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 116extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
@@ -231,7 +235,7 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
231static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, 235static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
232 u16 vlan_tci) 236 u16 vlan_tci)
233{ 237{
234 skb->vlan_tci = vlan_tci; 238 skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci;
235 return skb; 239 return skb;
236} 240}
237 241
@@ -284,7 +288,7 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
284 u16 *vlan_tci) 288 u16 *vlan_tci)
285{ 289{
286 if (vlan_tx_tag_present(skb)) { 290 if (vlan_tx_tag_present(skb)) {
287 *vlan_tci = skb->vlan_tci; 291 *vlan_tci = vlan_tx_tag_get(skb);
288 return 0; 292 return 0;
289 } else { 293 } else {
290 *vlan_tci = 0; 294 *vlan_tci = 0;