diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2011-02-11 08:39:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-12 00:14:49 -0500 |
commit | dcf96f1ff66f328fecf1e14437ac73db71b08c03 (patch) | |
tree | 0dbb534f4a497f1e8afbda73362e85ba29d87b72 | |
parent | 9b037f3811acb0e613fae0fdf74e717f259b5b51 (diff) |
be2net: restrict WOL to PFs only.
WOL is not supported for Vrtual Functions.
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/benet/be_ethtool.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index 0c9931473346..07b4ab902b17 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
@@ -516,12 +516,23 @@ be_phys_id(struct net_device *netdev, u32 data) | |||
516 | return status; | 516 | return status; |
517 | } | 517 | } |
518 | 518 | ||
519 | static bool | ||
520 | be_is_wol_supported(struct be_adapter *adapter) | ||
521 | { | ||
522 | if (!be_physfn(adapter)) | ||
523 | return false; | ||
524 | else | ||
525 | return true; | ||
526 | } | ||
527 | |||
519 | static void | 528 | static void |
520 | be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | 529 | be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) |
521 | { | 530 | { |
522 | struct be_adapter *adapter = netdev_priv(netdev); | 531 | struct be_adapter *adapter = netdev_priv(netdev); |
523 | 532 | ||
524 | wol->supported = WAKE_MAGIC; | 533 | if (be_is_wol_supported(adapter)) |
534 | wol->supported = WAKE_MAGIC; | ||
535 | |||
525 | if (adapter->wol) | 536 | if (adapter->wol) |
526 | wol->wolopts = WAKE_MAGIC; | 537 | wol->wolopts = WAKE_MAGIC; |
527 | else | 538 | else |
@@ -537,7 +548,7 @@ be_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
537 | if (wol->wolopts & ~WAKE_MAGIC) | 548 | if (wol->wolopts & ~WAKE_MAGIC) |
538 | return -EINVAL; | 549 | return -EINVAL; |
539 | 550 | ||
540 | if (wol->wolopts & WAKE_MAGIC) | 551 | if ((wol->wolopts & WAKE_MAGIC) && be_is_wol_supported(adapter)) |
541 | adapter->wol = true; | 552 | adapter->wol = true; |
542 | else | 553 | else |
543 | adapter->wol = false; | 554 | adapter->wol = false; |