Skip to content

Commit

Permalink
e1000e: check WoL mode is among set of supported modes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bruce Allan authored and David S. Miller committed Nov 21, 2009
1 parent e994b7c commit 1fbfca3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/net/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1fbfca3

Please sign in to comment.