CHROMIUM: r8169: Enable WOL from Magic Packet by default
authorSameer Nanda <snanda@chromium.org>
Sat, 26 May 2012 00:28:38 +0000 (17:28 -0700)
committerOlof Johansson <olof@lixom.net>
Fri, 1 Jun 2012 06:56:15 +0000 (23:56 -0700)
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 <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/15831
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
drivers/net/ethernet/realtek/r8169.c

index 631ee93..3e3497e 100644 (file)
@@ -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);