Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / intel / ixgbe / ixgbe_main.c
index 6bd1dd13682cb562abfd4356784e6a3f3664db82..6225f880a3f455a342a1abe0dc9a76bf15b8a737 100644 (file)
@@ -1488,10 +1488,10 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
 
        ixgbe_ptp_rx_hwtstamp(rx_ring, rx_desc, skb);
 
-       if ((dev->features & NETIF_F_HW_VLAN_RX) &&
+       if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
            ixgbe_test_staterr(rx_desc, IXGBE_RXD_STAT_VP)) {
                u16 vid = le16_to_cpu(rx_desc->wb.upper.vlan);
-               __vlan_hwaccel_put_tag(skb, vid);
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
        }
 
        skb_record_rx_queue(skb, rx_ring->queue_index);
@@ -3467,7 +3467,8 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
        hw->mac.ops.enable_rx_dma(hw, rxctrl);
 }
 
-static int ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
+static int ixgbe_vlan_rx_add_vid(struct net_device *netdev,
+                                __be16 proto, u16 vid)
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
        struct ixgbe_hw *hw = &adapter->hw;
@@ -3479,7 +3480,8 @@ static int ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
        return 0;
 }
 
-static int ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
+static int ixgbe_vlan_rx_kill_vid(struct net_device *netdev,
+                                 __be16 proto, u16 vid)
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
        struct ixgbe_hw *hw = &adapter->hw;
@@ -3584,10 +3586,10 @@ static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter)
 {
        u16 vid;
 
-       ixgbe_vlan_rx_add_vid(adapter->netdev, 0);
+       ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), 0);
 
        for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
-               ixgbe_vlan_rx_add_vid(adapter->netdev, vid);
+               ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
 }
 
 /**
@@ -3722,7 +3724,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
 
        IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
 
-       if (netdev->features & NETIF_F_HW_VLAN_RX)
+       if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)
                ixgbe_vlan_strip_enable(adapter);
        else
                ixgbe_vlan_strip_disable(adapter);
@@ -5123,14 +5125,14 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
 
        netif_device_detach(netdev);
 
+       rtnl_lock();
        if (netif_running(netdev)) {
-               rtnl_lock();
                ixgbe_down(adapter);
                ixgbe_free_irq(adapter);
                ixgbe_free_all_tx_resources(adapter);
                ixgbe_free_all_rx_resources(adapter);
-               rtnl_unlock();
        }
+       rtnl_unlock();
 
        ixgbe_clear_interrupt_scheme(adapter);
 
@@ -7024,7 +7026,7 @@ static int ixgbe_set_features(struct net_device *netdev,
                break;
        }
 
-       if (features & NETIF_F_HW_VLAN_RX)
+       if (features & NETIF_F_HW_VLAN_CTAG_RX)
                ixgbe_vlan_strip_enable(adapter);
        else
                ixgbe_vlan_strip_disable(adapter);
@@ -7206,6 +7208,7 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
                case IXGBE_SUBDEV_ID_82599_SFP:
                case IXGBE_SUBDEV_ID_82599_RNDC:
                case IXGBE_SUBDEV_ID_82599_ECNA_DP:
+               case IXGBE_SUBDEV_ID_82599_LOM_SFP:
                        is_wol_supported = 1;
                        break;
                }
@@ -7430,9 +7433,9 @@ skip_sriov:
        netdev->features = NETIF_F_SG |
                           NETIF_F_IP_CSUM |
                           NETIF_F_IPV6_CSUM |
-                          NETIF_F_HW_VLAN_TX |
-                          NETIF_F_HW_VLAN_RX |
-                          NETIF_F_HW_VLAN_FILTER |
+                          NETIF_F_HW_VLAN_CTAG_TX |
+                          NETIF_F_HW_VLAN_CTAG_RX |
+                          NETIF_F_HW_VLAN_CTAG_FILTER |
                           NETIF_F_TSO |
                           NETIF_F_TSO6 |
                           NETIF_F_RXHASH |
@@ -7625,9 +7628,7 @@ skip_sriov:
                e_err(probe, "failed to allocate sysfs resources\n");
 #endif /* CONFIG_IXGBE_HWMON */
 
-#ifdef CONFIG_DEBUG_FS
        ixgbe_dbg_adapter_init(adapter);
-#endif /* CONFIG_DEBUG_FS */
 
        /* Need link setup for MNG FW, else wait for IXGBE_UP */
        if (hw->mng_fw_enabled && hw->mac.ops.setup_link)
@@ -7669,9 +7670,7 @@ static void ixgbe_remove(struct pci_dev *pdev)
        struct ixgbe_adapter *adapter = pci_get_drvdata(pdev);
        struct net_device *netdev = adapter->netdev;
 
-#ifdef CONFIG_DEBUG_FS
        ixgbe_dbg_adapter_exit(adapter);
-#endif /*CONFIG_DEBUG_FS */
 
        set_bit(__IXGBE_DOWN, &adapter->state);
        cancel_work_sync(&adapter->service_task);
@@ -7934,15 +7933,11 @@ static int __init ixgbe_init_module(void)
        pr_info("%s - version %s\n", ixgbe_driver_string, ixgbe_driver_version);
        pr_info("%s\n", ixgbe_copyright);
 
-#ifdef CONFIG_DEBUG_FS
        ixgbe_dbg_init();
-#endif /* CONFIG_DEBUG_FS */
 
        ret = pci_register_driver(&ixgbe_driver);
        if (ret) {
-#ifdef CONFIG_DEBUG_FS
                ixgbe_dbg_exit();
-#endif /* CONFIG_DEBUG_FS */
                return ret;
        }
 
@@ -7968,9 +7963,7 @@ static void __exit ixgbe_exit_module(void)
 #endif
        pci_unregister_driver(&ixgbe_driver);
 
-#ifdef CONFIG_DEBUG_FS
        ixgbe_dbg_exit();
-#endif /* CONFIG_DEBUG_FS */
 
        rcu_barrier(); /* Wait for completion of call_rcu()'s */
 }