summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2015-12-03 19:24:20 +0100
committerDavid S. Miller <davem@davemloft.net>2015-12-04 22:56:23 +0100
commit81e0ce79f2919dbd5f025894d29aa806af8695c7 (patch)
treef0c25084b409f3382b693aa53327bb10a46daa56 /drivers/net/usb
parentnet: qmi_wwan: remove 1199:9070 device id (diff)
downloadlinux-81e0ce79f2919dbd5f025894d29aa806af8695c7.tar.xz
linux-81e0ce79f2919dbd5f025894d29aa806af8695c7.zip
usbnet: allow mini-drivers to consume L2 headers
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>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/usbnet.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 0744bf2ef2d6..0b0ba7ef14e4 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -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;