History

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.

Rafael J. Wysocki committed 15 years ago

Commit 6fdbab91 parent 41c31f31 file · +6 −2Browse files

Unified · Split

drivers/net/tg3.c+6−2
@@ -12327,8 +12327,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) · 12326 unmodified lines
1232712327 if (val & VCPU_CFGSHDW_ASPM_DBNC)
1232812328 tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
1232912329 if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
12330− (val & VCPU_CFGSHDW_WOL_MAGPKT))
12330+ (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
1233112331 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12332+ device_set_wakeup_enable(&tp->pdev->dev, true);
12333+ }
1233212334 goto done;
1233312335 }
1233412336
@@ -12461,8 +12463,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) · 126 unmodified lines
1246112463 tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
1246212464
1246312465 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)) {
1246512467 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12468+ device_set_wakeup_enable(&tp->pdev->dev, true);
12469+ }
1246612470
1246712471 if (cfg2 & (1 << 17))
1246812472 tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;