aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-2.6.36/031-sb-fix-nvram_get-on-bcm47xx-platform.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2010-12-05 19:19:50 +0000
committerHauke Mehrtens <hauke@openwrt.org>2010-12-05 19:19:50 +0000
commita3239da5861210e11b191eac3138df571aa22737 (patch)
tree7e40103c70b144be9d1f55eb543c3396b92ae737 /target/linux/brcm47xx/patches-2.6.36/031-sb-fix-nvram_get-on-bcm47xx-platform.patch
parent91e32e19b526559a67c2508c5d26a3040946eb52 (diff)
downloadupstream-a3239da5861210e11b191eac3138df571aa22737.tar.gz
upstream-a3239da5861210e11b191eac3138df571aa22737.tar.bz2
upstream-a3239da5861210e11b191eac3138df571aa22737.zip
brcm47xx: backport patch from kernel 2.6.37
Backport patches from r24162 brcm47xx: reorder patches like they were commitet upstream git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24266 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-2.6.36/031-sb-fix-nvram_get-on-bcm47xx-platform.patch')
-rw-r--r--target/linux/brcm47xx/patches-2.6.36/031-sb-fix-nvram_get-on-bcm47xx-platform.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.36/031-sb-fix-nvram_get-on-bcm47xx-platform.patch b/target/linux/brcm47xx/patches-2.6.36/031-sb-fix-nvram_get-on-bcm47xx-platform.patch
new file mode 100644
index 0000000000..a6f98ee4cc
--- /dev/null
+++ b/target/linux/brcm47xx/patches-2.6.36/031-sb-fix-nvram_get-on-bcm47xx-platform.patch
@@ -0,0 +1,51 @@
+From 99dfec6e793651963ede3c2721b9ff3c81e3aeac Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 27 Nov 2010 14:04:36 +0100
+Subject: [PATCH 6/6] sb: fix nvram_get on bcm47xx platform
+
+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
+declaration.
+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 <hauke@hauke-m.de>
+---
+ include/linux/ssb/ssb_driver_gige.h | 17 +++++++++++------
+ 1 files changed, 11 insertions(+), 6 deletions(-)
+
+--- 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_p
+ 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);
+-#endif
++ char buf[20];
++ if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0)
++ return;
++ nvram_parse_macaddr(buf, macaddr);
+ }
++#else
++static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
++{
++}
++#endif
+
+ extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev,
+ struct pci_dev *pdev);