]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] DM9000 - check for MAC left in by bootloader
authorBen Dooks <ben-linux@fluff.org>
Tue, 13 Jun 2006 22:50:15 +0000 (23:50 +0100)
committerJeff Garzik <jeff@garzik.org>
Tue, 27 Jun 2006 02:01:53 +0000 (22:01 -0400)
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>
drivers/net/dm9000.c

index 631e0d9f2e4021390e41d1a12c765225af4c135c..e6bdbd3a6796a748dc10291c343a059841065cbd 100644 (file)
@@ -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);