Skip to content

Commit

Permalink
r8169: WoL fixes, part 2.
Browse files Browse the repository at this point in the history
Since recent kernel (2.6.26 or 2.6.27) the PCI wakeup functions are
influenced by generic device ability and configuration when enabling
PCI-device triggered wake-up.

This patch causes WoL setting to enable/disable device's wish to
be permitted to wake-up the host when changing WoL options and
also during device probing.

Without this patch one has write 'enabled' to
  /sys/bus/pci/devices/0000:02:08.0/power/wakeup

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bruno Prémont authored and David S. Miller committed Oct 9, 2008
1 parent 20037fa commit 8b76ab3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
tp->features |= RTL_FEATURE_WOL;
else
tp->features &= ~RTL_FEATURE_WOL;
device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);

spin_unlock_irq(&tp->lock);

Expand Down Expand Up @@ -2017,6 +2018,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}

rtl8169_init_phy(dev, tp);
device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);

out:
return rc;
Expand Down

0 comments on commit 8b76ab3

Please sign in to comment.