netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DM9000 - check for MAC left in by bootloader
@ 2006-06-13 22:50 Ben Dooks
  0 siblings, 0 replies; only message in thread
From: Ben Dooks @ 2006-06-13 22:50 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

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.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

[-- Attachment #2: dm9k-no-valid-eeprom.patch --]
[-- Type: text/plain, Size: 606 bytes --]

--- ../linux-2.6.17/linux-2.6.17-rc5/drivers/net/dm9000.c	2006-03-20 05:53:29.000000000 +0000
+++ linux-2.6.16-simtec2/drivers/net/dm9000.c	2006-05-22 21:46:18.000000000 +0100
@@ -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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-13 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-13 22:50 [PATCH] DM9000 - check for MAC left in by bootloader Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).