Commit 9f113618 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

r6040: generate random ethernet MAC address when not initialized

This patch makes the ethernet driver assign a random ethernet
MAC address when the bootloader does not set it.
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58854c6b
......@@ -1153,8 +1153,10 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
/* Some bootloader/BIOSes do not initialize
* MAC address, warn about that */
if (!(adrp[0] || adrp[1] || adrp[2]))
printk(KERN_WARNING DRV_NAME ": MAC address not initialized\n");
if (!(adrp[0] || adrp[1] || adrp[2])) {
printk(KERN_WARNING DRV_NAME ": MAC address not initialized, generating random\n");
random_ether_addr(dev->dev_addr);
}
/* Link new device into r6040_root_dev */
lp->pdev = pdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment