diff options
Diffstat (limited to 'include/linux/if_vlan.h')
-rw-r--r-- | include/linux/if_vlan.h | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 7ff9af1d0f0..3d870fda8c4 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 */ |
69 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | 73 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); |
@@ -81,6 +85,7 @@ struct vlan_group { | |||
81 | * the vlan is attached to. | 85 | * the vlan is attached to. |
82 | */ | 86 | */ |
83 | unsigned int nr_vlans; | 87 | unsigned int nr_vlans; |
88 | int killall; | ||
84 | struct hlist_node hlist; /* linked list */ | 89 | struct hlist_node hlist; /* linked list */ |
85 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; | 90 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
86 | struct rcu_head rcu; | 91 | struct rcu_head rcu; |
@@ -105,8 +110,8 @@ static inline void vlan_group_set_device(struct vlan_group *vg, | |||
105 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | 110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; |
106 | } | 111 | } |
107 | 112 | ||
108 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci) | 113 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
109 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci) | 114 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
110 | 115 | ||
111 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 116 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
112 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); | 117 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); |
@@ -115,10 +120,12 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev); | |||
115 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | 120 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
116 | u16 vlan_tci, int polling); | 121 | u16 vlan_tci, int polling); |
117 | extern int vlan_hwaccel_do_receive(struct sk_buff *skb); | 122 | extern int vlan_hwaccel_do_receive(struct sk_buff *skb); |
118 | extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 123 | extern gro_result_t |
119 | unsigned int vlan_tci, struct sk_buff *skb); | 124 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
120 | extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | 125 | unsigned int vlan_tci, struct sk_buff *skb); |
121 | unsigned int vlan_tci); | 126 | extern gro_result_t |
127 | vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | ||
128 | unsigned int vlan_tci); | ||
122 | 129 | ||
123 | #else | 130 | #else |
124 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) | 131 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) |
@@ -145,17 +152,18 @@ static inline int vlan_hwaccel_do_receive(struct sk_buff *skb) | |||
145 | return 0; | 152 | return 0; |
146 | } | 153 | } |
147 | 154 | ||
148 | static inline int vlan_gro_receive(struct napi_struct *napi, | 155 | static inline gro_result_t |
149 | struct vlan_group *grp, | 156 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
150 | unsigned int vlan_tci, struct sk_buff *skb) | 157 | unsigned int vlan_tci, struct sk_buff *skb) |
151 | { | 158 | { |
152 | return NET_RX_DROP; | 159 | return GRO_DROP; |
153 | } | 160 | } |
154 | 161 | ||
155 | static inline int vlan_gro_frags(struct napi_struct *napi, | 162 | static inline gro_result_t |
156 | struct vlan_group *grp, unsigned int vlan_tci) | 163 | vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, |
164 | unsigned int vlan_tci) | ||
157 | { | 165 | { |
158 | return NET_RX_DROP; | 166 | return GRO_DROP; |
159 | } | 167 | } |
160 | #endif | 168 | #endif |
161 | 169 | ||
@@ -231,7 +239,7 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | |||
231 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, | 239 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, |
232 | u16 vlan_tci) | 240 | u16 vlan_tci) |
233 | { | 241 | { |
234 | skb->vlan_tci = vlan_tci; | 242 | skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci; |
235 | return skb; | 243 | return skb; |
236 | } | 244 | } |
237 | 245 | ||
@@ -284,7 +292,7 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, | |||
284 | u16 *vlan_tci) | 292 | u16 *vlan_tci) |
285 | { | 293 | { |
286 | if (vlan_tx_tag_present(skb)) { | 294 | if (vlan_tx_tag_present(skb)) { |
287 | *vlan_tci = skb->vlan_tci; | 295 | *vlan_tci = vlan_tx_tag_get(skb); |
288 | return 0; | 296 | return 0; |
289 | } else { | 297 | } else { |
290 | *vlan_tci = 0; | 298 | *vlan_tci = 0; |
@@ -331,6 +339,7 @@ enum vlan_ioctl_cmds { | |||
331 | enum vlan_flags { | 339 | enum vlan_flags { |
332 | VLAN_FLAG_REORDER_HDR = 0x1, | 340 | VLAN_FLAG_REORDER_HDR = 0x1, |
333 | VLAN_FLAG_GVRP = 0x2, | 341 | VLAN_FLAG_GVRP = 0x2, |
342 | VLAN_FLAG_LOOSE_BINDING = 0x4, | ||
334 | }; | 343 | }; |
335 | 344 | ||
336 | enum vlan_name_types { | 345 | enum vlan_name_types { |