Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72395
b: refs/heads/master
c: f23e7fd
h: refs/heads/master
i:
  72393: 8fe1596
  72391: dc24c7e
v: v3
  • Loading branch information
Francois Romieu committed Oct 18, 2007
1 parent 8754a9c commit cc2edf7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53edbecd589520833a89b57af1ee636fdc7544a5
refs/heads/master: f23e7fdad166a4968f1f7f56964b75acfdcf57a4
14 changes: 11 additions & 3 deletions trunk/drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@ struct ring_info {
u8 __pad[sizeof(void *) - sizeof(u32)];
};

enum features {
RTL_FEATURE_WOL = (1 << 0),
};

struct rtl8169_private {
void __iomem *mmio_addr; /* memory map physical address */
struct pci_dev *pci_dev; /* Index of PCI device */
Expand Down Expand Up @@ -421,7 +425,7 @@ struct rtl8169_private {
unsigned int (*phy_reset_pending)(void __iomem *);
unsigned int (*link_ok)(void __iomem *);
struct delayed_work task;
unsigned wol_enabled : 1;
unsigned features;
};

MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
Expand Down Expand Up @@ -627,7 +631,10 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)

RTL_W8(Cfg9346, Cfg9346_Lock);

tp->wol_enabled = (wol->wolopts) ? 1 : 0;
if (wol->wolopts)
tp->features |= RTL_FEATURE_WOL;
else
tp->features &= ~RTL_FEATURE_WOL;

spin_unlock_irq(&tp->lock);

Expand Down Expand Up @@ -3045,7 +3052,8 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state)

out_pci_suspend:
pci_save_state(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev, state), tp->wol_enabled);
pci_enable_wake(pdev, pci_choose_state(pdev, state),
(tp->features & RTL_FEATURE_WOL) ? 1 : 0);
pci_set_power_state(pdev, pci_choose_state(pdev, state));

return 0;
Expand Down

0 comments on commit cc2edf7

Please sign in to comment.