提交 1fbfca32 编写于 作者: B Bruce Allan 提交者: David S. Miller

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: NBruce Allan <bruce.w.allan@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e994b7c9
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册