--- via-rhine.c 2004-10-18 23:55:28.000000000 +0200 +++ via-rhine-patched.c 2004-12-01 01:02:18.000000000 +0100 @@ -664,7 +664,7 @@ static void __devinit rhine_reload_eepro /* Turn off EEPROM-controlled wake-up (magic packet) */ if (rp->quirks & rqWOL) - writeb(readb(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA); + writeb(readb(ioaddr + ConfigA) & 0xFC, ioaddr + ConfigA); } @@ -1917,8 +1917,14 @@ static void rhine_shutdown (struct devic if (rp->quirks & rq6patterns) writeb(0x04, ioaddr + 0xA7); - if (rp->wolopts & WAKE_MAGIC) + if (rp->wolopts & WAKE_MAGIC) { writeb(WOLmagic, ioaddr + WOLcrSet); + /* + * Turn EEPROM-controlled wake-up back on -- some hardware may + * not cooperate otherwise. + */ + writeb(readb(ioaddr + ConfigA) | 0x03, ioaddr + ConfigA); + } if (rp->wolopts & (WAKE_BCAST|WAKE_MCAST)) writeb(WOLbmcast, ioaddr + WOLcgSet); @@ -1929,9 +1935,11 @@ static void rhine_shutdown (struct devic if (rp->wolopts & WAKE_UCAST) writeb(WOLucast, ioaddr + WOLcrSet); - /* Enable legacy WOL (for old motherboards) */ - writeb(0x01, ioaddr + PwcfgSet); - writeb(readb(ioaddr + StickyHW) | 0x04, ioaddr + StickyHW); + if (rp->wolopts) { + /* Enable legacy WOL (for old motherboards) */ + writeb(0x01, ioaddr + PwcfgSet); + writeb(readb(ioaddr + StickyHW) | 0x04, ioaddr + StickyHW); + } /* Hit power state D3 (sleep) */ writeb(readb(ioaddr + StickyHW) | 0x03, ioaddr + StickyHW);