From: Sameer Nanda Date: Sat, 26 May 2012 00:28:38 +0000 (-0700) Subject: CHROMIUM: r8169: Enable WOL from Magic Packet by default X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=b6ac1e4b71119fb188f3cb21082bc2f0d23c979c;p=cascardo%2Flinux.git CHROMIUM: r8169: Enable WOL from Magic Packet by default 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. BUG=chrome-os-partner:7026 TEST=On a system with a realtek ethernet MAC, do the following 1. run "ethtool -s eth0 wol p" to enable WOL from PHY activity 2. reboot the system 3. run "ethtool eth0" and check that "p" is not listed in "Wake-on" Change-Id: Iee843b5a93c04a9463342bd87dc03078d37e2ef0 Signed-off-by: Sameer Nanda Reviewed-on: https://gerrit.chromium.org/gerrit/15831 Reviewed-by: Olof Johansson Reviewed-by: Todd Broch --- diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 631ee933f45b..3e3497e812d7 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -6199,11 +6199,9 @@ 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) - 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);