Skip to content

Commit 8e20236

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Add ethtool get_wol method.
Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d196ece commit 8e20236

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* Broadcom NetXtreme-C/E network driver.
22
*
33
* Copyright (c) 2014-2016 Broadcom Corporation
4+
* Copyright (c) 2016-2017 Broadcom Limited
45
*
56
* This program is free software; you can redistribute it and/or modify
67
* it under the terms of the GNU General Public License as published by
@@ -832,6 +833,20 @@ static void bnxt_get_drvinfo(struct net_device *dev,
832833
kfree(pkglog);
833834
}
834835

836+
static void bnxt_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
837+
{
838+
struct bnxt *bp = netdev_priv(dev);
839+
840+
wol->supported = 0;
841+
wol->wolopts = 0;
842+
memset(&wol->sopass, 0, sizeof(wol->sopass));
843+
if (bp->flags & BNXT_FLAG_WOL_CAP) {
844+
wol->supported = WAKE_MAGIC;
845+
if (bp->wol)
846+
wol->wolopts = WAKE_MAGIC;
847+
}
848+
}
849+
835850
u32 _bnxt_fw_to_ethtool_adv_spds(u16 fw_speeds, u8 fw_pause)
836851
{
837852
u32 speed_mask = 0;
@@ -2134,6 +2149,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {
21342149
.get_pauseparam = bnxt_get_pauseparam,
21352150
.set_pauseparam = bnxt_set_pauseparam,
21362151
.get_drvinfo = bnxt_get_drvinfo,
2152+
.get_wol = bnxt_get_wol,
21372153
.get_coalesce = bnxt_get_coalesce,
21382154
.set_coalesce = bnxt_set_coalesce,
21392155
.get_msglevel = bnxt_get_msglevel,

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* Broadcom NetXtreme-C/E network driver.
22
*
33
* Copyright (c) 2014-2016 Broadcom Corporation
4+
* Copyright (c) 2016-2017 Broadcom Limited
45
*
56
* This program is free software; you can redistribute it and/or modify
67
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)