Re: [OpenWrt-Devel] [PATCH] include: make sure modules are modposted after initramfs image is built

2014-10-06 Thread Hattink, Tjalling [FINT]
Hi Felix,

The first patch I submitted was faulty. I forgot to notify the
mailinglist about this, my apologies. The problem is the $(subst
,,$(KERNELNAME)) part. For most targets KERNELNAME is defined so the
command is expanded to something like make bzImage modules. But for
the targets that do not have KERNELNAME defined (for example, the at91
target) the command is expanded to make modules. In this case the main
image is not compiled anymore, only the modules.

I tried to fix this by first calling make with the KERNELNAME only (or
empty, which will build the default kernel image target), and then a
second call to make for only modules. An alternative way to fix this is
to make sure KERNELNAME is defined for every target, but that requires
reworking the target makefiles, and could break 3rd party targets that
do not have KERNELNAME defined.

Kind regards,
Fugro Intersite B.V.

Tjalling Hattink
Software Development Engineer

T +31 (0)70 31 11493 | F  +31 (0)70 31 11890
t.hatt...@fugro.nl | www.fugro.com
Dillenburgsingel 69, 2263 HW Leidschendam | P.O. Box 154, 2260 AD
Leidschendam, The Netherlands
Trade Register nr 34048179 | VAT nr NL005621409B24
 -Original Message-
 From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
On Behalf Of Felix Fietkau
 Sent: Sunday, October 05, 2014 19:00
 To: Stam, Michel [FINT]; openwrt-devel@lists.openwrt.org
 Subject: Re: [OpenWrt-Devel] [PATCH] include: make sure modules are
modposted after initramfs image is
 built
 
 On 2014-10-02 15:33, Michel Stam wrote:
  From: Tjalling Hattink t.hatt...@fugro.nl
 
  Otherwise the modpost steps for individual modules that are compiled
  manually (using make package/name_of_module/install) will give
  warning of missing symbols when that module depends other modules.
 
  This is caused by the Module.symvers file not containing any symbols
  anymore of external modules when the initramfs image is built
without
  specifically giving the modules target.
 
  Signed-off-by: Tjalling Hattink t.hatt...@fugro.nl
 I liked Tjalling's original change better (putting both in the same
command line instead of doing a
 second $(MAKE) invocation), so I applied that one instead.
 
 - Felix
 ___
 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] [PATCH procd 3/8] Fix curses applications towork with procd

2014-10-06 Thread Stam, Michel [FINT]
Hello Gert,

After looking through the documentation and code here, I found why I
implemented it this way;
Several months ago we had, as mentioned before, a problem getting curses
applications to start on a new version of OpenWRT. This manifested in
applications not starting at all, or not accepting any input from STDIN,
but otherwise outputing to STDOUT quite nicely.

I then started by checking the init.c of the busybox that was used with
the older OpenWRT, I believe this was busybox 1.4. This version of
busybox did the ioctl I did, and as I was under time pressure,
it-worked-for-me, and I added the patch.

After your comment, I looked into this a little deeper, found that the
ioctl was not really necessary, and removed it. It has since been
removed from busybox init.c too, which only helped to convince me. I
will submit this revised patch on the mailing list in a few minutes.

Thanks for the remark.

Kind regards,

Michel Stam

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
Behalf Of Stam, Michel [FINT]
Sent: Friday, October 03, 2014 17:23 PM
To: Gert Doering
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH procd 3/8] Fix curses applications
towork with procd

Hello Gert,

Good question.

What we discovered during an upgrade of our OpenWRT distribution (from a
fairly old one, I cannot exactly recall the version, I do recall it was
running kernel 2.6.22), was that suddenly our curses application did not
start anymore. And yes, for historical reasons, it was executed from the
inittab, no argument there.

I was looking into the reason and typing an answer to you, but I have to
look a little better as to the why. If you don't mind, I will get back
to you on Monday.

Kind regards,

Michel Stam

-Original Message-
From: Gert Doering [mailto:g...@greenie.muc.de]
Sent: Friday, October 03, 2014 16:16 PM
To: Stam, Michel [FINT]
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH procd 3/8] Fix curses applications
to work with procd

Hi,

On Thu, Oct 02, 2014 at 02:56:18PM +0200, Michel Stam wrote:
 The problem was caused by procd not opening /dev/tty* (which ever was 
 specified in /etc/inittab), causing /proc/PID/fd to point to /console 
 instead. /dev/console is a non-controlling tty (CTTY), and cannot be 
 used as one, which is exactly what curses applications want. Since 
 this is very likely to cause problems with other programs, procd now 
 opens /dev/tty? when the ID field of the inittab assigns one, and
forces this to be a CTTY.

I won't claim to understand the OpenWRT intricacies here, so take this
with a grain of salt.

In traditional unix systems, setting up a tty and acquiring a
controlling tty is getty's job, and not that of the init system - and
init should not start interactive programs (or possibly interactive
programs) from /etc/inittab.

Changing this is fairly invasive into the way the system works and what
programs can expect regarding signal delivery etc. - like, someone
pressing ctrl-c on a tty, and a background process being started on that
tty will get a SIGINT (while it normally wouldn't).

Genuinely curious: can you explain a bit better in which cases this
change would be needed and/or beneficial?

thanks,

gert
--
USENET is *not* the non-clickable part of WWW!
 
//www.muc.de/~gert/
Gert Doering - Munich, Germany
g...@greenie.muc.de
fax: +49-89-35655025
g...@net.informatik.tu-muenchen.de
___
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 v2 procd 3/8] Fix curses applications to work with procd

2014-10-06 Thread Michel Stam
The problem was caused by procd not opening /dev/tty* (which ever was specified 
in
/etc/inittab), causing /proc/PID/fd to point to /console instead. /dev/console 
is a
non-controlling tty (CTTY), and cannot be used as one, which is exactly what 
curses
applications want. Since this is very likely to cause problems with other 
programs,
procd now opens /dev/tty? when the ID field of the inittab assigns one.

Signed-off-by: Michel Stam m.s...@fugro.nl
---
 inittab.c| 62 
 utils/askfirst.c | 28 ++---
 2 files changed, 47 insertions(+), 43 deletions(-)

diff --git a/inittab.c b/inittab.c
index c8540b1..5ddf4f0 100644
--- a/inittab.c
+++ b/inittab.c
@@ -63,10 +63,48 @@ static char *ask = /sbin/askfirst;
 
 static LIST_HEAD(actions);
 
+static int dev_open(const char *dev)
+{
+   int fd = -1;
+
+   if (dev) {
+   chdir(/dev);
+   fd = open( dev, O_RDWR);
+   chdir(/);
+   }
+
+   return fd;
+}
+
+static int dev_exist(const char *dev)
+{
+   int res;
+
+   res = dev_open(dev);
+   if (res != -1) {
+   close(res);
+   }
+   
+   return (res != -1);
+}
+
 static void fork_worker(struct init_action *a)
 {
+   int fd;
+   pid_t p;
+
a-proc.pid = fork();
if (!a-proc.pid) {
+   p = setsid( );
+   fd = dev_open(a-id);
+   if (fd != -1)
+   {
+   dup2(fd, STDIN_FILENO);
+   dup2(fd, STDOUT_FILENO);
+   dup2(fd, STDERR_FILENO);
+   tcsetpgrp(fd, p);
+   close(fd);
+   }
execvp(a-argv[0], a-argv);
ERROR(Failed to execute %s\n, a-argv[0]);
exit(-1);
@@ -110,22 +148,17 @@ static void runrc(struct init_action *a)
 
 static void askfirst(struct init_action *a)
 {
-   struct stat s;
int i;
 
-   chdir(/dev);
-   i = stat(a-id, s);
-   chdir(/);
-   if (i || (console  !strcmp(console, a-id))) {
+   if (!dev_exist(a-id) || (console  !strcmp(console, a-id))) {
DEBUG(4, Skipping %s\n, a-id);
return;
}
 
a-tout.cb = respawn;
-   for (i = MAX_ARGS - 2; i = 2; i--)
-   a-argv[i] = a-argv[i - 2];
+   for (i = MAX_ARGS - 1; i = 1; i--)
+   a-argv[i] = a-argv[i - 1];
a-argv[0] = ask;
-   a-argv[1] = a-id;
a-respawn = 500;
 
a-proc.cb = child_exit;
@@ -134,7 +167,6 @@ static void askfirst(struct init_action *a)
 
 static void askconsole(struct init_action *a)
 {
-   struct stat s;
char line[256], *tty;
int i, r, fd = open(/proc/cmdline, O_RDONLY);
regex_t pat_cmdline;
@@ -153,20 +185,16 @@ static void askconsole(struct init_action *a)
line[matches[1].rm_eo] = '\0';
tty = line[matches[1].rm_so];
 
-   chdir(/dev);
-   i = stat(tty, s);
-   chdir(/);
-   if (i) {
+   if (!dev_exist(tty)) {
DEBUG(4, skipping %s\n, tty);
goto err_out;
}
-   console = strdup(tty);
 
a-tout.cb = respawn;
-   for (i = MAX_ARGS - 2; i = 2; i--)
-   a-argv[i] = a-argv[i - 2];
+   for (i = MAX_ARGS - 1; i = 1; i--)
+   a-argv[i] = a-argv[i - 1];
+   a-id = strdup(tty);
a-argv[0] = ask;
-   a-argv[1] = strdup(tty);
a-respawn = 500;
 
a-proc.cb = child_exit;
diff --git a/utils/askfirst.c b/utils/askfirst.c
index 6ad77aa..e1f757a 100644
--- a/utils/askfirst.c
+++ b/utils/askfirst.c
@@ -19,34 +19,10 @@
 #include unistd.h
 #include fcntl.h
 
-static int redirect_output(const char *dev)
-{
-   pid_t p = setsid();
-   int fd;
-
-   chdir(/dev);
-   fd = open(dev, O_RDWR);
-   chdir(/);
-
-   if (fd  0)
-   return -1;
-
-   dup2(fd, STDIN_FILENO);
-   dup2(fd, STDOUT_FILENO);
-   dup2(fd, STDERR_FILENO);
-   tcsetpgrp(fd, p);
-   close(fd);
-
-   return 0;
-}
-
 int main(int argc, char **argv)
 {
int c;
 
-   if (redirect_output(argv[1]))
-   fprintf(stderr, %s: Failed to open %s\n, argv[0], argv[1]);
-
printf(Please press Enter to activate this console.\n);
do {
c = getchar();
@@ -55,8 +31,8 @@ int main(int argc, char **argv)
}
while (c != 0xA);
 
-   execvp(argv[2], argv[2]);
-   printf(%s: Failed to execute %s\n, argv[0], argv[2]);
+   execvp(argv[1], argv[1]);
+   printf(%s: Failed to execute %s\n, argv[0], argv[1]);
 
return -1;
 }
-- 
1.7.12.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Atheros AR231x MIPS machine name (ex [PATCH 01/16] MIPS: ar231x: add common parts)

2014-10-06 Thread Sergey Ryazanov
2014-10-03 22:46 GMT+04:00, Sergey Ryazanov ryazanov@gmail.com:
 Add owrt mailing list to cc.

 Any suggestions?

 2014-09-30 0:57 GMT+04:00 Sergey Ryazanov ryazanov@gmail.com:
 2014-09-29 13:30 GMT+04:00 Jonas Gorski j...@openwrt.org:
 On Sun, Sep 28, 2014 at 8:33 PM, Sergey Ryazanov ryazanov@gmail.com
 wrote:
 Add common code for Atheros AR5312 and Atheros AR2315 SoCs families.

 [...]

 +config AR231X

 I would suggest naming it ATH25, to match the other atheros target
 (ATH79).
 I have been thinking about such name. But decided to keep code closer
 to owrt realization. May be maintainers could suggest smth. Ralf, what
 do you think?


Any thoughts?

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


Re: [OpenWrt-Devel] [PATCH procd 7/8] Show the shutdown sequence on the active virtual terminal

2014-10-06 Thread Stam, Michel [FINT]
Hello John,

We have a tty0 (our board happened to have an x86 processor), the
situation is no different when you're running this with the console port
on the serial port of a router board. The presence of the VT in the
kernel determines if tty0 actually exists. So point taken, I had not
taken that into account.

My point is that i would like to see what is going on when I issue a
reboot on a device. It would be logical to see that on whatever screen
happens to be active at that moment.
Is it acceptable for you if I try and open /dev/tty0 if available, or
use /dev/console otherwise? 

Kind regards,

Michel Stam

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
Behalf Of John Crispin
Sent: Friday, October 03, 2014 18:35 PM
To: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH procd 7/8] Show the shutdown
sequence on the active virtual terminal

see inline

On 02/10/2014 14:56, Michel Stam wrote:
 procd by default writes to /dev/console. When rebooting, this means 
 that the terminal on which the reboot sequence was started will not 
 see what is going on. This patch fixes that by reopening stdin, stdout

 and stderr to /dev/tty0 upon reboot.
 
 Also, due to (probably) pivot-root, /proc/1/fd shows 1-3 pointing to 
 /console. This patch also fixes that.
 
 Signed-off-by: Michel Stam m.s...@fugro.nl --- state.c | 13
 + 1 file changed, 13 insertions(+)
 
 diff --git a/state.c b/state.c index e6c8712..2268de3 100644 --- 
 a/state.c +++ b/state.c @@ -12,7 +12,9 @@ * GNU General Public License

 for more details. */
 
 +#include fcntl.h #include sys/reboot.h +#include stdio.h
 #include stdlib.h #include unistd.h #include sys/types.h @@
 -37,6 +39,14 @@ enum { static int state = STATE_NONE; static int 
 reboot_event;
 
 +static void set_stdio( const char* tty ) +{ +freopen( tty,
r,
 stdin ); +freopen( tty, w, stdout ); +  freopen( tty, w,
stderr
 ); +  fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) |
 O_NONBLOCK); +} + static void state_enter(void) { char ubus_cmd[] = 
 /sbin/ubusd; @@ -55,6 +65,7 @@ static void state_enter(void)
 LOG(- ubus -\n); procd_connect_ubus();
 
 + set_stdio( /dev/console ); LOG(- init -\n);
service_init();
 service_start_early(ubus, ubus_cmd); @@ -71,6 +82,8 @@ static void 
 state_enter(void) break;
 
 case STATE_SHUTDOWN: +/* Redirect output to the
current virtual
 terminal for the users' benefit */ +  set_stdio( /dev/tty0
);

tty0 is a virtual console on a desktop. routers don't have a tty0.
this would break all the routers



 LOG(- shutdown -\n); procd_inittab_run(shutdown); sync();
 
___
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] [PATCH procd 2/8] Log startup/shutdown toconsole

2014-10-06 Thread John Crispin


On 06/10/2014 15:12, Stam, Michel [FINT] wrote:
 Hello John,
 
 A single printf would not work; it seems to work if it is a fprintf
 to stderr. The problem with regular printfs is that if someone
 presses CTRL-S /scroll lock on the console, they can effectively
 block procd that way, because printf will block when writing to a
 blocked tty.
 
 Also, this would require my other patch at 
 http://patchwork.openwrt.org/patch/6364/, otherwise stderr may be 
 blocked as well.
 
 Please let me know if this is an acceptable solution, I will then
 rework the patch this way.

lets use 6364 + a fprintf(sdterr, )

i will use the patches you sent as a basis and do the missing bits.















 
 Kind regards,
 
 Michel Stam







 
 -Original Message- From: openwrt-devel
 [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf Of John
 Crispin Sent: Friday, October 03, 2014 18:30 PM To:
 openwrt-devel@lists.openwrt.org Subject: Re: [OpenWrt-Devel] [PATCH
 procd 2/8] Log startup/shutdown toconsole
 
 stdout is already /dev/console i think and removing the messages
 on shutdown also removes them in all other cases from the log.
 
 should adding a single printf(%s, str); not work ?
 
 On 02/10/2014 14:56, Michel Stam wrote:
 procd has the habit of logging startup/shutdown via rcS to
 syslog, which is pointless in case of a shutdown, and unlikely to
 be complete on a startup (as syslog is not running). Write to
 /dev/console instead.
 
 Signed-off-by: Michel Stam m.s...@fugro.nl --- rcS.c | 10 
 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/rcS.c b/rcS.c index 4545621..e01fc49 100644 ---
 a/rcS.c +++ b/rcS.c @@ -18,10 +18,11 @@
 
 #include libubox/uloop.h #include libubox/runqueue.h
 +#include fcntl.h #include stdlib.h #include stdio.h
 #include unistd.h -
 
 +#include paths.h #include sys/types.h #include sys/stat.h
  #include glob.h @@ -43,8 +44,9 @@ struct initd { static void 
 pipe_cb(struct ustream *s, int bytes) { char *newline, *str; -
 int len; +   int len, console_fd;
 
 +console_fd = open(_PATH_CONSOLE, O_WRONLY | O_NOCTTY | 
 O_NONBLOCK); do { str = ustream_get_read_buf(s, NULL); if (!str)
 @@ -52,11 +54,11 @@ static void pipe_cb(struct ustream *s, int
 bytes) newline = strchr(str, '\n'); if (!newline) break; -
 *newline
 = 0;
 len = newline + 1 - str; -   syslog(0, %s, str); + 
 write(console_fd, str, len); ustream_consume(s, len); } while
 (1); +   close(console_fd); }
 
 static void q_initd_run(struct runqueue *q, struct runqueue_task 
 *t)
 
 ___ 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] [PATCH procd 7/8] Show the shutdown sequence on the active virtual terminal

2014-10-06 Thread John Crispin


On 06/10/2014 15:24, Stam, Michel [FINT] wrote:
 Hello John,
 
 We have a tty0 (our board happened to have an x86 processor), the
 situation is no different when you're running this with the console port
 on the serial port of a router board. The presence of the VT in the
 kernel determines if tty0 actually exists. So point taken, I had not
 taken that into account.
 
 My point is that i would like to see what is going on when I issue a
 reboot on a device. It would be logical to see that on whatever screen
 happens to be active at that moment.
 Is it acceptable for you if I try and open /dev/tty0 if available, or
 use /dev/console otherwise? 
 
 Kind regards,
 
 Michel Stam


inside inittab.c we work out the value of console= on the kernels
cmdline and use the value as basis for setting up console. you could try
to reuse that value to work out actual terminal that the messages should
be printed to.




 
 -Original Message-
 From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
 Behalf Of John Crispin
 Sent: Friday, October 03, 2014 18:35 PM
 To: openwrt-devel@lists.openwrt.org
 Subject: Re: [OpenWrt-Devel] [PATCH procd 7/8] Show the shutdown
 sequence on the active virtual terminal
 
 see inline
 
 On 02/10/2014 14:56, Michel Stam wrote:
 procd by default writes to /dev/console. When rebooting, this means 
 that the terminal on which the reboot sequence was started will not 
 see what is going on. This patch fixes that by reopening stdin, stdout
 
 and stderr to /dev/tty0 upon reboot.

 Also, due to (probably) pivot-root, /proc/1/fd shows 1-3 pointing to 
 /console. This patch also fixes that.

 Signed-off-by: Michel Stam m.s...@fugro.nl --- state.c | 13
 + 1 file changed, 13 insertions(+)

 diff --git a/state.c b/state.c index e6c8712..2268de3 100644 --- 
 a/state.c +++ b/state.c @@ -12,7 +12,9 @@ * GNU General Public License
 
 for more details. */

 +#include fcntl.h #include sys/reboot.h +#include stdio.h
 #include stdlib.h #include unistd.h #include sys/types.h @@
 -37,6 +39,14 @@ enum { static int state = STATE_NONE; static int 
 reboot_event;

 +static void set_stdio( const char* tty ) +{ +   freopen( tty,
 r,
 stdin ); +   freopen( tty, w, stdout ); +  freopen( tty, w,
 stderr
 ); + fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) |
 O_NONBLOCK); +} + static void state_enter(void) { char ubus_cmd[] = 
 /sbin/ubusd; @@ -55,6 +65,7 @@ static void state_enter(void)
 LOG(- ubus -\n); procd_connect_ubus();

 +set_stdio( /dev/console ); LOG(- init -\n);
 service_init();
 service_start_early(ubus, ubus_cmd); @@ -71,6 +82,8 @@ static void 
 state_enter(void) break;

 case STATE_SHUTDOWN: +   /* Redirect output to the
 current virtual
 terminal for the users' benefit */ + set_stdio( /dev/tty0
 );
 
 tty0 is a virtual console on a desktop. routers don't have a tty0.
 this would break all the routers
 
 
 
 LOG(- shutdown -\n); procd_inittab_run(shutdown); sync();

 ___
 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] [PATCH procd 2/8] Log startup/shutdown toconsole

2014-10-06 Thread Stam, Michel [FINT]
Ok John,

Thanks

Kind regards,

Michel Stam

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
Behalf Of John Crispin
Sent: Monday, October 06, 2014 16:44 PM
To: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH procd 2/8] Log startup/shutdown
toconsole



On 06/10/2014 15:12, Stam, Michel [FINT] wrote:
 Hello John,
 
 A single printf would not work; it seems to work if it is a fprintf to

 stderr. The problem with regular printfs is that if someone presses 
 CTRL-S /scroll lock on the console, they can effectively block procd 
 that way, because printf will block when writing to a blocked tty.
 
 Also, this would require my other patch at 
 http://patchwork.openwrt.org/patch/6364/, otherwise stderr may be 
 blocked as well.
 
 Please let me know if this is an acceptable solution, I will then 
 rework the patch this way.

lets use 6364 + a fprintf(sdterr, )

i will use the patches you sent as a basis and do the missing bits.















 
 Kind regards,
 
 Michel Stam







 
 -Original Message- From: openwrt-devel 
 [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf Of John 
 Crispin Sent: Friday, October 03, 2014 18:30 PM To:
 openwrt-devel@lists.openwrt.org Subject: Re: [OpenWrt-Devel] [PATCH 
 procd 2/8] Log startup/shutdown toconsole
 
 stdout is already /dev/console i think and removing the messages on 
 shutdown also removes them in all other cases from the log.
 
 should adding a single printf(%s, str); not work ?
 
 On 02/10/2014 14:56, Michel Stam wrote:
 procd has the habit of logging startup/shutdown via rcS to syslog, 
 which is pointless in case of a shutdown, and unlikely to be complete

 on a startup (as syslog is not running). Write to /dev/console 
 instead.
 
 Signed-off-by: Michel Stam m.s...@fugro.nl --- rcS.c | 10
 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/rcS.c b/rcS.c index 4545621..e01fc49 100644 --- a/rcS.c 
 +++ b/rcS.c @@ -18,10 +18,11 @@
 
 #include libubox/uloop.h #include libubox/runqueue.h
 +#include fcntl.h #include stdlib.h #include stdio.h
 #include unistd.h -
 
 +#include paths.h #include sys/types.h #include sys/stat.h
  #include glob.h @@ -43,8 +44,9 @@ struct initd { static void 
 pipe_cb(struct ustream *s, int bytes) { char *newline, *str; -
 int len; +   int len, console_fd;
 
 +console_fd = open(_PATH_CONSOLE, O_WRONLY | O_NOCTTY |
 O_NONBLOCK); do { str = ustream_get_read_buf(s, NULL); if (!str) @@ 
 -52,11 +54,11 @@ static void pipe_cb(struct ustream *s, int
 bytes) newline = strchr(str, '\n'); if (!newline) break; - *newline
 = 0;
 len = newline + 1 - str; -   syslog(0, %s, str); + 
 write(console_fd, str, len); ustream_consume(s, len); } while
 (1); +   close(console_fd); }
 
 static void q_initd_run(struct runqueue *q, struct runqueue_task
 *t)
 
 ___ 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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH procd 7/8] Show the shutdown sequence on the active virtual terminal

2014-10-06 Thread John Crispin


On 06/10/2014 16:47, Stam, Michel [FINT] wrote:
 Hey John,
 
 Ok, I will rework the patch to use that, then repost it.
 
 Kind regards,
 
 Michel Stam


i just had a look, we already have 2 pieces of code for reading values
from the cmdline. can you move the code from init/initd.c and
inittab.c to utils/utils.c and add a function such as
get_cmdline_val(char *name, char *out, int len); that setups up the
regex based on name and returns the value inside out. and then use it
all 3 places please.




 
 -Original Message- From: openwrt-devel
 [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf Of John
 Crispin Sent: Monday, October 06, 2014 16:46 PM To:
 openwrt-devel@lists.openwrt.org Subject: Re: [OpenWrt-Devel] [PATCH
 procd 7/8] Show the shutdown sequence on the active virtual
 terminal
 
 
 
 On 06/10/2014 15:24, Stam, Michel [FINT] wrote:
 Hello John,
 
 We have a tty0 (our board happened to have an x86 processor), the
  situation is no different when you're running this with the
 console port on the serial port of a router board. The presence
 of the VT in the kernel determines if tty0 actually exists. So
 point taken, I had not taken that into account.
 
 My point is that i would like to see what is going on when I
 issue a reboot on a device. It would be logical to see that on
 whatever screen
 
 happens to be active at that moment. Is it acceptable for you if
 I try and open /dev/tty0 if available, or use /dev/console
 otherwise?
 
 Kind regards,
 
 Michel Stam
 
 
 inside inittab.c we work out the value of console= on the kernels 
 cmdline and use the value as basis for setting up console. you
 could try to reuse that value to work out actual terminal that the
 messages should be printed to.
 
 
 
 
 
 -Original Message- From: openwrt-devel
 [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf Of
 John Crispin Sent: Friday, October 03, 2014 18:35 PM To:
 openwrt-devel@lists.openwrt.org Subject: Re: [OpenWrt-Devel]
 [PATCH procd 7/8] Show the shutdown sequence on the active
 virtual terminal
 
 see inline
 
 On 02/10/2014 14:56, Michel Stam wrote:
 procd by default writes to /dev/console. When rebooting, this
 means that the terminal on which the reboot sequence was
 started will not see what is going on. This patch fixes that by
 reopening stdin, stdout
 
 and stderr to /dev/tty0 upon reboot.
 
 Also, due to (probably) pivot-root, /proc/1/fd shows 1-3
 pointing to /console. This patch also fixes that.
 
 Signed-off-by: Michel Stam m.s...@fugro.nl --- state.c | 13 
 + 1 file changed, 13 insertions(+)
 
 diff --git a/state.c b/state.c index e6c8712..2268de3 100644
 --- a/state.c +++ b/state.c @@ -12,7 +12,9 @@ * GNU General
 Public License
 
 for more details. */
 
 +#include fcntl.h #include sys/reboot.h +#include
 stdio.h #include stdlib.h #include unistd.h #include
 sys/types.h @@ -37,6 +39,14 @@ enum { static int state =
 STATE_NONE; static int reboot_event;
 
 +static void set_stdio( const char* tty ) +{ +  freopen( tty,
 r,
 stdin ); +  freopen( tty, w, stdout ); +  freopen( tty, w,
 stderr
 ); +fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO,
 F_GETFL) | O_NONBLOCK); +} + static void state_enter(void) {
 char ubus_cmd[] = /sbin/ubusd; @@ -55,6 +65,7 @@ static void
 state_enter(void) LOG(- ubus -\n); procd_connect_ubus();
 
 +   set_stdio( /dev/console ); LOG(- init -\n);
 service_init();
 service_start_early(ubus, ubus_cmd); @@ -71,6 +82,8 @@ static
 void state_enter(void) break;
 
 case STATE_SHUTDOWN: +  /* Redirect output to the
 current virtual
 terminal for the users' benefit */ +set_stdio( /dev/tty0
 );
 
 tty0 is a virtual console on a desktop. routers don't have a
 tty0. this would break all the routers
 
 
 
 LOG(- shutdown -\n); procd_inittab_run(shutdown); sync();
 
 ___ 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 
 ___ 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] [PATCH procd 7/8] Show the shutdown sequence on the active virtual terminal

2014-10-06 Thread Stam, Michel [FINT]
Hey John, 

Ok, I will rework the patch to use that, then repost it.

Kind regards,

Michel Stam

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
Behalf Of John Crispin
Sent: Monday, October 06, 2014 16:46 PM
To: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH procd 7/8] Show the shutdown
sequence on the active virtual terminal



On 06/10/2014 15:24, Stam, Michel [FINT] wrote:
 Hello John,
 
 We have a tty0 (our board happened to have an x86 processor), the 
 situation is no different when you're running this with the console 
 port on the serial port of a router board. The presence of the VT in 
 the kernel determines if tty0 actually exists. So point taken, I had 
 not taken that into account.
 
 My point is that i would like to see what is going on when I issue a 
 reboot on a device. It would be logical to see that on whatever screen

 happens to be active at that moment.
 Is it acceptable for you if I try and open /dev/tty0 if available, or 
 use /dev/console otherwise?
 
 Kind regards,
 
 Michel Stam


inside inittab.c we work out the value of console= on the kernels
cmdline and use the value as basis for setting up console. you could try
to reuse that value to work out actual terminal that the messages should
be printed to.




 
 -Original Message-
 From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] 
 On Behalf Of John Crispin
 Sent: Friday, October 03, 2014 18:35 PM
 To: openwrt-devel@lists.openwrt.org
 Subject: Re: [OpenWrt-Devel] [PATCH procd 7/8] Show the shutdown 
 sequence on the active virtual terminal
 
 see inline
 
 On 02/10/2014 14:56, Michel Stam wrote:
 procd by default writes to /dev/console. When rebooting, this means 
 that the terminal on which the reboot sequence was started will not 
 see what is going on. This patch fixes that by reopening stdin, 
 stdout
 
 and stderr to /dev/tty0 upon reboot.

 Also, due to (probably) pivot-root, /proc/1/fd shows 1-3 pointing to 
 /console. This patch also fixes that.

 Signed-off-by: Michel Stam m.s...@fugro.nl --- state.c | 13
 + 1 file changed, 13 insertions(+)

 diff --git a/state.c b/state.c index e6c8712..2268de3 100644 --- 
 a/state.c +++ b/state.c @@ -12,7 +12,9 @@ * GNU General Public 
 License
 
 for more details. */

 +#include fcntl.h #include sys/reboot.h +#include stdio.h
 #include stdlib.h #include unistd.h #include sys/types.h @@
 -37,6 +39,14 @@ enum { static int state = STATE_NONE; static int 
 reboot_event;

 +static void set_stdio( const char* tty ) +{ +   freopen( tty,
 r,
 stdin ); +   freopen( tty, w, stdout ); +  freopen( tty, w,
 stderr
 ); + fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) |
 O_NONBLOCK); +} + static void state_enter(void) { char ubus_cmd[] = 
 /sbin/ubusd; @@ -55,6 +65,7 @@ static void state_enter(void)
 LOG(- ubus -\n); procd_connect_ubus();

 +set_stdio( /dev/console ); LOG(- init -\n);
 service_init();
 service_start_early(ubus, ubus_cmd); @@ -71,6 +82,8 @@ static void
 state_enter(void) break;

 case STATE_SHUTDOWN: +   /* Redirect output to the
 current virtual
 terminal for the users' benefit */ + set_stdio( /dev/tty0
 );
 
 tty0 is a virtual console on a desktop. routers don't have a tty0.
 this would break all the routers
 
 
 
 LOG(- shutdown -\n); procd_inittab_run(shutdown); sync();

 ___
 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
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 02/10] lantiq - vgv7519: fix gphy led configuration (this set correct alt function to gpio and let peripherials on pci bus to comes up)

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index 3f56d82..b4449f1 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -58,15 +58,24 @@
lantiq,groups = gnt1, req1;
lantiq,function = pci;
};
+   gphy-leds_out {
+   lantiq,pins = io7, io44;
+   lantiq,pull = 0;
+   lantiq,output = 1;
+   };
conf_out {
lantiq,pins = io4, io5,
io6, /* stp */
io21,
-   io33,
-   io7, io44;
/* Internal ethernet phy leds */
+   io33;
lantiq,open-drain;
lantiq,pull = 0;
lantiq,output = 1;
};
+   gphy-leds {
+   lantiq,groups = gphy0 led1,
gphy1 led0;
+   lantiq,function = gphy;
+   lantiq,open-drain = 0;
+   };
pcie-rst {
lantiq,pins = io38;
lantiq,pull = 0;
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 01/10] lantiq: fix some alt function on pinctrl-xway

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 .../lantiq/patches-3.14/0150-lantiq-pinctrl-xway.patch  |   15 +++
 1 file changed, 15 insertions(+)
 create mode 100644
target/linux/lantiq/patches-3.14/0150-lantiq-pinctrl-xway.patch

diff --git a/target/linux/lantiq/patches-3.14/0150-lantiq-pinctrl-xway.patch
b/target/linux/lantiq/patches-3.14/0150-lantiq-pinctrl-xway.patch
new file mode 100644
index 000..55cb2b9
--- /dev/null
+++ b/target/linux/lantiq/patches-3.14/0150-lantiq-pinctrl-xway.patch
@@ -0,0 +1,15 @@
+--- linux-3.14.18.orig/drivers/pinctrl/pinctrl-xway.c.orig
2014-09-27 14:55:20.0 +0200
 linux-3.14.18/drivers/pinctrl/pinctrl-xway.c   2014-10-05
21:15:02.0 +0200
+@@ -152,10 +152,10 @@
+   MFP_XWAY(GPIO41, GPIO,  NONE,   NONE,   NONE),
+   MFP_XWAY(GPIO42, GPIO,  MDIO,   NONE,   NONE),
+   MFP_XWAY(GPIO43, GPIO,  MDIO,   NONE,   NONE),
+-  MFP_XWAY(GPIO44, GPIO,  NONE,   GPHY,   SIN),
++  MFP_XWAY(GPIO44, GPIO,  MII,SIN,GPHY),
+   MFP_XWAY(GPIO45, GPIO,  NONE,   GPHY,   SIN),
+   MFP_XWAY(GPIO46, GPIO,  NONE,   NONE,   EXIN),
+-  MFP_XWAY(GPIO47, GPIO,  NONE,   GPHY,   SIN),
++  MFP_XWAY(GPIO47, GPIO,  MII,GPHY,   SIN),
+   MFP_XWAY(GPIO48, GPIO,  EBU,NONE,   NONE),
+   MFP_XWAY(GPIO49, GPIO,  EBU,NONE,   NONE),
+   MFP_XWAY(GPIO50, GPIO,  NONE,   NONE,   NONE),
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 04/10] lantiq - vgv7519: we don't have pcie bus so we don't need the reset device tree for this board

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi |5 -
 1 file changed, 5 deletions(-)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index f9956d3..ce523fb 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -72,11 +72,6 @@
lantiq,function = gphy;
lantiq,open-drain = 0;
};
-   pcie-rst {
-   lantiq,pins = io38;
-   lantiq,pull = 0;
-   lantiq,output = 1;
-   };
conf_in {
lantiq,pins = io39; /* exin3 */
lantiq,pull = 2;
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 06/10] lantiq - vgv7519: add pci-rst entry into dts

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi |6 ++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index 83adda9..50ee7a3 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -55,6 +55,12 @@
lantiq,pull = 0;
lantiq,output = 1;
};
+   pci-rst {
+   lantiq,pins = io21;
+   lantiq,open-drain = 0;
+   lantiq,pull = 0;
+   lantiq,output = 1;
+   };
conf_out {
lantiq,pins = io4, io5,
io6, /* stp */
io21,
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 00/10] lantiq - vgv7519 - multiple dts fix and make minipci card visible

2014-10-06 Thread Eddi De Pieri
Hi maintainers,

As requested I'm trying to send my  patch to the mail list.

Whith these patch I'm able to:
1. get rt2800pci driver to probe the wifi board.
2. leds connected to stp to work again (some changes into openwrt broken them)
3. gphy leds working

Regards


Eddi De Pieri (10):
  lantiq: fix some alt function on pinctrl-xway
  lantiq - vgv7519: fix gphy led configuration (this set correct alt
function to gpio and let peripherials on pci bus to comes up)
  lantiq - vgv7519: we don't have dual minipci-card so we don't need
gnt1-req1 for pci handling
  lantiq - vgv7519: we don't have pcie bus so we don't need the reset
device tree for this board
  lantiq - vgv7519: remove exin definition copied from dev-board dts
  lantiq - vgv7519: add pci-rst entry into dts
  lantiq - vgv7519: fix open-drain configuration for stp
  lantiq - vgv7519: remove spi_cs4, since the board use this line for
something else
  lantiq - vgv7519: enable pci bus
  lantiq - vgv7519: load rt5362 eeprom from bootloader param patition

 .../etc/hotplug.d/firmware/10-rt2x00-eeprom|2 +-
 target/linux/lantiq/dts/VGV7519.dtsi   |   48 +++-
 target/linux/lantiq/dts/VGV7519BRN.dts |6 +++
 target/linux/lantiq/dts/VGV7519NOR.dts |6 +++
 .../patches-3.14/0150-lantiq-pinctrl-xway.patch|   15 ++
 target/linux/lantiq/xrx200/config-3.14 |2 +-
 6 files changed, 55 insertions(+), 24 deletions(-)
 create mode 100644
target/linux/lantiq/patches-3.14/0150-lantiq-pinctrl-xway.patch

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


[OpenWrt-Devel] [PATCH 03/10] lantiq - vgv7519: we don't have dual minipci-card so we don't need gnt1-req1 for pci handling

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi |4 
 1 file changed, 4 deletions(-)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index b4449f1..f9956d3 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -54,10 +54,6 @@
lantiq,groups = mdio;
lantiq,function = mdio;
};
-   pci {
-   lantiq,groups = gnt1, req1;
-   lantiq,function = pci;
-   };
gphy-leds_out {
lantiq,pins = io7, io44;
lantiq,pull = 0;
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 05/10] lantiq - vgv7519: remove exin definition copied from dev-board dts

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi |8 
 1 file changed, 8 deletions(-)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index ce523fb..83adda9 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -38,10 +38,6 @@
reg = 0xE100B10 0xA0;

state_default: pinmux {
-   exin3 {
-   lantiq,groups = exin3;
-   lantiq,function = exin;
-   };
stp {
lantiq,groups = stp;
lantiq,function = stp;
@@ -72,10 +68,6 @@
lantiq,function = gphy;
lantiq,open-drain = 0;
};
-   conf_in {
-   lantiq,pins = io39; /* exin3 */
-   lantiq,pull = 2;
-   };
};
};

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


[OpenWrt-Devel] [PATCH 07/10] lantiq - vgv7519: fix open-drain configuration for stp

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index 50ee7a3..2894099 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -55,17 +55,15 @@
lantiq,pull = 0;
lantiq,output = 1;
};
-   pci-rst {
-   lantiq,pins = io21;
+   stp_out {
+   lantiq,pins = io4, io5, io6;
lantiq,open-drain = 0;
-   lantiq,pull = 0;
lantiq,output = 1;
+   lantiq,pull = 0;
};
-   conf_out {
-   lantiq,pins = io4, io5,
io6, /* stp */
-   io21,
-   io33;
-   lantiq,open-drain;
+   pci-rst {
+   lantiq,pins = io21;
+   lantiq,open-drain = 0;
lantiq,pull = 0;
lantiq,output = 1;
};
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 08/10] lantiq - vgv7519: remove spi_cs4, since the board use this line for something else

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index 2894099..fafcf5e 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -43,7 +43,7 @@
lantiq,function = stp;
};
spi {
-   lantiq,groups = spi, spi_cs4;
+   lantiq,groups = spi;
lantiq,function = spi;
};
mdio {
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 09/10] lantiq - vgv7519: enable pci bus

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 target/linux/lantiq/dts/VGV7519.dtsi   |5 +++--
 target/linux/lantiq/xrx200/config-3.14 |2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index fafcf5e..d652839 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -188,10 +188,11 @@
};

pci@E105400 {
+   status = okay;
#address-cells = 3;
#size-cells = 2;
#interrupt-cells = 1;
-   compatible = lantiq,pci-xway1;
+   compatible = lantiq,pci-xway;
bus-range = 0x0 0x0;
ranges = 0x200 0 0x800 0x800 0
0x200   /* pci memory */
0x100 0 0x 0xAE0 0
0x20; /* io space */
@@ -205,7 +206,7 @@
interrupt-map = 
0x7000 0 0 1 icu0 29 1 // slot 14, irq 29
;
-   gpios-reset = gpio 21 0;
+   gpio-reset = gpio 21 0;
req-mask = 0x1;   /* GNT1 */
};
};
diff --git a/target/linux/lantiq/xrx200/config-3.14
b/target/linux/lantiq/xrx200/config-3.14
index 959bf6a..3d525a4 100644
--- a/target/linux/lantiq/xrx200/config-3.14
+++ b/target/linux/lantiq/xrx200/config-3.14
@@ -44,7 +44,7 @@ CONFIG_MTD_UBI_GLUEBI=y
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_NLS=y
 CONFIG_PCIE_LANTIQ=y
-# CONFIG_PCI_LANTIQ is not set
+CONFIG_PCI_LANTIQ=y
 # CONFIG_PROC_DEVICETREE is not set
 # CONFIG_RCU_STALL_COMMON is not set
 CONFIG_RTL8306_PHY=y
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 10/10] lantiq - vgv7519: load rt5362 eeprom from bootloader param patition

2014-10-06 Thread Eddi De Pieri
Signed-off-by: Eddi De Pieri e...@depieri.net
---
 .../lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom   |2 +-
 target/linux/lantiq/dts/VGV7519.dtsi|7 +++
 target/linux/lantiq/dts/VGV7519BRN.dts  |6 ++
 target/linux/lantiq/dts/VGV7519NOR.dts  |6 ++
 4 files changed, 20 insertions(+), 1 deletion(-)

diff --git 
a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 5664c13..3ebd5e8 100644
--- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -35,7 +35,7 @@ case $FIRMWARE in
 RT2860.eeprom )
local board=$(lantiq_board_name)
case $board in
-   ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22)
+   ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22|VGV7519)
rt2x00_eeprom_extract board_config 520 256 1
;;
ARV7525PW)
diff --git a/target/linux/lantiq/dts/VGV7519.dtsi
b/target/linux/lantiq/dts/VGV7519.dtsi
index d652839..146d06a 100644
--- a/target/linux/lantiq/dts/VGV7519.dtsi
+++ b/target/linux/lantiq/dts/VGV7519.dtsi
@@ -71,6 +71,8 @@
lantiq,groups = gphy0 led1,
gphy1 led0;
lantiq,function = gphy;
lantiq,open-drain = 0;
+   lantiq,pull = 0;
+   lantiq,output = 1;
};
};
};
@@ -217,6 +219,11 @@
phys = [ 00 01 ];
};

+   ralink_eep {
+   compatible = ralink,eeprom;
+   ralink,eeprom = RT2860.eeprom;
+   };
+
gpio-keys-polled {
compatible = gpio-keys-polled;
#address-cells = 1;
diff --git a/target/linux/lantiq/dts/VGV7519BRN.dts
b/target/linux/lantiq/dts/VGV7519BRN.dts
index 53692a3..b885952 100644
--- a/target/linux/lantiq/dts/VGV7519BRN.dts
+++ b/target/linux/lantiq/dts/VGV7519BRN.dts
@@ -22,6 +22,12 @@
label = rootfs_data;
reg = 0x88 0x78;
};
+
+   partition@1f8 {
+   label = board_config;
+   reg = 0x4 0x1;
+   read-only;
+   };
};
};
};
diff --git a/target/linux/lantiq/dts/VGV7519NOR.dts
b/target/linux/lantiq/dts/VGV7519NOR.dts
index 283aa19..744efe6 100644
--- a/target/linux/lantiq/dts/VGV7519NOR.dts
+++ b/target/linux/lantiq/dts/VGV7519NOR.dts
@@ -30,6 +30,12 @@
// 0x1b - 0x100 :
rootfs (squashfs)
// 0x39 - 0x100 : rootfs_data
};
+
+   partition@1f8 {
+   label = board_config;
+   reg = 0x4 0x1;
+   read-only;
+   };
};
};
};
--
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3 v2] netifd: implement zeroconf

2014-10-06 Thread Michel Stam
The scripts were based on the netifd dhcp scripts,
and should add zeroconf support to /etc/config/network
Example:
config interface 'lan'
option ifname 'eth0'
option auto '0'
option proto 'zeroconf'

Optionally, the desired IP address can be added by:
option ipaddr '169.254.200.100'

and the range from which addresses are desired can
be added by:
option range '192.168.0.0'

Note that zcip in Busybox must be enabled for this to
work.

Signed-off-by: Michel Stam m.s...@fugro.nl
---
 .../netifd/files/lib/netifd/proto/zeroconf.sh  | 34 ++
 .../config/netifd/files/lib/netifd/zeroconf.script | 29 ++
 2 files changed, 63 insertions(+)
 create mode 100755 
package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh
 create mode 100755 
package/network/config/netifd/files/lib/netifd/zeroconf.script

diff --git a/package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh 
b/package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh
new file mode 100755
index 000..f7a6f76
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto $@
+
+proto_zeroconf_init_config() {
+   proto_config_add_string 'ipaddr:ipaddr'
+   proto_config_add_string 'range:ipaddr'
+}
+
+proto_zeroconf_setup() {
+   local config=$1
+   local iface=$2
+
+   local ipaddr
+   local range
+   json_get_vars ipaddr range
+
+   proto_export INTERFACE=$config
+   proto_run_command $config zcip \
+   ${ipaddr:+-r $ipaddr} \
+   ${range:+-l $range} \
+   -f $iface \
+   /lib/netifd/zeroconf.script
+}
+
+proto_zeroconf_teardown() {
+   local interface=$1
+   proto_kill_command $INTERFACE
+}
+
+add_protocol zeroconf
+
diff --git a/package/network/config/netifd/files/lib/netifd/zeroconf.script 
b/package/network/config/netifd/files/lib/netifd/zeroconf.script
new file mode 100755
index 000..8d34a67
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/zeroconf.script
@@ -0,0 +1,29 @@
+#!/bin/sh
+[ -z $1 ]  echo Error: should be run by zcip  exit 1
+
+. /lib/functions.sh
+. /lib/netifd/netifd-proto.sh
+
+setup_interface () {
+   proto_init_update * 1
+   proto_add_ipv4_address $ip '255.255.0.0'
+   proto_send_update $INTERFACE
+}
+
+deconfig_interface() {
+   proto_init_update * 0
+   proto_send_update $INTERFACE
+}
+
+case $1 in
+   deconfig)
+   deconfig_interface
+   ;;
+   config)
+   setup_interface
+   ;;
+   *|init)
+   ;;
+esac
+
+exit 0
-- 
1.7.12.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3 v2] busybox/netifd: make zcip log to syslog (always)

2014-10-06 Thread Michel Stam
zcip is not the most talkative beast at the best of times. It
would be nice to see -something- in syslog when an IP address
is acquired.

Signed-off-by: Michel Stam m.s...@fugro.nl
---
 .../netifd/files/lib/netifd/proto/zeroconf.sh  |  2 +-
 .../busybox/patches/460-zcip-always-syslog.patch   | 44 ++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 package/utils/busybox/patches/460-zcip-always-syslog.patch

diff --git a/package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh 
b/package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh
index f7a6f76..998d2c6 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/zeroconf.sh
@@ -21,7 +21,7 @@ proto_zeroconf_setup() {
proto_run_command $config zcip \
${ipaddr:+-r $ipaddr} \
${range:+-l $range} \
-   -f $iface \
+   -f -s -v $iface \
/lib/netifd/zeroconf.script
 }
 
diff --git a/package/utils/busybox/patches/460-zcip-always-syslog.patch 
b/package/utils/busybox/patches/460-zcip-always-syslog.patch
new file mode 100644
index 000..7519aa0
--- /dev/null
+++ b/package/utils/busybox/patches/460-zcip-always-syslog.patch
@@ -0,0 +1,44 @@
+From 297563d4d859643de249d180f3bf308f9536de18 Mon Sep 17 00:00:00 2001
+From: Michel Stam m.s...@fugro.nl
+Date: Thu, 25 Sep 2014 14:06:39 +0200
+Subject: [PATCH] zcip: add an option to force logging to syslog even if
+ running -f
+
+Signed-off-by: Michel Stam m.s...@fugro.nl
+---
+ networking/zcip.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/networking/zcip.c b/networking/zcip.c
+index 2a57543..2997503 100644
+--- a/networking/zcip.c
 b/networking/zcip.c
+@@ -32,6 +32,7 @@
+ //usage: \n  -r 169.254.x.x  Request this address first
+ //usage: \n  -l w.x.0.0  Use this class B range instead of 
169.254
+ //usage: \n  -v  Verbose
++//usage: \n  -s  Log to syslog (even in foreground)
+ //usage: \n
+ //usage: \nWith no -q, runs continuously monitoring for ARP conflicts,
+ //usage: \nexits only on I/O errors (link down etc)
+@@ -238,7 +239,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
+   // parse commandline: prog [options] ifname script
+   // exactly 2 args; -v accumulates and implies -f
+   opt_complementary = =2:vv:vf;
+-  opts = getopt32(argv, fqr:l:v, r_opt, l_opt, verbose);
++  opts = getopt32(argv, fqr:l:vs, r_opt, l_opt, verbose);
+ #if !BB_MMU
+   // on NOMMU reexec early (or else we will rerun things twice)
+   if (!FOREGROUND)
+@@ -248,7 +249,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
+   // (need to do it before openlog to prevent openlog from taking
+   // fd 3 (sock_fd==3))
+   xmove_fd(xsocket(AF_PACKET, SOCK_PACKET, htons(ETH_P_ARP)), sock_fd);
+-  if (!FOREGROUND) {
++  if (!FOREGROUND || (opts  16)) {
+   // do it before all bb_xx_msg calls
+   openlog(applet_name, 0, LOG_DAEMON);
+   logmode |= LOGMODE_SYSLOG;
+-- 
+1.7.12.1
+
-- 
1.7.12.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/4] octeon: fix serial console for 3.14 kernel

2014-10-06 Thread Roman Yeryomin
From: Roman Yeryomin ro...@advem.lv

Signed-off-by: Roman Yeryomin ro...@advem.lv
---
 target/linux/octeon/config-3.14 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/octeon/config-3.14 b/target/linux/octeon/config-3.14
index 389f1c7..baabe91 100644
--- a/target/linux/octeon/config-3.14
+++ b/target/linux/octeon/config-3.14
@@ -193,6 +193,7 @@ CONFIG_RPS=y
 CONFIG_SCHED_DEBUG=y
 CONFIG_SCSI=y
 CONFIG_SECCOMP=y
+CONFIG_SERIAL_8250_DW=y
 CONFIG_SMP=y
 CONFIG_SPARSEMEM=y
 CONFIG_SPARSEMEM_STATIC=y
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] octeon: prepare elf kernel image and md5sum for usb copying

2014-10-06 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin ro...@advem.lv
---
 target/linux/octeon/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/octeon/image/Makefile 
b/target/linux/octeon/image/Makefile
index 25a8149..f06dd6b 100644
--- a/target/linux/octeon/image/Makefile
+++ b/target/linux/octeon/image/Makefile
@@ -12,6 +12,8 @@ define Image/BuildKernel
$(TARGET_CROSS)strip -R .notes $(KDIR)/vmlinux.elf -o 
$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
$(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.l7
dd if=$(KDIR)/vmlinux.bin.l7 of=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma 
bs=65536 conv=sync
+   $(CP) $(KDIR)/vmlinux.elf $(BIN_DIR)/vmlinux.64
+   md5sum  $(BIN_DIR)/vmlinux.64 | cut -d   -f 1 | tee 
$(BIN_DIR)/vmlinux.64.md5
 endef
 
 define Image/Build/squashfs
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/4] octeon: remove kmod-ath9k from default packages

2014-10-06 Thread Roman Yeryomin
Looks like the targets are Ubiquiti routers which don't come with any wireless 
cards.

Signed-off-by: Roman Yeryomin ro...@advem.lv
---
 target/linux/octeon/profiles/000-Generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/octeon/profiles/000-Generic.mk 
b/target/linux/octeon/profiles/000-Generic.mk
index 427fbba..cf9a013 100644
--- a/target/linux/octeon/profiles/000-Generic.mk
+++ b/target/linux/octeon/profiles/000-Generic.mk
@@ -7,7 +7,7 @@
 
 define Profile/generic
   NAME:=Generic Octeon board
-  PACKAGES:=kmod-ath9k
+  PACKAGES:=
 endef
 
 define Profile/generic/Description
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/4] octeon: add patches which are not upstreamed yet

2014-10-06 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin ro...@advem.lv
---
 ...-Add-interface-mode-detection-for-Octeon-.patch | 202 +
 ...-Add-twsi-interrupt-initialization-for-OC.patch |  47 +
 2 files changed, 249 insertions(+)
 create mode 100644 
target/linux/octeon/patches-3.14/0010-MIPS-octeon-Add-interface-mode-detection-for-Octeon-.patch
 create mode 100644 
target/linux/octeon/patches-3.14/0011-MIPS-Octeon-Add-twsi-interrupt-initialization-for-OC.patch

diff --git 
a/target/linux/octeon/patches-3.14/0010-MIPS-octeon-Add-interface-mode-detection-for-Octeon-.patch
 
b/target/linux/octeon/patches-3.14/0010-MIPS-octeon-Add-interface-mode-detection-for-Octeon-.patch
new file mode 100644
index 000..2002dd1
--- /dev/null
+++ 
b/target/linux/octeon/patches-3.14/0010-MIPS-octeon-Add-interface-mode-detection-for-Octeon-.patch
@@ -0,0 +1,202 @@
+From d8ce75934b888df0bd73dfd9c030a2b034a04977 Mon Sep 17 00:00:00 2001
+From: Alex Smith alex.sm...@imgtec.com
+Date: Thu, 29 May 2014 11:10:01 +0100
+Subject: [PATCH] MIPS: octeon: Add interface mode detection for Octeon II
+
+Add interface mode detection for Octeon II. This is necessary to detect
+the interface modes correctly on the UBNT E200 board. Code is taken
+from the UBNT GPL source release, with some alterations: SRIO, ILK and
+RXAUI interface modes are removed and instead return disabled as these
+modes are not currently supported.
+
+Signed-off-by: Alex Smith alex.sm...@imgtec.com
+Tested-by: David Daney david.da...@cavium.com
+Cc: linux-m...@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/7039/
+Signed-off-by: Ralf Baechle r...@linux-mips.org
+---
+ arch/mips/cavium-octeon/executive/cvmx-helper.c | 166 
+ 1 file changed, 166 insertions(+)
+
+--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
 b/arch/mips/cavium-octeon/executive/cvmx-helper.c
+@@ -104,6 +104,158 @@ int cvmx_helper_ports_on_interface(int i
+ }
+ 
+ /**
++ * @INTERNAL
++ * Return interface mode for CN68xx.
++ */
++static cvmx_helper_interface_mode_t __cvmx_get_mode_cn68xx(int interface)
++{
++  union cvmx_mio_qlmx_cfg qlm_cfg;
++  switch (interface) {
++  case 0:
++  qlm_cfg.u64 = cvmx_read_csr(CVMX_MIO_QLMX_CFG(0));
++  /* QLM is disabled when QLM SPD is 15. */
++  if (qlm_cfg.s.qlm_spd == 15)
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++
++  if (qlm_cfg.s.qlm_cfg == 2)
++  return CVMX_HELPER_INTERFACE_MODE_SGMII;
++  else if (qlm_cfg.s.qlm_cfg == 3)
++  return CVMX_HELPER_INTERFACE_MODE_XAUI;
++  else
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++  case 2:
++  case 3:
++  case 4:
++  qlm_cfg.u64 = cvmx_read_csr(CVMX_MIO_QLMX_CFG(interface));
++  /* QLM is disabled when QLM SPD is 15. */
++  if (qlm_cfg.s.qlm_spd == 15)
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++
++  if (qlm_cfg.s.qlm_cfg == 2)
++  return CVMX_HELPER_INTERFACE_MODE_SGMII;
++  else if (qlm_cfg.s.qlm_cfg == 3)
++  return CVMX_HELPER_INTERFACE_MODE_XAUI;
++  else
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++  case 7:
++  qlm_cfg.u64 = cvmx_read_csr(CVMX_MIO_QLMX_CFG(3));
++  /* QLM is disabled when QLM SPD is 15. */
++  if (qlm_cfg.s.qlm_spd == 15) {
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++  } else if (qlm_cfg.s.qlm_cfg != 0) {
++  qlm_cfg.u64 = cvmx_read_csr(CVMX_MIO_QLMX_CFG(1));
++  if (qlm_cfg.s.qlm_cfg != 0)
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++  }
++  return CVMX_HELPER_INTERFACE_MODE_NPI;
++  case 8:
++  return CVMX_HELPER_INTERFACE_MODE_LOOP;
++  default:
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++  }
++}
++
++/**
++ * @INTERNAL
++ * Return interface mode for an Octeon II
++ */
++static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface)
++{
++  union cvmx_gmxx_inf_mode mode;
++
++  if (OCTEON_IS_MODEL(OCTEON_CN68XX))
++  return __cvmx_get_mode_cn68xx(interface);
++
++  if (interface == 2)
++  return CVMX_HELPER_INTERFACE_MODE_NPI;
++
++  if (interface == 3)
++  return CVMX_HELPER_INTERFACE_MODE_LOOP;
++
++  /* Only present in CN63XX  CN66XX Octeon model */
++  if ((OCTEON_IS_MODEL(OCTEON_CN63XX) 
++   (interface == 4 || interface == 5)) ||
++  (OCTEON_IS_MODEL(OCTEON_CN66XX) 
++   interface = 4  interface = 7)) {
++  return CVMX_HELPER_INTERFACE_MODE_DISABLED;
++  }
++
++  if (OCTEON_IS_MODEL(OCTEON_CN66XX)) {
++  union cvmx_mio_qlmx_cfg mio_qlm_cfg;
++
++ 

Re: [OpenWrt-Devel] Barrier Breaker 14.07 Final

2014-10-06 Thread Dave Taht

Congrats everyone!

Here's to a faster, bufferbloat-free and ipv6 enabled
Internet!

On Thu, Oct 02, 2014 at 02:59:08PM +0200, Steven Barth wrote:
 The OpenWrt developers are proud to announce the final release
 of OpenWrt Barrier Breaker.
 
   ___ __
  |   |.-.-.-.|  |  |  |..|  |_
  |   -   ||  _  |  -__| ||  |  |  ||   _||   _|
  |___||   __|_|__|__||||__|  ||
   |__| W I R E L E S S   F R E E D O M
  -
  BARRIER BREAKER (14.07)
  -
   * 1/2 oz Galliano Pour all ingredients into
   * 4 oz cold Coffeean irish coffee mug filled
   * 1 1/2 oz Dark Rum   with crushed ice. Stir.
   * 2 tsp. Creme de Cacao
  -
 
 http://downloads.openwrt.org/barrier_breaker/14.07/
 
 Important changes since RC3
 * various ath9k related fixes
 * a few board related fixes
 * fixes for packages depdending on curl
 * per feed download folders
 
 Important changes since RC2
 * NAT  firewall throughput improvements
 * Security updates for OpenSSL  PolarSSL
 * Minor fixes in DHCP  DHCPv6 handling
 * Configuration support for GRE tunnels
 * Various other fixes
 
 Important changes since RC1
 * fix a long standing ath9k deadlock bug
 * all feeds are now built
 * image builder now works and RC2 contains all board specific images
 * various board/stability fixes
 
 ** Highlights since Attitude Adjustment **
 Default configuration and images
 
 * Linux kernel updated to version 3.10
 * Procd: new preinit, init, hotplug and event system written in C
 * Native IPv6-support
 - RA  DHCPv6+PD client and server
 - Local prefix allocation  source-restricted routes
   (multihoming)
 * Filesystem improvements
 - Added support for sysupgrade on NAND-flash
 - Added support for filesystem snapshot and rollback
 - Rewritten mounting system in C for rootfs and block devices
 * UCI configuration improvements
 - Support for testing configuration and rollback to working
   last working state
 - Unified change trigger system to restart services on-demand
 - Added a data validation layer
 * Networking improvements
 - Netifd now handles setup and configuration reload of
   wireless interfaces
 - Added reworked event support to allow obsoleting network
   hotplug-scripts
 - Added support for dynamic firewall rules and zones
 - Added support for transparent multicast to unicast
   translation for bridges
 - Various other fixes and improvements
 
 Additional highlights selectable in the package feeds or SDK
 * Extended IPv6-support
 - Added DS-Lite support and improved 6to4, 6in4 and 6rd-support
 - Experimental support for Lightweight 4over6, MAP-E and MAP-T
 - Draft-support for self-managing home networks (HNCP)
 * rpcd: new JSONRPC over HTTP-frontend for remote access to ubus
 * mdns: new lightweight mdns daemon (work in progress)
 * Initial support for the musl C standard library
 * Support for QMI-based 3g/4g modems
 * Support for DNSSEC validation
 * Added architecture for package signing and SHA256 hashing
 * ... and many more cool things
 
 Package feed reorganization
 For quite a while already we are not very satisfied with the quality
 of the packages-feed. To address this, we decided to do a fresh start
 on GitHub. The new feed https://github.com/openwrt/packages should be
 used from now on and package maintainers are asked to move their
 packages there. For the final release we will still build the old
 packages feed but it will be necessary to enable it manually in the
 opkg package list to be usable.
 Additionally we would like to give a big thank you to all of our
 package
 maintainers working on our various feeds.
 
 New build servers
 We would like to express our gratitude to Imagination Technology for
 funding the 2 build servers that we used for the release.
 
 Whats next ?
 We aim at releasing Chaos Calmer (CC) before the end of the year. The
 CC release will use 3.14 or a newer LTS kernel as baseline.
 
 
 Have fun!
 The OpenWrt developer team
 ___
 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 1/2] base-files: add network_get_ipaddrs_all()

2014-10-06 Thread Mathias Kresin
Return all IPv4 and IPv6 addresses.

Signed-off-by: Mathias Kresin open...@kresin.me
---
 package/base-files/files/lib/functions/network.sh | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/package/base-files/files/lib/functions/network.sh 
b/package/base-files/files/lib/functions/network.sh
index 3a6903f..1b0c717 100644
--- a/package/base-files/files/lib/functions/network.sh
+++ b/package/base-files/files/lib/functions/network.sh
@@ -94,6 +94,29 @@ network_get_ipaddrs6() {
return 1
 }
 
+# determine all IP addresses of given logical interface
+# 1: destination variable
+# 2: interface
+network_get_ipaddrs_all() {
+   local __addr
+   local __list=
+
+   if __network_ifstatus __addr $2 
['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address; then
+   for __addr in $__addr; do
+   case $__addr in
+   *:) __list=${__list:+$__list }${__addr}1 ;;
+   *)  __list=${__list:+$__list }${__addr}  ;;
+   esac
+   done
+
+   export $1=$__list
+   return 0
+   fi
+
+   unset $1
+   return 1
+}
+
 # determine all IPv4 subnets of given logical interface
 # 1: destination variable
 # 2: interface
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] dropbear: ensure the interface has an ip-address

2014-10-06 Thread Mathias Kresin
Use network_get_ipaddrs_all to get all ip-addresses of an interface. If the
function fails, the interface does not exists or has not any suiteable ip
addresses assigned.

Use the returned ip-address(es) to construct the dropbear listen address.

Signed-off-by: Mathias Kresin open...@kresin.me
---
 .../network/services/dropbear/files/dropbear.init  | 23 +++---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/package/network/services/dropbear/files/dropbear.init 
b/package/network/services/dropbear/files/dropbear.init
index 5186523..860235e 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -14,20 +14,15 @@ EXTRA_HELP=killclients Kill ${NAME} processes 
except servers and yourself
 
 append_ports()
 {
-   local ifname=$1
+   local ipaddrs=$1
local port=$2
 
-   grep -qs ^ *$ifname: /proc/net/dev || {
+   [ -z $ipaddrs ]  {
procd_append_param command -p $port
return
}
 
-   for addr in $(
-   ifconfig $ifname | sed -ne '
-   /addr: *fe[89ab][0-9a-f]:/d
-   s/.* addr: *\([0-9a-f:\.]*\).*/\1/p
-   '
-   ); do
+   for addr in $ipaddrs; do
procd_append_param command -p $addr:$port
done
 }
@@ -55,13 +50,20 @@ dropbear_instance()
local PasswordAuth enable Interface GatewayPorts \
RootPasswordAuth RootLogin rsakeyfile \
dsskeyfile BannerFile Port SSHKeepAlive IdleTimeout \
-   mdns
+   mdns ipaddrs
 
validate_section_dropbear ${1} || {
echo validation failed
return 1
}
 
+   [ -n ${Interface} ]  {
+   network_get_ipaddrs_all ipaddrs ${Interface} || {
+   echo interface ${Interface} has no physdev or physdev 
has no suitable ip
+   return 1
+   }
+   }
+
[ ${enable} = 0 ]  return 1
PIDCOUNT=$(( ${PIDCOUNT} + 1))
local pid_file=/var/run/${NAME}.${PIDCOUNT}.pid
@@ -75,8 +77,7 @@ dropbear_instance()
[ -n ${rsakeyfile} ]  procd_append_param command -r ${rsakeyfile}
[ -n ${dsskeyfile} ]  procd_append_param command -d ${dsskeyfile}
[ -n ${BannerFile} ]  procd_append_param command -b ${BannerFile}
-   [ -n ${Interface} ]  network_get_device Interface ${Interface}
-   append_ports ${Interface} ${Port}
+   append_ports ${ipaddrs} ${Port}
[ ${IdleTimeout} -ne 0 ]  procd_append_param command -I 
${IdleTimeout}
[ ${SSHKeepAlive} -ne 0 ]  procd_append_param command -K 
${SSHKeepAlive}
[ ${mdns} -ne 0 ]  procd_add_mdns ssh tcp $Port 
daemon=dropbear
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2] dropbear: ensure the specified interface exists and has an ip-address

2014-10-06 Thread Mathias Kresin
If dropbear is configured to listen on a logic interface which does not (yet)
results in a physical interface when dropbear is (re)started, the init script
bind the particular instance to 0.0.0.0.

The same happens if the physical interface exists but does not have an 
ip-address
assigned.

All following dropbear instances refuse to start because of an already in use
address and a particular unwanted dropbear configuration is bound to global.

The impact of this error depends hardly on the instance definition order.

The following configuration results in a PasswortAuth enabled instance
reachable from WAN:

config dropbear
option PasswordAuth 'on'
option Port '22'
option Interface 'lan'

config dropbear
option Port '22'
option Interface 'nonexistent'
option PasswordAuth 'on'

config dropbear
option Port '22'
option Interface 'wan'
option PasswordAuth 'off'
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH procd 4/8] Fix scroll lock blocking procd

2014-10-06 Thread John Crispin

On 02/10/2014 14:56, Michel Stam wrote:
 diff --git a/procd.c b/procd.c
 index 6ec7cd0..32febd6 100644
 --- a/procd.c
 +++ b/procd.c
 @@ -16,6 +16,7 @@
  #include sys/types.h
  #include sys/stat.h
  
 +#include fcntl.h
  #include unistd.h
  #include getopt.h
  #include libgen.h
 @@ -61,6 +62,7 @@ int main(int argc, char **argv)
   return usage(argv[0]);
   }
   }
 + fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) | 
 O_NONBLOCK);

i have moved this line to initd/early.c where the rest of the
stdin/out/err happens. procd inherits the fds from the preinit and i
assume the fcntl is persitent. can you verify that this is the case
please once i pushed the changes ?


   uloop_init();
   uloop_release_sigint();
   procd_signal();
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Barrier Breaker 14.07 Final

2014-10-06 Thread Andre Valentin

Hi!

Thank you very much for this great work!

André



Mit freundlichen Grüßen
André Valentin
Systemadministrator
--
Internet * Netzwerk * Mobile Daten
Citrix Silver Solution Advisor

Ausserhalb unserer Geschäftszeiten (Montag bis Freitag von 8:30 Uhr bis
17:30 Uhr, ausgenommen gesetzliche Feiertage in NRW) stehen wir Ihnen
gemäß Ihrer jeweiligen Service-Level-Agreements unter der Ihnen
mitgeteilten Telefonnummer für Störungen und Notfälle zur Verfügung.
Sie können natürlich auch gerne jederzeit unter supp...@marcant.net ein
Ticket eröffnen, welches am nächsten Arbeitstag bearbeitet wird.

MarcanT GmbH, Ravensberger Str. 10 G, D - 33602 Bielefeld
Fon: +49 (521) 95945-0 | Fax -18
URL: http://www.marcant.net | http://www.global-m2m.com

Geschäftsführer: Thorsten Hojas
Handelsregister: AG Bielefeld, HRB 35827 USt-ID Nr.: DE 190203238
___
CONFIDENTIALITY NOTICE
The contents of this email are confidential to the ordinary user of the email
address to which it was addressed and may also be privileged. If you are not
the addressee of this email you may not copy, forward, disclose or otherwise
use it or any part of it in any form whatsoever. If you have received this
email in error please email the sender by replying to this message.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: qihoo-c301: reset imageNtrynum after each successful boot.

2014-10-06 Thread John Crispin

On 14/09/2014 02:27, Yousong Zhou wrote:
 Qihoo C301 has 2 flash chips of which one is used as primary and the
 other is used as backup.  OEM U-Boot will try to boot an activeregion N
 with imageNstatus=0 and imageNtrynum = imagemaxtry.  If such a region
 is found, bootloader will try to increment imageNtrynum and boot it.

 This patch tries to reset imageNtrynum after each successful boot (if
 the boot process reaches the execution of /etc/init.d/done).

   root@OpenWrt:/# hexdump -C -n 128 /dev/mtdblock9
     9e f3 63 91 61 63 74 69  76 65 72 65 67 69 6f 6e  
 |..c.activeregion|
   0010  3d 31 00 69 6d 61 67 65  31 73 74 61 74 75 73 3d  
 |=1.image1status=|
   0020  30 00 69 6d 61 67 65 32  73 74 61 74 75 73 3d 30  
 |0.image2status=0|
   0030  00 69 6d 61 67 65 32 74  72 79 6e 75 6d 3d 30 00  
 |.image2trynum=0.|
   0040  69 6d 61 67 65 6d 61 78  74 72 79 3d 33 00 69 6d  
 |imagemaxtry=3.im|
   0050  61 67 65 31 74 72 79 6e  75 6d 3d 30 00 00 00 00  
 |age1trynum=0|
   0060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
 ||

 Signed-off-by: Yousong Zhou yszhou4t...@gmail.com

do we need this patch and the one made by swigger ? it seems his patch
write the crc32 somewhere and your patch resets the uboot-env.




 ---
  package/boot/uboot-envtools/files/ar71xx   |3 +++
  target/linux/ar71xx/base-files/etc/diag.sh |6 ++
  2 files changed, 9 insertions(+)

 diff --git a/package/boot/uboot-envtools/files/ar71xx 
 b/package/boot/uboot-envtools/files/ar71xx
 index 5deed9c..f660883 100644
 --- a/package/boot/uboot-envtools/files/ar71xx
 +++ b/package/boot/uboot-envtools/files/ar71xx
 @@ -41,6 +41,9 @@ om2p-lc)
  wzr-hp-ag300h)
   ubootenv_add_uci_config /dev/mtd3 0x0 0x1 0x1
   ;;
 +qihoo-c301)
 + ubootenv_add_uci_config /dev/mtd9 0x0 0x1 0x1
 + ;;
  esac
  
  config_load ubootenv
 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index ac7e20d..c7c6233 100755
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -294,6 +294,12 @@ set_state() {
   ;;
   done)
   status_led_on
 + case $(ar71xx_board_name) in
 + qihoo-c301)
 + local n=$(fw_printenv activeregion | cut -d = -f 2)
 + fw_setenv image${n}trynum 0
 + ;;
 + esac
   ;;
   esac
  }
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] base-files: add network_get_ipaddrs_all()

2014-10-06 Thread Bastian Bittorf
* Mathias Kresin open...@kresin.me [06.10.2014 20:23]:
 +network_get_ipaddrs_all() {
 + local __addr
 + local __list=

1)
is there a special reason for starting everything with '__'?
(the vars are local anyway).

2)
is there a special reason not to name the vars $1 and $2? e.g.

local dest_var=$1
local interface=$2

3)
why you append a '1' to the list if it's IPv6? (make it clear in the code)

4)
use a special var for the list and for the element of the list.
(for __addr in $__addr; do - for ELEMENT in $LIST)

 + if __network_ifstatus __addr $2 
 ['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address; then
 + for __addr in $__addr; do
 + case $__addr in
 + *:) __list=${__list:+$__list }${__addr}1 ;;
 + *)  __list=${__list:+$__list }${__addr}  ;;
 + esac
 + done
 +
 + export $1=$__list
 + return 0
 + fi
 +
 + unset $1
 + return 1
 +}

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


Re: [OpenWrt-Devel] [PATCH] at91: remove support for TQMa9263

2014-10-06 Thread Michael Heimpold
Hi John,

Am Freitag, 3. Oktober 2014, 21:43:29 schrieb John Crispin:
 EOL as in not produced anymore or has no existing users ?
 

Both is true.

 On 23/09/2014 21:33, Michael Heimpold wrote:
  This board is EOL, we should not bother anymore with it.
  
  Signed-off-by: Michael Heimpold m...@heimpold.de --- 

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



[OpenWrt-Devel] [PATCH] cns3xxx: fix shared PCI interrupt mapping

2014-10-06 Thread Pushpal Sidhu
This patch originally failed to combine INTA/B/C/D onto a single ARM CPU
interrupt. Instead, it mapped INTA/B/C and excluded D. This patch
corrects the issue by mapping all four interrupts to the single ARM CPU
interrupt. The original intent of the patch still holds as the newer PCB
take advantage of isolated interrupts. This fix only applies to older
PCB's that do not route INTA/B/C/D to unique external ARM CPU
interrupts.

Signed-off-by: Pushpal Sidhu psi...@gateworks.com
---
 .../linux/cns3xxx/patches-3.10/310-pci_isolated_interrupts.patch   | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/target/linux/cns3xxx/patches-3.10/310-pci_isolated_interrupts.patch 
b/target/linux/cns3xxx/patches-3.10/310-pci_isolated_interrupts.patch
index 03f0009..d181cc2 100644
--- a/target/linux/cns3xxx/patches-3.10/310-pci_isolated_interrupts.patch
+++ b/target/linux/cns3xxx/patches-3.10/310-pci_isolated_interrupts.patch
@@ -30,7 +30,7 @@
  #include linux/gpio.h
  #include linux/dma-mapping.h
  #include linux/serial_core.h
-@@ -869,12 +870,45 @@ static int laguna_register_gpio(struct g
+@@ -869,12 +870,42 @@ static int laguna_register_gpio(struct g
return ret;
  }
  
@@ -70,10 +70,7 @@
 +  }
 +  printk(laguna: using shared PCI interrupts: irq%d\n,
 + IRQ_CNS3XXX_PCIE0_DEVICE);
-+  irqs[0] = IRQ_CNS3XXX_PCIE0_DEVICE;
-+  irqs[1] = IRQ_CNS3XXX_PCIE0_DEVICE;
-+  irqs[2] = IRQ_CNS3XXX_PCIE0_DEVICE;
-+  return cns3xxx_pcie_init(irqs, NULL);
++  return cns3xxx_pcie_init(NULL, NULL);
  }
  subsys_initcall(laguna_pcie_init);
  
-- 
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] [Cerowrt-devel] [RFC PATCH] packages: Smart Queue Management for AQM Packet Scheduling and Qos from CeroWrt

2014-10-06 Thread Sebastian Moeller
Hi Richard,


On Oct 6, 2014, at 18:02 , Richard A. Smith rich...@laptop.org wrote:

 On 10/02/2014 10:05 AM, Sebastian Moeller wrote:
 
  I assume you are talking about the pure routing performance with no 
 firewall/NAT and traffic-shaping involved? I think they pretty much are 
 equal (pretty much the same kernel and most of the cerowrt guts are from 
 openwrt bb trunk). But I have not tested that (I have only one 
 cerowrt/openwrt capable router and that pretty much is my main router).
  If you are talking about comparing QOS-scripts with SQM-scripts, they 
 also seem to top out at roughly 50-60 Mbps (down- and uplink combined), it 
 seems hfsc (qos-scripts) and HTB (sam-scripts) are equally expensive on MIPS.
  Now if you are setup to do tests yourself I would love to hear the 
 results. I would be happy to help you getting SQM-scripts to work (so far 
 all people interested disappeared before or just after sharing initial test 
 results).
 
 Do you still need testers?  I have a bit of an interest here.

Oh, sure every little bit of testing is helpful (especially on openwrt, 
as I am not setup to test openwrt at all). I might be that SQM-scripts will 
explode spectacularly, but I hope that there is only a little 
“impedance-mismatch” ;)

 
 I have spare routers that I can run OpenWRT or CeroWRt on and I'm setup to 
 test with netperf, netperf-wrapper on my local network
 ( desktop - router - laptop )  it's Gbit so I can easily saturate the 
 router.

That sounds great. I think the first test should be to run SQM under 
cerowrt, so you get a feel of how things should look. I typically run 
netperf-wrapper rrul tests (for ipv4 and if available for ipv6) through cerowrt 
with different settings for SQM. A second step then is to instal SQM-scripts 
under openwrt and check whether the same settings produce the same results ;)

 
 What I don't have is a lot of time but I can do a few runs in the evenings or 
 on weekends.  

I think all that is needed is testing a few relevant shaping bandwidth 
combinations (always Downlink/Uplink, 3000Kbps/512Kbps, 16000Kbps/1000Kbps, 
5Kbps/1Kbps, 10Kbps/4Kbps, and 0/5Kbps, with a setting of 0 
disabling shaping in a particular direction, 0/5Kbps with the ethernet 
interface set 100Mbps, and with SQM disabled: pick the test set most relevant 
to your planned deployment to save time) And finally it would be great to test 
whether the ATM link layer encapsulation also works…
Basically that is the set of things to test, but the most important is 
just testing one of them to see hw SQM-scripts (and luci-app-sqm works under 
stock openwrt)


 I also am very out of touch with the latest and greatest QoS vs SQM 
 development and configuration so you will have to feed me test recipes.

Oh, happy to help out with this, thanks to Toke’s netperf-wrapper my 
tests typically look like (for say 3000Kbps/512Kbps):
date ; ping -c 10 netperf-eu.bufferbloat.net ; ./netperf-wrapper --ipv4 -l 300 
-s 0.4 -H netperf-eu.bufferbloat.net rrul -p all_scaled --disable-log -t 
IPv4_test_D3000Kbps-U512Kbps

followed by:
date ; ping -c 10 netperf-eu.bufferbloat.net ; ./netperf-wrapper --ipv6 -l 300 
-s 0.4 -H netperf-eu.bufferbloat.net rrul -p all_scaled --disable-log -t 
IPv6_test_D3000Kbps-U512Kbps

for links faster than ~5Mbps or so you can skip the -s 0.4 line and for links 
slower than 2Mbps you probably need rouse -s 0.8 or even -s 1.0, running for 5 
minutes (-l 300) makes sure you can also judge the robustness/stability of the 
shaping...
And then simply load the resulting output files in netperf-wrapper’s GUI to 
simplify comparison between the different SQM settings (and since these tests 
work independent of the used shaper you could also run the relevant shaper 
settings for your own situation through QOS. So you can compare how these two 
stack up against each other…)
It might be a good idea to capture the output of:
logread
and:
tc -d qdisc
and
tc class show dev ge00 (for cerowrt, “tc class show dev wan” for openwrt, I 
believe)
before each test run on the router (this allows to confirm whether the selected 
shaper settings actually were applied properly)

I also, very unscientifically, ssh into the router while the tests are running 
and start “top -d 1” and visually monitor the %idle and %sirq (softinterrupts), 
the first goes to 0% and the second to 90% once you reached the your router’s 
shaping limit.

So just let me know what you are willing/ready to test and we will take it from 
there okay? (I would already be a happy camper if you could just install the 
current SQM-scripts on openwrt and just send me the output of “logread” after 
installing and activating SQM, as well as the output from “tc -d qdisc” before 
and after enabling SQM, and finally the output of running “/etc/init.d/sqm stop 
; /etc/init.d/sqm start” on the router’s console; that hopefully works or at 
least gives some indication 

Re: [OpenWrt-Devel] [PATCH 1/2] base-files: add network_get_ipaddrs_all()

2014-10-06 Thread Mathias Kresin
Hi Bastian,

the short answer for all your questions is: Because all the existing
functions in network.sh are written this way. The function I would
like to introduce is a dupe of network_get_ipaddrs6() which is a dupe
of network_get_ipaddr6(). All three functions only differ by the value
which is passed to jsonfilter later on.

2014-10-06 20:54 GMT+02:00 Bastian Bittorf bitt...@bluebottle.com:
 1)
 is there a special reason for starting everything with '__'?
 (the vars are local anyway).
To be honest. I don't know why its done this way. Maybe someone can
enlighten me.

 2)
 is there a special reason not to name the vars $1 and $2? e.g.

 local dest_var=$1
 local interface=$2

 3)
 why you append a '1' to the list if it's IPv6? (make it clear in the code)

 4)
 use a special var for the list and for the element of the list.
 (for __addr in $__addr; do - for ELEMENT in $LIST)

 + if __network_ifstatus __addr $2 
 ['ipv4-address','ipv6-address','ipv6-prefix-assignment'][*].address; then
 + for __addr in $__addr; do
 + case $__addr in
 + *:) __list=${__list:+$__list }${__addr}1 ;;
 + *)  __list=${__list:+$__list }${__addr}  ;;
 + esac
 + done
 +
 + export $1=$__list
 + return 0
 + fi
 +
 + unset $1
 + return 1
 +}
I'm with you. It would improve the readability. But as already said,
that's the coding style of the existing functions...


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


Re: [OpenWrt-Devel] [PATCH] Add download mirrors for tools from GNU Savannah (bug #15184)

2014-10-06 Thread John Crispin

On 23/09/2014 18:07, Hannu Nyman wrote:
 The attached patch adds three download mirrors for tools from GNU
 Savannah, quilt and qemu.

 GNU Savannah's download mirrorring system seems to always assign you
 to the same mirror, so there is no round-robin logic. If that mirror
 is down, you will not get the download at all unless it has been
 uploaded to mirror2.openwrt.org.

 As discussed in bug #15184 (https://dev.openwrt.org/ticket/15184)
 related to quilt, download mirrors could be added for the Savannah tools.

 I have tested downloading both tools via Makefile from all three added
 mirrors.


can you make this work like @SF_NET and then make a second patch to fix
up all other users to use the @SAVANNAH syntax ?




 Signed-off-by: Hannu Nyman hannu.ny...@iki.fi



 ___
 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] [PATCH] Add download mirrors for tools from GNU Savannah (bug #15184)

2014-10-06 Thread Hannu Nyman

John Crispin wrote at Mon Oct 6 22:04:07 CEST 2014:
 can you make this work like @SF_NET and then make a second patch to fix
 up all other users to use the @SAVANNAH syntax ?

Patch v2:
I defined a new download method @SAVANNAH in include/download.mk and 
scripts/download.pl,

and converted quilt and qemu to use that method.

Signed-off-by: Hannu Nyman hannu.ny...@iki.fi

Index: include/download.mk
===
--- include/download.mk (revision 42806)
+++ include/download.mk (working copy)
@@ -11,7 +11,7 @@
 define dl_method
 $(strip \
   $(if $(2),$(2), \
-$(if $(filter @GNOME/% @GNU/% @KERNEL/% @SF/% ftp://% http://% https://% 
file://%,$(1)),default, \
+$(if $(filter @GNOME/% @GNU/% @KERNEL/% @SF/% @SAVANNAH/% ftp://% http://% 
https://% file://%,$(1)),default, \
   $(if $(filter git://%,$(1)),git, \
 $(if $(filter svn://%,$(1)),svn, \
   $(if $(filter cvs://%,$(1)),cvs, \
Index: scripts/download.pl
===
--- scripts/download.pl (revision 42806)
+++ scripts/download.pl (working copy)
@@ -157,6 +157,11 @@
push @mirrors, ftp://ftp.belnet.be/mirror/ftp.gnu.org/gnu/$1;;
push @mirrors, ftp://ftp.mirror.nl/pub/mirror/gnu/$1;;
push @mirrors, http://mirror.switch.ch/ftp/mirror/gnu/$1;;
+   } elsif ($mirror =~ /^\@SAVANNAH\/(.+)$/) {
+   push @mirrors, http://download.savannah.gnu.org/releases/$1;;
+   push @mirrors, http://nongnu.uib.no/$1;;
+   push @mirrors, http://ftp.igh.cnrs.fr/pub/nongnu/$1;;
+   push @mirrors, 
http://download-mirror.savannah.gnu.org/releases/$1;;
} elsif ($mirror =~ /^\@KERNEL\/(.+)$/) {
my @extra = ( $1 );
if ($filename =~ /linux-\d+\.\d+(?:\.\d+)?-rc/) {
Index: tools/qemu/Makefile
===
--- tools/qemu/Makefile (revision 42806)
+++ tools/qemu/Makefile (working copy)
@@ -10,7 +10,7 @@
 PKG_VERSION:=0.14.1
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/qemu/
+PKG_SOURCE_URL:=@SAVANNAH/qemu
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_MD5SUM:=b6c713a8db638e173af53a62d5178640
 
Index: tools/quilt/Makefile
===
--- tools/quilt/Makefile(revision 42806)
+++ tools/quilt/Makefile(working copy)
@@ -10,7 +10,7 @@
 PKG_VERSION:=0.63
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/$(PKG_NAME)
+PKG_SOURCE_URL:=@SAVANNAH/quilt
 PKG_MD5SUM:=c0ef4beb58a6fa72563b955e70624b6e
 
 include $(INCLUDE_DIR)/host-build.mk
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] rb532: switch to 3.14 and ath5k

2014-10-06 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin ro...@advem.lv
---
 target/linux/rb532/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/rb532/Makefile b/target/linux/rb532/Makefile
index 3fda24b..e07afc1 100644
--- a/target/linux/rb532/Makefile
+++ b/target/linux/rb532/Makefile
@@ -11,9 +11,9 @@ BOARD:=rb532
 BOARDNAME:=Mikrotik RouterBoard 532
 FEATURES:=pci targz
 
-LINUX_VERSION:=3.10.49
+LINUX_VERSION:=3.14.18
 
 include $(INCLUDE_DIR)/target.mk
-DEFAULT_PACKAGES += wpad-mini kmod-madwifi kmod-input-rb532
+DEFAULT_PACKAGES += wpad-mini kmod-ath5k kmod-input-rb532
 
 $(eval $(call BuildTarget))
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] rb532: add 3.14 support

2014-10-06 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin ro...@advem.lv
---
 target/linux/rb532/config-3.14 | 148 +
 .../rb532/patches-3.14/001-cmdline_hack.patch  |  20 +++
 .../rb532/patches-3.14/002-rb532_nand_fixup.patch  |  47 +++
 .../003-MIPS-rc32434-fix-broken-pci-init.patch |  37 ++
 ...tion_info-rename-rootfs-to-rootfs_onboard.patch |  11 ++
 5 files changed, 263 insertions(+)
 create mode 100644 target/linux/rb532/config-3.14
 create mode 100644 target/linux/rb532/patches-3.14/001-cmdline_hack.patch
 create mode 100644 target/linux/rb532/patches-3.14/002-rb532_nand_fixup.patch
 create mode 100644 
target/linux/rb532/patches-3.14/003-MIPS-rc32434-fix-broken-pci-init.patch
 create mode 100644 
target/linux/rb532/patches-3.14/004-rb532_partition_info-rename-rootfs-to-rootfs_onboard.patch

diff --git a/target/linux/rb532/config-3.14 b/target/linux/rb532/config-3.14
new file mode 100644
index 000..d14a04f
--- /dev/null
+++ b/target/linux/rb532/config-3.14
@@ -0,0 +1,148 @@
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ATA=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CEVT_R4K=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_NONCOHERENT=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+CONFIG_EXT4_FS=y
+CONFIG_FS_MBCACHE=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_DEVRES=y
+CONFIG_GPIO_SYSFS=y
+# CONFIG_HAMRADIO is not set
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_HW_HAS_PCI=y
+CONFIG_HW_RANDOM=y
+CONFIG_HZ=250
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+CONFIG_HZ_PERIODIC=y
+CONFIG_IMAGE_CMDLINE_HACK=y
+CONFIG_INITRAMFS_SOURCE=
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_JBD2=y
+CONFIG_KEXEC=y
+CONFIG_KORINA=y
+CONFIG_LEDS_MIKROTIK_RB532=y
+CONFIG_MIKROTIK_RB532=y
+CONFIG_MIPS=y
+# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
+CONFIG_MIPS_L1_CACHE_SHIFT=4
+# CONFIG_MIPS_MACHINE is not set
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_O32_FP64_SUPPORT is not set
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MTD_BLOCK2MTD=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_CFI_INTELEXT is not set
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_PLATFORM=y
+CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_ROOTFS_ROOT_DEV is not set
+CONFIG_MTD_ROOTFS_SPLIT=y
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_SPLIT is not set
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PATA_RB532=y
+CONFIG_PCI=y
+CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PERF_USE_VMALLOC=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_RC32434_WDT=y
+# CONFIG_RCU_STALL_COMMON is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_PROC_FS is not set
+# CONFIG_SWAP is not set
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_UIDGID_CONVERTED=y
+CONFIG_USB_ARCH_HAS_XHCI=y
+CONFIG_VIA_RHINE=y
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_YAFFS_9BYTE_TAGS=y
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_BACKGROUND is not set
+# 

[OpenWrt-Devel] [PATCH 2/3] generic: fix yaffs compilation on 3.14

2014-10-06 Thread Roman Yeryomin
Signed-off-by: Roman Yeryomin ro...@advem.lv
---
 .../503-yaffs-add-tags-9bytes-mount-option.patch | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/target/linux/generic/patches-3.14/503-yaffs-add-tags-9bytes-mount-option.patch
 
b/target/linux/generic/patches-3.14/503-yaffs-add-tags-9bytes-mount-option.patch
index 5a15b51..88531a6 100644
--- 
a/target/linux/generic/patches-3.14/503-yaffs-add-tags-9bytes-mount-option.patch
+++ 
b/target/linux/generic/patches-3.14/503-yaffs-add-tags-9bytes-mount-option.patch
@@ -80,7 +80,15 @@ Signed-off-by: Gabor Juhos juh...@openwrt.org
if (options.lazy_loading_overridden)
 --- a/fs/yaffs2/yaffs_mtdif.c
 +++ b/fs/yaffs2/yaffs_mtdif.c
-@@ -276,7 +276,8 @@ struct mtd_info * yaffs_get_mtd_device(d
+@@ -16,6 +16,7 @@
+ #include yaffs_mtdif.h
+
+ #include linux/mtd/mtd.h
++#include uapi/linux/major.h
+ #include linux/types.h
+ #include linux/time.h
+ #include linux/mtd/nand.h
+@@ -277,7 +277,8 @@ struct mtd_info * yaffs_get_mtd_device(d
return mtd;
  }
  
@@ -90,7 +98,7 @@ Signed-off-by: Gabor Juhos juh...@openwrt.org
  {
if (yaffs_version == 2) {
if ((WRITE_SIZE(mtd)  YAFFS_MIN_YAFFS2_CHUNK_SIZE ||
-@@ -295,6 +296,12 @@ int yaffs_verify_mtd(struct mtd_info *mt
+@@ -296,6 +297,12 @@ int yaffs_verify_mtd(struct mtd_info *mt
);
return -1;
}
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel