12 #ifndef _LINUX_IF_VLAN_H_
13 #define _LINUX_IF_VLAN_H_
15 #include <linux/netdevice.h>
17 #include <linux/rtnetlink.h>
24 #define VLAN_ETH_HLEN 18
25 #define VLAN_ETH_ZLEN 64
30 #define VLAN_ETH_DATA_LEN 1500
31 #define VLAN_ETH_FRAME_LEN 1518
66 #define VLAN_PRIO_MASK 0xe000
67 #define VLAN_PRIO_SHIFT 13
68 #define VLAN_CFI_MASK 0x1000
69 #define VLAN_TAG_PRESENT VLAN_CFI_MASK
70 #define VLAN_VID_MASK 0x0fff
71 #define VLAN_N_VID 4096
81 #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT)
82 #define vlan_tx_nonzero_tag_present(__skb) \
83 (vlan_tx_tag_present(__skb) && ((__skb)->vlan_tci & VLAN_VID_MASK))
84 #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
86 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
209 skb = vlan_insert_tag(skb, vlan_tci);
222 static inline struct sk_buff *__vlan_hwaccel_put_tag(
struct sk_buff *skb,
229 #define HAVE_VLAN_PUT_TAG
242 return __vlan_hwaccel_put_tag(skb, vlan_tci);
244 return __vlan_put_tag(skb, vlan_tci);
255 static inline int __vlan_get_tag(
const struct sk_buff *skb,
u16 *vlan_tci)
274 static inline int __vlan_hwaccel_get_tag(
const struct sk_buff *skb,
286 #define HAVE_VLAN_GET_TAG
295 static inline int vlan_get_tag(
const struct sk_buff *skb,
u16 *vlan_tci)
298 return __vlan_hwaccel_get_tag(skb, vlan_tci);
300 return __vlan_get_tag(skb, vlan_tci);
311 static inline __be16 vlan_get_protocol(
const struct sk_buff *skb)
322 sizeof(proto), &proto);
330 static inline void vlan_set_encap_proto(
struct sk_buff *skb,
342 if (
ntohs(proto) >= 1536) {
348 if (*(
unsigned short *) rawp == 0xFFFF)