1 From 99dfec6e793651963ede3c2721b9ff3c81e3aeac Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 27 Nov 2010 14:04:36 +0100
4 Subject: [PATCH 6/6] sb: fix nvram_get on bcm47xx platform
6 The nvram_get function was never in the mainline kernel, it only
7 existed in an external OpenWrt patch. Use nvram_getenv function, which
8 is in mainline and use an include instead of an extra function
10 et0macaddr contains the mac address in text from like
11 00:11:22:33:44:55. We have to parse it before adding it into macaddr.
13 nvram_parse_macaddr will be merged into asm/mach-bcm47xx/nvram.h though
14 the MIPS git tree and will be available soon. It will not build now
15 without nvram_parse_macaddr, but it haven't done before.
17 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
19 include/linux/ssb/ssb_driver_gige.h | 17 +++++++++++------
20 1 files changed, 11 insertions(+), 6 deletions(-)
22 --- a/include/linux/ssb/ssb_driver_gige.h
23 +++ b/include/linux/ssb/ssb_driver_gige.h
24 @@ -96,16 +96,21 @@ static inline bool ssb_gige_must_flush_p
28 -extern char * nvram_get(const char *name);
29 +#ifdef CONFIG_BCM47XX
30 +#include <asm/mach-bcm47xx/nvram.h>
31 /* Get the device MAC address */
32 static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
34 -#ifdef CONFIG_BCM47XX
35 - char *res = nvram_get("et0macaddr");
37 - memcpy(macaddr, res, 6);
40 + if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0)
42 + nvram_parse_macaddr(buf, macaddr);
45 +static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
50 extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
51 struct pci_dev *pdev);