summaryrefslogtreecommitdiff
path: root/drivers/net/dm9000.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2006-06-13 23:50:15 +0100
committerJeff Garzik <jeff@garzik.org>2006-06-26 22:01:53 -0400
commit5b55dda6f40c46e93006b3c88f75550e0d3b3032 (patch)
tree408d1795bff1b55f54c07bf52570172fc4dfcd84 /drivers/net/dm9000.c
parentb4ed03ff12e4bf228aaf15b2a364134348ebe8a9 (diff)
[PATCH] 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. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/dm9000.c')
-rw-r--r--drivers/net/dm9000.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 631e0d9f2e40..e6bdbd3a6796 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -559,6 +559,13 @@ dm9000_probe(struct platform_device *pdev)
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);