summaryrefslogtreecommitdiff
path: root/target/linux/brcm47xx/patches-2.6.36/030-b44-fix-workarround-for-wap54g10.patch
diff options
context:
space:
mode:
authorhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-12-05 19:19:50 +0000
committerhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-12-05 19:19:50 +0000
commit2308d83efb10f97b03a12808b56f08ae4d7540a5 (patch)
tree7e40103c70b144be9d1f55eb543c3396b92ae737 /target/linux/brcm47xx/patches-2.6.36/030-b44-fix-workarround-for-wap54g10.patch
parent2c5bea6134b3f2a601323b48c4d6c58ced2cf727 (diff)
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/030-b44-fix-workarround-for-wap54g10.patch')
-rw-r--r--target/linux/brcm47xx/patches-2.6.36/030-b44-fix-workarround-for-wap54g10.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.36/030-b44-fix-workarround-for-wap54g10.patch b/target/linux/brcm47xx/patches-2.6.36/030-b44-fix-workarround-for-wap54g10.patch
new file mode 100644
index 0000000000..a23e3a71e4
--- /dev/null
+++ b/target/linux/brcm47xx/patches-2.6.36/030-b44-fix-workarround-for-wap54g10.patch
@@ -0,0 +1,50 @@
+From 93f94103b9d239b15bba69f592bb6fb2ec5e363f Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 27 Nov 2010 13:14:14 +0100
+Subject: [PATCH 5/6] b44: fix workarround for wap54g10
+
+The code for the b44_wap54g10_workaround was never included, because
+the config option was wrong. The nvram_get function was never in
+mainline kernel, only in external OpenWrt patches.
+
+The code should be compiled in when CONFIG_BCM47XX is selected and not
+when CONFIG_SSB_DRIVER_MIPS is selected, because nvram_getenv is only
+available on bcm47xx platforms and now in the mainline kernel code.
+Using an include is better than a second function declaration, to fix
+this when the function signature changes.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ drivers/net/b44.c | 11 +++++------
+ 1 files changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/b44.c
++++ b/drivers/net/b44.c
+@@ -381,11 +381,11 @@ static void b44_set_flow_ctrl(struct b44
+ __b44_set_flow_ctrl(bp, pause_enab);
+ }
+
+-#ifdef SSB_DRIVER_MIPS
+-extern char *nvram_get(char *name);
++#ifdef CONFIG_BCM47XX
++#include <asm/mach-bcm47xx/nvram.h>
+ static void b44_wap54g10_workaround(struct b44 *bp)
+ {
+- const char *str;
++ char buf[20];
+ u32 val;
+ int err;
+
+@@ -394,10 +394,9 @@ static void b44_wap54g10_workaround(stru
+ * see https://dev.openwrt.org/ticket/146
+ * check and reset bit "isolate"
+ */
+- str = nvram_get("boardnum");
+- if (!str)
++ if (nvram_getenv("boardnum", buf, sizeof(buf)) < 0)
+ return;
+- if (simple_strtoul(str, NULL, 0) == 2) {
++ if (simple_strtoul(buf, NULL, 0) == 2) {
+ err = __b44_readphy(bp, 0, MII_BMCR, &val);
+ if (err)
+ goto error;