aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-01-08 10:04:45 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-11 03:03:38 -0500
commit9f1136182f732f6e847fc43bd88b579739d5c211 (patch)
tree97f375925a18791b266c444443096555c31bf9db /drivers
parent58854c6b411e9e9f46b39bd7092022f639c41904 (diff)
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: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/r6040.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index b59837e80750..8b5d50927ebf 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -1153,8 +1153,10 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1153 1153
1154 /* Some bootloader/BIOSes do not initialize 1154 /* Some bootloader/BIOSes do not initialize
1155 * MAC address, warn about that */ 1155 * MAC address, warn about that */
1156 if (!(adrp[0] || adrp[1] || adrp[2])) 1156 if (!(adrp[0] || adrp[1] || adrp[2])) {
1157 printk(KERN_WARNING DRV_NAME ": MAC address not initialized\n"); 1157 printk(KERN_WARNING DRV_NAME ": MAC address not initialized, generating random\n");
1158 random_ether_addr(dev->dev_addr);
1159 }
1158 1160
1159 /* Link new device into r6040_root_dev */ 1161 /* Link new device into r6040_root_dev */
1160 lp->pdev = pdev; 1162 lp->pdev = pdev;