netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macb: use random mac if stored address in EEPROM is invalid
@ 2008-06-04 17:44 Sven Schnelle
  2008-06-08 20:41 ` Haavard Skinnemoen
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Schnelle @ 2008-06-04 17:44 UTC (permalink / raw)
  To: hskinnemoen; +Cc: netdev, linux-kernel


We should use a random mac address if the EEPROM doesn't contain a valid
one. This makes life on Boards with unprogrammed EEPROM devices easier.

Signed-off-by: Sven Schnelle <svens@stackframe.org>

---
 drivers/net/macb.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 92dccd4..e346302 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -80,8 +80,12 @@ static void __init macb_get_hwaddr(struct macb *bp)
        addr[4] = top & 0xff;
        addr[5] = (top >> 8) & 0xff;
 
-       if (is_valid_ether_addr(addr))
+       if (is_valid_ether_addr(addr)) {
                memcpy(bp->dev->dev_addr, addr, sizeof(addr));
+       } else {
+               dev_info(&bp->pdev->dev, "invalid hw address, using
random\n");
+               random_ether_addr(bp->dev->dev_addr);
+       }
 }
 
 static int macb_mdio_read(struct mii_bus *bus, int mii_id, int regnum)

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

end of thread, other threads:[~2008-06-08 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-04 17:44 [PATCH] macb: use random mac if stored address in EEPROM is invalid Sven Schnelle
2008-06-08 20:41 ` Haavard Skinnemoen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).