]> err.no Git - linux-2.6/commitdiff
Fix Wake on LAN support in sis900
authorDaniele Venzano <venza@brownhat.org>
Sat, 25 Feb 2006 22:01:09 +0000 (17:01 -0500)
committerJeff Garzik <jeff@garzik.org>
Sat, 25 Feb 2006 22:01:09 +0000 (17:01 -0500)
Fix two bugs in the WoL implementation of sis900. The first causes
hangs on some system on driver load, the second causes troubles
when disabling WoL support.  Both fixes are one liner and really
simple.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Daniele Venzano <venza@brownhat.org>
drivers/net/sis900.c

index 3d95fa20cd883e969cb3b138f8edb0a07a06c815..7a952fe60be28dc8604f1c42ce6d51413251c40a 100644 (file)
@@ -540,7 +540,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
        printk("%2.2x.\n", net_dev->dev_addr[i]);
 
        /* Detect Wake on Lan support */
-       ret = inl(CFGPMC & PMESP);
+       ret = (inl(net_dev->base_addr + CFGPMC) & PMESP) >> 27;
        if (netif_msg_probe(sis_priv) && (ret & PME_D3C) == 0)
                printk(KERN_INFO "%s: Wake on LAN only available from suspend to RAM.", net_dev->name);
 
@@ -2040,7 +2040,7 @@ static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wo
 
        if (wol->wolopts == 0) {
                pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr);
-               cfgpmcsr |= ~PME_EN;
+               cfgpmcsr &= ~PME_EN;
                pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr);
                outl(pmctrl_bits, pmctrl_addr);
                if (netif_msg_wol(sis_priv))