aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-3.3/251-MIPS-bcm47xx-refactor-fetching-board-data.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-05-17 13:22:38 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2012-05-17 13:22:38 +0000
commit273797f15a2ec0fc47cd88a92904a5712bd6539e (patch)
treec6806b48609216e9a0e3f0d613471ac270fbc168 /target/linux/brcm47xx/patches-3.3/251-MIPS-bcm47xx-refactor-fetching-board-data.patch
parent3491d8c01799eedc6bb00405d306b206242abe40 (diff)
downloadupstream-273797f15a2ec0fc47cd88a92904a5712bd6539e.tar.gz
upstream-273797f15a2ec0fc47cd88a92904a5712bd6539e.tar.bz2
upstream-273797f15a2ec0fc47cd88a92904a5712bd6539e.zip
kernel: ssb/bcma: update to version from wireless-testing tag master-2012-05-16-2
SVN-Revision: 31772
Diffstat (limited to 'target/linux/brcm47xx/patches-3.3/251-MIPS-bcm47xx-refactor-fetching-board-data.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.3/251-MIPS-bcm47xx-refactor-fetching-board-data.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/251-MIPS-bcm47xx-refactor-fetching-board-data.patch b/target/linux/brcm47xx/patches-3.3/251-MIPS-bcm47xx-refactor-fetching-board-data.patch
new file mode 100644
index 0000000000..a50cd8c048
--- /dev/null
+++ b/target/linux/brcm47xx/patches-3.3/251-MIPS-bcm47xx-refactor-fetching-board-data.patch
@@ -0,0 +1,46 @@
+--- a/arch/mips/bcm47xx/setup.c
++++ b/arch/mips/bcm47xx/setup.c
+@@ -157,12 +157,7 @@ static int bcm47xx_get_invariants(struct
+ /* Fill boardinfo structure */
+ memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
+
+- if (nvram_getenv("boardvendor", buf, sizeof(buf)) >= 0)
+- iv->boardinfo.vendor = (u16)simple_strtoul(buf, NULL, 0);
+- else
+- iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
+- if (nvram_getenv("boardtype", buf, sizeof(buf)) >= 0)
+- iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
++ bcm47xx_fill_ssb_boardinfo(&iv->boardinfo, NULL);
+
+ memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
+ bcm47xx_fill_sprom(&iv->sprom, NULL);
+--- a/arch/mips/bcm47xx/sprom.c
++++ b/arch/mips/bcm47xx/sprom.c
+@@ -616,3 +616,15 @@ void bcm47xx_fill_sprom(struct ssb_sprom
+ bcm47xx_fill_sprom_r1(sprom, prefix);
+ }
+ }
++
++#ifdef CONFIG_BCM47XX_SSB
++void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
++ const char *prefix)
++{
++ nvram_read_u16(prefix, NULL, "boardvendor", &boardinfo->vendor, 0);
++ if (!boardinfo->vendor)
++ boardinfo->vendor = SSB_BOARDVENDOR_BCM;
++
++ nvram_read_u16(prefix, NULL, "boardtype", &boardinfo->type, 0);
++}
++#endif
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
+@@ -47,4 +47,9 @@ extern enum bcm47xx_bus_type bcm47xx_bus
+ void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix);
+ void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix);
+
++#ifdef CONFIG_BCM47XX_SSB
++void bcm47xx_fill_ssb_boardinfo(struct ssb_boardinfo *boardinfo,
++ const char *prefix);
++#endif
++
+ #endif /* __ASM_BCM47XX_H */