Skip to content

Commit

Permalink
be2net: restrict WOL to PFs only.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ajit Khaparde authored and David S. Miller committed Feb 12, 2011
1 parent 9b037f3 commit dcf96f1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/net/benet/be_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,23 @@ be_phys_id(struct net_device *netdev, u32 data)
return status;
}

static bool
be_is_wol_supported(struct be_adapter *adapter)
{
if (!be_physfn(adapter))
return false;
else
return true;
}

static void
be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
struct be_adapter *adapter = netdev_priv(netdev);

wol->supported = WAKE_MAGIC;
if (be_is_wol_supported(adapter))
wol->supported = WAKE_MAGIC;

if (adapter->wol)
wol->wolopts = WAKE_MAGIC;
else
Expand All @@ -537,7 +548,7 @@ be_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
if (wol->wolopts & ~WAKE_MAGIC)
return -EINVAL;

if (wol->wolopts & WAKE_MAGIC)
if ((wol->wolopts & WAKE_MAGIC) && be_is_wol_supported(adapter))
adapter->wol = true;
else
adapter->wol = false;
Expand Down

0 comments on commit dcf96f1

Please sign in to comment.