mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-19 15:39:07 +00:00
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>
This commit is contained in:
parent
6f2e154b68
commit
85e6b8c5d8
@ -1592,10 +1592,15 @@ dm9000_probe(struct platform_device *pdev)
|
|||||||
ndev->dev_addr[i] = ior(db, i+DM9000_PAR);
|
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 "
|
dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please "
|
||||||
"set using ifconfig\n", ndev->name);
|
"set using ifconfig\n", ndev->name);
|
||||||
|
|
||||||
|
random_ether_addr(ndev->dev_addr);
|
||||||
|
mac_src = "random";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
platform_set_drvdata(pdev, ndev);
|
platform_set_drvdata(pdev, ndev);
|
||||||
ret = register_netdev(ndev);
|
ret = register_netdev(ndev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user