Re: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for multiple PCIE devices in nvram.

2015-04-23 Thread Hante Meuleman
Thank you for the information Ian, that was very helpful. Just found 
part of the problem. My R8000 used to work quite well, till I upgraded 
to new Netgear firmware. The old Netgear firmware is using this nvram 
entry:

vlan1ports=3 2 1 0 5 7 8*

Newer firmware will update this nvram entry to

vlan1ports=0 1 2 3 5 7 8*

So depending on when you bought the AP you will have one of these 
entries in the nvram. Both strings indicate that port 8 is the cpu port, 
however, somehow the application (or script, not sure what is doing 
this) that generates the file /etc/config/network at first boot will 
generate different results for the entry:

option ports

vlan1ports=3 2 1 0 5 7 8* - option ports '0 1 2 3 5t'
vlan1ports=0 1 2 3 5 7 8* - option ports '0 1 2 3 5 7 8t'

So when you have newer Netgear FW in your AP then you'll have a 
different setting for vlan1ports in /etc/config/network then with older 
firmware. This setting determines whether or not the switch is going to 
work (as you already figured out).

Still investigating to as of why this setting doesn't work with b53 driver.

-Original Message-
On Wed, 2015-04-22 at 11:45 +, Hante Meuleman wrote:
 Today I wrote the original firmware back on the device 
 (using the latest from netgear). This worked and the device
  was working fine. Then I flashed openwrt again, now the 
 switch didn’t work anymore. So I checked the ports 
 configuration and it had changed. So I reverted that 
 using the nvram userspace program. This killed the 
 nvram contents completely and after reboot I only had 
 the bare minimum nvram contents and it was the same 
 as before. However, now I cannot get the switch to work 
 anymore. 
 
 So doing an nvram set xxx=yyy, followed by nvram commit
 appears to be killing my nvram contents. 
 
 I've no idea why my switch is not working anymore. The 
 problems with this switch is starting to get frustrating

Yes, the switch is frustrating and all I can do is describe what I've
seen, maybe it will help.

A fairly recent change to setting the switch configuration
in /etc/config/network at install sets the switch ports to 0 1 2 3 5 7
8t and 4 8t for the respective vlans.

But the b53 driver still uses port 5 as the cpu and does the setup that
you've previously described as working (using port 5 as cpu).

The switch configuration in network is done once at firmware install so
it needs to be changed by hand.

What's more annoying is doing the heavy lifting in b53 to setup the
switch to use port 8 for the cpu, the way the Broadcom source does,
doesn't work so I'm missing something with that for sure.

So we do need to stick to using port 5 for the cpu consistently
throughout for now.

 
 Regards,
 Hante
 
 -Original Message-
 From: Hante Meuleman 
 Sent: dinsdag 21 april 2015 17:22
 To: 'Ian Kent'; Arend Van Spriel
 Cc: 'Jonas Gorski'; 'mailinglist'
 Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for 
 multiple PCIE devices in nvram.
 
 Today I managed to update brcmfmac to load the data
  directly from bcm47xx_nvram but it will require an additional
 api in this module. I will post my version of bcm47xx_nvram
  later this week. Also the patch for brcmfmac will be posted 
 later this week. With proper NVRAM the device is now booting 
 fine and all wireless devices get detected properly and are
  working fine. 
 
 I still do not know why I lost the complete contents of the nvram. 
 I do know that the CFE holds a very small default set which get 
 programmed if nothing is available from the nvram mtd block 
 device. As I dumped the nvram initially I was able to restore the 
 nvram completely and after that I was not able to get in the 
 situation where the nvram would be cleared and only hold the
 default set of keys.
 
 We do have another r8000, but that one needs to be recoverable. 
 So I will spent some time to see if I can make sure that I can restore
  the r8000 with the original firmware and the original nvram 
 contents and once I'm sure I can I will try to update the other 
 r8000 as well. Then I can see if nvram gets perhaps erased on 
 the initial flashing of the OpenWRT. It's just a guess, but I really 
 don’t know what cleared the nvram contents on my device and 
 as long as that isn’t clear I wouldn’t recommend anybody to flash 
 an openwrt image on it.
 
 Regards,
 Hante
 
 -Original Message-
 From: Hante Meuleman 
 Sent: dinsdag 21 april 2015 10:29
 To: 'Ian Kent'; Arend Van Spriel
 Cc: 'Jonas Gorski'; 'mailinglist'
 Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for 
 multiple PCIE devices in nvram.
 
 It is something else, the CFE appears to override the
 nvram for some reason with some default data. Don’t
 know yet what is reason for CFE to determine that nvram 
 is invalid but it appears to be within the CFE that NVRAM
 gets erased and defaulted to something minimal.
 
 Regards,
 Hante
 
 -Original Message-
 From: Hante Meuleman 
 Sent: 

Re: [OpenWrt-Devel] ar71xx: bug #19503 Fix TP-LINK Archer-C5/C7 v2 RFKILL-Switch

2015-04-23 Thread Lars Buerding

Thanks Dirk,

so this would break Archer-C7 v1 and so cant be used as-is.


-#define ARCHER_C7_GPIO_BTN_RFKILL  13
+#define ARCHER_C7_GPIO_BTN_RFKILL  23

On an Archer C7 v1 13 currently works (but with reversed logic)
toggle between Wireless On/Off position and id disables/enables
the wireless (iwinfo shows no entry / iwinfo showing entries)


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] dnsmasq and --dhcp-relay option ?

2015-04-23 Thread Kevin Darbyshire-Bryant
On 23/04/2015 21:55, openwrt-de...@couprie.net wrote:
 Hi,

 I need the dnsmasq --dhcp-relay option, how do i add this option to the 
 dnsmasq script ?

 Perry

You could edit '/etc/dnsmasq.conf' and add your option/s directly to it.  Does 
that achieve your aim?

Kevin


smime.p7s
Description: S/MIME Cryptographic Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] dnsmasq and --dhcp-relay option ?

2015-04-23 Thread openwrt-de...@couprie.net

Hi,

I need the dnsmasq --dhcp-relay option, how do i add this option to the 
dnsmasq script ?


Perry

--dhcp-relay=local address,server address[,interface] Configure 
dnsmasq to do DHCP relay. The local address is an address allocated to 
an interface on the host running dnsmasq. All DHCP requests arriving on 
that interface will we relayed to a remote DHCP server at the server 
address. It is possible to relay from a single local address to multiple 
remote servers by using multiple dhcp-relay configs with the same local 
address and different server addresses. A server address must be an IP 
literal address, not a domain name. In the case of DHCPv6, the server 
address may be the ALL_SERVERS multicast address, ff05::1:3. In this 
case the interface must be given, not be wildcard, and is used to direct 
the multicast to the correct interface to reach the DHCP server.


Access control for DHCP clients has the same rules as for the DHCP 
server, see --interface, --except-interface, etc. The optional interface 
name in the dhcp-relay config has a different function: it controls on 
which interface DHCP replies from the server will be accepted. This is 
intended for configurations which have three interfaces: one being 
relayed from, a second connecting the DHCP server, and a third untrusted 
network, typically the wider internet. It avoids the possibility of 
spoof replies arriving via this third interface.


It is allowed to have dnsmasq act as a DHCP server on one set of 
interfaces and relay from a disjoint set of interfaces. Note that whilst 
it is quite possible to write configurations which appear to act as a 
server and a relay on the same interface, this is not supported: the 
relay function will take precedence.


Both DHCPv4 and DHCPv6 relay is supported. It's not possible to relay 
DHCPv4 to a DHCPv6 server or vice-versa.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] wpa_supplicant p2p_device SSID overflow = 223 bytes of memory corruption, DoS, possible memory disclosure

2015-04-23 Thread Etienne Champetier
Hi guys,

Just saw this on redis (no idea if OpenWrt is vunerable)

http://w1.fi/security/2015-1/wpa_supplicant-p2p-ssid-overflow.txt

Regards,
Etienne
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] dnsmasq: Bump to dnsmasq2.73rc6 - resend

2015-04-23 Thread Kevin Darbyshire-Bryant
On 23/04/2015 13:22, Felix Fietkau wrote:
 On 2015-04-23 12:09, Kevin Darbyshire-Bryant wrote:
 Bump dnsmasq to v2.73rc6

 Remove 001-fix-crash-in-auth-code.patch 
 200-fix-dhcpv6-solicit-handling.patch as now included upstream.

 Signed-off-by: Kevin Darbyshire-Bryant ke...@darbyshire-bryant.me.uk
 The patch is line wrapped and does not apply.
 
 - Felix
 

G, stoopid Thunderbird! Hidden setting found. Sorry. Try this Felix.


Bump dnsmasq to v2.73rc6

Remove 001-fix-crash-in-auth-code.patch 
200-fix-dhcpv6-solicit-handling.patch as now included upstream.

Signed-off-by: Kevin Darbyshire-Bryant ke...@darbyshire-bryant.me.uk


diff --git a/package/network/services/dnsmasq/Makefile 
b/package/network/services/dnsmasq/Makefile
index 9c90e0f..c5d37a4 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -8,12 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_VERSION:=2.73rc4
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/release-candidates
-PKG_MD5SUM:=24569c7605059aee175b1776201afa93
+PKG_VERSION:=2.73rc6
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://thekelleys.org.uk/dnsmasq.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=b8f16556d36924cd8dc7663cb4129d7b1f3fc2be
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git 
a/package/network/services/dnsmasq/patches/001-fix-crash-in-auth-code.patch 
b/package/network/services/dnsmasq/patches/001-fix-crash-in-auth-code.patch
deleted file mode 100644
index 9cba0cc..000
--- a/package/network/services/dnsmasq/patches/001-fix-crash-in-auth-code.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 38440b204db65f9be16c4c3daa7e991e4356f6ed Mon Sep 17 00:00:00 2001
-From: Simon Kelley si...@thekelleys.org.uk
-Date: Sun, 12 Apr 2015 21:52:47 +0100
-Subject: [PATCH] Fix crash in auth code with odd configuration.
-

- CHANGELOG  | 32 +---
- src/auth.c | 13 -
- 2 files changed, 29 insertions(+), 16 deletions(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index 9af6170..f2142c7 100644
 a/CHANGELOG
-+++ b/CHANGELOG
-@@ -68,18 +68,31 @@ version 2.73
-   Fix broken DNSSEC validation of ECDSA signatures.
- 
-   Add --dnssec-timestamp option, which provides an automatic
--  way to detect when the system time becomes valid after boot
--  on systems without an RTC, whilst allowing DNS queries before the
--  clock is valid so that NTP can run. Thanks to
--  Kevin Darbyshire-Bryant for developing this idea.
-+  way to detect when the system time becomes valid after 
-+  boot on systems without an RTC, whilst allowing DNS 
-+  queries before the clock is valid so that NTP can run. 
-+  Thanks to Kevin Darbyshire-Bryant for developing this idea.
- 
-   Add --tftp-no-fail option. Thanks to Stefan Tomanek for
-   the patch.
- 
--  Fix crash caused by looking up servers.bind, CHAOS text record,
--  when more than about five --servers= lines are in the dnsmasq
--  config. This causes memory corruption which causes a crash later.
--  Thanks to Matt Coddington for sterling work chasing this down.
-+  Fix crash caused by looking up servers.bind, CHAOS text 
-+  record, when more than about five --servers= lines are 
-+  in the dnsmasq config. This causes memory corruption 
-+  which causes a crash later. Thanks to Matt Coddington for 
-+  sterling work chasing this down.
-+
-+  Fix crash on receipt of certain malformed DNS requests.
-+  Thanks to Nick Sampanis for spotting the problem.
-+
-+Fix crash in authoritative DNS code, if a .arpa zone 
-+  is declared as authoritative, and then a PTR query which
-+  is not to be treated as authoritative arrived. Normally, 
-+  directly declaring .arpa zone as authoritative is not 
-+  done, so this crash wouldn't be seen. Instead the 
-+  relevant .arpa zone should be specified as a subnet
-+  in the auth-zone declaration. Thanks to Johnny S. Lee
-+  for the bugreport and initial patch.
- 
-   
- version 2.72
-@@ -125,10 +138,7 @@ version 2.72
- Fix problem with --local-service option on big-endian platforms
-   Thanks to Richard Genoud for the patch.
- 
--  Fix crash on receipt of certain malformed DNS requests. Thanks
--  to Nick Sampanis for spotting the problem.
-   
--
- version 2.71
- Subtle change to error handling to help DNSSEC validation 
-   when servers fail to provide NODATA answers for 
-diff --git a/src/auth.c b/src/auth.c
-index 15721e5..4a5c39f 100644
 a/src/auth.c
-+++ b/src/auth.c
-@@ -141,7 +141,7 @@ size_t answer_auth(struct 

Re: [OpenWrt-Devel] ar71xx: bug #19503 Fix TP-LINK Archer-C5/C7 v2 RFKILL-Switch

2015-04-23 Thread Dirk Neukirchen


-#define ARCHER_C7_GPIO_BTN_RFKILL  13
+#define ARCHER_C7_GPIO_BTN_RFKILL  23

On an Archer C7 v1 13 currently works (but with reversed logic)
toggle between Wireless On/Off position and id disables/enables
the wireless (iwinfo shows no entry / iwinfo showing entries)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] tools/mkimage: backport gcc5 compatibility, patch

2015-04-23 Thread Dirk Neukirchen

Fedora 22 includes gcc5 by default
build leads to error:
include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc5.h: No 
such file or directory

backport upstream patch: Add linux/compiler-gcc5.h to fix builds with gcc5
id: 478b02f1a7043b673565075ea5016376f3293b23


Issue was reported at
https://forum.openwrt.org/viewtopic.php?id=56853
 replicated in a VM

created, flashed and tested ar71xx image successfully 
as test

Signed-off-by: Dirk Neukirchen dirkneukirc...@web.de
---
 tools/mkimage/patches/200-gcc5_compat.patch | 93 +
 1 file changed, 93 insertions(+)
 create mode 100644 tools/mkimage/patches/200-gcc5_compat.patch

diff --git a/tools/mkimage/patches/200-gcc5_compat.patch 
b/tools/mkimage/patches/200-gcc5_compat.patch
new file mode 100644
index 000..4d55f00
--- /dev/null
+++ b/tools/mkimage/patches/200-gcc5_compat.patch
@@ -0,0 +1,93 @@
+From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001
+From: Hans de Goede hdego...@redhat.com
+Date: Sat, 7 Feb 2015 22:52:40 +0100
+Subject: [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5
+
+Add linux/compiler-gcc5/h from the kernel sources at:
+
+commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
+Author: Steven Noonan ste...@uplinklabs.net
+Date:   Sat Oct 25 15:09:42 2014 -0700
+
+compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles
+
+Signed-off-by: Hans de Goede hdego...@redhat.com
+---
+ include/linux/compiler-gcc5.h |   65 +
+ 1 file changed, 65 insertions(+)
+ create mode 100644 include/linux/compiler-gcc5.h
+
+diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
+new file mode 100644
+index 000..c8c5659
+--- /dev/null
 b/include/linux/compiler-gcc5.h
+@@ -0,0 +1,65 @@
++#ifndef __LINUX_COMPILER_H
++#error Please don't include linux/compiler-gcc5.h directly, include 
linux/compiler.h instead.
++#endif
++
++#define __used__attribute__((__used__))
++#define __must_check  __attribute__((warn_unused_result))
++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
++
++/* Mark functions as cold. gcc will assume any path leading to a call
++   to them will be unlikely.  This means a lot of manual unlikely()s
++   are unnecessary now for any paths leading to the usual suspects
++   like BUG(), printk(), panic() etc. [but let's keep them for now for
++   older compilers]
++
++   Early snapshots of gcc 4.3 don't support this and we can't detect this
++   in the preprocessor, but we can live with this because they're unreleased.
++   Maketime probing would be overkill here.
++
++   gcc also has a __attribute__((__hot__)) to move hot functions into
++   a special section, but I don't see any sense in this right now in
++   the kernel context */
++#define __cold__attribute__((__cold__))
++
++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), 
__COUNTER__)
++
++#ifndef __CHECKER__
++# define __compiletime_warning(message) __attribute__((warning(message)))
++# define __compiletime_error(message) __attribute__((error(message)))
++#endif /* __CHECKER__ */
++
++/*
++ * Mark a position in code as unreachable.  This can be used to
++ * suppress control flow warnings after asm blocks that transfer
++ * control elsewhere.
++ *
++ * Early snapshots of gcc 4.5 don't support this and we can't detect
++ * this in the preprocessor, but we can live with this because they're
++ * unreleased.  Really, we need to have autoconf for the kernel.
++ */
++#define unreachable() __builtin_unreachable()
++
++/* Mark a function definition as prohibited from being cloned. */
++#define __noclone __attribute__((__noclone__))
++
++/*
++ * Tell the optimizer that something else uses this function or variable.
++ */
++#define __visible __attribute__((externally_visible))
++
++/*
++ * GCC 'asm goto' miscompiles certain code sequences:
++ *
++ *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
++ *
++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
++ *
++ * (asm goto is automatically volatile - the naming reflects this.)
++ */
++#define asm_volatile_goto(x...)   do { asm goto(x); asm (); } while (0)
++
++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
++#define __HAVE_BUILTIN_BSWAP32__
++#define __HAVE_BUILTIN_BSWAP64__
++#define __HAVE_BUILTIN_BSWAP16__
++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
+-- 
+1.7.10.4
+
-- 
2.3.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] busybox: replace hotfix with upstream commit de5edadee2dca2896492f97ab3a56e389305e74d

2015-04-23 Thread Bastian Bittorf
with this patch the hotfix from r45471 is replaced.

compile and runtested with ar71xx / r45568

the file 'shell/ash_test/ash-heredoc/heredoc1.right' is
not included, because it does not apply on our busybox.
when upgrading to next busybox-release, this patch can be dropped.

Signed-off-by: Bastian Bittorf bitt...@bluebottle.com
---
 ...-a-regression-in-handling-local-variables.patch |   75 ---
 .../290-ash-fix-handling-of-duplicate-local.patch  |  204 
 2 files changed, 204 insertions(+), 75 deletions(-)
 delete mode 100644 
package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
 create mode 100644 
package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch

diff --git 
a/package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
 
b/package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
deleted file mode 100644
index 0ac1925..000
--- 
a/package/utils/busybox/patches/290-ash-fix-a-regression-in-handling-local-variables.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From: Felix Fietkau n...@openwrt.org
-Date: Fri, 17 Apr 2015 01:54:51 +0200
-Subject: [PATCH] ash: fix a regression in handling local variables
-
-commit 109ee5d33694a03cda3424b4846584250832ba8e
-ash: make locak VAR unset VAR (bash does that)
-
-This commit introduced a regression where calling local on an already
-local variable unsets it. This does not match bash behavior.
-
-Update test case to check for this behavior
-
-Signed-off-by: Felix Fietkau n...@openwrt.org

-
 a/shell/ash.c
-+++ b/shell/ash.c
-@@ -8961,6 +8961,21 @@ parse_command_args(char **argv, const ch
- }
- #endif
- 
-+static bool
-+findlocal(struct var *vp)
-+{
-+  struct localvar *lvp = localvars;
-+
-+  while (lvp) {
-+  if (lvp-vp == vp)
-+  return true;
-+
-+  lvp = lvp-next;
-+  }
-+
-+  return false;
-+}
-+
- /*
-  * Make a variable a local variable.  When a variable is made local, it's
-  * value and flags are saved in a localvar structure.  The saved values
-@@ -9000,7 +9015,7 @@ mklocal(char *name)
-   vp-flags |= VSTRFIXED|VTEXTFIXED;
-   if (eq)
-   setvareq(name, 0);
--  else
-+  else if (!findlocal(vp))
-   /* local VAR unsets VAR: */
-   setvar(name, NULL, 0);
-   }
 a/shell/ash_test/ash-misc/local1.right
-+++ b/shell/ash_test/ash-misc/local1.right
-@@ -1,4 +1,5 @@
- A1:'A'
- A2:''
--A3:''
--A4:'A'
-+A3:'B'
-+A4:''
-+A5:'A'
 a/shell/ash_test/ash-misc/local1.tests
-+++ b/shell/ash_test/ash-misc/local1.tests
-@@ -3,9 +3,12 @@ f() {
-   local a
-   # the above line unsets $a
-   echo A2:'$a'
--  unset a
-+  a=B
-+  local a
-   echo A3:'$a'
-+  unset a
-+  echo A4:'$a'
- }
- echo A1:'$a'
- f
--echo A4:'$a'
-+echo A5:'$a'
diff --git 
a/package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch 
b/package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch
new file mode 100644
index 000..71c2162
--- /dev/null
+++ 
b/package/utils/busybox/patches/290-ash-fix-handling-of-duplicate-local.patch
@@ -0,0 +1,204 @@
+From 0a0acb55db8d7c4dec445573f1b0528d126b9e1f Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko vda.li...@googlemail.com
+Date: Sat, 18 Apr 2015 19:36:38 +0200
+Subject: [PATCH] ash: fix handling of duplicate local
+
+Signed-off-by: Denys Vlasenko vda.li...@googlemail.com
+---
+ shell/ash.c   | 51 +--
+ shell/ash_test/ash-vars/var3.right|  5 +++
+ shell/ash_test/ash-vars/var3.tests|  1 +
+ 4 files changed, 42 insertions(+), 17 deletions(-)
+ create mode 100644 shell/ash_test/ash-vars/var3.right
+ create mode 100755 shell/ash_test/ash-vars/var3.tests
+
+diff --git a/shell/ash.c b/shell/ash.c
+index b568013..697a64f 100644
+--- a/shell/ash.c
 b/shell/ash.c
+@@ -2030,7 +2030,7 @@ varcmp(const char *p, const char *q)
+   int c, d;
+ 
+   while ((c = *p) == (d = *q)) {
+-  if (!c || c == '=')
++  if (c == '\0' || c == '=')
+   goto out;
+   p++;
+   q++;
+@@ -2247,7 +2247,7 @@ setvar(const char *name, const char *val, int flags)
+ }
+ 
+ static void FAST_FUNC
+-setvar2(const char *name, const char *val)
++setvar0(const char *name, const char *val)
+ {
+   setvar(name, val, 0);
+ }
+@@ -2310,7 +2310,7 @@ unsetvar(const char *s)
+   free(vp);
+   INT_ON;
+   } else {
+-  setvar2(s, 0);
++  setvar0(s, NULL);
+   vp-flags = ~VEXPORT;
+   }
+  ok:
+@@ -5505,7 +5505,7 @@ ash_arith(const char *s)
+   arith_t result;
+ 
+   math_state.lookupvar 

[OpenWrt-Devel] [PATCH] dnsmasq: Bump to dnsmasq2.73rc6

2015-04-23 Thread Kevin Darbyshire-Bryant
Bump dnsmasq to v2.73rc6

Remove 001-fix-crash-in-auth-code.patch 
200-fix-dhcpv6-solicit-handling.patch as now included upstream.

Signed-off-by: Kevin Darbyshire-Bryant ke...@darbyshire-bryant.me.uk


diff --git a/package/network/services/dnsmasq/Makefile
b/package/network/services/dnsmasq/Makefile
index 9c90e0f..c5d37a4 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -8,12 +8,14 @@
 include $(TOPDIR)/rules.mk

 PKG_NAME:=dnsmasq
-PKG_VERSION:=2.73rc4
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/release-candidates
-PKG_MD5SUM:=24569c7605059aee175b1776201afa93
+PKG_VERSION:=2.73rc6
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://thekelleys.org.uk/dnsmasq.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=b8f16556d36924cd8dc7663cb4129d7b1f3fc2be
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git
a/package/network/services/dnsmasq/patches/001-fix-crash-in-auth-code.patch
b/package/network/services/dnsmasq/patches/001-fix-crash-in-auth-code.patch
deleted file mode 100644
index 9cba0cc..000
---
a/package/network/services/dnsmasq/patches/001-fix-crash-in-auth-code.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 38440b204db65f9be16c4c3daa7e991e4356f6ed Mon Sep 17 00:00:00 2001
-From: Simon Kelley si...@thekelleys.org.uk
-Date: Sun, 12 Apr 2015 21:52:47 +0100
-Subject: [PATCH] Fix crash in auth code with odd configuration.
-

- CHANGELOG  | 32 +---
- src/auth.c | 13 -
- 2 files changed, 29 insertions(+), 16 deletions(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index 9af6170..f2142c7 100644
 a/CHANGELOG
-+++ b/CHANGELOG
-@@ -68,18 +68,31 @@ version 2.73
-   Fix broken DNSSEC validation of ECDSA signatures.
-
-   Add --dnssec-timestamp option, which provides an automatic
--  way to detect when the system time becomes valid after boot
--  on systems without an RTC, whilst allowing DNS queries before the
--  clock is valid so that NTP can run. Thanks to
--  Kevin Darbyshire-Bryant for developing this idea.
-+  way to detect when the system time becomes valid after
-+  boot on systems without an RTC, whilst allowing DNS
-+  queries before the clock is valid so that NTP can run.
-+  Thanks to Kevin Darbyshire-Bryant for developing this idea.
-
-   Add --tftp-no-fail option. Thanks to Stefan Tomanek for
-   the patch.
-
--  Fix crash caused by looking up servers.bind, CHAOS text record,
--  when more than about five --servers= lines are in the dnsmasq
--  config. This causes memory corruption which causes a crash later.
--  Thanks to Matt Coddington for sterling work chasing this down.
-+  Fix crash caused by looking up servers.bind, CHAOS text
-+  record, when more than about five --servers= lines are
-+  in the dnsmasq config. This causes memory corruption
-+  which causes a crash later. Thanks to Matt Coddington for
-+  sterling work chasing this down.
-+
-+  Fix crash on receipt of certain malformed DNS requests.
-+  Thanks to Nick Sampanis for spotting the problem.
-+
-+Fix crash in authoritative DNS code, if a .arpa zone
-+  is declared as authoritative, and then a PTR query which
-+  is not to be treated as authoritative arrived. Normally,
-+  directly declaring .arpa zone as authoritative is not
-+  done, so this crash wouldn't be seen. Instead the
-+  relevant .arpa zone should be specified as a subnet
-+  in the auth-zone declaration. Thanks to Johnny S. Lee
-+  for the bugreport and initial patch.
-
-   
- version 2.72
-@@ -125,10 +138,7 @@ version 2.72
- Fix problem with --local-service option on big-endian
platforms
-   Thanks to Richard Genoud for the patch.
-
--  Fix crash on receipt of certain malformed DNS requests. Thanks
--  to Nick Sampanis for spotting the problem.
-   
--
- version 2.71
- Subtle change to error handling to help DNSSEC validation
-   when servers fail to provide NODATA answers for
-diff --git a/src/auth.c b/src/auth.c
-index 15721e5..4a5c39f 100644
 a/src/auth.c
-+++ b/src/auth.c
-@@ -141,7 +141,7 @@ size_t answer_auth(struct dns_header *header, char
*limit, size_t qlen, time_t n
- for (zone = daemon-auth_zones; zone; zone = zone-next)
-   if ((subnet = find_subnet(zone, flag, addr)))
- break;
--  
-+  
- if (!zone)
-   {
- auth = 0;
-@@ -186,7 +186,7 @@ size_t answer_auth(struct dns_header *header, char
*limit, size_t qlen, time_t n
-   
- if (intr)
-   {
--  

Re: [OpenWrt-Devel] [PATCH] dnsmasq: Bump to dnsmasq2.73rc6

2015-04-23 Thread Felix Fietkau
On 2015-04-23 12:09, Kevin Darbyshire-Bryant wrote:
 Bump dnsmasq to v2.73rc6
 
 Remove 001-fix-crash-in-auth-code.patch 
 200-fix-dhcpv6-solicit-handling.patch as now included upstream.
 
 Signed-off-by: Kevin Darbyshire-Bryant ke...@darbyshire-bryant.me.uk
The patch is line wrapped and does not apply.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] AR8334 switch support

2015-04-23 Thread Christian Mehlis

Am 22.04.2015 um 19:01 schrieb Heiner Kallweit:

Can you provide a complete dmesg output?


Bootlog is available here:
http://wiki.openwrt.org/toh/compex/wpj344#openwrt_upstream_bootlog

Dmesg is attached.


W/o having seen the datasheets for AR8337/AR8334 I'm hesitant to propose a 
patch.
1. AR8334 identifies itself as AR8337/rev.2. There might be a real AR8337/rev.2 
with 7 ports. How to tell between these two chips?


Perhaps there are some other registers where the number of ports are 
available? But I don't have any datasheets to look into...


Best
Christian
[0.00] Linux version 3.18.11 (c@black) (gcc version 4.8.3 
(OpenWrt/Linaro GCC 4.8-2014.04 r45458) ) #1 Tue Apr 21 18:45:08 CEST 2015
[0.00] MyLoader: sysp=cc7dbb0c, boardp=e9f041c4, parts=cbc748d9
[0.00] bootconsole [early0] enabled
[0.00] CPU0 revision is: 0001974c (MIPS 74Kc)
[0.00] SoC: Atheros AR9344 rev 2
[0.00] Determined physical RAM map:
[0.00]  memory: 0800 @  (usable)
[0.00] Initrd not found or empty - disabling initrd
[0.00] Zone ranges:
[0.00]   Normal   [mem 0x-0x07ff]
[0.00] Movable zone start for each node
[0.00] Early memory node ranges
[0.00]   node   0: [mem 0x-0x07ff]
[0.00] Initmem setup node 0 [mem 0x-0x07ff]
[0.00] On node 0 totalpages: 32768
[0.00] free_area_init_node: node 0, pgdat 803560f0, node_mem_map 
8100
[0.00]   Normal zone: 256 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 32768 pages, LIFO batch:7
[0.00] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[0.00] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 
bytes
[0.00] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[0.00] pcpu-alloc: [0] 0 
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 32512
[0.00] Kernel command line:  board=WPJ344 console=ttyS0,115200 
mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro 
rootfstype=squashfs,jffs2 noinitrd
[0.00] PID hash table entries: 512 (order: -1, 2048 bytes)
[0.00] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[0.00] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[0.00] Writing ErrCtl register=
[0.00] Readback ErrCtl register=
[0.00] Memory: 125920K/131072K available (2470K kernel code, 124K 
rwdata, 528K rodata, 260K init, 188K bss, 5152K reserved)
[0.00] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[0.00] NR_IRQS:51
[0.00] Clocks: CPU:560.000MHz, DDR:450.000MHz, AHB:225.000MHz, 
Ref:40.000MHz
[0.00] Calibrating delay loop... 278.93 BogoMIPS (lpj=1394688)
[0.07] pid_max: default: 32768 minimum: 301
[0.07] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.08] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[0.08] NET: Registered protocol family 16
[0.09] MIPS: machine is Compex WPJ344
[0.10] ar724x-pci ar724x-pci: PCIe link is down
[0.10] registering PCI controller with io_map_base unset
[0.11] ar71xx: using random MAC address for eth0
[0.33] ar71xx: using random MAC address for eth1
[0.55] PCI host bridge to bus :00
[0.56] pci_bus :00: root bus resource [mem 0x1000-0x13ff]
[0.56] pci_bus :00: root bus resource [io  0x]
[0.57] pci_bus :00: No busn resource found for root bus, will use 
[bus 00-ff]
[0.57] pci_bus :00: busn_res: [bus 00-ff] end is updated to 00
[0.57] Switched to clocksource MIPS
[0.58] NET: Registered protocol family 2
[0.58] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[0.58] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[0.59] TCP: Hash tables configured (established 1024 bind 1024)
[0.59] TCP: reno registered
[0.60] UDP hash table entries: 256 (order: 0, 4096 bytes)
[0.60] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[0.61] NET: Registered protocol family 1
[0.61] PCI: CLS 0 bytes, default 32
[0.61] futex hash table entries: 256 (order: -1, 3072 bytes)
[0.63] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[0.63] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) 
(CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[0.64] msgmni has been set to 245
[0.66] io scheduler noop registered
[0.66] io scheduler deadline registered (default)
[0.67] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[0.67] console [ttyS0] disabled
[0.70] serial8250.0: ttyS0 at MMIO 0x1802 (irq = 11, base_baud = 
250) is a 16550A
[0.70] console [ttyS0] enabled
[ 

Re: [OpenWrt-Devel] [PATCH] dnsmasq: Bump to dnsmasq2.73rc6 - resend

2015-04-23 Thread Kevin Darbyshire-Bryant
On 23/04/2015 14:06, Kevin Darbyshire-Bryant wrote:
 On 23/04/2015 13:22, Felix Fietkau wrote:
 On 2015-04-23 12:09, Kevin Darbyshire-Bryant wrote:
 Bump dnsmasq to v2.73rc6

 Remove 001-fix-crash-in-auth-code.patch 
 200-fix-dhcpv6-solicit-handling.patch as now included upstream.

 Signed-off-by: Kevin Darbyshire-Bryant ke...@darbyshire-bryant.me.uk
 The patch is line wrapped and does not apply.

 - Felix

 
 G, stoopid Thunderbird! Hidden setting found. Sorry. Try this Felix.
 
 

And I see Steven has beaten me to it anyway :-)



smime.p7s
Description: S/MIME Cryptographic Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for multiple PCIE devices in nvram.

2015-04-23 Thread Hante Meuleman
Can you tell a bit more about:

switch to use port 8 for the cpu, the way the Broadcom source does,
doesn't work so I'm missing something with that for sure.

Is that something you tried with the by Rafał suggested changes to 
fix the cpu port to 8 in the struct, as described on the forum? 


On Wed, 2015-04-22 at 11:45 +, Hante Meuleman wrote:
 Today I wrote the original firmware back on the device 
 (using the latest from netgear). This worked and the device
  was working fine. Then I flashed openwrt again, now the 
 switch didn’t work anymore. So I checked the ports 
 configuration and it had changed. So I reverted that 
 using the nvram userspace program. This killed the 
 nvram contents completely and after reboot I only had 
 the bare minimum nvram contents and it was the same 
 as before. However, now I cannot get the switch to work 
 anymore. 
 
 So doing an nvram set xxx=yyy, followed by nvram commit
 appears to be killing my nvram contents. 
 
 I've no idea why my switch is not working anymore. The 
 problems with this switch is starting to get frustrating

Yes, the switch is frustrating and all I can do is describe what I've
seen, maybe it will help.

A fairly recent change to setting the switch configuration
in /etc/config/network at install sets the switch ports to 0 1 2 3 5 7
8t and 4 8t for the respective vlans.

But the b53 driver still uses port 5 as the cpu and does the setup that
you've previously described as working (using port 5 as cpu).

The switch configuration in network is done once at firmware install so
it needs to be changed by hand.

What's more annoying is doing the heavy lifting in b53 to setup the
switch to use port 8 for the cpu, the way the Broadcom source does,
doesn't work so I'm missing something with that for sure.

So we do need to stick to using port 5 for the cpu consistently
throughout for now.

 
 Regards,
 Hante
 
 -Original Message-
 From: Hante Meuleman 
 Sent: dinsdag 21 april 2015 17:22
 To: 'Ian Kent'; Arend Van Spriel
 Cc: 'Jonas Gorski'; 'mailinglist'
 Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for 
 multiple PCIE devices in nvram.
 
 Today I managed to update brcmfmac to load the data
  directly from bcm47xx_nvram but it will require an additional
 api in this module. I will post my version of bcm47xx_nvram
  later this week. Also the patch for brcmfmac will be posted 
 later this week. With proper NVRAM the device is now booting 
 fine and all wireless devices get detected properly and are
  working fine. 
 
 I still do not know why I lost the complete contents of the nvram. 
 I do know that the CFE holds a very small default set which get 
 programmed if nothing is available from the nvram mtd block 
 device. As I dumped the nvram initially I was able to restore the 
 nvram completely and after that I was not able to get in the 
 situation where the nvram would be cleared and only hold the
 default set of keys.
 
 We do have another r8000, but that one needs to be recoverable. 
 So I will spent some time to see if I can make sure that I can restore
  the r8000 with the original firmware and the original nvram 
 contents and once I'm sure I can I will try to update the other 
 r8000 as well. Then I can see if nvram gets perhaps erased on 
 the initial flashing of the OpenWRT. It's just a guess, but I really 
 don’t know what cleared the nvram contents on my device and 
 as long as that isn’t clear I wouldn’t recommend anybody to flash 
 an openwrt image on it.
 
 Regards,
 Hante
 
 -Original Message-
 From: Hante Meuleman 
 Sent: dinsdag 21 april 2015 10:29
 To: 'Ian Kent'; Arend Van Spriel
 Cc: 'Jonas Gorski'; 'mailinglist'
 Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for 
 multiple PCIE devices in nvram.
 
 It is something else, the CFE appears to override the
 nvram for some reason with some default data. Don’t
 know yet what is reason for CFE to determine that nvram 
 is invalid but it appears to be within the CFE that NVRAM
 gets erased and defaulted to something minimal.
 
 Regards,
 Hante
 
 -Original Message-
 From: Hante Meuleman 
 Sent: dinsdag 21 april 2015 9:36
 To: 'Ian Kent'; Arend Van Spriel
 Cc: Jonas Gorski; mailinglist
 Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for 
 multiple PCIE devices in nvram.
 
 Well, I found that the cause is within openwrt. 
 I thought that CFE would still show the original 
 contents, but that is incorrect. So I reprogrammed 
 the nvram (via CFE, using created script, as I still 
 had the original nvram contents) then booted openwrt,
 gave the command nvram show then rebooted and 
 the contents was suddenly very minimal. I'm still
 investigating if it is some kernel driver which is 
 doing this, or the nvram userspace app. As this
  userspace app is capable of printing (all) entries
  I suspect it is this app. I hope people who did this
  still have the original content. May also be 

Re: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for multiple PCIE devices in nvram.

2015-04-23 Thread Ian Kent
On Thu, 2015-04-23 at 13:19 +, Hante Meuleman wrote:
 Can you tell a bit more about:
 
 switch to use port 8 for the cpu, the way the Broadcom source does,
 doesn't work so I'm missing something with that for sure.
 
 Is that something you tried with the by Rafał suggested changes to 
 fix the cpu port to 8 in the struct, as described on the forum? 

This goes back to quite a while before you had a look at the switch
problem.

Essentially I was not able to get the switch to work at all so here's
probably a lot more info. than you really want but 

I was sure I had tried what you ultimately described as working and
which does work now so that was a bit of a surprise. That probably
changed along the way and I never returned to trying what you found to
work.

The fact that the nvram settings indicate that switch port 8 is set as
the cpu port is what lead to the belief that it should be used rather
than port 5, but also ports 5 and 7 are related to port 8 in some way as
well (judging by the nvram setting).

I located GPL released source that looked like what the bgmac driver
originated from and tried to find any new changes. I didn't find any
except perhaps the endian order of the mac address when setting it. That
made no difference.

The next thing was to go through the same process for the b53 driver but
it doesn't have a real parallel in the Broadcom source. The closest is
bcmrobo.c which I used for the comparison.

The patch I posted in the forum, when you started looking at the switch
problem, is the result of that comparison and essentially configures
switch port 8 and switch ports 5 and 7 as is done in bcmrobo.c in order
to try and use port 8 as the switch cpu port. It doesn't work for me.

I believe that there's some other device, perhaps a Flow Accelerator,
that lives on the third pcie device that bgmac ignores which needs to be
configured to provide the link between ports 5 and 7 to port 8. But that
looks like it's also related to the cut through forward proprietary code
so is probably something we can't use.

The bottom line is, in light of you pointing out that using switch port
5 as the cpu port does now work, we probably need to ignore the fact
that the nvram setting uses port 8 and just use port 5.

For a long time the switch configuration in /etc/config/network set at
install used port 5 as the cpu. But this recently changed to use port 8
if the nvram setting used port 8 which actually breaks the switch until
it is set back to use port 5.

Rafał has asked me to try only setting the cpu port to 8 in the b53
driver code for this switch device and try that to see if it works. I
haven't done that yet but will get to it.

 
 
 On Wed, 2015-04-22 at 11:45 +, Hante Meuleman wrote:
  Today I wrote the original firmware back on the device 
  (using the latest from netgear). This worked and the device
   was working fine. Then I flashed openwrt again, now the 
  switch didn’t work anymore. So I checked the ports 
  configuration and it had changed. So I reverted that 
  using the nvram userspace program. This killed the 
  nvram contents completely and after reboot I only had 
  the bare minimum nvram contents and it was the same 
  as before. However, now I cannot get the switch to work 
  anymore. 
  
  So doing an nvram set xxx=yyy, followed by nvram commit
  appears to be killing my nvram contents. 
  
  I've no idea why my switch is not working anymore. The 
  problems with this switch is starting to get frustrating
 
 Yes, the switch is frustrating and all I can do is describe what I've
 seen, maybe it will help.
 
 A fairly recent change to setting the switch configuration
 in /etc/config/network at install sets the switch ports to 0 1 2 3 5 7
 8t and 4 8t for the respective vlans.
 
 But the b53 driver still uses port 5 as the cpu and does the setup that
 you've previously described as working (using port 5 as cpu).
 
 The switch configuration in network is done once at firmware install so
 it needs to be changed by hand.
 
 What's more annoying is doing the heavy lifting in b53 to setup the
 switch to use port 8 for the cpu, the way the Broadcom source does,
 doesn't work so I'm missing something with that for sure.
 
 So we do need to stick to using port 5 for the cpu consistently
 throughout for now.
 
  
  Regards,
  Hante
  
  -Original Message-
  From: Hante Meuleman 
  Sent: dinsdag 21 april 2015 17:22
  To: 'Ian Kent'; Arend Van Spriel
  Cc: 'Jonas Gorski'; 'mailinglist'
  Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support 
  for multiple PCIE devices in nvram.
  
  Today I managed to update brcmfmac to load the data
   directly from bcm47xx_nvram but it will require an additional
  api in this module. I will post my version of bcm47xx_nvram
   later this week. Also the patch for brcmfmac will be posted 
  later this week. With proper NVRAM the device is now booting 
  fine and all wireless devices get detected properly and are
   working fine. 

Re: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support for multiple PCIE devices in nvram.

2015-04-23 Thread Ian Kent
On Thu, 2015-04-23 at 14:48 +, Hante Meuleman wrote:
 Thank you for the information Ian, that was very helpful. Just found 
 part of the problem. My R8000 used to work quite well, till I upgraded 
 to new Netgear firmware. The old Netgear firmware is using this nvram 
 entry:
 
 vlan1ports=3 2 1 0 5 7 8*
 
 Newer firmware will update this nvram entry to
 
 vlan1ports=0 1 2 3 5 7 8*

My device had this setting from the beginning.

 
 So depending on when you bought the AP you will have one of these 
 entries in the nvram. Both strings indicate that port 8 is the cpu port, 
 however, somehow the application (or script, not sure what is doing 
 this) that generates the file /etc/config/network at first boot will 
 generate different results for the entry:
 
 option ports
 
 vlan1ports=3 2 1 0 5 7 8* - option ports '0 1 2 3 5t'
 vlan1ports=0 1 2 3 5 7 8* - option ports '0 1 2 3 5 7 8t'
 
 So when you have newer Netgear FW in your AP then you'll have a 
 different setting for vlan1ports in /etc/config/network then with older 
 firmware. This setting determines whether or not the switch is going to 
 work (as you already figured out).
 
 Still investigating to as of why this setting doesn't work with b53 driver.

 
 -Original Message-
 On Wed, 2015-04-22 at 11:45 +, Hante Meuleman wrote:
  Today I wrote the original firmware back on the device 
  (using the latest from netgear). This worked and the device
   was working fine. Then I flashed openwrt again, now the 
  switch didn’t work anymore. So I checked the ports 
  configuration and it had changed. So I reverted that 
  using the nvram userspace program. This killed the 
  nvram contents completely and after reboot I only had 
  the bare minimum nvram contents and it was the same 
  as before. However, now I cannot get the switch to work 
  anymore. 
  
  So doing an nvram set xxx=yyy, followed by nvram commit
  appears to be killing my nvram contents. 
  
  I've no idea why my switch is not working anymore. The 
  problems with this switch is starting to get frustrating
 
 Yes, the switch is frustrating and all I can do is describe what I've
 seen, maybe it will help.
 
 A fairly recent change to setting the switch configuration
 in /etc/config/network at install sets the switch ports to 0 1 2 3 5 7
 8t and 4 8t for the respective vlans.
 
 But the b53 driver still uses port 5 as the cpu and does the setup that
 you've previously described as working (using port 5 as cpu).
 
 The switch configuration in network is done once at firmware install so
 it needs to be changed by hand.
 
 What's more annoying is doing the heavy lifting in b53 to setup the
 switch to use port 8 for the cpu, the way the Broadcom source does,
 doesn't work so I'm missing something with that for sure.
 
 So we do need to stick to using port 5 for the cpu consistently
 throughout for now.
 
  
  Regards,
  Hante
  
  -Original Message-
  From: Hante Meuleman 
  Sent: dinsdag 21 april 2015 17:22
  To: 'Ian Kent'; Arend Van Spriel
  Cc: 'Jonas Gorski'; 'mailinglist'
  Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support 
  for multiple PCIE devices in nvram.
  
  Today I managed to update brcmfmac to load the data
   directly from bcm47xx_nvram but it will require an additional
  api in this module. I will post my version of bcm47xx_nvram
   later this week. Also the patch for brcmfmac will be posted 
  later this week. With proper NVRAM the device is now booting 
  fine and all wireless devices get detected properly and are
   working fine. 
  
  I still do not know why I lost the complete contents of the nvram. 
  I do know that the CFE holds a very small default set which get 
  programmed if nothing is available from the nvram mtd block 
  device. As I dumped the nvram initially I was able to restore the 
  nvram completely and after that I was not able to get in the 
  situation where the nvram would be cleared and only hold the
  default set of keys.
  
  We do have another r8000, but that one needs to be recoverable. 
  So I will spent some time to see if I can make sure that I can restore
   the r8000 with the original firmware and the original nvram 
  contents and once I'm sure I can I will try to update the other 
  r8000 as well. Then I can see if nvram gets perhaps erased on 
  the initial flashing of the OpenWRT. It's just a guess, but I really 
  don’t know what cleared the nvram contents on my device and 
  as long as that isn’t clear I wouldn’t recommend anybody to flash 
  an openwrt image on it.
  
  Regards,
  Hante
  
  -Original Message-
  From: Hante Meuleman 
  Sent: dinsdag 21 april 2015 10:29
  To: 'Ian Kent'; Arend Van Spriel
  Cc: 'Jonas Gorski'; 'mailinglist'
  Subject: RE: [OpenWrt-Devel] Fwd: Re: [PATCH 10/10] brcmfmac: Add support 
  for multiple PCIE devices in nvram.
  
  It is something else, the CFE appears to override the
  nvram for some reason with some default data. Don’t
  know yet what is