From: Francois Romieu Date: Mon, 18 Feb 2008 20:20:32 +0000 (+0100) Subject: sis190: read the mac address from the eeprom first X-Git-Tag: v2.6.24.5~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93ea6ab18c1b1a511e168f9207d8c855822f90ff;p=thirdparty%2Fkernel%2Fstable.git sis190: read the mac address from the eeprom first upstream commit: 563e0ae06ff18f0b280f11cf706ba0172255ce52 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 Signed-off-by: Jeff Garzik dsd@gentoo.org notes: This patch fixes http://bugs.gentoo.org/207706 Cc: Daniel Drake Signed-off-by: Chris Wright --- diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index b570402f7feda..053eab669b2f1 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c @@ -1632,13 +1632,18 @@ static inline void sis190_init_rxfilter(struct net_device *dev) static int 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)