summaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/ethtool.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2009-11-21 00:22:01 +0100
committerDavid S. Miller <davem@davemloft.net>2009-11-21 20:33:42 +0100
commit1fbfca3211ce50d992d66bcda71fc47bf5e268c9 (patch)
tree43cf6dc5a2854a878fba9a4438add33253967d3a /drivers/net/e1000e/ethtool.c
parenttcp: Don't make syn cookies initial setting depend on CONFIG_SYSCTL (diff)
downloadlinux-1fbfca3211ce50d992d66bcda71fc47bf5e268c9.tar.xz
linux-1fbfca3211ce50d992d66bcda71fc47bf5e268c9.zip
e1000e: check WoL mode is among set of supported modes
When setting WoL feature, check the supplied modes are all supported rather than checking for no support. This way, if any new modes are added the driver does not default to not complaining about it if we don't really support it. Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/ethtool.c')
-rw-r--r--drivers/net/e1000e/ethtool.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index c430dc8b70a3..3af5ee4a4cc8 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1777,12 +1777,11 @@ static int e1000_set_wol(struct net_device *netdev,
{
struct e1000_adapter *adapter = netdev_priv(netdev);
- if (wol->wolopts & WAKE_MAGICSECURE)
- return -EOPNOTSUPP;
-
if (!(adapter->flags & FLAG_HAS_WOL) ||
- !device_can_wakeup(&adapter->pdev->dev))
- return wol->wolopts ? -EOPNOTSUPP : 0;
+ !device_can_wakeup(&adapter->pdev->dev) ||
+ (wol->wolopts & ~(WAKE_UCAST | WAKE_MCAST | WAKE_BCAST |
+ WAKE_MAGIC | WAKE_PHY | WAKE_ARP)))
+ return -EOPNOTSUPP;
/* these settings will always override what we currently have */
adapter->wol = 0;