netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sameer Nanda <snanda@chromium.org>
To: omieu@fr.zoreil.com, jw@sisk.pl, hayeswang@realtek.com
Cc: netdev@vger.kernel.org, linux-pm@lists.linux-foundation.org,
	Sameer Nanda <snanda@chromium.org>
Subject: [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
Date: Tue, 14 Feb 2012 10:27:59 -0800	[thread overview]
Message-ID: <1329244079-27842-1-git-send-email-snanda@chromium.org> (raw)

Set the WOL config registers to only enable WOL from magic packet by
default. Without this change in place, the WOL config register
settings on warm reboot come up in an inconsistent state since these
registers don't get reset on a warm reboot.

Signed-off-by: Sameer Nanda <snanda@chromium.org>
---
 drivers/net/ethernet/realtek/r8169.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7a0c800..a6921b7 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4073,12 +4073,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	tp->txd_version = rtl_chip_infos[chipset].txd_version;
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
+
+	/* Enable WOL from Magic Packet by default */
 	RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
-	RTL_W8(Config5, RTL_R8(Config5) & PMEStatus);
-	if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0)
-		tp->features |= RTL_FEATURE_WOL;
-	if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)
-		tp->features |= RTL_FEATURE_WOL;
+	RTL_W8(Config3, MagicPacket);
+	RTL_W8(Config5, PMEStatus);
+	tp->features |= RTL_FEATURE_WOL;
+
 	tp->features |= rtl_try_msi(tp, cfg);
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 
-- 
1.7.7.3

             reply	other threads:[~2012-02-14 18:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 18:27 Sameer Nanda [this message]
2012-02-14 18:33 ` [PATCH 1/2] r8169: Enable WOL from Magic Packet by default Sameer Nanda
2012-02-14 18:38   ` Sameer Nanda
2012-02-15  0:13 ` Francois Romieu
2012-02-15  1:00   ` Sameer Nanda
2012-02-15  3:37     ` David Miller
2012-02-16 20:47       ` Sameer Nanda

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=1329244079-27842-1-git-send-email-snanda@chromium.org \
    --to=snanda@chromium.org \
    --cc=hayeswang@realtek.com \
    --cc=jw@sisk.pl \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=omieu@fr.zoreil.com \
    /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).