diff options
| author | Bjørn Mork <bjorn@mork.no> | 2015-12-03 19:24:20 +0100 |
|---|---|---|
| committer | Gustavo Solaira <gustavos@codeaurora.org> | 2018-11-19 13:02:17 -0800 |
| commit | 2e641b848ace6d0b6e8de9ae228cd8423fcc5904 (patch) | |
| tree | 0cf1c6069632aed60b90148189d71f1fa4b191eb | |
| parent | 332c11dd05e008a83bca08edae6f3bd2093687bc (diff) | |
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.
Change-Id: Ied7fc3752673a68e5bb22a623cc3fc59c1f1e0ff
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>
Git-commit: 81e0ce79f2919dbd5f025894d29aa806af8695c7
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[gustavos@codeaurora.org: fix checkpatch warning]
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
| -rw-r--r-- | drivers/net/usb/usbnet.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index c0bcfa979253..932c759c7ecb 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -323,7 +323,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; |
