提交 9f113618 编写于 作者: F Florian Fainelli 提交者: 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: NFlorian Fainelli <florian@openwrt.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册