Hello!

I found some fishy-looking things while backporting sis900 wake-on-lan
support.


> +     /* Detect Wake on Lan support */
> +     ret = inl(CFGPMC & PMESP);

"ret = (inl(net_dev->base_addr + CFGPMC) & PMESP) >> 27;"  ?


> +     if (wol->wolopts == 0) {
> +             pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr);
> +             cfgpmcsr |= ~PME_EN;

"cfgpmcsr &= ~PME_EN;"  ?


> +/* Power management capabilities bits */
> +enum sis900_cfgpmc_register_bits {
> +     PMVER = 0x00070000,
> +     DSI = 0x00100000,
> +     PMESP = 0xf8000000
> +};
> +
> +enum sis900_pmesp_bits {
> +     PME_D0 = 0x1,
> +     PME_D1 = 0x2,
> +     PME_D2 = 0x4,
> +     PME_D3H = 0x8,
> +     PME_D3C = 0x10
> +};

Why not something like this instead?

        /* Power management capabilities bits */
        enum sis900_cfgpmc_register_bits {
                PMVER = 0x00070000,
                DSI = 0x00100000,
                PMESP = 0xf8000000
                PME_D0 = 0x08000000,
                PME_D1 = 0x10000000,
                PME_D2 = 0x20000000,
                PME_D3H = 0x40000000,
                PME_D3C = 0x80000000
        };


cheers,
Lennert
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to