kernel: bump 4.4 to 4.4.167
[openwrt/staging/chunkeey.git] / target / linux / generic / patches-4.4 / 099-0001-usbnet-allow-mini-drivers-to-consume-L2-headers.patch
1 From 81e0ce79f2919dbd5f025894d29aa806af8695c7 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>
3 Date: Thu, 3 Dec 2015 19:24:20 +0100
4 Subject: [PATCH] usbnet: allow mini-drivers to consume L2 headers
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Assume the minidriver has taken care of all L2 header parsing
10 if it sets skb->protocol. This allows the minidriver to
11 support non-ethernet L2 headers, and even operate without
12 any L2 header at all.
13
14 Signed-off-by: Bjørn Mork <bjorn@mork.no>
15 Acked-by: Oliver Neukum <oneukum@suse.com>
16 Signed-off-by: David S. Miller <davem@davemloft.net>
17 ---
18 drivers/net/usb/usbnet.c | 5 ++++-
19 1 file changed, 4 insertions(+), 1 deletion(-)
20
21 --- a/drivers/net/usb/usbnet.c
22 +++ b/drivers/net/usb/usbnet.c
23 @@ -324,7 +324,10 @@ void usbnet_skb_return (struct usbnet *d
24 return;
25 }
26
27 - skb->protocol = eth_type_trans (skb, dev->net);
28 + /* only update if unset to allow minidriver rx_fixup override */
29 + if (skb->protocol == 0)
30 + skb->protocol = eth_type_trans (skb, dev->net);
31 +
32 dev->net->stats.rx_packets++;
33 dev->net->stats.rx_bytes += skb->len;
34