aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c88
1 files changed, 55 insertions, 33 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 7c4325ec22c2..aa29edb950f2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6598,7 +6598,7 @@ static netdev_features_t ixgbe_fix_features(struct net_device *netdev,
6598 /* Turn off LRO if not RSC capable */ 6598 /* Turn off LRO if not RSC capable */
6599 if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) 6599 if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE))
6600 features &= ~NETIF_F_LRO; 6600 features &= ~NETIF_F_LRO;
6601 6601
6602 6602
6603 return features; 6603 return features;
6604} 6604}
@@ -6786,6 +6786,57 @@ static void __devinit ixgbe_probe_vf(struct ixgbe_adapter *adapter,
6786} 6786}
6787 6787
6788/** 6788/**
6789 * ixgbe_wol_supported - Check whether device supports WoL
6790 * @hw: hw specific details
6791 * @device_id: the device ID
6792 * @subdev_id: the subsystem device ID
6793 *
6794 * This function is used by probe and ethtool to determine
6795 * which devices have WoL support
6796 *
6797 **/
6798int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
6799 u16 subdevice_id)
6800{
6801 struct ixgbe_hw *hw = &adapter->hw;
6802 u16 wol_cap = adapter->eeprom_cap & IXGBE_DEVICE_CAPS_WOL_MASK;
6803 int is_wol_supported = 0;
6804
6805 switch (device_id) {
6806 case IXGBE_DEV_ID_82599_SFP:
6807 /* Only these subdevices could supports WOL */
6808 switch (subdevice_id) {
6809 case IXGBE_SUBDEV_ID_82599_560FLR:
6810 /* only support first port */
6811 if (hw->bus.func != 0)
6812 break;
6813 case IXGBE_SUBDEV_ID_82599_SFP:
6814 is_wol_supported = 1;
6815 break;
6816 }
6817 break;
6818 case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
6819 /* All except this subdevice support WOL */
6820 if (subdevice_id != IXGBE_SUBDEV_ID_82599_KX4_KR_MEZZ)
6821 is_wol_supported = 1;
6822 break;
6823 case IXGBE_DEV_ID_82599_KX4:
6824 is_wol_supported = 1;
6825 break;
6826 case IXGBE_DEV_ID_X540T:
6827 /* check eeprom to see if enabled wol */
6828 if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||
6829 ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&
6830 (hw->bus.func == 0))) {
6831 is_wol_supported = 1;
6832 }
6833 break;
6834 }
6835
6836 return is_wol_supported;
6837}
6838
6839/**
6789 * ixgbe_probe - Device Initialization Routine 6840 * ixgbe_probe - Device Initialization Routine
6790 * @pdev: PCI device information struct 6841 * @pdev: PCI device information struct
6791 * @ent: entry in ixgbe_pci_tbl 6842 * @ent: entry in ixgbe_pci_tbl
@@ -6811,7 +6862,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
6811 u16 device_caps; 6862 u16 device_caps;
6812#endif 6863#endif
6813 u32 eec; 6864 u32 eec;
6814 u16 wol_cap;
6815 6865
6816 /* Catch broken hardware that put the wrong VF device ID in 6866 /* Catch broken hardware that put the wrong VF device ID in
6817 * the PCIe SR-IOV capability. 6867 * the PCIe SR-IOV capability.
@@ -7075,40 +7125,12 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7075 netdev->features &= ~NETIF_F_RXHASH; 7125 netdev->features &= ~NETIF_F_RXHASH;
7076 } 7126 }
7077 7127
7078 /* WOL not supported for all but the following */ 7128 /* WOL not supported for all devices */
7079 adapter->wol = 0; 7129 adapter->wol = 0;
7080 switch (pdev->device) { 7130 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap);
7081 case IXGBE_DEV_ID_82599_SFP: 7131 if (ixgbe_wol_supported(adapter, pdev->device, pdev->subsystem_device))
7082 /* Only these subdevice supports WOL */
7083 switch (pdev->subsystem_device) {
7084 case IXGBE_SUBDEV_ID_82599_560FLR:
7085 /* only support first port */
7086 if (hw->bus.func != 0)
7087 break;
7088 case IXGBE_SUBDEV_ID_82599_SFP:
7089 adapter->wol = IXGBE_WUFC_MAG;
7090 break;
7091 }
7092 break;
7093 case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
7094 /* All except this subdevice support WOL */
7095 if (pdev->subsystem_device != IXGBE_SUBDEV_ID_82599_KX4_KR_MEZZ)
7096 adapter->wol = IXGBE_WUFC_MAG;
7097 break;
7098 case IXGBE_DEV_ID_82599_KX4:
7099 adapter->wol = IXGBE_WUFC_MAG; 7132 adapter->wol = IXGBE_WUFC_MAG;
7100 break;
7101 case IXGBE_DEV_ID_X540T:
7102 /* Check eeprom to see if it is enabled */
7103 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap);
7104 wol_cap = adapter->eeprom_cap & IXGBE_DEVICE_CAPS_WOL_MASK;
7105 7133
7106 if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||
7107 ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&
7108 (hw->bus.func == 0)))
7109 adapter->wol = IXGBE_WUFC_MAG;
7110 break;
7111 }
7112 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 7134 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
7113 7135
7114 /* save off EEPROM version number */ 7136 /* save off EEPROM version number */