aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@emulex.com>2011-02-11 13:39:30 +0000
committerDavid S. Miller <davem@davemloft.net>2011-02-11 21:14:49 -0800
commitdcf96f1ff66f328fecf1e14437ac73db71b08c03 (patch)
tree0dbb534f4a497f1e8afbda73362e85ba29d87b72
parent9b037f3811acb0e613fae0fdf74e717f259b5b51 (diff)
downloadkernel_samsung_smdk4412-dcf96f1ff66f328fecf1e14437ac73db71b08c03.zip
kernel_samsung_smdk4412-dcf96f1ff66f328fecf1e14437ac73db71b08c03.tar.gz
kernel_samsung_smdk4412-dcf96f1ff66f328fecf1e14437ac73db71b08c03.tar.bz2
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.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 0c99314..07b4ab9 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)
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
@@ -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;