netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] r8169: remember WOL preferences on driver load
@ 2013-08-17  9:00 Peter Wu
  2013-08-20 22:10 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Wu @ 2013-08-17  9:00 UTC (permalink / raw)
  To: netdev; +Cc: nic_swsd, Hayes Wang, Francois Romieu, lekensteyn

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] r8169: remember WOL preferences on driver load
@ 2013-08-13 20:19 Peter Wu
  2013-08-13 21:28 ` Francois Romieu
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Wu @ 2013-08-13 20:19 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, nic_swsd, lekensteyn

Do not clear Broadcast/Multicast/Unicast Wake Flag or LanWake in
Config5. This is necessary to preserve WOL state when the driver is
loaded. The r8168 vendor driver used to write to both Config1 and
Config5, but in recent versions, this is commented out. Here we keep
writing PMEnable to Config1 because there may be older chips where
PMEnable is not sticky.

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

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 28af01c..7bdf322 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7093,7 +7093,6 @@ 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);
 	if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0)
 		tp->features |= RTL_FEATURE_WOL;
 	if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-20 23:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-17  9:00 [PATCH] r8169: remember WOL preferences on driver load Peter Wu
2013-08-20 22:10 ` 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

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).