diff mbox

r8169: Fix WOL in power down case

Message ID 20111009104907.0c6cd439900ca5eb7789295f@gmx.de
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Marc Ballarin Oct. 9, 2011, 8:49 a.m. UTC
Commit 92fc43b4159b518f5baae57301f26d770b0834c9 ("r8169: modify the flow of the
hw reset.") breaks WOL on some versions of the hardware.

Commit 106633897e086e1b47126996aac1a427eb80eb1b ("r8169: fix WOL setting for
8105 and 8111evl") tries to fix this, but only does so in the standby case.

This patch applies an analogous fix to the shutdown path.

Signed-off-by: Marc Ballarin <ballarin.marc@gmx.de>

---


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c236670..a2d6e3a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -5817,6 +5817,15 @@  static void rtl_shutdown(struct pci_dev *pdev)
 			/* PCI commit */
 			RTL_R8(ChipCmd);
 		}
+		/* rtl8105, rtl8111E, and rtl8111evl need the following bits
+		 * set for WOL to work */
+		if ((tp->mac_version == RTL_GIGA_MAC_VER_32 ||
+		     tp->mac_version == RTL_GIGA_MAC_VER_33 ||
+		     tp->mac_version == RTL_GIGA_MAC_VER_34) &&
+		    (__rtl8169_get_wol(tp) & WAKE_ANY)) {
+			RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
+			  AcceptMulticast | AcceptMyPhys);
+		}
 
 		pci_wake_from_d3(pdev, true);
 		pci_set_power_state(pdev, PCI_D3hot);