Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / realtek / r8169.c
index 9a1bc1a238542d8ab9db05a3f4cb9d0078fec97e..c6dac38fd9ccf0a56a8cfa45316e0b2c020659d5 100644 (file)
@@ -1793,16 +1793,17 @@ static void __rtl8169_set_features(struct net_device *dev,
        netdev_features_t changed = features ^ dev->features;
        void __iomem *ioaddr = tp->mmio_addr;
 
-       if (!(changed & (NETIF_F_RXALL | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX)))
+       if (!(changed & (NETIF_F_RXALL | NETIF_F_RXCSUM |
+                        NETIF_F_HW_VLAN_CTAG_RX)))
                return;
 
-       if (changed & (NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX)) {
+       if (changed & (NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX)) {
                if (features & NETIF_F_RXCSUM)
                        tp->cp_cmd |= RxChkSum;
                else
                        tp->cp_cmd &= ~RxChkSum;
 
-               if (dev->features & NETIF_F_HW_VLAN_RX)
+               if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
                        tp->cp_cmd |= RxVlan;
                else
                        tp->cp_cmd &= ~RxVlan;
@@ -1842,7 +1843,7 @@ static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb)
        u32 opts2 = le32_to_cpu(desc->opts2);
 
        if (opts2 & RxVlanTag)
-               __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff));
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), swab16(opts2 & 0xffff));
 }
 
 static int rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd)
@@ -7036,16 +7037,17 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        /* don't enable SG, IP_CSUM and TSO by default - it might not work
         * properly for all devices */
        dev->features |= NETIF_F_RXCSUM |
-               NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+               NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
 
        dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
-               NETIF_F_RXCSUM | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+               NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX |
+               NETIF_F_HW_VLAN_CTAG_RX;
        dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
                NETIF_F_HIGHDMA;
 
        if (tp->mac_version == RTL_GIGA_MAC_VER_05)
                /* 8110SCd requires hardware Rx VLAN - disallow toggling */
-               dev->hw_features &= ~NETIF_F_HW_VLAN_RX;
+               dev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_RX;
 
        dev->hw_features |= NETIF_F_RXALL;
        dev->hw_features |= NETIF_F_RXFCS;