From 85e6b8c5d8be1e901b5402bfe42ce408912ab83e Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 24 Feb 2011 03:17:12 +0000 Subject: [PATCH] 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 Signed-off-by: Mark Brown Signed-off-by: David S. Miller --- drivers/net/dm9000.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.20.1