diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-10-21 07:07:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-22 00:45:40 -0400 |
commit | bc083ce98eeb42205e99495481c8616d30916f6e (patch) | |
tree | b6111dd22d2d3a9102362b2e2a6b75e8aa928b74 /drivers/net/qlge/qlge_ethtool.c | |
parent | d8eb59dc8b9e77bb4fa5420ff80142759ad5cd7b (diff) |
qlge: Add ethtool wake on LAN function.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_ethtool.c')
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index 0c0549bc7bde..019f35fb10c1 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c | |||
@@ -371,6 +371,36 @@ static void ql_get_drvinfo(struct net_device *ndev, | |||
371 | drvinfo->eedump_len = 0; | 371 | drvinfo->eedump_len = 0; |
372 | } | 372 | } |
373 | 373 | ||
374 | static void ql_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) | ||
375 | { | ||
376 | struct ql_adapter *qdev = netdev_priv(ndev); | ||
377 | /* What we support. */ | ||
378 | wol->supported = WAKE_MAGIC; | ||
379 | /* What we've currently got set. */ | ||
380 | wol->wolopts = qdev->wol; | ||
381 | } | ||
382 | |||
383 | static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) | ||
384 | { | ||
385 | struct ql_adapter *qdev = netdev_priv(ndev); | ||
386 | int status; | ||
387 | |||
388 | if (wol->wolopts & ~WAKE_MAGIC) | ||
389 | return -EINVAL; | ||
390 | qdev->wol = wol->wolopts; | ||
391 | |||
392 | QPRINTK(qdev, DRV, INFO, "Set wol option 0x%x on %s\n", | ||
393 | qdev->wol, ndev->name); | ||
394 | if (!qdev->wol) { | ||
395 | u32 wol = 0; | ||
396 | status = ql_mb_wol_mode(qdev, wol); | ||
397 | QPRINTK(qdev, DRV, ERR, "WOL %s (wol code 0x%x) on %s\n", | ||
398 | (status == 0) ? "cleared sucessfully" : "clear failed", | ||
399 | wol, qdev->ndev->name); | ||
400 | } | ||
401 | |||
402 | return 0; | ||
403 | } | ||
374 | 404 | ||
375 | static int ql_phys_id(struct net_device *ndev, u32 data) | 405 | static int ql_phys_id(struct net_device *ndev, u32 data) |
376 | { | 406 | { |
@@ -523,6 +553,8 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value) | |||
523 | const struct ethtool_ops qlge_ethtool_ops = { | 553 | const struct ethtool_ops qlge_ethtool_ops = { |
524 | .get_settings = ql_get_settings, | 554 | .get_settings = ql_get_settings, |
525 | .get_drvinfo = ql_get_drvinfo, | 555 | .get_drvinfo = ql_get_drvinfo, |
556 | .get_wol = ql_get_wol, | ||
557 | .set_wol = ql_set_wol, | ||
526 | .get_msglevel = ql_get_msglevel, | 558 | .get_msglevel = ql_get_msglevel, |
527 | .set_msglevel = ql_set_msglevel, | 559 | .set_msglevel = ql_set_msglevel, |
528 | .get_link = ethtool_op_get_link, | 560 | .get_link = ethtool_op_get_link, |