aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_ethtool.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajitk@serverengines.com>2009-12-03 01:16:59 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-03 15:39:21 -0500
commit71d8d1b58aa4025ea73a66a130a98d0ed077f9b1 (patch)
tree36034463fa1b1438ad018fbaafbe9dac60159751 /drivers/net/benet/be_ethtool.c
parentd744b44e21a2c908aae23a60da1b4ce35cd925ef (diff)
be2net: Support for WoL using magic packet after suspend.
Add support for WOL using Magic Packet after suspend is done. Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_ethtool.c')
-rw-r--r--drivers/net/benet/be_ethtool.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 329560f9e543..83a2fc703995 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -411,6 +411,36 @@ be_phys_id(struct net_device *netdev, u32 data)
411 return status; 411 return status;
412} 412}
413 413
414static void
415be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
416{
417 struct be_adapter *adapter = netdev_priv(netdev);
418
419 wol->supported = WAKE_MAGIC;
420 if (adapter->wol)
421 wol->wolopts = WAKE_MAGIC;
422 else
423 wol->wolopts = 0;
424 memset(&wol->sopass, 0, sizeof(wol->sopass));
425 return;
426}
427
428static int
429be_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
430{
431 struct be_adapter *adapter = netdev_priv(netdev);
432
433 if (wol->wolopts & ~WAKE_MAGIC)
434 return -EINVAL;
435
436 if (wol->wolopts & WAKE_MAGIC)
437 adapter->wol = true;
438 else
439 adapter->wol = false;
440
441 return 0;
442}
443
414static int 444static int
415be_do_flash(struct net_device *netdev, struct ethtool_flash *efl) 445be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
416{ 446{
@@ -428,6 +458,8 @@ be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
428const struct ethtool_ops be_ethtool_ops = { 458const struct ethtool_ops be_ethtool_ops = {
429 .get_settings = be_get_settings, 459 .get_settings = be_get_settings,
430 .get_drvinfo = be_get_drvinfo, 460 .get_drvinfo = be_get_drvinfo,
461 .get_wol = be_get_wol,
462 .set_wol = be_set_wol,
431 .get_link = ethtool_op_get_link, 463 .get_link = ethtool_op_get_link,
432 .get_coalesce = be_get_coalesce, 464 .get_coalesce = be_get_coalesce,
433 .set_coalesce = be_set_coalesce, 465 .set_coalesce = be_set_coalesce,