From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Subject: [PATCH net-next 3/3] net: ethernet: ave: Preserve wol state in suspend/resume sequence
Date: Thu, 29 Nov 2018 17:06:33 +0900 [thread overview]
Message-ID: <1543478793-13719-4-git-send-email-hayashi.kunihiko@socionext.com> (raw)
In-Reply-To: <1543478793-13719-1-git-send-email-hayashi.kunihiko@socionext.com>
Since the wol state forces to be initialized after reset, the state should
be preserved in suspend/resume sequence.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/net/ethernet/socionext/sni_ave.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index ac96fb9..8c1e120 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -261,6 +261,7 @@ struct ave_private {
struct regmap *regmap;
unsigned int pinmode_mask;
unsigned int pinmode_val;
+ u32 wolopts;
/* stats */
struct ave_stats stats_rx;
@@ -1741,6 +1742,7 @@ static int ave_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int ave_suspend(struct device *dev)
{
+ struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
struct net_device *ndev = dev_get_drvdata(dev);
struct ave_private *priv = netdev_priv(ndev);
int ret = 0;
@@ -1750,17 +1752,25 @@ static int ave_suspend(struct device *dev)
netif_device_detach(ndev);
}
+ ave_ethtool_get_wol(ndev, &wol);
+ priv->wolopts = wol.wolopts;
+
return ret;
}
static int ave_resume(struct device *dev)
{
+ struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
struct net_device *ndev = dev_get_drvdata(dev);
struct ave_private *priv = netdev_priv(ndev);
int ret = 0;
ave_global_reset(ndev);
+ ave_ethtool_get_wol(ndev, &wol);
+ wol.wolopts = priv->wolopts;
+ ave_ethtool_set_wol(ndev, &wol);
+
if (ndev->phydev) {
ret = phy_resume(ndev->phydev);
if (ret)
--
2.7.4
next prev parent reply other threads:[~2018-11-29 8:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 8:06 [PATCH net-next 0/3] Add suspend/resume support for AVE ethernet driver Kunihiko Hayashi
2018-11-29 8:06 ` [PATCH net-next 1/3] net: ethernet: ave: Add suspend/resume support Kunihiko Hayashi
2018-11-29 8:06 ` [PATCH net-next 2/3] net: ethernet: ave: Set initial wol state to disabled Kunihiko Hayashi
2018-11-29 8:06 ` Kunihiko Hayashi [this message]
2018-11-29 18:35 ` [PATCH net-next 0/3] Add suspend/resume support for AVE ethernet driver David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1543478793-13719-4-git-send-email-hayashi.kunihiko@socionext.com \
--to=hayashi.kunihiko@socionext.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).