aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorfrançois romieu <romieu@fr.zoreil.com>2009-07-24 08:34:19 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-26 23:18:52 -0400
commitca52efd5490f97f396d3c5863ba714624f272033 (patch)
treeedf6f77c4f367be9673cc340edd72eeeb326b982 /drivers/net/r8169.c
parentc8a5a658b826508c7c61b57e9a590f7b8760fb51 (diff)
r8169: WakeOnLan fix for the 8168
More stuff for http://bugzilla.kernel.org/show_bug.cgi?id=9512 Some 8168 are unable to WoL when receiving is not enabled (plain old 8169 do not seem to care). It is not exactly pretty to leave the receiver enabled but we should now enable DMA late enough for it to be safe. Some late stage boot failure due to pxe and friends may benefit from the delayed enabling of bus-mastering as well. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Tested-by: Jaromír Cápík <tavvva@volny.cz> Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 4b53b58d75fc..b82780d805f5 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2060,8 +2060,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2060 } 2060 }
2061 } 2061 }
2062 2062
2063 pci_set_master(pdev);
2064
2065 /* ioremap MMIO region */ 2063 /* ioremap MMIO region */
2066 ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); 2064 ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE);
2067 if (!ioaddr) { 2065 if (!ioaddr) {
@@ -2089,6 +2087,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2089 2087
2090 RTL_W16(IntrStatus, 0xffff); 2088 RTL_W16(IntrStatus, 0xffff);
2091 2089
2090 pci_set_master(pdev);
2091
2092 /* Identify chip attached to board */ 2092 /* Identify chip attached to board */
2093 rtl8169_get_mac_version(tp, ioaddr); 2093 rtl8169_get_mac_version(tp, ioaddr);
2094 2094
@@ -3874,6 +3874,15 @@ static void rtl_shutdown(struct pci_dev *pdev)
3874 spin_unlock_irq(&tp->lock); 3874 spin_unlock_irq(&tp->lock);
3875 3875
3876 if (system_state == SYSTEM_POWER_OFF) { 3876 if (system_state == SYSTEM_POWER_OFF) {
3877 /* WoL fails with some 8168 when the receiver is disabled. */
3878 if (tp->features & RTL_FEATURE_WOL) {
3879 pci_clear_master(pdev);
3880
3881 RTL_W8(ChipCmd, CmdRxEnb);
3882 /* PCI commit */
3883 RTL_R8(ChipCmd);
3884 }
3885
3877 pci_wake_from_d3(pdev, true); 3886 pci_wake_from_d3(pdev, true);
3878 pci_set_power_state(pdev, PCI_D3hot); 3887 pci_set_power_state(pdev, PCI_D3hot);
3879 } 3888 }