Commit 182181d0 authored by Roger Luethi's avatar Roger Luethi Committed by Jeff Garzik

[PATCH] via-rhine: WOL band-aid

After I disabled legacy WOL (i.e. controlled by EEPROM rather than
driver) in 2.6.9, several people reported regressions. Legacy WOL had
worked for them, but now it didn't anymore. The Right Way (TM) to fix
this will get the driver to set up working WOL for all hardware, but a
simpler solution will have to do for the time being: If a user requests
magic packet WOL, the driver re-enables legacy WOL. Yeah, I know it's
cheating.

This version applies against -mm. I suggest to put it there for testing
and into 2.6.11 if feedback is good.

Thanks to Pavel Ruzicka for testing.

Roger
Signed-off-by: default avatarRoger Luethi <rl@hellgate.ch>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 63e2579b
......@@ -654,7 +654,7 @@ static void __devinit rhine_reload_eeprom(long pioaddr, struct net_device *dev)
/* Turn off EEPROM-controlled wake-up (magic packet) */
if (rp->quirks & rqWOL)
iowrite8(ioread8(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA);
iowrite8(ioread8(ioaddr + ConfigA) & 0xFC, ioaddr + ConfigA);
}
......@@ -1905,8 +1905,14 @@ static void rhine_shutdown (struct device *gendev)
if (rp->quirks & rq6patterns)
iowrite8(0x04, ioaddr + 0xA7);
if (rp->wolopts & WAKE_MAGIC)
if (rp->wolopts & WAKE_MAGIC) {
iowrite8(WOLmagic, ioaddr + WOLcrSet);
/*
* Turn EEPROM-controlled wake-up back on -- some hardware may
* not cooperate otherwise.
*/
iowrite8(ioread8(ioaddr + ConfigA) | 0x03, ioaddr + ConfigA);
}
if (rp->wolopts & (WAKE_BCAST|WAKE_MCAST))
iowrite8(WOLbmcast, ioaddr + WOLcgSet);
......@@ -1917,9 +1923,11 @@ static void rhine_shutdown (struct device *gendev)
if (rp->wolopts & WAKE_UCAST)
iowrite8(WOLucast, ioaddr + WOLcrSet);
if (rp->wolopts) {
/* Enable legacy WOL (for old motherboards) */
iowrite8(0x01, ioaddr + PwcfgSet);
iowrite8(ioread8(ioaddr + StickyHW) | 0x04, ioaddr + StickyHW);
}
/* Hit power state D3 (sleep) */
iowrite8(ioread8(ioaddr + StickyHW) | 0x03, ioaddr + StickyHW);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment