[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1298553432-30240-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Date: Thu, 24 Feb 2011 13:17:12 +0000
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: davem@...emloft.net, eric.dumazet@...il.com
Cc: netdev@...r.kernel.org, patches@...nsource.wolfsonmicro.com,
Ben Dooks <ben-linux@...ff.org>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH] DM9000: Allow randomised ethernet address
From: Ben Dooks <ben-linux@...ff.org>
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@...ff.org>
Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
---
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 461dd6f..3177081 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -1593,10 +1593,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);
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists