aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_ethtool.c
diff options
context:
space:
mode:
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,