diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2008-02-18 21:20:32 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-02-23 23:57:47 -0500 |
commit | 563e0ae06ff18f0b280f11cf706ba0172255ce52 (patch) | |
tree | dd1dfe89ac42824348b1ae8857685f77692c7dba /drivers/net/sis190.c | |
parent | 98e0f521456943801aacc7a4c0efb5b3bb6f89e0 (diff) | |
download | lwn-563e0ae06ff18f0b280f11cf706ba0172255ce52.tar.gz lwn-563e0ae06ff18f0b280f11cf706ba0172255ce52.zip |
sis190: read the mac address from the eeprom first
Reading a serie of zero from the cmos sram area do not work
well with is_valid_ether_addr(). Let's read the mac address
from the eeprom first as it seems more reliable.
Fix for http://bugzilla.kernel.org/show_bug.cgi?id=9831
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sis190.c')
-rw-r--r-- | drivers/net/sis190.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 202fdf356621..20745fd4e973 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c @@ -1633,13 +1633,18 @@ static inline void sis190_init_rxfilter(struct net_device *dev) static int __devinit sis190_get_mac_addr(struct pci_dev *pdev, struct net_device *dev) { - u8 from; + int rc; + + rc = sis190_get_mac_addr_from_eeprom(pdev, dev); + if (rc < 0) { + u8 reg; - pci_read_config_byte(pdev, 0x73, &from); + pci_read_config_byte(pdev, 0x73, ®); - return (from & 0x00000001) ? - sis190_get_mac_addr_from_apc(pdev, dev) : - sis190_get_mac_addr_from_eeprom(pdev, dev); + if (reg & 0x00000001) + rc = sis190_get_mac_addr_from_apc(pdev, dev); + } + return rc; } static void sis190_set_speed_auto(struct net_device *dev) |