aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-28 07:02:15 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-02 18:44:17 -0400
commit6fdbab9d93e04bfe71f2b3fde485d092e2ffe3ec (patch)
treecd88b86a5b7b7c9c16f6fbdefd03b9d5310b41c6 /drivers/net
parent41c31f318a5209922d051e293c61e4724daad11c (diff)
tg3: Fix failure to enable WoL by default when possible
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 use device_set_wakeup_enable() to enable wakeup automatically whenever WoL should be enabled by default. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tg3.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index b8c5f35577e4..7a5daefb6f33 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -12327,8 +12327,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
12327 if (val & VCPU_CFGSHDW_ASPM_DBNC) 12327 if (val & VCPU_CFGSHDW_ASPM_DBNC)
12328 tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND; 12328 tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
12329 if ((val & VCPU_CFGSHDW_WOL_ENABLE) && 12329 if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
12330 (val & VCPU_CFGSHDW_WOL_MAGPKT)) 12330 (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
12331 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; 12331 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12332 device_set_wakeup_enable(&tp->pdev->dev, true);
12333 }
12332 goto done; 12334 goto done;
12333 } 12335 }
12334 12336
@@ -12461,8 +12463,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
12461 tp->tg3_flags &= ~TG3_FLAG_WOL_CAP; 12463 tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
12462 12464
12463 if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) && 12465 if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
12464 (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) 12466 (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) {
12465 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; 12467 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12468 device_set_wakeup_enable(&tp->pdev->dev, true);
12469 }
12466 12470
12467 if (cfg2 & (1 << 17)) 12471 if (cfg2 & (1 << 17))
12468 tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING; 12472 tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;