Commit efb90e43 authored by Mitch Williams's avatar Mitch Williams Committed by David S. Miller

e1000e: add new wakeup cababilities

Ethtool supports wake-on-ARP and wake-on-link, and so does the hardware
supported by e1000e.  This patch just introduces the two.
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a51c0d0
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#define E1000_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */ #define E1000_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */
#define E1000_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */ #define E1000_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */
#define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */ #define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */
#define E1000_WUFC_ARP 0x00000020 /* ARP Request Packet Wakeup Enable */
/* Extended Device Control */ /* Extended Device Control */
#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */ #define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */
......
...@@ -1632,7 +1632,8 @@ static void e1000_get_wol(struct net_device *netdev, ...@@ -1632,7 +1632,8 @@ static void e1000_get_wol(struct net_device *netdev,
return; return;
wol->supported = WAKE_UCAST | WAKE_MCAST | wol->supported = WAKE_UCAST | WAKE_MCAST |
WAKE_BCAST | WAKE_MAGIC; WAKE_BCAST | WAKE_MAGIC |
WAKE_PHY | WAKE_ARP;
/* apply any specific unsupported masks here */ /* apply any specific unsupported masks here */
if (adapter->flags & FLAG_NO_WAKE_UCAST) { if (adapter->flags & FLAG_NO_WAKE_UCAST) {
...@@ -1651,6 +1652,10 @@ static void e1000_get_wol(struct net_device *netdev, ...@@ -1651,6 +1652,10 @@ static void e1000_get_wol(struct net_device *netdev,
wol->wolopts |= WAKE_BCAST; wol->wolopts |= WAKE_BCAST;
if (adapter->wol & E1000_WUFC_MAG) if (adapter->wol & E1000_WUFC_MAG)
wol->wolopts |= WAKE_MAGIC; wol->wolopts |= WAKE_MAGIC;
if (adapter->wol & E1000_WUFC_LNKC)
wol->wolopts |= WAKE_PHY;
if (adapter->wol & E1000_WUFC_ARP)
wol->wolopts |= WAKE_ARP;
} }
static int e1000_set_wol(struct net_device *netdev, static int e1000_set_wol(struct net_device *netdev,
...@@ -1658,7 +1663,7 @@ static int e1000_set_wol(struct net_device *netdev, ...@@ -1658,7 +1663,7 @@ static int e1000_set_wol(struct net_device *netdev,
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) if (wol->wolopts & WAKE_MAGICSECURE)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (!(adapter->flags & FLAG_HAS_WOL)) if (!(adapter->flags & FLAG_HAS_WOL))
...@@ -1675,6 +1680,10 @@ static int e1000_set_wol(struct net_device *netdev, ...@@ -1675,6 +1680,10 @@ static int e1000_set_wol(struct net_device *netdev,
adapter->wol |= E1000_WUFC_BC; adapter->wol |= E1000_WUFC_BC;
if (wol->wolopts & WAKE_MAGIC) if (wol->wolopts & WAKE_MAGIC)
adapter->wol |= E1000_WUFC_MAG; adapter->wol |= E1000_WUFC_MAG;
if (wol->wolopts & WAKE_PHY)
adapter->wol |= E1000_WUFC_LNKC;
if (wol->wolopts & WAKE_ARP)
adapter->wol |= E1000_WUFC_ARP;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment