All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4] r6040: warn about MAC address being unset
@ 2009-01-07 16:40 Florian Fainelli
  2009-01-08 19:03 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2009-01-07 16:40 UTC (permalink / raw)
  To: David Miller, Jeff Garzik, netdev

From: Florian Fainelli <florian@openwrt.org>
Subject: [PATCH 3/4] r6040: warn about MAC address being unset

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

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index a59efbd..ce619d3 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/4] r6040: warn about MAC address being unset
  2009-01-07 16:40 [PATCH 3/4] r6040: warn about MAC address being unset Florian Fainelli
@ 2009-01-08 19:03 ` David Miller
  2009-01-08 21:09   ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2009-01-08 19:03 UTC (permalink / raw)
  To: florian; +Cc: jeff, netdev

From: Florian Fainelli <florian@openwrt.org>
Date: Wed, 7 Jan 2009 17:40:41 +0100

> r6040: warn about MAC address being unset
> 
> Some bootloader/BIOSes do not set the MAC
> address, warn about that.
> 
> Signed-off-by: Florian Fainelli <florian@openwrt.org>

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/4] r6040: warn about MAC address being unset
  2009-01-08 19:03 ` David Miller
@ 2009-01-08 21:09   ` Florian Fainelli
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2009-01-08 21:09 UTC (permalink / raw)
  To: David Miller; +Cc: jeff, netdev

Hi David,

Le Thursday 08 January 2009 20:03:29 David Miller, vous avez écrit :
> 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 ;)

>
> 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.
-- 
Best regards, Florian Fainelli
Email : florian@openwrt.org
http://openwrt.org
-------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-08 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 16:40 [PATCH 3/4] r6040: warn about MAC address being unset Florian Fainelli
2009-01-08 19:03 ` David Miller
2009-01-08 21:09   ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.