diff options
author | Nick Nunley <nicholasx.d.nunley@intel.com> | 2010-02-16 20:01:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:21:31 -0500 |
commit | 22939f0606e515799d83e1a29250917f94c8d07b (patch) | |
tree | 067adc565d0686c7d0fe26dd1082ea8b6d4a65ea /drivers/net/igb | |
parent | 26b39276ca5ff4dbf3c07704e34fd820fd97decf (diff) |
igb: add support for wake-on-link
This adds support for wake-on-link/phy activity to the ethtool
interface.
Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r-- | drivers/net/igb/igb_ethtool.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index f771a6c0877..145a8eb55fa 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
@@ -1812,7 +1812,8 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
1812 | struct igb_adapter *adapter = netdev_priv(netdev); | 1812 | struct igb_adapter *adapter = netdev_priv(netdev); |
1813 | 1813 | ||
1814 | wol->supported = WAKE_UCAST | WAKE_MCAST | | 1814 | wol->supported = WAKE_UCAST | WAKE_MCAST | |
1815 | WAKE_BCAST | WAKE_MAGIC; | 1815 | WAKE_BCAST | WAKE_MAGIC | |
1816 | WAKE_PHY; | ||
1816 | wol->wolopts = 0; | 1817 | wol->wolopts = 0; |
1817 | 1818 | ||
1818 | /* this function will set ->supported = 0 and return 1 if wol is not | 1819 | /* this function will set ->supported = 0 and return 1 if wol is not |
@@ -1835,15 +1836,15 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
1835 | wol->wolopts |= WAKE_BCAST; | 1836 | wol->wolopts |= WAKE_BCAST; |
1836 | if (adapter->wol & E1000_WUFC_MAG) | 1837 | if (adapter->wol & E1000_WUFC_MAG) |
1837 | wol->wolopts |= WAKE_MAGIC; | 1838 | wol->wolopts |= WAKE_MAGIC; |
1838 | 1839 | if (adapter->wol & E1000_WUFC_LNKC) | |
1839 | return; | 1840 | wol->wolopts |= WAKE_PHY; |
1840 | } | 1841 | } |
1841 | 1842 | ||
1842 | static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | 1843 | static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) |
1843 | { | 1844 | { |
1844 | struct igb_adapter *adapter = netdev_priv(netdev); | 1845 | struct igb_adapter *adapter = netdev_priv(netdev); |
1845 | 1846 | ||
1846 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) | 1847 | if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)) |
1847 | return -EOPNOTSUPP; | 1848 | return -EOPNOTSUPP; |
1848 | 1849 | ||
1849 | if (igb_wol_exclusion(adapter, wol) || | 1850 | if (igb_wol_exclusion(adapter, wol) || |
@@ -1861,6 +1862,8 @@ static int igb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
1861 | adapter->wol |= E1000_WUFC_BC; | 1862 | adapter->wol |= E1000_WUFC_BC; |
1862 | if (wol->wolopts & WAKE_MAGIC) | 1863 | if (wol->wolopts & WAKE_MAGIC) |
1863 | adapter->wol |= E1000_WUFC_MAG; | 1864 | adapter->wol |= E1000_WUFC_MAG; |
1865 | if (wol->wolopts & WAKE_PHY) | ||
1866 | adapter->wol |= E1000_WUFC_LNKC; | ||
1864 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | 1867 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); |
1865 | 1868 | ||
1866 | return 0; | 1869 | return 0; |