Lines Matching refs:skb
62 static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) in vlan_eth_hdr() argument
64 return (struct vlan_ethhdr *)skb_mac_header(skb); in vlan_eth_hdr()
96 extern bool vlan_do_receive(struct sk_buff **skb);
97 extern struct sk_buff *vlan_untag(struct sk_buff *skb);
125 static inline bool vlan_do_receive(struct sk_buff **skb) in vlan_do_receive() argument
130 static inline struct sk_buff *vlan_untag(struct sk_buff *skb) in vlan_untag() argument
132 return skb; in vlan_untag()
169 static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci) in vlan_insert_tag() argument
173 if (skb_cow_head(skb, VLAN_HLEN) < 0) { in vlan_insert_tag()
174 kfree_skb(skb); in vlan_insert_tag()
177 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); in vlan_insert_tag()
180 memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); in vlan_insert_tag()
181 skb->mac_header -= VLAN_HLEN; in vlan_insert_tag()
189 return skb; in vlan_insert_tag()
203 static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) in __vlan_put_tag() argument
205 skb = vlan_insert_tag(skb, vlan_tci); in __vlan_put_tag()
206 if (skb) in __vlan_put_tag()
207 skb->protocol = htons(ETH_P_8021Q); in __vlan_put_tag()
208 return skb; in __vlan_put_tag()
218 static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, in __vlan_hwaccel_put_tag() argument
221 skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci; in __vlan_hwaccel_put_tag()
222 return skb; in __vlan_hwaccel_put_tag()
235 static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) in vlan_put_tag() argument
237 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { in vlan_put_tag()
238 return __vlan_hwaccel_put_tag(skb, vlan_tci); in vlan_put_tag()
240 return __vlan_put_tag(skb, vlan_tci); in vlan_put_tag()
251 static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) in __vlan_get_tag() argument
253 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; in __vlan_get_tag()
270 static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, in __vlan_hwaccel_get_tag() argument
273 if (vlan_tx_tag_present(skb)) { in __vlan_hwaccel_get_tag()
274 *vlan_tci = vlan_tx_tag_get(skb); in __vlan_hwaccel_get_tag()
291 static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) in vlan_get_tag() argument
293 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { in vlan_get_tag()
294 return __vlan_hwaccel_get_tag(skb, vlan_tci); in vlan_get_tag()
296 return __vlan_get_tag(skb, vlan_tci); in vlan_get_tag()
307 static inline __be16 vlan_get_protocol(const struct sk_buff *skb) in vlan_get_protocol() argument
311 if (vlan_tx_tag_present(skb) || in vlan_get_protocol()
312 skb->protocol != cpu_to_be16(ETH_P_8021Q)) in vlan_get_protocol()
313 protocol = skb->protocol; in vlan_get_protocol()
316 protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr, in vlan_get_protocol()
326 static inline void vlan_set_encap_proto(struct sk_buff *skb, in vlan_set_encap_proto() argument
339 skb->protocol = proto; in vlan_set_encap_proto()
352 skb->protocol = htons(ETH_P_802_3); in vlan_set_encap_proto()
357 skb->protocol = htons(ETH_P_802_2); in vlan_set_encap_proto()