diff options
author | Ben Dooks <ben-linux@fluff.org> | 2011-02-24 03:17:12 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-28 12:42:17 -0800 |
commit | 85e6b8c5d8be1e901b5402bfe42ce408912ab83e (patch) | |
tree | e614a49bf8a3039e07e2fca77eee358e7827e853 /drivers/net/dm9000.c | |
parent | 6f2e154b68b9321d958391bc0b1ffc2b90d57d71 (diff) |
DM9000: Allow randomised ethernet address
Allow randomised ethernet address if the device does not have a valid
EEPROM or pre-set MAC address.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dm9000.c')
-rw-r--r-- | drivers/net/dm9000.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 2d4c4fc1d900..c30935587207 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c @@ -1592,10 +1592,15 @@ dm9000_probe(struct platform_device *pdev) ndev->dev_addr[i] = ior(db, i+DM9000_PAR); } - if (!is_valid_ether_addr(ndev->dev_addr)) + if (!is_valid_ether_addr(ndev->dev_addr)) { dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please " "set using ifconfig\n", ndev->name); + random_ether_addr(ndev->dev_addr); + mac_src = "random"; + } + + platform_set_drvdata(pdev, ndev); ret = register_netdev(ndev); |