Skip to contentSkip to conversation

rtl8102e: commit 7bf6bf480 zeroized MAC address

PATCH In review [email protected] 2 participants 2 messages Oct 15, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtl8102e: commit 7bf6bf480 zeroized MAC address

Tested on top of linus tree and back ported 2.6.27.

Please cc me, thanks
Martin Capitanio

    Commit 7bf6bf4803df1adc927f585168d2135fb019c698 broke the in between
    flawlessly working realtek chipset rtl8102e. The mac address is here _not_
    located in the EEPROM at offset 0x0e and it is (at least for this notebook)
    not needed. After a reboot is the original MAC address automagically
    restored.

    [    8.242349] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
    [    8.242434] r8169 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
    [    8.242517] r8169 0000:02:00.0: setting latency timer to 64
    [    8.243548] eth0: RTL8102e at 0xffffc2000004a000, 00:00:00:00:00:00, XID 34a00000 IRQ 316
drivers/net/r8169.c +6 -1
index c821da2..84b3d31 100644
@@ -2156,7 +2156,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	tp->mmio_addr = ioaddr;
 
-	rtl_init_mac_address(tp, ioaddr);
+	if(tp->mac_version == RTL_GIGA_MAC_VER_09)
+	{
+		dprintk("Reading MAC address from EEPROM is not supported\n");
+	} else {
+		rtl_init_mac_address(tp, ioaddr);
+	}
 
 	/* Get MAC address */
 	for (i = 0; i < MAC_ADDR_LEN; i++)
#1 lore raw
Quoted 5 lines · [email protected] wrote:

Tested on top of linus tree and back ported 2.6.27.

Please cc me, thanks
Martin Capitanio

I think this one is more common.

Ivan

=====
Subject: [PATCH] [r8169] initialize MAC address found in EEPROM only if is it valid

---
 drivers/net/r8169.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/r8169.c +3 -2
index c821da2..587a96c 100644
@@ -1975,8 +1975,9 @@ static void rtl_init_mac_address(struct rtl8169_private *tp,
 
 	dprintk("MAC address found in EEPROM: %s\n", print_mac(buf, mac));
 
-	/* Write MAC address */
-	rtl_rar_set(tp, mac);
+	/* Write MAC address if is it valid */
+	if (is_valid_ether_addr(mac))
+		rtl_rar_set(tp, mac);
 }
 
 static int __devinit
Signature · 1 line
1.5.6.3