Skip to content

Commit

Permalink
usbnet: allow mini-drivers to consume L2 headers
Browse files Browse the repository at this point in the history
Assume the minidriver has taken care of all L2 header parsing
if it sets skb->protocol.  This allows the minidriver to
support non-ethernet L2 headers, and even operate without
any L2 header at all.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
bmork authored and davem330 committed Dec 4, 2015
1 parent 544c8f6 commit 81e0ce7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb)
return;
}

skb->protocol = eth_type_trans (skb, dev->net);
/* only update if unset to allow minidriver rx_fixup override */
if (skb->protocol == 0)
skb->protocol = eth_type_trans (skb, dev->net);

dev->net->stats.rx_packets++;
dev->net->stats.rx_bytes += skb->len;

Expand Down

0 comments on commit 81e0ce7

Please sign in to comment.