]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Add ethtool get_wol method.
authorMichael Chan <michael.chan@broadcom.com>
Tue, 4 Apr 2017 22:14:09 +0000 (18:14 -0400)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Tue, 11 Jul 2017 00:04:09 +0000 (17:04 -0700)
Orabug: 264025332632559926366387

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8e202366dd752564d7f090ba280cc51cbf7bbbd9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h

index 9b70815313209febe8c8d20cd6add2586a20bc14..05840b217def06e75793de1c557e67a191c639e6 100644 (file)
@@ -1,6 +1,7 @@
 /* Broadcom NetXtreme-C/E network driver.
  *
  * Copyright (c) 2014-2016 Broadcom Corporation
+ * Copyright (c) 2016-2017 Broadcom Limited
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -859,6 +860,20 @@ static void bnxt_get_drvinfo(struct net_device *dev,
        kfree(pkglog);
 }
 
+static void bnxt_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+{
+       struct bnxt *bp = netdev_priv(dev);
+
+       wol->supported = 0;
+       wol->wolopts = 0;
+       memset(&wol->sopass, 0, sizeof(wol->sopass));
+       if (bp->flags & BNXT_FLAG_WOL_CAP) {
+               wol->supported = WAKE_MAGIC;
+               if (bp->wol)
+                       wol->wolopts = WAKE_MAGIC;
+       }
+}
+
 u32 _bnxt_fw_to_ethtool_adv_spds(u16 fw_speeds, u8 fw_pause)
 {
        u32 speed_mask = 0;
@@ -2360,6 +2375,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {
        .get_pauseparam         = bnxt_get_pauseparam,
        .set_pauseparam         = bnxt_set_pauseparam,
        .get_drvinfo            = bnxt_get_drvinfo,
+       .get_wol                = bnxt_get_wol,
        .get_coalesce           = bnxt_get_coalesce,
        .set_coalesce           = bnxt_set_coalesce,
        .get_msglevel           = bnxt_get_msglevel,
index ed1e555292e9ce404b44017eca84fac5edb23d85..27621710e07bb2567a6e8cddd56e4decb279c833 100644 (file)
@@ -1,6 +1,7 @@
 /* Broadcom NetXtreme-C/E network driver.
  *
  * Copyright (c) 2014-2016 Broadcom Corporation
+ * Copyright (c) 2016-2017 Broadcom Limited
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by