Il giorno 29/gen/06, alle ore 14:16, Lennert Buytenhek ha scritto:
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;"  ?
You're right, this is wrong and the probable cause of some troubles I have recently seen. Thanks ! (Another bug filed on bugzilla as 5977).

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

"cfgpmcsr &= ~PME_EN;"  ?
Since cfgpmcsr is initialized as 0 I don't think this is a problem.

+/* 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
        };
It's really the same and the way it is now is more similar to the way those bits are explained in the datasheets.

Thanks.

--
Daniele Venzano
http://www.brownhat.org

-
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