Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Claudio Thomas
+1

On 07.04.2015 21:47, Hartmut Knaack wrote:
 That Doodle poll turned out to be spamed/trolled, and everyone could even
 change or delete other votes. Since this was just communicated over this
 mailing list, and subscribers are at least basically verified, why not have a
 good old fashioned poll?

 Give your +1 answer on this mail if you prefer Designated Driver.
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

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


Re: [OpenWrt-Devel] I'd like to donate a Linksys WRT300N V1

2015-04-08 Thread Rafał Miłecki
On 5 April 2015 at 01:01, Rafał Miłecki zaj...@gmail.com wrote:
 On 30 March 2015 at 23:43, Rafał Miłecki zaj...@gmail.com wrote:
 On 17 March 2015 at 22:05, Alex Henrie alexhenri...@gmail.com wrote:
 I just mailed the router. When it arrives, please send confirmation to
 me and to treasu...@spi-inc.org.

 I just got it today, thanks!

 I disassembled it, it's really a PCMCIA wireless card, nice :) Quite
 an unique device!

 Well, it isn't that simple. It's actually CardBus, which is much
 closer to PCI rather than what I meant by PCMCIA.


 I'll have to install serial console (requires soldering a header) and
 doing more tests, so it may take me a bit more of time.

 I got serial working, unfortunately I discovered many problems with
 wireless card support.
 1) ssb believes there isn't cardbus
 2) ssb can't detect PCI is working in hostmode
 3) forcing hostmode causes reboots during PCI init
 4) fixing PCI init causes crash during first MMIO access

 That means a lot of problems, pretty hard to track  understand  fix.
 This simply wouldn't be possible to handle this device without having
 a physical access to it. It shares some bugs with WRT350N v1 which
 unresolved for more than 2 years:
 https://dev.openwrt.org/ticket/12682#comment:11

 So far I only sent generic support for detecting WRT300N v1.0:
 http://patchwork.linux-mips.org/patch/9656/
 I'll try to get some PCI patches after this long weekend.

WRT300N v1.0 is supported now. I did it even before CC release, hooray :)

For few minutes of testing I got a nice 20-22 Mb/s transfer using b43
driver (it doesn't support 802.11n features, so 802.11g speeds are
available only).

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


Re: [OpenWrt-Devel] I'd like to donate a Linksys WRT300N V1

2015-04-08 Thread Alex Henrie
2015-04-08 0:01 GMT-06:00 Rafał Miłecki zaj...@gmail.com:
 WRT300N v1.0 is supported now. I did it even before CC release, hooray :)

 For few minutes of testing I got a nice 20-22 Mb/s transfer using b43
 driver (it doesn't support 802.11n features, so 802.11g speeds are
 available only).

Wow, that was fast. Thanks!

Make sure to get back to the linux-mips guys though, as they might
have ideas on how to improve this code further.

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


Re: [OpenWrt-Devel] Dirty Diamond

2015-04-08 Thread phaidros
+1000

On 04/07/2015 11:15 PM, Marc Nicholas wrote:
 +1
 
 -- 
 Marc Nicholas
 CTO, Wimoto Technologies Inc.
 Unit 2, 300 Don Park Road, Markham, Ontario L3R 3A1 CANADA
 +1.416.414.6272
 
 On April 7, 2015 at 5:11:55 PM, Daniel Golle (dan...@makrotopia.org) wrote:
 
 +1  
 ___  
 openwrt-devel mailing list  
 openwrt-devel@lists.openwrt.org  
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel  
 
 
 
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 



0xB8B85894.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] 14.07 SDK - iostream.h not found

2015-04-08 Thread Nishant Sharma

Hi,

This is my first time using the SDK to build a perl module (JSON-XS) 
which is not available in OpenWRT 14.07.


I am using 
OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2 on a 
Debian Jessie x86_64 host.


This module was successfully built if I use BuildRoot and create 
everything from scratch, so there is no problem with package Makefile.


The compilation fails as db47 needs iostream.h and is not found in the 
SDK. (output of make is below)


Any pointers on how to resolve this would be of great help.

Thanks in advance.

Regards,
Nishant


nishant at lyle :: make  package/perlbase-json-xs/compile V=s
#
# configuration written to .config
#
make[1]: Entering directory 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2'
make[2]: Entering directory 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/feeds/packages/libs/libxml2'
make[2]: Leaving directory 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/feeds/packages/libs/libxml2'
make[2]: Entering directory 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/feeds/packages/libs/db47'
make   -C 
/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/build_dir/target-mips_34kc_uClibc-0.9.33.2/db-4.7.25.NC/build_unix 
DESTDIR=/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/build_dir/target-mips_34kc_uClibc-0.9.33.2/db-4.7.25.NC/ipkg-install 
all
make[3]: Entering directory 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/build_dir/target-mips_34kc_uClibc-0.9.33.2/db-4.7.25.NC/build_unix'
/bin/sh ./libtool --mode=compile ccache_cxx -c -I. -I../dist/.. 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include 
 -D_GNU_SOURCE -D_REENTRANT -Os -pipe -mno-branch-likely -mips32r2 
-mtune=34kc -fno-caller-saves -fhonour-copts 
-Wno-error=unused-but-set-variable -msoft-float -mips16 
-minterlink-mips16 -fpic  ../dist/../cxx/cxx_db.cpp
 ccache_cxx -c -I. -I../dist/.. 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/include 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/target-mips_34kc_uClibc-0.9.33.2/include 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include 
-I/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/include 
-D_GNU_SOURCE -D_REENTRANT -Os -pipe -mno-branch-likely -mips32r2 
-mtune=34kc -fno-caller-saves -fhonour-copts 
-Wno-error=unused-but-set-variable -msoft-float -mips16 
-minterlink-mips16 -fpic ../dist/../cxx/cxx_db.cpp  -fPIC -DPIC -o 
.libs/cxx_db.o

In file included from ../dist/../cxx/cxx_db.cpp:13:0:
./db_cxx.h:59:22: fatal error: iostream.h: No such file or directory
 #include iostream.h
  ^
compilation terminated.
Makefile:1845: recipe for target 'cxx_db.lo' failed
make[3]: *** [cxx_db.lo] Error 1
make[3]: Leaving directory 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/build_dir/target-mips_34kc_uClibc-0.9.33.2/db-4.7.25.NC/build_unix'
Makefile:96: recipe for target 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/build_dir/target-mips_34kc_uClibc-0.9.33.2/db-4.7.25.NC/.built' 
failed
make[2]: *** 
[/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/build_dir/target-mips_34kc_uClibc-0.9.33.2/db-4.7.25.NC/.built] 
Error 2
make[2]: Leaving directory 
'/data/openwrt/hopmesh/sdk/ar71xx/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2/feeds/packages/libs/db47'
package/Makefile:173: recipe for target 
'package/feeds/packages/db47/compile' failed

make[1]: *** [package/feeds/packages/db47/compile] Error 2
make[1]: Leaving directory 

Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Alpha Sparc
+1 Designated Driver
On Apr 8, 2015 3:27 PM, Ștefan Rusu saltwat...@gmail.com wrote:

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


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


Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Ștefan Rusu
+1 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Dirty Diamond

2015-04-08 Thread Caleb James DeLisle
+1 to Dirty Diamond, really I have no opinion except that Diamond was chosen
first and -1 to letting the bikeshed painting terrorists win ! ;)


On 04/07/2015 09:47 PM, Hartmut Knaack wrote:
 That Doodle poll turned out to be spamed/trolled, and everyone could even
 change or delete other votes. Since this was just communicated over this
 mailing list, and subscribers are at least basically verified, why not have a
 good old fashioned poll?
 
 Give your +1 answer on this mail if you prefer Dirty Diamond.
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 

-- 
Satire is the escape hatch from the cycle of sorrow, hatred and violence. 
#JeSuisCharlie
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Submitting PATCH for rtl8192cu HTmode deadlock

2015-04-08 Thread Derek Werthmuller
In reference to bug # 18539
https://dev.openwrt.org/ticket/18539#comment:4
The deadlock appears that when the adapter is in AP mode and client
negotiates into the HT modes.  I don't know if this effects the adapter
used in client modes.  But without the patch the adapter is not usable in
ap mode.  This adapter is integrated in the sunxi based bpi-r1 board.
I'd be interested in conversations to get this adapter up to some level of
802.11n HT mode.

The below patch I'd like to submit for evaluation for inclusion.
Cheers
   Derek


DEBUGing and patch done by sbrown
Comment (by sbrown):

 I found that the problem only occurs at HT rates.

 After looking at some more wireshark output, the problem seems to be
 that the aggregation sessions deadlock when a second one starts before
 the first one completes. That would explain why it only occurs in HT
 mode.

 The sequence on the air before the deadlock is:

 STA-AP block ack req
 STA-AP ping req
 AP-STA block ack resp
 AP-STA ping resp
 AP-STA block ack req
 STA-AP block ack resp

 The sequence on the air after the deadlock is:

 AP-STA block ack req
 STA-AP block ack req
 AP-STA block ack resp
 STA-AP block ack resp
 STA-AP ping req
 ...
 STA-AP ping req (repeats)

 If I disable aggregation in the driver with the attached patch, the
 problem goes away with a performance loss.

 {{{
  diff -rupN a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c2015-04-03
07:10:19.343543253 -0400
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c2015-04-03
07:11:51.323999358 -0400
@@ -59,7 +59,9 @@ static int rtl92cu_init_sw_vars(struct i
 {
 struct rtl_priv *rtlpriv = rtl_priv(hw);
 int err;
-
+ /* disable aggregation until the deadlock is fixed */
+hw-flags = ~IEEE80211_HW_AMPDU_AGGREGATION;
+
 rtlpriv-dm.dm_initialgain_enable = true;
 rtlpriv-dm.dm_flag = 0;
 rtlpriv-dm.disable_framebursting = false;

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


Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Brent Thomson
+1

--

Brent


On Tue, Apr 7, 2015 at 12:47 PM, Hartmut Knaack knaac...@gmx.de wrote:
 That Doodle poll turned out to be spamed/trolled, and everyone could even
 change or delete other votes. Since this was just communicated over this
 mailing list, and subscribers are at least basically verified, why not have a
 good old fashioned poll?

 Give your +1 answer on this mail if you prefer Designated Driver.
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] significance of (proto_add_host_dependency $cfg :: $tunlink) in dslite.sh

2015-04-08 Thread Sekhar Avutu
Hi,

May I know the significance of proto_add_host_dependency $cfg ::
$tunlink  in dslite.sh?

In my case the script is not executing after this point.

Please help me.

Thanks and regards
Sekhar Avutu
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 2/7] add command done status to verbose output

2015-04-08 Thread Bjørn Mork
Signed-off-by: Bjørn Mork bj...@mork.no
---
 mbim-dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mbim-dev.c b/mbim-dev.c
index 4c129b0..af76683 100644
--- a/mbim-dev.c
+++ b/mbim-dev.c
@@ -76,7 +76,7 @@ mbim_recv(struct uloop_fd *u, unsigned int events)
 {
ssize_t cnt = read(u-fd, mbim_buffer, MBIM_BUFFER_SIZE);
struct mbim_message_header *hdr = (struct mbim_message_header *) 
mbim_buffer;
-   struct command_message *msg = (struct command_message *) mbim_buffer;
+   struct command_done_message *msg = (struct command_done_message *) (hdr 
+ 1);
int i;
 
if (cnt  0)
@@ -105,6 +105,8 @@ mbim_recv(struct uloop_fd *u, unsigned int events)
mbim_send_close_msg();
break;
case MBIM_MESSAGE_TYPE_COMMAND_DONE:
+   if (verbose)
+   printf(  status_code: %04X\n, 
le32toh(msg-status_code));
return_code = current_handler-response(msg-buffer, 
le32toh(msg-buffer_length));
if (return_code  0)
no_close = 0;
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 6/7] support IPv6 configuration

2015-04-08 Thread Bjørn Mork
Signed-off-by: Bjørn Mork bj...@mork.no
---
 cli.c  | 32 
 mbim-msg.c | 10 ++
 mbim-msg.h |  1 +
 3 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/cli.c b/cli.c
index c43b4f3..d1f3e88 100644
--- a/cli.c
+++ b/cli.c
@@ -216,7 +216,7 @@ static int
 mbim_config_response(void *buffer, int len)
 {
struct mbim_basic_connect_ip_configuration_r *ip = (struct 
mbim_basic_connect_ip_configuration_r *) buffer;
-   char ipv4[16];
+   char out[40];
int i;
uint32_t offset;
 
@@ -228,22 +228,38 @@ mbim_config_response(void *buffer, int len)
if (le32toh(ip-ipv4configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_ADDRESS)
for (i = 0; i  le32toh(ip-ipv4addresscount); i++) {
offset = le32toh(ip-ipv4address) + (i * 4);
-   mbim_get_ipv4(buffer, ipv4, 4 + offset);
-   printf(  ipv4address: %s/%d\n, ipv4, 
mbim_get_int(buffer, offset));
+   mbim_get_ipv4(buffer, out, 4 + offset);
+   printf(  ipv4address: %s/%d\n, out, 
mbim_get_int(buffer, offset));
}
if (le32toh(ip-ipv4configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS) {
-   mbim_get_ipv4(buffer, ipv4, ip-ipv4gateway);
-   printf(  ipv4gateway: %s\n, ipv4);
+   mbim_get_ipv4(buffer, out, le32toh(ip-ipv4gateway));
+   printf(  ipv4gateway: %s\n, out);
}
if (le32toh(ip-ipv4configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_MTU)
printf(  ipv4mtu: %d\n, le32toh(ip-ipv4mtu));
if (le32toh(ip-ipv4configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS)
for (i = 0; i  le32toh(ip-ipv4dnsservercount); i++) {
-   mbim_get_ipv4(buffer, ipv4, ip-ipv4dnsserver + (i * 
4));
-   printf(  ipv4dnsserver: %s\n, ipv4);
+   mbim_get_ipv4(buffer, out, le32toh(ip-ipv4dnsserver) + 
(i * 4));
+   printf(  ipv4dnsserver: %s\n, out);
}
 
-   printf(  ipv6configurationavailable: %04X\n, 
le32toh(ip-ipv6configurationavailable));
+   if (le32toh(ip-ipv6configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_ADDRESS)
+   for (i = 0; i  le32toh(ip-ipv6addresscount); i++) {
+   offset = le32toh(ip-ipv6address) + (i * 16);
+   mbim_get_ipv6(buffer, out, 4 + offset);
+   printf(  ipv6address: %s/%d\n, out, 
mbim_get_int(buffer, offset));
+   }
+   if (le32toh(ip-ipv6configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS) {
+   mbim_get_ipv6(buffer, out, le32toh(ip-ipv6gateway));
+   printf(  ipv6gateway: %s\n, out);
+   }
+   if (le32toh(ip-ipv6configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_MTU)
+   printf(  ipv6mtu: %d\n, le32toh(ip-ipv6mtu));
+   if (le32toh(ip-ipv6configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS)
+   for (i = 0; i  le32toh(ip-ipv6dnsservercount); i++) {
+   mbim_get_ipv6(buffer, out, le32toh(ip-ipv6dnsserver) + 
(i * 16));
+   printf(  ipv6dnsserver: %s\n, out);
+   }
 
return 0;
 }
diff --git a/mbim-msg.c b/mbim-msg.c
index 7199e85..ad5a2d5 100644
--- a/mbim-msg.c
+++ b/mbim-msg.c
@@ -97,6 +97,16 @@ mbim_get_ipv4(void *buffer, char *out, uint32_t offset)
snprintf(out, 16, %d.%d.%d.%d, b[0], b[1], b[2], b[3]);
 }
 
+void
+mbim_get_ipv6(void *buffer, char *out, uint32_t offset)
+{
+   uint8_t *b = buffer + offset;
+
+   snprintf(out, 40, %x:%x:%x:%x:%x:%x:%x:%x, b[0]  8 | b[1],
+b[2]  8 | b[3], b[4]  8 | b[5], b[6]  8 | b[7],
+b[8]  8 | b[9], b[10]  8 | b[11], b[12]  8 | b[13],
+b[14]  8 | b[15]);
+}
 
 uint32_t
 mbim_get_int(void *buffer, uint32_t offset)
diff --git a/mbim-msg.h b/mbim-msg.h
index 25415a5..2957abb 100644
--- a/mbim-msg.h
+++ b/mbim-msg.h
@@ -94,6 +94,7 @@ int mbim_send_command_msg(void);
 int mbim_add_payload(uint8_t len);
 int mbim_encode_string(struct mbim_string *str, char *in);
 void mbim_get_ipv4(void *buffer, char *out, uint32_t offset);
+void mbim_get_ipv6(void *buffer, char *out, uint32_t offset);
 uint32_t mbim_get_int(void *buffer, uint32_t offset);
 
 #endif
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 4/7] add command_id to verbose output

2015-04-08 Thread Bjørn Mork
Signed-off-by: Bjørn Mork bj...@mork.no
---
 mbim-dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mbim-dev.c b/mbim-dev.c
index 4474b2d..d986cbe 100644
--- a/mbim-dev.c
+++ b/mbim-dev.c
@@ -105,8 +105,10 @@ mbim_recv(struct uloop_fd *u, unsigned int events)
mbim_send_close_msg();
break;
case MBIM_MESSAGE_TYPE_COMMAND_DONE:
-   if (verbose)
+   if (verbose) {
+   printf(  command_id: %04X\n, 
le32toh(msg-command_id));
printf(  status_code: %04X\n, 
le32toh(msg-status_code));
+   }
if (msg-status_code  !msg-buffer_length)
return_code = -le32toh(msg-status_code);
else
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 0/7] updated umbim fixes

2015-04-08 Thread Bjørn Mork
Sorry about sending the previous version without doing any runtime
testing.  I overlooked the fact that 'struct command_done_message'
doesn't include the header like 'struct command_message' does, so the
status field parsing was completely off...

BTW, is there a more appropriate mailing list where I should send
stuff like this?

Changes in v2:
 - fix the above bug
 - add command_id to the verbose command done output
 - fix IP config parsing (missed the prefix length)
 - add IPv6 configuration output
 - add support for non-default ip-types

I don't really know how the last patch should be implemented.  This
version is simply a hack I made to be able to test the IPv6 config
output.  Please modify or drop as you find appropriate.

Sample test runs with IPv6 and IPv4v6 contexts (please ignore the
bogous IPv6 addresses - that's a bug in my modem firmware.  This is
tested on a Sierra Wireless EM7345):

bjorn@nemi:/usr/local/src/git/umbim$ ./umbim -d /dev/cdc-wdm0 -n -v caps
sending (16): 01 00 00 00 10 00 00 00 01 00 00 00 00 04 00 00 
  header_type: 0001
  header_length: 0010
  header_transaction: 0001
reading (16): 01 00 00 80 10 00 00 00 01 00 00 00 00 00 00 00 
  header_type: 8001
  header_length: 0010
  header_transaction: 0001
sending (48): 03 00 00 00 30 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 a2 89 
cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 01 00 00 00 00 00 00 00 00 00 00 00 
  header_type: 0003
  header_length: 0030
  header_transaction: 0002
reading (256): 03 00 00 80 00 01 00 00 02 00 00 00 01 00 00 00 00 00 00 00 a2 
89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 01 00 00 00 00 00 00 00 d0 00 00 
00 01 00 00 00 01 00 00 00 01 00 00 00 02 00 00 00 3f 00 00 00 03 00 00 00 01 
00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 1e 00 00 00 60 00 00 
00 34 00 00 00 94 00 00 00 3c 00 00 00 30 00 31 00 33 00 39 00 33 00 37 00 30 
00 30 00 30 00 35 00 33 00 36 00 31 00 39 00 31 00 00 00 46 00 49 00 48 00 37 
00 31 00 36 00 30 00 5f 00 56 00 31 00 2e 00 32 00 5f 00 57 00 57 00 5f 00 30 
00 31 00 2e 00 31 00 34 00 31 00 35 00 2e 00 30 00 37 00 58 00 4d 00 4d 00 37 
00 31 00 36 00 30 00 5f 00 56 00 31 00 2e 00 32 00 5f 00 4d 00 42 00 49 00 4d 
00 5f 00 47 00 4e 00 53 00 53 00 5f 00 4e 00 41 00 4e 00 44 00 5f 00 52 00 45 
00 
  header_type: 8003
  header_length: 0100
  header_transaction: 0002
  command_id: 0001
  status_code: 
  devicetype: 0001 - embedded
  cellularclass: 0001
  voiceclass: 0001 - no-voice
  simclass: 0002
  dataclass: 003F
  smscaps: 0003
  controlcaps: 0001
  maxsessions: 0010
  deviceid: 013937000536191
  firmwareinfo: FIH7160_V1.2_WW_01.1415.07
  hardwareinfo: XMM7160_V1.2_MBIM_GNSS_NAND_RE
bjorn@nemi:/usr/local/src/git/umbim$ ./umbim -d /dev/cdc-wdm0 -n -t 2 -v 
subscriber
sending (48): 03 00 00 00 30 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 a2 89 
cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 02 00 00 00 00 00 00 00 00 00 00 00 
  header_type: 0003
  header_length: 0030
  header_transaction: 0002
reading (148): 03 00 00 80 94 00 00 00 02 00 00 00 01 00 00 00 00 00 00 00 a2 
89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 02 00 00 00 00 00 00 00 64 00 00 
00 01 00 00 00 1c 00 00 00 1e 00 00 00 3c 00 00 00 28 00 00 00 00 00 00 00 00 
00 00 00 32 00 34 00 32 00 30 00 31 00 33 00 30 00 35 00 30 00 31 00 33 00 38 
00 31 00 39 00 30 00 00 00 38 00 39 00 34 00 37 00 30 00 33 00 30 00 35 00 31 
00 32 00 31 00 30 00 31 00 31 00 30 00 30 00 38 00 31 00 39 00 35 00 
  header_type: 8003
  header_length: 0094
  header_transaction: 0002
  command_id: 0002
  status_code: 
  readystate: 0001 - initialized
  simiccid: 89470305121011008195
  subscriberid: 242013050138190
bjorn@nemi:/usr/local/src/git/umbim$ ./umbim -d /dev/cdc-wdm0 -n -t 3 -v attach
sending (52): 03 00 00 00 34 00 00 00 03 00 00 00 01 00 00 00 00 00 00 00 a2 89 
cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0a 00 00 00 01 00 00 00 04 00 00 00 
00 00 00 00 
  header_type: 0003
  header_length: 0034
  header_transaction: 0003
reading (76): 03 00 00 80 4c 00 00 00 03 00 00 00 01 00 00 00 00 00 00 00 a2 89 
cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0a 00 00 00 00 00 00 00 1c 00 00 00 
00 00 00 00 02 00 00 00 20 00 00 00 80 f0 fa 02 00 00 00 00 00 e1 f5 05 00 00 
00 00 
  header_type: 8003
  header_length: 004C
  header_transaction: 0003
  command_id: 000A
  status_code: 
  nwerror:  - unknown
  packetservicestate: 0002 - attached
  uplinkspeed: 5000
  downlinkspeed: 1
bjorn@nemi:/usr/local/src/git/umbim$ ./umbim -d /dev/cdc-wdm0 -n -t 4 -v 
connect ipv6:telenor.mobil
sending (136): 03 00 00 00 88 00 00 00 04 00 00 00 01 00 00 00 00 00 00 00 a2 
89 cc 33 bc bb 8b 4f b6 b0 13 3e c2 aa e6 df 0c 00 00 00 01 00 00 00 58 00 00 
00 00 00 00 00 01 00 00 00 3c 00 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 7e 5e 2a 7e 4e 6f 72 
72 73 6b 65 6e 7e 5e 2a 7e 74 00 65 00 6c 00 65 00 6e 00 6f 00 72 00 2e 00 6d 
00 6f 00 62 00 69 00 6c 00 00 00 
  

[OpenWrt-Devel] [PATCH v2 5/7] fix IP configuration prefix output

2015-04-08 Thread Bjørn Mork
Signed-off-by: Bjørn Mork bj...@mork.no
---
 cli.c  | 6 --
 mbim-msg.c | 9 +
 mbim-msg.h | 1 +
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/cli.c b/cli.c
index cb107b7..c43b4f3 100644
--- a/cli.c
+++ b/cli.c
@@ -218,6 +218,7 @@ mbim_config_response(void *buffer, int len)
struct mbim_basic_connect_ip_configuration_r *ip = (struct 
mbim_basic_connect_ip_configuration_r *) buffer;
char ipv4[16];
int i;
+   uint32_t offset;
 
if (len  sizeof(struct mbim_basic_connect_ip_configuration_r)) {
fprintf(stderr, message not long enough\n);
@@ -226,8 +227,9 @@ mbim_config_response(void *buffer, int len)
 
if (le32toh(ip-ipv4configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_ADDRESS)
for (i = 0; i  le32toh(ip-ipv4addresscount); i++) {
-   mbim_get_ipv4(buffer, ipv4, ip-ipv4address + (i * 4));
-   printf(  ipv4address: %s\n, ipv4);
+   offset = le32toh(ip-ipv4address) + (i * 4);
+   mbim_get_ipv4(buffer, ipv4, 4 + offset);
+   printf(  ipv4address: %s/%d\n, ipv4, 
mbim_get_int(buffer, offset));
}
if (le32toh(ip-ipv4configurationavailable)  
MBIM_IP_CONFIGURATION_AVAILABLE_FLAG_DNS) {
mbim_get_ipv4(buffer, ipv4, ip-ipv4gateway);
diff --git a/mbim-msg.c b/mbim-msg.c
index a327c6a..7199e85 100644
--- a/mbim-msg.c
+++ b/mbim-msg.c
@@ -97,6 +97,15 @@ mbim_get_ipv4(void *buffer, char *out, uint32_t offset)
snprintf(out, 16, %d.%d.%d.%d, b[0], b[1], b[2], b[3]);
 }
 
+
+uint32_t
+mbim_get_int(void *buffer, uint32_t offset)
+{
+   uint32_t *i = buffer + offset;
+
+   return le32toh(*i);
+}
+
 const char*
 mbim_enum_string(struct mbim_enum *e, uint32_t key)
 {
diff --git a/mbim-msg.h b/mbim-msg.h
index 353d998..25415a5 100644
--- a/mbim-msg.h
+++ b/mbim-msg.h
@@ -94,5 +94,6 @@ int mbim_send_command_msg(void);
 int mbim_add_payload(uint8_t len);
 int mbim_encode_string(struct mbim_string *str, char *in);
 void mbim_get_ipv4(void *buffer, char *out, uint32_t offset);
+uint32_t mbim_get_int(void *buffer, uint32_t offset);
 
 #endif
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 1/7] fix subscriber response segfault

2015-04-08 Thread Bjørn Mork
Signed-off-by: Bjørn Mork bj...@mork.no
---
 cli.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cli.c b/cli.c
index e6b34d7..cb107b7 100644
--- a/cli.c
+++ b/cli.c
@@ -152,7 +152,7 @@ mbim_subscriber_response(void *buffer, int len)
if (le32toh(state-readyinfo)  MBIM_READY_INFO_FLAG_PROTECT_UNIQUE_ID)
printf(  dont display subscriberID: 1\n);
for (nr = 0; nr  le32toh(state-telephonenumberscount); nr++) {
-   struct mbim_string *str = buffer + 
le32toh(state-telephonenumbers) + (nr * sizeof(struct mbim_string));
+   struct mbim_string *str = (void *)state-telephonenumbers + 
(nr * sizeof(struct mbim_string));
char *number = mbim_get_string(str, buffer);
printf(  number: %s\n, number);
}
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH][V3] ramips:Add support for Microduino MicroWRT

2015-04-08 Thread 郭传鈜
Hi!

I'm sorry for the crazy mistake in the previous patch.This time I've
asked Jason to test the firmware before giving me the patch.Everything
works fine now :-)
I wonder if this patch could be accepted because I'm planning to send
another patch for a new device and I don't know if the new patch should be
based on the source with this patch applied or not.
Best regards.
Guo Chuanhong


2015-04-06 17:13 GMT+08:00 郭传鈜 gch981...@gmail.com:

 From: 盛凯 shengka...@gmail.com

 Sorry,Sheng Kai told me that the flash layout is wrong in his previous
 patch-_-!!

 From: 盛凯 shengka...@gmail.com

 v3:fix flash layout and change model name
 v2:fix space issues

 MicroWRT is an wireless router with 2 USB,1 ethernet port. It
 has a 16M flash and 64M DDR2 RAM. You can use most interface, such as
 i2c, SPI, i2s and PCIe. Besides that there are three expansion borad to
 combine with the core board. The detailed information, please refer to
 https://www.microduino.cc/wiki/index.php?title=Main_Page

 This patch adds support for it.
 Because there is only one port,so disabled VLAN and use eth0 as lan
 port. and only a power LED control by power pin.
 Signed-off-by: 盛凯 shengka...@gmail.com
 ---
  .../linux/ramips/base-files/etc/board.d/02_network |   1 +
  target/linux/ramips/base-files/lib/ramips.sh   |   3 +
  .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ramips/dts/MicroWRT.dts   | 107
 +
  target/linux/ramips/image/Makefile |   3 +
  target/linux/ramips/mt7620/profiles/microwrt.mk|   9 ++
  6 files changed, 124 insertions(+)
  create mode 100644 target/linux/ramips/dts/MicroWRT.dts
  create mode 100644 target/linux/ramips/mt7620/profiles/microwrt.mk

 diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
 b/target/linux/ramips/base-files/etc/board.d/02_network
 index d4ec19d..24e1ba8 100755
 --- a/target/linux/ramips/base-files/etc/board.d/02_network
 +++ b/target/linux/ramips/base-files/etc/board.d/02_network
 @@ -45,6 +45,7 @@ ramips_setup_interfaces()

 3g150b | \
 3g300m | \
 +   microwrt | \
 w150m | \
 zte-q7 | \
 all0256n | \
 diff --git a/target/linux/ramips/base-files/lib/ramips.sh
 b/target/linux/ramips/base-files/lib/ramips.sh
 index fc6eb37..dffa832 100755
 --- a/target/linux/ramips/base-files/lib/ramips.sh
 +++ b/target/linux/ramips/base-files/lib/ramips.sh
 @@ -202,6 +202,9 @@ ramips_board_detect() {
 *Planex MZK-750DHP)
 name=mzk-750dhp
 ;;
 +   *Microduino MicroWRT)
 +   name=microwrt
 +   ;;
 *NBG-419N)
 name=nbg-419n
 ;;
 diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
 b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 index a5773b5..17b456b 100755
 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 @@ -60,6 +60,7 @@ platform_check_image() {
 m2m | \
 m3 | \
 m4 | \
 +   microwrt | \
 mlw221 | \
 mlwg2 | \
 mofi3500-3gn | \
 diff --git a/target/linux/ramips/dts/MicroWRT.dts
 b/target/linux/ramips/dts/MicroWRT.dts
 new file mode 100644
 index 000..9500b14
 --- /dev/null
 +++ b/target/linux/ramips/dts/MicroWRT.dts
 @@ -0,0 +1,107 @@
 +/dts-v1/;
 +
 +/include/ mt7620a.dtsi
 +
 +/ {
 +   compatible = microwrt, ralink,mt7620a-soc;
 +   model = Microduino MicroWRT;
 +
 +   chosen {
 +   bootargs = console=ttyS0,115200;
 +   };
 +
 +   palmbus@1000 {
 +   gpio2: gpio@660 {
 +   status = okay;
 +   };
 +
 +   gpio3: gpio@688 {
 +   status = okay;
 +   };
 +
 +   spi@b00 {
 +   status = okay;
 +
 +   m25p80@0 {
 +   #address-cells = 1;
 +   #size-cells = 1;
 +   compatible = w25q128;
 +   reg = 0 0;
 +   linux,modalias = m25p80, w25q128;
 +   spi-max-frequency = 1000;
 +
 +   partition@0 {
 +   label = u-boot;
 +   reg = 0x0 0x2;
 +   read-only;
 +   };
 +
 +   partition@2 {
 +   label = u-boot-env;
 +   reg = 0x2 0x1;
 +   read-only;
 +   };
 +
 +   factory: partition@3 {
 +   label = factory;
 +   reg = 0x3 0x1;
 

[OpenWrt-Devel] [PATCH v2 3/7] avoid parsing InformationBuffer unless status is success

2015-04-08 Thread Bjørn Mork
The MBIM specification requires that the InformationBuffer
is empty unless the status field is MBIM_STATUS_SUCCESS,
except for 4 explicit combinations of status code and
command id.

Avoid calling the reply handler if the status code is
non-zero and the information buffer is empty.

Signed-off-by: Bjørn Mork bj...@mork.no
---
 mbim-dev.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mbim-dev.c b/mbim-dev.c
index af76683..4474b2d 100644
--- a/mbim-dev.c
+++ b/mbim-dev.c
@@ -107,7 +107,10 @@ mbim_recv(struct uloop_fd *u, unsigned int events)
case MBIM_MESSAGE_TYPE_COMMAND_DONE:
if (verbose)
printf(  status_code: %04X\n, 
le32toh(msg-status_code));
-   return_code = current_handler-response(msg-buffer, 
le32toh(msg-buffer_length));
+   if (msg-status_code  !msg-buffer_length)
+   return_code = -le32toh(msg-status_code);
+   else
+   return_code = current_handler-response(msg-buffer, 
le32toh(msg-buffer_length));
if (return_code  0)
no_close = 0;
mbim_send_close_msg();
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 7/7] support non default ip-types

2015-04-08 Thread Bjørn Mork
Signed-off-by: Bjørn Mork bj...@mork.no
---
 cli.c | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/cli.c b/cli.c
index d1f3e88..15ca5b4 100644
--- a/cli.c
+++ b/cli.c
@@ -324,6 +324,7 @@ mbim_detach_request(void)
 static int
 mbim_connect_request(void)
 {
+   char *apn;
struct mbim_basic_connect_connect_s *c =
(struct mbim_basic_connect_connect_s *) 
mbim_setup_command_msg(basic_connect,
MBIM_MESSAGE_COMMAND_TYPE_SET, 
MBIM_CMD_BASIC_CONNECT_CONNECT,
@@ -332,8 +333,22 @@ mbim_connect_request(void)
c-activationcommand = htole32(MBIM_ACTIVATION_COMMAND_ACTIVATE);
c-iptype = htole32(MBIM_CONTEXT_IP_TYPE_DEFAULT);
memcpy(c-contexttype, uuid_context_type_internet, 16);
-   if (_argc  0)
-   mbim_encode_string(c-accessstring, *_argv);
+   if (_argc  0) {
+   apn = index(*_argv, ':');
+   if (!apn) {
+   apn = *_argv;
+   } else {
+   apn[0] = 0;
+   apn++;
+   if (!strcmp(*_argv, ipv4))
+   c-iptype = htole32(MBIM_CONTEXT_IP_TYPE_IPV4);
+   else if (!strcmp(*_argv, ipv6))
+   c-iptype = htole32(MBIM_CONTEXT_IP_TYPE_IPV6);
+   else if (!strcmp(*_argv, ipv4v6))
+   c-iptype = 
htole32(MBIM_CONTEXT_IP_TYPE_IPV4V6);
+   }
+   mbim_encode_string(c-accessstring, apn);
+   }
if (_argc  3) {
if (!strcmp(_argv[1], pap))
c-authprotocol = htole32(MBIM_AUTH_PROTOCOL_PAP);
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [BUG] UCI parsing regression?

2015-04-08 Thread Russell Senior

I just mentioned this on IRC last night, and have not had time to
investigate, but a uci-defaults script (http://sprunge.us/EAYF) that was
working about a month ago, now gives me this: http://sprunge.us/LTWi,
and the uci commit fails.  The error messages don't give much clue
what's wrong.  Seems like a regression.


-- 
Russell Senior, President
russ...@personaltelco.net
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Joris de Vries
+1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Oleg Titov
+1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ppp: Detailed last error support

2015-04-08 Thread Hans Dedecker
Enables last error support for the PPP protocol handlers.
In generic teardown the PPP daemon exit code is translated into 
a self explaining error string which is set as interface error
by proto_notify_error in case of failure.

Signed-off-by: Johan Peeters johan.peeters...@gmail.com
Signed-off-by: Hans Dedecker dedec...@gmail.com
---
 package/network/services/ppp/files/ppp.sh | 51 ---
 1 file changed, 47 insertions(+), 4 deletions(-)

diff --git a/package/network/services/ppp/files/ppp.sh 
b/package/network/services/ppp/files/ppp.sh
index b4a7467..99fdc87 100755
--- a/package/network/services/ppp/files/ppp.sh
+++ b/package/network/services/ppp/files/ppp.sh
@@ -8,6 +8,38 @@
init_proto $@
 }
 
+ppp_exitcode_tostring()
+{
+   local errorcode=$1
+   [ -n $errorcode ] || errorcode=5
+
+   case $errorcode in
+   0) echo OK ;;
+   1) echo FATAL_ERROR ;;
+   2) echo OPTION_ERROR ;;
+   3) echo NOT_ROOT ;;
+   4) echo NO_KERNEL_SUPPORT ;;
+   5) echo USER_REQUEST ;;
+   6) echo LOCK_FAILED ;;
+   7) echo OPEN_FAILED ;;
+   8) echo CONNECT_FAILED ;;
+   9) echo PTYCMD_FAILED ;;
+   10) echo NEGOTIATION_FAILED ;;
+   11) echo PEER_AUTH_FAILED ;;
+   12) echo IDLE_TIMEOUT ;;
+   13) echo CONNECT_TIME ;;
+   14) echo CALLBACK ;;
+   15) echo PEER_DEAD ;;
+   16) echo HANGUP ;;
+   17) echo LOOPBACK ;;
+   18) echo INIT_FAILED ;;
+   19) echo AUTH_TOPEER_FAILED ;;
+   20) echo TRAFFIC_LIMIT ;;
+   21) echo CNID_AUTH_FAILED;;
+   *) echo UNKNOWN_ERROR ;;
+   esac
+}
+
 ppp_generic_init_config() {
proto_config_add_string username
proto_config_add_string password
@@ -72,20 +104,27 @@ ppp_generic_setup() {
 
 ppp_generic_teardown() {
local interface=$1
+   local errorstring=$(ppp_exitcode_tostring $ERROR)
 
case $ERROR in
+   0)
+   ;;
+   2)
+   proto_notify_error $interface $errorstring
+   proto_block_restart $interface
+   ;;
11|19)
-   proto_notify_error $interface AUTH_FAILED
json_get_var authfail authfail
+   proto_notify_error $interface $errorstring
if [ ${authfail:-0} -gt 0 ]; then
proto_block_restart $interface
fi
;;
-   2)
-   proto_notify_error $interface INVALID_OPTIONS
-   proto_block_restart $interface
+   *)
+   proto_notify_error $interface $errorstring
;;
esac
+
proto_kill_command $interface
 }
 
@@ -96,6 +135,7 @@ proto_ppp_init_config() {
ppp_generic_init_config
no_device=1
available=1
+   lasterror=1
 }
 
 proto_ppp_setup() {
@@ -114,6 +154,7 @@ proto_pppoe_init_config() {
proto_config_add_string ac
proto_config_add_string service
proto_config_add_string host_uniq
+   lasterror=1
 }
 
 proto_pppoe_setup() {
@@ -151,6 +192,7 @@ proto_pppoa_init_config() {
proto_config_add_string encaps
no_device=1
available=1
+   lasterror=1
 }
 
 proto_pppoa_setup() {
@@ -184,6 +226,7 @@ proto_pptp_init_config() {
proto_config_add_string interface
available=1
no_device=1
+   lasterror=1
 }
 
 proto_pptp_setup() {
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [BUG] UCI parsing regression?

2015-04-08 Thread Yousong Zhou
On Apr 8, 2015 10:36 PM, Russell Senior russ...@personaltelco.net wrote:


 I just mentioned this on IRC last night, and have not had time to
 investigate, but a uci-defaults script (http://sprunge.us/EAYF) that was
 working about a month ago, now gives me this: http://sprunge.us/LTWi,
 and the uci commit fails.  The error messages don't give much clue
 what's wrong.  Seems like a regression.


Hmm, probably because of the blank lines within the here document.  I can
cook a patch for this tomorrow.

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


Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread David Hutchison
+1

On Wed, Apr 8, 2015 at 9:24 AM, Oleg Titov oleg.ti...@gmail.com wrote:
 +1
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] netifd: Interface last error support

2015-04-08 Thread Hans Dedecker
Adds interface last error support which preserves the last reported
error reported by the protocol handler till the interface is up;
e.g. survives network reload and interface restarts.
This is mainly usefull for tracking down why an interface fails
to establish; eg auth failure/traffic limit for PPP interfaces

Protocol handlers register last error support by setting lasterror=1
in the proto_init function

Signed-off-by: Johan Peeters johan.peeters...@gmail.com
Signed-off-by: Hans Dedecker dedec...@gmail.com
---
 interface.c | 27 ++-
 proto-shell.c   |  4 
 proto.c |  6 +-
 proto.h |  1 +
 scripts/netifd-proto.sh |  1 +
 5 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/interface.c b/interface.c
index 444f3ac..8239eac 100644
--- a/interface.c
+++ b/interface.c
@@ -80,7 +80,7 @@ const struct uci_blob_param_list interface_attr_list = {
 };
 
 static void
-interface_clear_errors(struct interface *iface)
+interface_error_flush(struct interface *iface)
 {
struct interface_error *error, *tmp;
 
@@ -90,6 +90,17 @@ interface_clear_errors(struct interface *iface)
}
 }
 
+static void
+interface_clear_errors(struct interface *iface)
+{
+/* don't flush the errors in case the configured protocol handler 
matches the
+   running protocol handler and is having the last error capability */
+   if (!(iface-proto 
+  (iface-proto-handler-flags  PROTO_FLAG_LASTERROR) 
+  (iface-proto-handler-name == iface-proto_handler-name)))
+   interface_error_flush(iface);
+}
+
 void interface_add_error(struct interface *iface, const char *subsystem,
 const char *code, const char **data, int n_data)
 {
@@ -98,6 +109,14 @@ void interface_add_error(struct interface *iface, const 
char *subsystem,
int *datalen = NULL;
char *dest, *d_subsys, *d_code;
 
+/* if the configured protocol handler has the last error support 
capability,
+   errors should only be added if the running protocol handler matches 
the
+   configured one */
+   if (iface-proto 
+(iface-proto-handler-flags  PROTO_FLAG_LASTERROR) 
+(iface-proto-handler-name != iface-proto_handler-name))
+   return;
+
if (n_data) {
len = n_data * sizeof(char *);
datalen = alloca(len);
@@ -113,6 +132,11 @@ void interface_add_error(struct interface *iface, const 
char *subsystem,
if (!error)
return;
 
+   /* Only keep the last flagged error, prevent this list grows unlimitted 
in case the
+  protocol can't be established (e.g auth failure) */
+   if (iface-proto_handler-flags  PROTO_FLAG_LASTERROR)
+   interface_error_flush(iface);
+
list_add_tail(error-list, iface-errors);
 
dest = (char *) error-data[n_data + 1];
@@ -188,6 +212,7 @@ interface_event(struct interface *iface, enum 
interface_event ev)
 
switch (ev) {
case IFEV_UP:
+   interface_error_flush(iface);
adev = iface-l3_dev.dev;
/* fall through */
case IFEV_DOWN:
diff --git a/proto-shell.c b/proto-shell.c
index 977cdbc..7a1896b 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -819,6 +819,10 @@ proto_shell_add_handler(const char *script, const char 
*name, json_object *obj)
if (tmp  json_object_get_boolean(tmp))
handler-proto.flags |= PROTO_FLAG_RENEW_AVAILABLE;
 
+   tmp = json_get_field(obj, lasterror, json_type_boolean);
+   if (tmp  json_object_get_boolean(tmp))
+   handler-proto.flags |= PROTO_FLAG_LASTERROR;
+
config = json_get_field(obj, config, json_type_array);
if (config)
handler-config_buf = 
netifd_handler_parse_config(handler-config, config);
diff --git a/proto.c b/proto.c
index 0ba2fbe..eaec913 100644
--- a/proto.c
+++ b/proto.c
@@ -586,16 +586,20 @@ void
 proto_attach_interface(struct interface *iface, const char *proto_name)
 {
const struct proto_handler *proto = no_proto;
+   const char *error = NULL;
 
if (proto_name) {
proto = get_proto_handler(proto_name);
if (!proto) {
-   interface_add_error(iface, proto, INVALID_PROTO, 
NULL, 0);
+   error = INVALID_PROTO;
proto = no_proto;
}
}
 
iface-proto_handler = proto;
+
+   if (error)
+   interface_add_error(iface, proto, error, NULL, 0);
 }
 
 int
diff --git a/proto.h b/proto.h
index 7210f48..87dec4e 100644
--- a/proto.h
+++ b/proto.h
@@ -37,6 +37,7 @@ enum {
PROTO_FLAG_INIT_AVAILABLE = (1  2),
PROTO_FLAG_RENEW_AVAILABLE = (1  3),
PROTO_FLAG_FORCE_LINK_DEFAULT = (1  4),
+   PROTO_FLAG_LASTERROR = (1  5),
 };
 
 struct interface_proto_state {
diff --git 

Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Dirk Neukirchen
+1 for Designated Driver


On 07.04.2015 21:47, Hartmut Knaack wrote:
 That Doodle poll turned out to be spamed/trolled, and everyone could even
 change or delete other votes. Since this was just communicated over this
 mailing list, and subscribers are at least basically verified, why not have a
 good old fashioned poll?
 
 Give your +1 answer on this mail if you prefer Designated Driver.
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ubox: add log_trailer_null option to uci

2015-04-08 Thread Etienne CHAMPETIER
this allow us to use syslog tcp with \0 trailer
instead of \n trailer (logread -0 option)

Signed-off-by: Etienne CHAMPETIER champetier.etie...@gmail.com
---
 package/system/ubox/files/log.init | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/package/system/ubox/files/log.init 
b/package/system/ubox/files/log.init
index 3e06fa5..4fc00d5 100644
--- a/package/system/ubox/files/log.init
+++ b/package/system/ubox/files/log.init
@@ -18,6 +18,7 @@ validate_log_section()
'log_remote:bool:1' \
'log_port:port:514' \
'log_proto:or(tcp, udp):udp' \
+   'log_trailer_null:bool:0' \
'log_prefix:string'
 }
 
@@ -63,7 +64,7 @@ start_service_remote()
 {
PIDCOUNT=$(( ${PIDCOUNT} + 1))
local pid_file=/var/run/logread.${PIDCOUNT}.pid
-   local log_ip log_port log_proto log_prefix log_remote
+   local log_ip log_port log_proto log_prefix log_remote log_trailer_null
 
validate_log_section ${1} || {
echo validation failed
@@ -74,7 +75,10 @@ start_service_remote()
 
procd_open_instance
procd_set_param command $PROG -f -r $log_ip ${log_port} -p 
$pid_file
-   [ ${log_proto} != udp ] || procd_append_param command -u
+   case ${log_proto} in
+   udp) procd_append_param command -u;;
+   tcp) [ ${log_trailer_null} -eq 1 ]  procd_append_param 
command -0;;
+   esac
[ -z ${log_prefix} ] || procd_append_param command -P ${log_prefix}
procd_close_instance
 }
-- 
2.1.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread RISCi_ATOM
+1
 
 
 2015-04-07 21:47 GMT+02:00 Hartmut Knaack knaac...@gmx.de:
 That Doodle poll turned out to be spamed/trolled, and everyone
 could even
 change or delete other votes. Since this was just communicated
 over this
 mailing list, and subscribers are at least basically verified,
 why not have a
 good old fashioned poll?
 
 Give your +1 answer on this mail if you prefer Designated
 Driver.
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 
 
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Designated Driver

2015-04-08 Thread Etienne Champetier
+1

2015-04-07 21:47 GMT+02:00 Hartmut Knaack knaac...@gmx.de:

 That Doodle poll turned out to be spamed/trolled, and everyone could even
 change or delete other votes. Since this was just communicated over this
 mailing list, and subscribers are at least basically verified, why not
 have a
 good old fashioned poll?

 Give your +1 answer on this mail if you prefer Designated Driver.
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

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


Re: [OpenWrt-Devel] Submitting PATCH for rtl8192cu HTmode deadlock

2015-04-08 Thread Daniel Golle
Hi!

I did quite some testing on the lamobo-r1 aka. bpi-r1 a couple of
weeks ago and didn't encounter any such issue -- however, I must
admit that I probably never had more than one client associated
and generating serious traffic simultanously (did you? i.e.
was there more than one client involved to trigger the deadlock
scenario?)

If needed for the board to work properly, I reckon the patch should
be temporarily included in package/kernel/mac80211/patches/.

Cheers


Daniel


On Wed, Apr 08, 2015 at 12:29:20PM -0400, Derek Werthmuller wrote:
 In reference to bug # 18539
 https://dev.openwrt.org/ticket/18539#comment:4
 The deadlock appears that when the adapter is in AP mode and client
 negotiates into the HT modes.  I don't know if this effects the adapter
 used in client modes.  But without the patch the adapter is not usable in
 ap mode.  This adapter is integrated in the sunxi based bpi-r1 board.
 I'd be interested in conversations to get this adapter up to some level of
 802.11n HT mode.
 
 The below patch I'd like to submit for evaluation for inclusion.
 Cheers
Derek
 
 
 DEBUGing and patch done by sbrown
 Comment (by sbrown):
 
  I found that the problem only occurs at HT rates.
 
  After looking at some more wireshark output, the problem seems to be
  that the aggregation sessions deadlock when a second one starts before
  the first one completes. That would explain why it only occurs in HT
  mode.
 
  The sequence on the air before the deadlock is:
 
  STA-AP block ack req
  STA-AP ping req
  AP-STA block ack resp
  AP-STA ping resp
  AP-STA block ack req
  STA-AP block ack resp
 
  The sequence on the air after the deadlock is:
 
  AP-STA block ack req
  STA-AP block ack req
  AP-STA block ack resp
  STA-AP block ack resp
  STA-AP ping req
  ...
  STA-AP ping req (repeats)
 
  If I disable aggregation in the driver with the attached patch, the
  problem goes away with a performance loss.
 
  {{{
   diff -rupN a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
 b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c2015-04-03
 07:10:19.343543253 -0400
 +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c2015-04-03
 07:11:51.323999358 -0400
 @@ -59,7 +59,9 @@ static int rtl92cu_init_sw_vars(struct i
  {
  struct rtl_priv *rtlpriv = rtl_priv(hw);
  int err;
 -
 + /* disable aggregation until the deadlock is fixed */
 +hw-flags = ~IEEE80211_HW_AMPDU_AGGREGATION;
 +
  rtlpriv-dm.dm_initialgain_enable = true;
  rtlpriv-dm.dm_flag = 0;
  rtlpriv-dm.disable_framebursting = false;
 
  }}}

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


[OpenWrt-Devel] [PATCH 2/2] procd: add helper for starting NAND sysupgrade

2015-04-08 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 package/system/procd/files/nand.sh | 9 +
 1 file changed, 9 insertions(+)

diff --git a/package/system/procd/files/nand.sh 
b/package/system/procd/files/nand.sh
index 7fb9343..0ed1b63 100644
--- a/package/system/procd/files/nand.sh
+++ b/package/system/procd/files/nand.sh
@@ -353,3 +353,12 @@ nand_do_platform_check() {
 
return 0
 }
+
+# Start NAND upgrade process
+#
+# $(1): file to be used for upgrade
+nand_do_upgrade() {
+   echo -n $1  /tmp/sysupgrade-nand-path
+   cp /sbin/upgraded /tmp/
+   nand_upgrade_stage1
+}
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] OnetSwitch FYI

2015-04-08 Thread Outback Dingo
Just came across this on another list, looks interesting, thought some of
you might  be interested,

About this project

As we all know, Raspberry Pi is an open source hardware computer, and
Arduino is an open source hardware microcontroller. Where is the standalone
open source hardware for networking without any PC support?

The ONetSwitch project sets up an open source Software Defined Networking
(SDN) platform that make it easy for you to create new network
applications.

What is ONetSwitch?

Open Source Hardware
ONetSwitch is a notebook-sized Quad Gigabit Ethernet Ports SBC based on
Xilinx Zynq SoC, which combines the software programmability of ARM
processors with the hardware programmability of FPGAs.


With a FPGA programmable accelerator (Efficient Bitcoin Miner System), five
Gigabit Ethernet ports, Up to 3GB DDR3 DRAM, SATA connector, and Mini PCIe
interface for WLAN Card (OpenWrt on Zynq).

Open Source Reference Design
ONetSwitch provides several reference designs available on GitHub. Each
reference design consist of open source FPGA Hardware(RTL Code), Linux OS
and open source software, sharing your mind and contribute to our community.

https://www.kickstarter.com/projects/onetswitch/onetswitch-open-source-hardware-for-networking
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: add platform_pre_upgrade for sysupgrade

2015-04-08 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 13 +
 1 file changed, 13 insertions(+)

diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 0cbee1d..01278b5 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -446,6 +446,19 @@ platform_check_image() {
return 1
 }
 
+platform_pre_upgrade() {
+   local board=$(ar71xx_board_name)
+
+   case $board in
+   nbg6716 | \
+   r6100 | \
+   wndr3700v4 | \
+   wndr4300 )
+   nand_do_upgrade $1
+   ;;
+   esac
+}
+
 platform_do_upgrade() {
local board=$(ar71xx_board_name)
 
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] AR8216 looses connectivity

2015-04-08 Thread Nikolay Martynov
Hi.

  Several times my router has lost wired connectivity (wireless was
still working).
  When this happens I got this in logs:

[273271.99] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 2 is down
[273272.00] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 3 is down
[273272.00] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273272.99] eth1: link down
[273273.99] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273273.99] eth1: link up (100Mbps/Full duplex)
[273274.01] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 2 is up
[273274.01] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 3 is up
[273274.02] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273278.00] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273278.00] eth1: link down
[273280.01] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273280.01] eth1: link up (100Mbps/Full duplex)
[273280.03] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273284.02] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273284.02] eth1: link down
[273285.03] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273285.03] eth1: link up (100Mbps/Full duplex)
[273286.04] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273289.04] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273289.04] eth1: link down
[273291.05] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273291.05] eth1: link up (100Mbps/Full duplex)
[273292.06] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273307.06] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273307.06] eth1: link down
[273309.07] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273309.07] eth1: link up (100Mbps/Full duplex)
[273311.08] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273312.08] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273313.08] eth1: link down
[273314.08] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273314.08] eth1: link up (100Mbps/Full duplex)
[273314.09] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273328.09] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273328.09] eth1: link down
[273329.10] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273329.10] eth1: link up (100Mbps/Full duplex)
[273331.11] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273332.11] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[27.11] eth1: link down
[273336.11] ar71xx: pll_reg 0xb8050018: 0x13000a44
[273336.11] eth1: link up (100Mbps/Full duplex)
[273336.12] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up
[273340.12] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is down
[273340.12] eth1: link down
[273341.13] ar71xx: pll_reg 0xb8050018: 0x441099
[273341.13] eth1: link up (10Mbps/Full duplex)
[273342.13] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:04: Port 5 is up

No wires were moved or touched when this was happening. Note that is
somehow managed to bring up 10Mbits on WAN interface. It is also kind
of interesting how eth1 (WAN) and port 5 were going up and down in
sync - are they in any way connected?

I've got this two or three times lately, once in 2-3 days. I'm on
r45267. Hardware is TEW632BRP with ieee80211 phy0: Atheros AR9100
MAC/BB Rev:7 AR2122 RF Rev:a1 mem=0xb80c, irq=2.

Is there anything I can do to debug this?

Thanks.
Nikolay.

-- 
Martynov Nikolay.
Email: mar.ko...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH][RFT ar71xx] procd: get rid of /tmp/sysupgrade-nand-path magic

2015-04-08 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 package/system/procd/files/nand.sh | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/package/system/procd/files/nand.sh 
b/package/system/procd/files/nand.sh
index 0ed1b63..dfa1ee6 100644
--- a/package/system/procd/files/nand.sh
+++ b/package/system/procd/files/nand.sh
@@ -312,17 +312,15 @@ nand_upgrade_stage2() {
}
 }
 
+# $(1): file to be used for upgrade
 nand_upgrade_stage1() {
-   [ -f /tmp/sysupgrade-nand-path ]  {
-   path=$(cat /tmp/sysupgrade-nand-path)
-   [ $SAVE_CONFIG != 1 -a -f $CONF_TAR ] 
-   rm $CONF_TAR
+   local path=$1
+   [ $SAVE_CONFIG != 1 -a -f $CONF_TAR ] 
+   rm $CONF_TAR
 
-   ubus call system nandupgrade {\path\: \$path\ }
-   exit 0
-   }
+   ubus call system nandupgrade {\path\: \$path\ }
+   exit 0
 }
-append sysupgrade_pre_upgrade nand_upgrade_stage1
 
 # Check if passed file is a valid one for NAND sysupgrade. Currently it accepts
 # 3 types of files:
@@ -348,9 +346,6 @@ nand_do_platform_check() {
return 1
}
 
-   echo -n $2  /tmp/sysupgrade-nand-path
-   cp /sbin/upgraded /tmp/
-
return 0
 }
 
@@ -358,7 +353,6 @@ nand_do_platform_check() {
 #
 # $(1): file to be used for upgrade
 nand_do_upgrade() {
-   echo -n $1  /tmp/sysupgrade-nand-path
cp /sbin/upgraded /tmp/
-   nand_upgrade_stage1
+   nand_upgrade_stage1 $1
 }
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] base-files: add support for platform_pre_upgrade function

2015-04-08 Thread Rafał Miłecki
Current NAND sysupgrade process is a bit hard to follow due to the way
of triggering stage1. Currently this is done by leaving a /mark/ in the
form of /tmp/sysupgrade-nand-path during nand_do_platform_check.
Existence of this mark stops standard sysupgrade process (as the result
of sysupgrade_pre_upgrade exit). This may be a bit misleading.

Proposed solution adds a new function that will allow platform.sh
trigger NAND sysupgrade consciously. This will also allow cleaning
nand_do_platform_check limiting it to just checking the image.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 package/base-files/files/sbin/sysupgrade | 8 
 1 file changed, 8 insertions(+)

diff --git a/package/base-files/files/sbin/sysupgrade 
b/package/base-files/files/sbin/sysupgrade
index 215f482..ef83c4b 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -215,6 +215,14 @@ fi
 
 run_hooks  $sysupgrade_pre_upgrade
 
+# Some platforms/devices may want different sysupgrade process, e.g. without
+# killing processes yet or calling ubus system upgrade method.
+# This is needed e.g. on NAND devices where we just want to trigger stage1 at
+# this point.
+if type 'platform_pre_upgrade' /dev/null 2/dev/null; then
+   platform_pre_upgrade $ARGV
+fi
+
 ubus call system upgrade
 touch /tmp/sysupgrade
 
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel