aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-08-16 03:34:18 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-09-23 12:05:51 -0400
commitc23f5b6bbb5ba73cafdb354dcace17426fef4d38 (patch)
treedf362819c3d35ef5be8ae9b5ba47f747ca3d9243 /drivers
parentff9d1a5aefa70ef161a5716f44ad2c24957db7c8 (diff)
ixgbe: add WOL support for X540
Add support for WOL as determined by the EEPROM. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c13
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c14
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_type.h4
4 files changed, 30 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index b43b2cde49d..1f4a4caeb00 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -491,6 +491,7 @@ struct ixgbe_adapter {
491 u64 rsc_total_flush; 491 u64 rsc_total_flush;
492 u32 wol; 492 u32 wol;
493 u16 eeprom_version; 493 u16 eeprom_version;
494 u16 eeprom_cap;
494 495
495 int node; 496 int node;
496 u32 led_reg; 497 u32 led_reg;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 63cd2a11ff1..debcf5f350c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -1888,6 +1888,7 @@ static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter,
1888{ 1888{
1889 struct ixgbe_hw *hw = &adapter->hw; 1889 struct ixgbe_hw *hw = &adapter->hw;
1890 int retval = 1; 1890 int retval = 1;
1891 u16 wol_cap = adapter->eeprom_cap & IXGBE_DEVICE_CAPS_WOL_MASK;
1891 1892
1892 /* WOL not supported except for the following */ 1893 /* WOL not supported except for the following */
1893 switch(hw->device_id) { 1894 switch(hw->device_id) {
@@ -1911,6 +1912,18 @@ static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter,
1911 case IXGBE_DEV_ID_82599_KX4: 1912 case IXGBE_DEV_ID_82599_KX4:
1912 retval = 0; 1913 retval = 0;
1913 break; 1914 break;
1915 case IXGBE_DEV_ID_X540T:
1916 /* check eeprom to see if enabled wol */
1917 if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||
1918 ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&
1919 (hw->bus.func == 0))) {
1920 retval = 0;
1921 break;
1922 }
1923
1924 /* All others not supported */
1925 wol->supported = 0;
1926 break;
1914 default: 1927 default:
1915 wol->supported = 0; 1928 wol->supported = 0;
1916 } 1929 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index fae2f441033..5f50f1b69ca 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7074,6 +7074,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7074 u16 device_caps; 7074 u16 device_caps;
7075#endif 7075#endif
7076 u32 eec; 7076 u32 eec;
7077 u16 wol_cap;
7077 7078
7078 /* Catch broken hardware that put the wrong VF device ID in 7079 /* Catch broken hardware that put the wrong VF device ID in
7079 * the PCIe SR-IOV capability. 7080 * the PCIe SR-IOV capability.
@@ -7338,6 +7339,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7338 netdev->features &= ~NETIF_F_RXHASH; 7339 netdev->features &= ~NETIF_F_RXHASH;
7339 } 7340 }
7340 7341
7342 /* WOL not supported for all but the following */
7343 adapter->wol = 0;
7341 switch (pdev->device) { 7344 switch (pdev->device) {
7342 case IXGBE_DEV_ID_82599_SFP: 7345 case IXGBE_DEV_ID_82599_SFP:
7343 /* Only this subdevice supports WOL */ 7346 /* Only this subdevice supports WOL */
@@ -7352,8 +7355,15 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7352 case IXGBE_DEV_ID_82599_KX4: 7355 case IXGBE_DEV_ID_82599_KX4:
7353 adapter->wol = IXGBE_WUFC_MAG; 7356 adapter->wol = IXGBE_WUFC_MAG;
7354 break; 7357 break;
7355 default: 7358 case IXGBE_DEV_ID_X540T:
7356 adapter->wol = 0; 7359 /* Check eeprom to see if it is enabled */
7360 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap);
7361 wol_cap = adapter->eeprom_cap & IXGBE_DEVICE_CAPS_WOL_MASK;
7362
7363 if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||
7364 ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&
7365 (hw->bus.func == 0)))
7366 adapter->wol = IXGBE_WUFC_MAG;
7357 break; 7367 break;
7358 } 7368 }
7359 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 7369 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index b119cd60237..9a03341e526 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -1754,6 +1754,10 @@ enum {
1754#define IXGBE_ALT_SAN_MAC_ADDR_CAPS_SANMAC 0x0 /* Alt. SAN MAC exists */ 1754#define IXGBE_ALT_SAN_MAC_ADDR_CAPS_SANMAC 0x0 /* Alt. SAN MAC exists */
1755#define IXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN 0x1 /* Alt. WWN base exists */ 1755#define IXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN 0x1 /* Alt. WWN base exists */
1756 1756
1757#define IXGBE_DEVICE_CAPS_WOL_PORT0_1 0x4 /* WoL supported on ports 0 & 1 */
1758#define IXGBE_DEVICE_CAPS_WOL_PORT0 0x8 /* WoL supported on port 0 */
1759#define IXGBE_DEVICE_CAPS_WOL_MASK 0xC /* Mask for WoL capabilities */
1760
1757/* PCI Bus Info */ 1761/* PCI Bus Info */
1758#define IXGBE_PCI_DEVICE_STATUS 0xAA 1762#define IXGBE_PCI_DEVICE_STATUS 0xAA
1759#define IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING 0x0020 1763#define IXGBE_PCI_DEVICE_STATUS_TRANSACTION_PENDING 0x0020