All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Wu <lekensteyn@gmail.com>
To: netdev@vger.kernel.org
Cc: nic_swsd <nic_swsd@realtek.com>,
	Hayes Wang <hayeswang@realtek.com>,
	Francois Romieu <romieu@fr.zoreil.com>,
	lekensteyn@gmail.com
Subject: [PATCH] r8169: remember WOL preferences on driver load
Date: Sat, 17 Aug 2013 11:00:02 +0200	[thread overview]
Message-ID: <1376730002-9235-1-git-send-email-lekensteyn@gmail.com> (raw)

From: Peter Wu <lekensteyn@gmail.com>

Do not clear Broadcast/Multicast/Unicast Wake Flag or LanWake in
Config5. This is necessary to preserve WOL state when the driver is
loaded. Although the r8168 vendor driver does not write Config5 (it has
been commented out), Hayes Wang from Realtek said that masking bits like
this is more sensible.

Signed-off-by: Peter Wu <lekensteyn@gmail.com>
---
 drivers/net/ethernet/realtek/r8169.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 2943916..104eaef 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7092,7 +7092,7 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
 	RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
-	RTL_W8(Config5, RTL_R8(Config5) & PMEStatus);
+	RTL_W8(Config5, RTL_R8(Config5) & (BWF | MWF | UWF | LanWake | PMEStatus));
 	if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0)
 		tp->features |= RTL_FEATURE_WOL;
 	if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)
-- 
1.8.3.4

             reply	other threads:[~2013-08-17  9:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-17  9:00 Peter Wu [this message]
2013-08-20 22:10 ` [PATCH] r8169: remember WOL preferences on driver load David Miller
2013-08-20 23:12   ` Francois Romieu
2013-08-20 23:48     ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2013-08-13 20:19 Peter Wu
2013-08-13 21:28 ` Francois Romieu
2013-08-14 12:56   ` Peter Wu
2013-08-15  6:09     ` hayeswang

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=1376730002-9235-1-git-send-email-lekensteyn@gmail.com \
    --to=lekensteyn@gmail.com \
    --cc=hayeswang@realtek.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=romieu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.