Lines Matching refs:skb
32 static void skb_debug(const struct sk_buff *skb) in skb_debug() argument
37 16, 1, skb->data, min(NUM2PRINT, skb->len), true); in skb_debug()
69 void (*old_push)(struct atm_vcc *vcc, struct sk_buff *skb);
70 void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb);
184 static void br2684_pop(struct atm_vcc *vcc, struct sk_buff *skb) in br2684_pop() argument
189 brvcc->old_pop(vcc, skb); in br2684_pop()
201 static int br2684_xmit_vcc(struct sk_buff *skb, struct net_device *dev, in br2684_xmit_vcc() argument
211 if (skb_headroom(skb) < minheadroom) { in br2684_xmit_vcc()
212 struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom); in br2684_xmit_vcc()
214 dev_kfree_skb(skb); in br2684_xmit_vcc()
219 skb = skb2; in br2684_xmit_vcc()
224 skb_push(skb, sizeof(llc_oui_pid_pad)); in br2684_xmit_vcc()
225 skb_copy_to_linear_data(skb, llc_oui_pid_pad, in br2684_xmit_vcc()
228 unsigned short prot = ntohs(skb->protocol); in br2684_xmit_vcc()
230 skb_push(skb, sizeof(llc_oui_ipv4)); in br2684_xmit_vcc()
233 skb_copy_to_linear_data(skb, llc_oui_ipv4, in br2684_xmit_vcc()
237 skb_copy_to_linear_data(skb, llc_oui_ipv6, in br2684_xmit_vcc()
241 dev_kfree_skb(skb); in br2684_xmit_vcc()
247 skb_push(skb, 2); in br2684_xmit_vcc()
248 memset(skb->data, 0, 2); in br2684_xmit_vcc()
251 skb_debug(skb); in br2684_xmit_vcc()
253 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc; in br2684_xmit_vcc()
254 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev); in br2684_xmit_vcc()
255 atomic_add(skb->truesize, &sk_atm(atmvcc)->sk_wmem_alloc); in br2684_xmit_vcc()
256 ATM_SKB(skb)->atm_options = atmvcc->atm_options; in br2684_xmit_vcc()
258 dev->stats.tx_bytes += skb->len; in br2684_xmit_vcc()
271 return !atmvcc->send(atmvcc, skb); in br2684_xmit_vcc()
285 static inline struct br2684_vcc *pick_outgoing_vcc(const struct sk_buff *skb, in pick_outgoing_vcc() argument
291 static netdev_tx_t br2684_start_xmit(struct sk_buff *skb, in br2684_start_xmit() argument
299 pr_debug("skb_dst(skb)=%p\n", skb_dst(skb)); in br2684_start_xmit()
301 brvcc = pick_outgoing_vcc(skb, brdev); in br2684_start_xmit()
307 dev_kfree_skb(skb); in br2684_start_xmit()
318 dev_kfree_skb(skb); in br2684_start_xmit()
328 if (!br2684_xmit_vcc(skb, dev, brvcc)) { in br2684_start_xmit()
391 packet_fails_filter(__be16 type, struct br2684_vcc *brvcc, struct sk_buff *skb) in packet_fails_filter() argument
396 (((struct iphdr *)(skb->data))->daddr & brvcc->filter. in packet_fails_filter()
423 static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb) in br2684_push() argument
431 if (unlikely(skb == NULL)) { in br2684_push()
444 skb_debug(skb); in br2684_push()
445 atm_return(atmvcc, skb->truesize); in br2684_push()
449 if (skb->len > 7 && skb->data[7] == 0x01) in br2684_push()
450 __skb_trim(skb, skb->len - 4); in br2684_push()
453 if ((skb->len >= (sizeof(llc_oui_ipv4))) && in br2684_push()
454 (memcmp(skb->data, llc_oui_ipv4, in br2684_push()
456 if (memcmp(skb->data + 6, ethertype_ipv6, in br2684_push()
458 skb->protocol = htons(ETH_P_IPV6); in br2684_push()
459 else if (memcmp(skb->data + 6, ethertype_ipv4, in br2684_push()
461 skb->protocol = htons(ETH_P_IP); in br2684_push()
464 skb_pull(skb, sizeof(llc_oui_ipv4)); in br2684_push()
465 skb_reset_network_header(skb); in br2684_push()
466 skb->pkt_type = PACKET_HOST; in br2684_push()
472 } else if ((skb->len >= sizeof(llc_oui_pid_pad)) && in br2684_push()
473 (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) { in br2684_push()
474 skb_pull(skb, sizeof(llc_oui_pid_pad)); in br2684_push()
475 skb->protocol = eth_type_trans(skb, net_dev); in br2684_push()
483 skb_reset_network_header(skb); in br2684_push()
484 iph = ip_hdr(skb); in br2684_push()
486 skb->protocol = htons(ETH_P_IP); in br2684_push()
488 skb->protocol = htons(ETH_P_IPV6); in br2684_push()
491 skb->pkt_type = PACKET_HOST; in br2684_push()
494 if (memcmp(skb->data, pad, BR2684_PAD_LEN) != 0) in br2684_push()
496 skb_pull(skb, BR2684_PAD_LEN); in br2684_push()
497 skb->protocol = eth_type_trans(skb, net_dev); in br2684_push()
502 if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) in br2684_push()
505 skb->dev = net_dev; in br2684_push()
506 ATM_SKB(skb)->vcc = atmvcc; /* needed ? */ in br2684_push()
507 pr_debug("received packet's protocol: %x\n", ntohs(skb->protocol)); in br2684_push()
508 skb_debug(skb); in br2684_push()
513 net_dev->stats.rx_bytes += skb->len; in br2684_push()
514 memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data)); in br2684_push()
515 netif_rx(skb); in br2684_push()
524 dev_kfree_skb(skb); in br2684_push()