Skip to contentSkip to conversation

r6040: warn about MAC address being unset

PATCH Applied Florian Fainelli 2 participants 3 messages Jan 7, 2009 – Jan 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/4 r6040: warn about MAC address being unset

From: Florian Fainelli <[email protected]>
Subject: [PATCH 3/4] r6040: warn about MAC address being unset

Some bootloader/BIOSes do not set the MAC
address, warn about that.

---

drivers/net/r6040.c +5 -0
index a59efbd..ce619d3 100644
@@ -1127,6 +1127,11 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
 	adrp[1] = ioread16(ioaddr + MID_0M);
 	adrp[2] = ioread16(ioaddr + MID_0H);
 
+	/* 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");
+
 	/* Link new device into r6040_root_dev */
 	lp->pdev = pdev;
 	lp->dev = dev;
maintainer Applied
#1 lore raw

From: Florian Fainelli <[email protected]>
Date: Wed, 7 Jan 2009 17:40:41 +0100

Quoted 6 lines

r6040: warn about MAC address being unset

Some bootloader/BIOSes do not set the MAC
address, warn about that.

Applied.

Even better behavior would be to use a random ethernet address after emitting the warning, so that the user still has a usable interface.

See the random_ether_addr() interface and how many other net drivers make use of it in situations nearly identical to this one.

#2 lore raw

Hi David,

Le Thursday 08 January 2009 20:03:29 David Miller, vous avez écrit :

Quoted 4 lines

Applied.

Even better behavior would be to use a random ethernet address after emitting the warning, so that the user still has a usable interface.

Yes, I realised that right after sending the patch ;)

Quoted 3 lines

See the random_ether_addr() interface and how many other net drivers make use of it in situations nearly identical to this one.

Thanks, will send a patch using this.

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------