[Top] [All Lists]

[PATCH RESEND] ssb: fix nvram_get on bcm47xx platform

Subject: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
From: Hauke Mehrtens <>
Date: Sat, 27 Nov 2010 19:26:32 +0100
Cc:,, Hauke Mehrtens <>
Original-recipient: rfc822;
The nvram_get function was never in the mainline kernel, it only
existed in an external OpenWrt patch. Use nvram_getenv function, which
is in mainline and use an include instead of an extra function
et0macaddr contains the mac address in text from like
00:11:22:33:44:55. We have to parse it before adding it into macaddr.

nvram_parse_macaddr will be merged into asm/mach-bcm47xx/nvram.h though
the MIPS git tree and will be available soon. It will not build now
without nvram_parse_macaddr, but it haven't done before.

Signed-off-by: Hauke Mehrtens <>
 include/linux/ssb/ssb_driver_gige.h |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/include/linux/ssb/ssb_driver_gige.h 
index 942e387..eba52a1 100644
--- a/include/linux/ssb/ssb_driver_gige.h
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -96,16 +96,21 @@ static inline bool ssb_gige_must_flush_posted_writes(struct 
pci_dev *pdev)
        return 0;
-extern char * nvram_get(const char *name);
+#ifdef CONFIG_BCM47XX
+#include <asm/mach-bcm47xx/nvram.h>
 /* Get the device MAC address */
 static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
-#ifdef CONFIG_BCM47XX
-       char *res = nvram_get("et0macaddr");
-       if (res)
-               memcpy(macaddr, res, 6);
+       char buf[20];
+       if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0)
+               return;
+       nvram_parse_macaddr(buf, macaddr);
+static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
 extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
                                          struct pci_dev *pdev);

<Prev in Thread] Current Thread [Next in Thread>