aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 9c11087d3e87..16ecba15830d 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -381,6 +381,10 @@ struct ring_info {
381 u8 __pad[sizeof(void *) - sizeof(u32)]; 381 u8 __pad[sizeof(void *) - sizeof(u32)];
382}; 382};
383 383
384enum features {
385 RTL_FEATURE_WOL = (1 << 0),
386};
387
384struct rtl8169_private { 388struct rtl8169_private {
385 void __iomem *mmio_addr; /* memory map physical address */ 389 void __iomem *mmio_addr; /* memory map physical address */
386 struct pci_dev *pci_dev; /* Index of PCI device */ 390 struct pci_dev *pci_dev; /* Index of PCI device */
@@ -421,7 +425,7 @@ struct rtl8169_private {
421 unsigned int (*phy_reset_pending)(void __iomem *); 425 unsigned int (*phy_reset_pending)(void __iomem *);
422 unsigned int (*link_ok)(void __iomem *); 426 unsigned int (*link_ok)(void __iomem *);
423 struct delayed_work task; 427 struct delayed_work task;
424 unsigned wol_enabled : 1; 428 unsigned features;
425}; 429};
426 430
427MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); 431MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
@@ -627,7 +631,10 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
627 631
628 RTL_W8(Cfg9346, Cfg9346_Lock); 632 RTL_W8(Cfg9346, Cfg9346_Lock);
629 633
630 tp->wol_enabled = (wol->wolopts) ? 1 : 0; 634 if (wol->wolopts)
635 tp->features |= RTL_FEATURE_WOL;
636 else
637 tp->features &= ~RTL_FEATURE_WOL;
631 638
632 spin_unlock_irq(&tp->lock); 639 spin_unlock_irq(&tp->lock);
633 640
@@ -3045,7 +3052,8 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state)
3045 3052
3046out_pci_suspend: 3053out_pci_suspend:
3047 pci_save_state(pdev); 3054 pci_save_state(pdev);
3048 pci_enable_wake(pdev, pci_choose_state(pdev, state), tp->wol_enabled); 3055 pci_enable_wake(pdev, pci_choose_state(pdev, state),
3056 (tp->features & RTL_FEATURE_WOL) ? 1 : 0);
3049 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 3057 pci_set_power_state(pdev, pci_choose_state(pdev, state));
3050 3058
3051 return 0; 3059 return 0;