Skip to content

Commit

Permalink
DM9000: Allow randomised ethernet address
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks authored and David S. Miller committed Feb 28, 2011
1 parent 6f2e154 commit 85e6b8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 85e6b8c

Please sign in to comment.