Skip to contentSkip to conversation

DM9000 - check for MAC left in by bootloader

PATCH New Ben Dooks 1 participant 1 message Jun 13, 2006

Subsystems (2)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 DM9000 - check for MAC left in by bootloader

The DM9000 driver does not deal with the case where there is no serial EEPROM to store the configuration, and the bootloader has placed an MAC address into the device already.

If there is no valid MAC in the EEPROM, read the one already in the chip and check to see if that one is valid.

drivers/net/dm9000.c renamed from linux-2.6.17/linux-2.6.17-rc5/drivers/net/dm9000.c +7 -0
@@ -564,6 +559,13 @@ dm9000_probe(struct platform_device *pde
 	for (i = 0; i < 6; i++)
 		ndev->dev_addr[i] = db->srom[i];
 
+	if (!is_valid_ether_addr(ndev->dev_addr)) {
+		/* try reading from mac */
+
+		for (i = 0; i < 6; i++)
+			ndev->dev_addr[i] = ior(db, i+DM9000_PAR);
+	}
+
 	if (!is_valid_ether_addr(ndev->dev_addr))
 		printk("%s: Invalid ethernet MAC address.  Please "
 		       "set using ifconfig\n", ndev->name);