2010-07-07 11:12:45 +00:00
|
|
|
From: Rafael J. Wysocki <rjw@suse.de>
|
|
|
|
Subject: net (tg3): Fix failure to enable WoL by default when possible
|
|
|
|
References: bnc#447371
|
|
|
|
Patch-mainline: not yet
|
|
|
|
|
|
|
|
tg3 is supposed to enable WoL by default on adapters which support
|
|
|
|
that, but it fails to do so unless the adapter's
|
|
|
|
/sys/devices/.../power/wakeup file contains 'enabled' during the
|
|
|
|
initialization of the adapter. Fix that by making tg3 update the
|
|
|
|
device's 'should_wakeup' bit automatically whenever WoL should be
|
|
|
|
enabled by default.
|
|
|
|
|
|
|
|
Signed-off-by: Rafael J. Wysocki <rjw@suse.de>
|
|
|
|
---
|
|
|
|
drivers/net/tg3.c | 8 ++++++--
|
|
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/net/tg3.c
|
|
|
|
+++ b/drivers/net/tg3.c
|
2011-04-19 20:09:59 +00:00
|
|
|
@@ -12048,8 +12048,10 @@ static void __devinit tg3_get_eeprom_hw_
|
2010-07-07 11:12:45 +00:00
|
|
|
if (val & VCPU_CFGSHDW_ASPM_DBNC)
|
|
|
|
tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
|
|
|
|
if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
|
|
|
|
- (val & VCPU_CFGSHDW_WOL_MAGPKT))
|
|
|
|
+ (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
|
|
|
|
tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
|
|
|
|
+ device_set_wakeup_enable(&tp->pdev->dev, true);
|
|
|
|
+ }
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
2011-04-19 20:09:59 +00:00
|
|
|
@@ -12182,8 +12184,10 @@ static void __devinit tg3_get_eeprom_hw_
|
2010-07-07 11:12:45 +00:00
|
|
|
tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
|
|
|
|
|
|
|
|
if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
|
|
|
|
- (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE))
|
|
|
|
+ (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) {
|
|
|
|
tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
|
|
|
|
+ device_set_wakeup_enable(&tp->pdev->dev, true);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (cfg2 & (1 << 17))
|
2011-04-19 20:09:59 +00:00
|
|
|
tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;
|