89ecbedfa38ea4591a40374725381bd44ec16e58
[openwrt/staging/lynxis.git] / target / linux / brcm2708 / patches-4.14 / 950-0270-net-lan78xx-Add-support-for-VLAN-filtering.patch
1 From c9101bf318db158e88e293aface9ce952657d958 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Tue, 10 Apr 2018 12:39:06 +0100
4 Subject: [PATCH 270/454] net: lan78xx: Add support for VLAN filtering.
5
6 HW_VLAN_CTAG_FILTER was partially implemented, but not fully to Linux.
7 Complete the implementation of this.
8
9 See #2458.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
12 ---
13 drivers/net/usb/lan78xx.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16 --- a/drivers/net/usb/lan78xx.c
17 +++ b/drivers/net/usb/lan78xx.c
18 @@ -2279,7 +2279,7 @@ static int lan78xx_set_features(struct n
19 pdata->rfe_ctl &= ~(RFE_CTL_ICMP_COE_ | RFE_CTL_IGMP_COE_);
20 }
21
22 - if (features & NETIF_F_HW_VLAN_CTAG_RX)
23 + if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
24 pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_;
25 else
26 pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_;
27 @@ -2892,6 +2892,9 @@ static int lan78xx_bind(struct lan78xx_n
28 if (DEFAULT_TSO_CSUM_ENABLE)
29 dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG;
30
31 + if (DEFAULT_VLAN_FILTER_ENABLE)
32 + dev->net->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
33 +
34 dev->net->hw_features = dev->net->features;
35
36 ret = lan78xx_setup_irq_domain(dev);