[LEDE-DEV] ar71xx - please help test

2016-06-21 Thread John Crispin
Hi,

i have moved all the profiles into the image building code. i have done
some basic testing and already got a bit of feedback from others.

it would be nice if people could help test the following patch from my
staging tree

https://git.lede-project.org/?p=lede/blogic/staging.git;a=commit;h=75773d43cd44ee70e293343fad11db654c35a4ed

John

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [OpenWrt-Devel] MPTCP

2016-06-21 Thread Juliusz Chroboczek
> I'm now having a highly experimental version of MPTCP (as a package) for
> 15.05, (and one that builds on my old dirty trunk with the old
> patches-4.1 still i place)

Just to make sure people don't get confused -- MP-TCP doesn't need router
support, and OpenWRT/LEDE is quite able to route MP-TCP traffic flowing
through it out of the box.

MP-TCP on the router is only needed for traffic that terminates at the
router.  It's a good idea e.g. if you're running a web server on your
router.

-- Juliusz



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] ar71xx - please help test

2016-06-21 Thread Dat Le

Hi,

I will test Compex products WPJ342, WPJ344, WPJ531 and WPJ558.

By the way, please let us* know if you are interested in testing Compex 
products or fixing LEDE bugs for Compex products, we shall arrange you 
sample accordingly.


us = huibo_...@compex.com.sg or dat...@compex.com.sg

Thanks,
Dat

On 6/21/2016 4:23 PM, John Crispin wrote:

Hi,

i have moved all the profiles into the image building code. i have done
some basic testing and already got a bit of feedback from others.

it would be nice if people could help test the following patch from my
staging tree

https://git.lede-project.org/?p=lede/blogic/staging.git;a=commit;h=75773d43cd44ee70e293343fad11db654c35a4ed

John

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH libubox 2/3] loop: make uloop_run() return the cancelling signal

2016-06-21 Thread Jo-Philipp Wich
On 06/20/2016 09:59 AM, Matthias Schiffer wrote:
> When a process quits in response to a signal it handles, it should to so
> be re-sending the signal to itself. This especially important for SIGINT,
> as is explained in [1].
> 
> uloop currently hides the reason for quitting uloop_run(). Fix this by
> returning the signal that caused the loop to quit (or 0 when uloop_end()
> was used), so a program using loop an comply with [1].
> 
> uloop_cancelled is renamed to uloop_status, so accidentially running a
> process compiled with one uloop_cancelled definition against the other is
> not possible.
> 
> [1] https://www.cons.org/cracauer/sigint.html
> 
> Signed-off-by: Matthias Schiffer 
Acked-by: Jo-Philipp Wich 
> ---
>  uloop.c | 14 --
>  uloop.h |  6 +++---
>  2 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/uloop.c b/uloop.c
> index cd3de85..fa3544d 100644
> --- a/uloop.c
> +++ b/uloop.c
> @@ -57,7 +57,7 @@ static struct list_head timeouts = LIST_HEAD_INIT(timeouts);
>  static struct list_head processes = LIST_HEAD_INIT(processes);
>  
>  static int poll_fd = -1;
> -bool uloop_cancelled = false;
> +int uloop_status = -1;
>  static bool do_sigchld = false;
>  
>  static struct uloop_fd_event cur_fds[ULOOP_MAX_EVENTS];
> @@ -330,7 +330,7 @@ static void uloop_handle_processes(void)
>  
>  static void uloop_handle_sigint(int signo)
>  {
> - uloop_cancelled = true;
> + uloop_status = signo;
>  }
>  
>  static void uloop_sigchld(int signo)
> @@ -443,7 +443,7 @@ static void uloop_clear_processes(void)
>   uloop_process_delete(p);
>  }
>  
> -void uloop_run(void)
> +int uloop_run(void)
>  {
>   static int recursive_calls = 0;
>   struct timeval tv;
> @@ -455,8 +455,8 @@ void uloop_run(void)
>   if (!recursive_calls++)
>   uloop_setup_signals(true);
>  
> - uloop_cancelled = false;
> - while(!uloop_cancelled)
> + uloop_status = -1;
> + while (uloop_status < 0)
>   {
>   uloop_gettime(&tv);
>   uloop_process_timeouts(&tv);
> @@ -464,7 +464,7 @@ void uloop_run(void)
>   if (do_sigchld)
>   uloop_handle_processes();
>  
> - if (uloop_cancelled)
> + if (uloop_status >= 0)
>   break;
>  
>   uloop_gettime(&tv);
> @@ -473,6 +473,8 @@ void uloop_run(void)
>  
>   if (!--recursive_calls)
>   uloop_setup_signals(false);
> +
> + return uloop_status;
>  }
>  
>  void uloop_done(void)
> diff --git a/uloop.h b/uloop.h
> index 7564514..4d87d46 100644
> --- a/uloop.h
> +++ b/uloop.h
> @@ -83,7 +83,7 @@ struct uloop_process
>   pid_t pid;
>  };
>  
> -extern bool uloop_cancelled;
> +extern int uloop_status;
>  extern bool uloop_handle_sigchld;
>  
>  int uloop_fd_add(struct uloop_fd *sock, unsigned int flags);
> @@ -99,11 +99,11 @@ int uloop_process_delete(struct uloop_process *p);
>  
>  static inline void uloop_end(void)
>  {
> - uloop_cancelled = true;
> + uloop_status = 0;
>  }
>  
>  int uloop_init(void);
> -void uloop_run(void);
> +int uloop_run(void);
>  void uloop_done(void);
>  
>  #endif
> 


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH libubox 1/3] Fix various memory management issues

2016-06-21 Thread Jo-Philipp Wich
Hi,

first of all, thanks for putting work into that - I like the changes in
general. Have a few comments inline below.

~ Jo

> Consistently handle allocation failures. Some functions are changed to
> return bool instead of void to allow returning an error.
> 
> Also fix a buffer size miscalculation in lua/uloop.
> 
> Signed-off-by: Matthias Schiffer 
> ---
>  blobmsg.c  | 20 +++-
>  blobmsg.h  |  4 ++--
>  blobmsg_json.c | 26 +++---
>  jshn.c |  4 
>  json_script.c  | 17 +++--
>  kvlist.c   | 11 ---
>  kvlist.h   |  2 +-
>  lua/uloop.c|  5 -
>  ustream.c  |  7 +++
>  utils.c|  2 ++
>  10 files changed, 77 insertions(+), 21 deletions(-)
> 
> diff --git a/blobmsg.c b/blobmsg.c
> index 80b984a..1529fbc 100644
> --- a/blobmsg.c
> +++ b/blobmsg.c
> @@ -227,29 +227,38 @@ blobmsg_open_nested(struct blob_buf *buf, const char 
> *name, bool array)
>   return (void *)offset;
>  }
>  
> -void
> +bool
>  blobmsg_vprintf(struct blob_buf *buf, const char *name, const char *format, 
> va_list arg)
>  {
>   va_list arg2;
>   char cbuf;
> + char *sbuf;
>   int len;
>  
>   va_copy(arg2, arg);
>   len = vsnprintf(&cbuf, sizeof(cbuf), format, arg2);
>   va_end(arg2);
>  
> - vsprintf(blobmsg_alloc_string_buffer(buf, name, len + 1), format, arg);
> + sbuf = blobmsg_alloc_string_buffer(buf, name, len + 1);
> + if (!sbuf)
> + return false;
> + vsprintf(sbuf, format, arg);
>   blobmsg_add_string_buffer(buf);
> +
> + return true;

The vsprintf() we're wrapping here returns the number of bytes written,
which is useful imho. What about returning >= 0 bytes for success and -1
for error (alloc fail) ?

>  }
>  
> -void
> +bool
>  blobmsg_printf(struct blob_buf *buf, const char *name, const char *format, 
> ...)
>  {
>   va_list ap;
> + bool ret;
>  
>   va_start(ap, format);
> - blobmsg_vprintf(buf, name, format, ap);
> + ret = blobmsg_vprintf(buf, name, format, ap);
>   va_end(ap);
> +
> + return ret;

Same, if we decide to return the bytes in blobmsg_vprintf() we need to
adjust the return type here.

>  }
>  
>  void *
> @@ -278,7 +287,8 @@ blobmsg_realloc_string_buffer(struct blob_buf *buf, 
> unsigned int maxlen)
>   if (required <= 0)
>   goto out;
>  
> - blob_buf_grow(buf, required);
> + if (!blob_buf_grow(buf, required))
> + return NULL;
>   attr = blob_next(buf->head);
>  
>  out:
> diff --git a/blobmsg.h b/blobmsg.h
> index e58f95d..7153565 100644
> --- a/blobmsg.h
> +++ b/blobmsg.h
> @@ -224,8 +224,8 @@ void *blobmsg_alloc_string_buffer(struct blob_buf *buf, 
> const char *name, unsign
>  void *blobmsg_realloc_string_buffer(struct blob_buf *buf, unsigned int 
> maxlen);
>  void blobmsg_add_string_buffer(struct blob_buf *buf);
>  
> -void blobmsg_vprintf(struct blob_buf *buf, const char *name, const char 
> *format, va_list arg);
> -void blobmsg_printf(struct blob_buf *buf, const char *name, const char 
> *format, ...)
> +bool blobmsg_vprintf(struct blob_buf *buf, const char *name, const char 
> *format, va_list arg);
> +bool blobmsg_printf(struct blob_buf *buf, const char *name, const char 
> *format, ...)
>   __attribute__((format(printf, 3, 4)));
>  
>  
> diff --git a/blobmsg_json.c b/blobmsg_json.c
> index 5713948..33f3969 100644
> --- a/blobmsg_json.c
> +++ b/blobmsg_json.c
> @@ -123,10 +123,13 @@ static bool blobmsg_puts(struct strbuf *s, const char 
> *c, int len)
>   return true;
>  
>   if (s->pos + len >= s->len) {
> - s->len += 16 + len;
> - s->buf = realloc(s->buf, s->len);
> - if (!s->buf)
> + size_t new_len = s->len + 16 + len;
> + char *new = realloc(s->buf, new_len);

Can we move the declarations to the top of the function and avoid "new"
as it is a C++ reserved word? You could call them "buf" and "buf_len" or
"cpy" and "cpy_len" maybe.

> + if (!new)
>   return false;
> +
> + s->len = new_len;
> + s->buf = new;
>   }
>   memcpy(s->buf + s->pos, c, len);
>   s->pos += len;
> @@ -290,14 +293,18 @@ char *blobmsg_format_json_with_cb(struct blob_attr 
> *attr, bool list, blobmsg_jso
>  {
>   struct strbuf s;
>   bool array;
> + char *ret;
>  
>   s.len = blob_len(attr);
> - s.buf = malloc(s.len);
>   s.pos = 0;
>   s.custom_format = cb;
>   s.priv = priv;
>   s.indent = false;
>  
> + s.buf = malloc(s.len);
> + if (!s.buf)
> + return NULL;
> +
>   if (indent >= 0) {
>   s.indent = true;
>   s.indent_level = indent;
> @@ -316,8 +323,13 @@ char *blobmsg_format_json_with_cb(struct blob_attr 
> *attr, bool list, blobmsg_jso
>   return NULL;
>   }
>  
> - s.buf = realloc(s.buf, s.pos + 1);
> - s.buf[s.pos] = 0;
> + ret 

Re: [LEDE-DEV] [PATCH libubox 3/3] blobmsg_json: add new functions blobmsg_format_json_value*

2016-06-21 Thread Jo-Philipp Wich
On 06/20/2016 09:59 AM, Matthias Schiffer wrote:
> The current blobmsg_format_json* functions will return invalid JSON when
> the "list" argument is given as false (blobmsg_format_element() will
> output the name of the blob_attr as if the value is printed as part of a
> JSON object).
> 
> To avoid breaking software relying on this behaviour, introduce new
> functions which will never print the blob_attr name and thus always
> produce valid JSON.
> 
> Signed-off-by: Matthias Schiffer 
Acked-by: Jo-Philipp Wich 
> ---
>  blobmsg_json.c | 61 
> --
>  blobmsg_json.h | 14 ++
>  2 files changed, 61 insertions(+), 14 deletions(-)
> 
> diff --git a/blobmsg_json.c b/blobmsg_json.c
> index 33f3969..115d575 100644
> --- a/blobmsg_json.c
> +++ b/blobmsg_json.c
> @@ -210,7 +210,7 @@ static void blobmsg_format_string(struct strbuf *s, const 
> char *str)
>  
>  static void blobmsg_format_json_list(struct strbuf *s, struct blob_attr 
> *attr, int len, bool array);
>  
> -static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, 
> bool array, bool head)
> +static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, 
> bool without_name, bool head)
>  {
>   const char *data_str;
>   char buf[32];
> @@ -220,7 +220,7 @@ static void blobmsg_format_element(struct strbuf *s, 
> struct blob_attr *attr, boo
>   if (!blobmsg_check_attr(attr, false))
>   return;
>  
> - if (!array && blobmsg_name(attr)[0]) {
> + if (!without_name && blobmsg_name(attr)[0]) {
>   blobmsg_format_string(s, blobmsg_name(attr));
>   blobmsg_puts(s, ": ", s->indent ? 2 : 1);
>   }
> @@ -289,27 +289,30 @@ static void blobmsg_format_json_list(struct strbuf *s, 
> struct blob_attr *attr, i
>   blobmsg_puts(s, (array ? "]" : "}"), 1);
>  }
>  
> +static void setup_strbuf(struct strbuf *s, struct blob_attr *attr, 
> blobmsg_json_format_t cb, void *priv, int indent) {
> + s->len = blob_len(attr);
> + s->buf = malloc(s->len);
> + s->pos = 0;
> + s->custom_format = cb;
> + s->priv = priv;
> + s->indent = false;
> +
> + if (indent >= 0) {
> + s->indent = true;
> + s->indent_level = indent;
> + }
> +}
> +
>  char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, 
> blobmsg_json_format_t cb, void *priv, int indent)
>  {
>   struct strbuf s;
>   bool array;
>   char *ret;
>  
> - s.len = blob_len(attr);
> - s.pos = 0;
> - s.custom_format = cb;
> - s.priv = priv;
> - s.indent = false;
> -
> - s.buf = malloc(s.len);
> + setup_strbuf(&s, attr, cb, priv, indent);
>   if (!s.buf)
>   return NULL;
>  
> - if (indent >= 0) {
> - s.indent = true;
> - s.indent_level = indent;
> - }
> -
>   array = blob_is_extended(attr) &&
>   blobmsg_type(attr) == BLOBMSG_TYPE_ARRAY;
>  
> @@ -333,3 +336,33 @@ char *blobmsg_format_json_with_cb(struct blob_attr 
> *attr, bool list, blobmsg_jso
>  
>   return ret;
>  }
> +
> +char *blobmsg_format_json_value_with_cb(struct blob_attr *attr, 
> blobmsg_json_format_t cb, void *priv, int indent)
> +{
> + struct strbuf s;
> + char *ret;
> +
> + setup_strbuf(&s, attr, cb, priv, indent);
> + if (!s.buf)
> + return NULL;
> +
> + blobmsg_format_element(&s, attr, true, false);
> +
> + if (!s.len) {
> + free(s.buf);
> + return NULL;
> + }
> +
> + s.buf = realloc(s.buf, s.pos + 1);
> + s.buf[s.pos] = 0;
> +
> + ret = realloc(s.buf, s.pos + 1);
> + if (!ret) {
> + free(s.buf);
> + return NULL;
> + }
> +
> + ret[s.pos] = 0;
> +
> + return ret;
> +}
> diff --git a/blobmsg_json.h b/blobmsg_json.h
> index cd9ed33..9dfc02d 100644
> --- a/blobmsg_json.h
> +++ b/blobmsg_json.h
> @@ -42,4 +42,18 @@ static inline char *blobmsg_format_json_indent(struct 
> blob_attr *attr, bool list
>   return blobmsg_format_json_with_cb(attr, list, NULL, NULL, indent);
>  }
>  
> +char *blobmsg_format_json_value_with_cb(struct blob_attr *attr,
> + blobmsg_json_format_t cb, void *priv,
> + int indent);
> +
> +static inline char *blobmsg_format_json_value(struct blob_attr *attr)
> +{
> + return blobmsg_format_json_value_with_cb(attr, NULL, NULL, -1);
> +}
> +
> +static inline char *blobmsg_format_json_value_indent(struct blob_attr *attr, 
> int indent)
> +{
> + return blobmsg_format_json_value_with_cb(attr, NULL, NULL, indent);
> +}
> +
>  #endif
> 


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH libubox 1/3] Fix various memory management issues

2016-06-21 Thread Matthias Schiffer
On 06/21/2016 12:32 PM, Jo-Philipp Wich wrote:
> Hi,
> 
> first of all, thanks for putting work into that - I like the changes in
> general. Have a few comments inline below.
> 
> ~ Jo
> 
>> Consistently handle allocation failures. Some functions are changed to
>> return bool instead of void to allow returning an error.
>>
>> Also fix a buffer size miscalculation in lua/uloop.
>>
>> Signed-off-by: Matthias Schiffer 
>> ---
[...]
>> @@ -316,8 +323,13 @@ char *blobmsg_format_json_with_cb(struct blob_attr 
>> *attr, bool list, blobmsg_jso
>>  return NULL;
>>  }
>>  
>> -s.buf = realloc(s.buf, s.pos + 1);
>> -s.buf[s.pos] = 0;
>> +ret = realloc(s.buf, s.pos + 1);
>> +if (!ret) {
>> +free(s.buf);
>> +return NULL;
>> +}
>>  
>> -return s.buf;
>> +ret[s.pos] = 0;
> 
> Did you forget to assign "ret" to "s.buf" here?
This one is correct as is, s is a local variable, so assigning it at the
end doesn't make sense.

> 
>> +
>> +return ret;
>>  }
[...]

Thanks for having a look, I'll fix up the rest.

Matthias





signature.asc
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] ar71xx - please help test

2016-06-21 Thread Hannu Nyman

On 21.6.2016 11:23, John Crispin wrote:

it would be nice if people could help test the following patch from my
staging tree

https://git.lede-project.org/?p=lede/blogic/staging.git;a=commit;h=75773d43cd44ee70e293343fad11db654c35a4ed


My WNDR3700/3800 firmware gets compiled ok with the patch. The same packages 
get selected and the router boots normally.


Hannu

Ps. when applying the patch, git complains about "trailing whitespace" errors...

...$ git apply p.patch
p.patch:2768: trailing whitespace.
  DEVICE_TITLE := NETGEAR WNDR3800
p.patch:2821: trailing whitespace.
  DEVICE_TITLE := PowerCloud CR3000 (No-Cloud)
p.patch:3110: trailing whitespace.
DEVICE_PACKAGES :=
...
warning: 31 lines add whitespace errors.


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] subscribe

2016-06-21 Thread Steve Elliott


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ath10k-ct: Update to latest 10.4.3 CT firmware for 9980 chipsets.

2016-06-21 Thread Jo-Philipp Wich
Hi Ben,

merged into source.git - thanks!

~ Jo

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] lantiq: fix type in new image generation

2016-06-21 Thread Jo-Philipp Wich
Hi Ben,

pushed to source.git with small typo fix in subject.

Thanks!

~ Jo

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] build: Adds the ability to disable personal initramfs build for target device

2016-06-21 Thread Сергеев Сергей

16.06.2016 22:15, Felix Fietkau пишет:

On 2016-06-16 21:04, ad...@yapic.net wrote:

From: Sergey Sergeev 

  If KERNEL_INITRAMFS := in the target/linux/*/image/Makefile->Device/%NAME% 
section is set to ''
  then personal initramfs file for this target device will not be created.
  This var is similar to the Device/Build/kernel KERNEL_INSTALL :=

Signed-off-by: Sergey Sergeev 

What devices do you need to disable initramfs for, and why?

- Felix

Hello. What about my patch? Maybe there is another correct way to 
disable build initratfs duplicate files?


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH libubox 1/3] Fix various memory management issues

2016-06-21 Thread Matthias Schiffer
On 06/21/2016 12:32 PM, Jo-Philipp Wich wrote:
> Hi,
> 
> first of all, thanks for putting work into that - I like the changes in
> general. Have a few comments inline below.
> 
> ~ Jo
> 
[...]
>> diff --git a/lua/uloop.c b/lua/uloop.c
>> index 782b5a5..db89e72 100644
>> --- a/lua/uloop.c
>> +++ b/lua/uloop.c
>> @@ -325,9 +325,12 @@ static int ul_process(lua_State *L)
>>  int argn = lua_objlen(L, -3);
>>  int envn = lua_objlen(L, -2);
>>  char** argp = malloc(sizeof(char*) * (argn + 2));
>> -char** envp = malloc(sizeof(char*) * envn + 1);
>> +char** envp = malloc(sizeof(char*) * (envn + 1));
>>  int i = 1;
>>  
>> +if (!argp || !envp)
>> +exit(-1);
> 
> A "return luaL_error(L, "Out of memory");" might be slightly more
> appropriate here.

This one is actually in the forked process. I'll change it from exit() to
_exit() to avoid affecting resources used by the parent process (and also
adjust the exit() a few lines below). I don't think it would be appropriate
to raise a Lua error in the child process.

Matthias



signature.asc
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH libubox v2 2/3] loop: make uloop_run() return the cancelling signal

2016-06-21 Thread Matthias Schiffer
When a process quits in response to a signal it handles, it should to so
be re-sending the signal to itself. This especially important for SIGINT,
as is explained in [1].

uloop currently hides the reason for quitting uloop_run(). Fix this by
returning the signal that caused the loop to quit (or 0 when uloop_end()
was used), so a program using loop an comply with [1].

[1] https://www.cons.org/cracauer/sigint.html

Signed-off-by: Matthias Schiffer 
---
v2: keep uloop_cancelled in addition to uloop_status to make libubus happy

 uloop.c | 9 +++--
 uloop.h | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/uloop.c b/uloop.c
index cd3de85..89c49a3 100644
--- a/uloop.c
+++ b/uloop.c
@@ -58,6 +58,7 @@ static struct list_head processes = LIST_HEAD_INIT(processes);
 
 static int poll_fd = -1;
 bool uloop_cancelled = false;
+static int uloop_status = 0;
 static bool do_sigchld = false;
 
 static struct uloop_fd_event cur_fds[ULOOP_MAX_EVENTS];
@@ -330,6 +331,7 @@ static void uloop_handle_processes(void)
 
 static void uloop_handle_sigint(int signo)
 {
+   uloop_status = signo;
uloop_cancelled = true;
 }
 
@@ -443,7 +445,7 @@ static void uloop_clear_processes(void)
uloop_process_delete(p);
 }
 
-void uloop_run(void)
+int uloop_run(void)
 {
static int recursive_calls = 0;
struct timeval tv;
@@ -455,8 +457,9 @@ void uloop_run(void)
if (!recursive_calls++)
uloop_setup_signals(true);
 
+   uloop_status = 0;
uloop_cancelled = false;
-   while(!uloop_cancelled)
+   while (!uloop_cancelled)
{
uloop_gettime(&tv);
uloop_process_timeouts(&tv);
@@ -473,6 +476,8 @@ void uloop_run(void)
 
if (!--recursive_calls)
uloop_setup_signals(false);
+
+   return uloop_status;
 }
 
 void uloop_done(void)
diff --git a/uloop.h b/uloop.h
index 7564514..2f1eb4c 100644
--- a/uloop.h
+++ b/uloop.h
@@ -103,7 +103,7 @@ static inline void uloop_end(void)
 }
 
 int uloop_init(void);
-void uloop_run(void);
+int uloop_run(void);
 void uloop_done(void);
 
 #endif
-- 
2.9.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH libubox v2 1/3] Fix various memory management issues

2016-06-21 Thread Matthias Schiffer
Consistently handle allocation failures. Some functions are changed to
return bool or int instead of void to allow returning an error.

Also fix a buffer size miscalculation in lua/uloop and use _exit() instead
of exit() on errors after forking.

Signed-off-by: Matthias Schiffer 
---
v2:
- make blobmsg_*printf functions return int
- use _exit in forked process in lua/uloop
- avoid using "new" as identifier


 blobmsg.c  | 22 --
 blobmsg.h  |  4 ++--
 blobmsg_json.c | 30 +++---
 jshn.c |  4 
 json_script.c  | 17 +++--
 kvlist.c   | 11 ---
 kvlist.h   |  2 +-
 lua/uloop.c|  7 +--
 ustream.c  |  7 +++
 utils.c|  2 ++
 10 files changed, 83 insertions(+), 23 deletions(-)

diff --git a/blobmsg.c b/blobmsg.c
index 80b984a..1e93376 100644
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -227,29 +227,38 @@ blobmsg_open_nested(struct blob_buf *buf, const char 
*name, bool array)
return (void *)offset;
 }
 
-void
+int
 blobmsg_vprintf(struct blob_buf *buf, const char *name, const char *format, 
va_list arg)
 {
va_list arg2;
char cbuf;
-   int len;
+   char *sbuf;
+   int len, ret;
 
va_copy(arg2, arg);
len = vsnprintf(&cbuf, sizeof(cbuf), format, arg2);
va_end(arg2);
 
-   vsprintf(blobmsg_alloc_string_buffer(buf, name, len + 1), format, arg);
+   sbuf = blobmsg_alloc_string_buffer(buf, name, len + 1);
+   if (!sbuf)
+   return -1;
+   ret = vsprintf(sbuf, format, arg);
blobmsg_add_string_buffer(buf);
+
+   return ret;
 }
 
-void
+int
 blobmsg_printf(struct blob_buf *buf, const char *name, const char *format, ...)
 {
va_list ap;
+   int ret;
 
va_start(ap, format);
-   blobmsg_vprintf(buf, name, format, ap);
+   ret = blobmsg_vprintf(buf, name, format, ap);
va_end(ap);
+
+   return ret;
 }
 
 void *
@@ -278,7 +287,8 @@ blobmsg_realloc_string_buffer(struct blob_buf *buf, 
unsigned int maxlen)
if (required <= 0)
goto out;
 
-   blob_buf_grow(buf, required);
+   if (!blob_buf_grow(buf, required))
+   return NULL;
attr = blob_next(buf->head);
 
 out:
diff --git a/blobmsg.h b/blobmsg.h
index e58f95d..84997a6 100644
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -224,8 +224,8 @@ void *blobmsg_alloc_string_buffer(struct blob_buf *buf, 
const char *name, unsign
 void *blobmsg_realloc_string_buffer(struct blob_buf *buf, unsigned int maxlen);
 void blobmsg_add_string_buffer(struct blob_buf *buf);
 
-void blobmsg_vprintf(struct blob_buf *buf, const char *name, const char 
*format, va_list arg);
-void blobmsg_printf(struct blob_buf *buf, const char *name, const char 
*format, ...)
+int blobmsg_vprintf(struct blob_buf *buf, const char *name, const char 
*format, va_list arg);
+int blobmsg_printf(struct blob_buf *buf, const char *name, const char *format, 
...)
  __attribute__((format(printf, 3, 4)));
 
 
diff --git a/blobmsg_json.c b/blobmsg_json.c
index 5713948..2e318b2 100644
--- a/blobmsg_json.c
+++ b/blobmsg_json.c
@@ -119,15 +119,22 @@ struct strbuf {
 
 static bool blobmsg_puts(struct strbuf *s, const char *c, int len)
 {
+   size_t new_len;
+   char *new_buf;
+
if (len <= 0)
return true;
 
if (s->pos + len >= s->len) {
-   s->len += 16 + len;
-   s->buf = realloc(s->buf, s->len);
-   if (!s->buf)
+   new_len = s->len + 16 + len;
+   new_buf = realloc(s->buf, new_len);
+   if (!new_buf)
return false;
+
+   s->len = new_len;
+   s->buf = new_buf;
}
+
memcpy(s->buf + s->pos, c, len);
s->pos += len;
return true;
@@ -290,14 +297,18 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, 
bool list, blobmsg_jso
 {
struct strbuf s;
bool array;
+   char *ret;
 
s.len = blob_len(attr);
-   s.buf = malloc(s.len);
s.pos = 0;
s.custom_format = cb;
s.priv = priv;
s.indent = false;
 
+   s.buf = malloc(s.len);
+   if (!s.buf)
+   return NULL;
+
if (indent >= 0) {
s.indent = true;
s.indent_level = indent;
@@ -316,8 +327,13 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, 
bool list, blobmsg_jso
return NULL;
}
 
-   s.buf = realloc(s.buf, s.pos + 1);
-   s.buf[s.pos] = 0;
+   ret = realloc(s.buf, s.pos + 1);
+   if (!ret) {
+   free(s.buf);
+   return NULL;
+   }
+
+   ret[s.pos] = 0;
 
-   return s.buf;
+   return ret;
 }
diff --git a/jshn.c b/jshn.c
index e2d9022..4989099 100644
--- a/jshn.c
+++ b/jshn.c
@@ -338,6 +338,10 @@ int main(int argc, char **argv)
for (i = 0; environ[i]; i++);
 
vars = calloc(i, sizeof(*vars));
+   if (!va

[LEDE-DEV] [PATCH libubox v2 3/3] blobmsg_json: add new functions blobmsg_format_json_value*

2016-06-21 Thread Matthias Schiffer
The current blobmsg_format_json* functions will return invalid JSON when
the "list" argument is given as false (blobmsg_format_element() will
output the name of the blob_attr as if the value is printed as part of a
JSON object).

To avoid breaking software relying on this behaviour, introduce new
functions which will never print the blob_attr name and thus always
produce valid JSON.

Signed-off-by: Matthias Schiffer 
---
v2: no changes

 blobmsg_json.c | 61 --
 blobmsg_json.h | 14 ++
 2 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/blobmsg_json.c b/blobmsg_json.c
index 2e318b2..78747d1 100644
--- a/blobmsg_json.c
+++ b/blobmsg_json.c
@@ -214,7 +214,7 @@ static void blobmsg_format_string(struct strbuf *s, const 
char *str)
 
 static void blobmsg_format_json_list(struct strbuf *s, struct blob_attr *attr, 
int len, bool array);
 
-static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, 
bool array, bool head)
+static void blobmsg_format_element(struct strbuf *s, struct blob_attr *attr, 
bool without_name, bool head)
 {
const char *data_str;
char buf[32];
@@ -224,7 +224,7 @@ static void blobmsg_format_element(struct strbuf *s, struct 
blob_attr *attr, boo
if (!blobmsg_check_attr(attr, false))
return;
 
-   if (!array && blobmsg_name(attr)[0]) {
+   if (!without_name && blobmsg_name(attr)[0]) {
blobmsg_format_string(s, blobmsg_name(attr));
blobmsg_puts(s, ": ", s->indent ? 2 : 1);
}
@@ -293,27 +293,30 @@ static void blobmsg_format_json_list(struct strbuf *s, 
struct blob_attr *attr, i
blobmsg_puts(s, (array ? "]" : "}"), 1);
 }
 
+static void setup_strbuf(struct strbuf *s, struct blob_attr *attr, 
blobmsg_json_format_t cb, void *priv, int indent) {
+   s->len = blob_len(attr);
+   s->buf = malloc(s->len);
+   s->pos = 0;
+   s->custom_format = cb;
+   s->priv = priv;
+   s->indent = false;
+
+   if (indent >= 0) {
+   s->indent = true;
+   s->indent_level = indent;
+   }
+}
+
 char *blobmsg_format_json_with_cb(struct blob_attr *attr, bool list, 
blobmsg_json_format_t cb, void *priv, int indent)
 {
struct strbuf s;
bool array;
char *ret;
 
-   s.len = blob_len(attr);
-   s.pos = 0;
-   s.custom_format = cb;
-   s.priv = priv;
-   s.indent = false;
-
-   s.buf = malloc(s.len);
+   setup_strbuf(&s, attr, cb, priv, indent);
if (!s.buf)
return NULL;
 
-   if (indent >= 0) {
-   s.indent = true;
-   s.indent_level = indent;
-   }
-
array = blob_is_extended(attr) &&
blobmsg_type(attr) == BLOBMSG_TYPE_ARRAY;
 
@@ -337,3 +340,33 @@ char *blobmsg_format_json_with_cb(struct blob_attr *attr, 
bool list, blobmsg_jso
 
return ret;
 }
+
+char *blobmsg_format_json_value_with_cb(struct blob_attr *attr, 
blobmsg_json_format_t cb, void *priv, int indent)
+{
+   struct strbuf s;
+   char *ret;
+
+   setup_strbuf(&s, attr, cb, priv, indent);
+   if (!s.buf)
+   return NULL;
+
+   blobmsg_format_element(&s, attr, true, false);
+
+   if (!s.len) {
+   free(s.buf);
+   return NULL;
+   }
+
+   s.buf = realloc(s.buf, s.pos + 1);
+   s.buf[s.pos] = 0;
+
+   ret = realloc(s.buf, s.pos + 1);
+   if (!ret) {
+   free(s.buf);
+   return NULL;
+   }
+
+   ret[s.pos] = 0;
+
+   return ret;
+}
diff --git a/blobmsg_json.h b/blobmsg_json.h
index cd9ed33..9dfc02d 100644
--- a/blobmsg_json.h
+++ b/blobmsg_json.h
@@ -42,4 +42,18 @@ static inline char *blobmsg_format_json_indent(struct 
blob_attr *attr, bool list
return blobmsg_format_json_with_cb(attr, list, NULL, NULL, indent);
 }
 
+char *blobmsg_format_json_value_with_cb(struct blob_attr *attr,
+   blobmsg_json_format_t cb, void *priv,
+   int indent);
+
+static inline char *blobmsg_format_json_value(struct blob_attr *attr)
+{
+   return blobmsg_format_json_value_with_cb(attr, NULL, NULL, -1);
+}
+
+static inline char *blobmsg_format_json_value_indent(struct blob_attr *attr, 
int indent)
+{
+   return blobmsg_format_json_value_with_cb(attr, NULL, NULL, indent);
+}
+
 #endif
-- 
2.9.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ath10k-ct: Update to latest 10.4.3 CT firmware for 9980 chipsets.

2016-06-21 Thread Adrian Panella
Hi Ben,
  
>-Original Message-
>From: Ben Greear 
>
>This works around regressions added in the 4.7 kernel.

Tried it but still have the recurrent stack trace warning we had after the
last compat-wireless update. 
This was the most "visible" regression we were experiencing we the updated
ath10k drivers. Which other problems are you addressing?

I'm not exactly sure, but it seems that the trace is now a little less
frequent.

This is an extract of the console log (from Linksys EA8500 router):


[   11.427882] ath10k_pci :01:00.0: firmware ver
10.4.3-ct-fW-007-41d8756 api 5 features peer-flow-ctrl crc32 5451981c

.

[  936.407284] [ cut here ]

[  936.407406] WARNING: CPU: 0 PID: 0 at
compat-wireless-2016-05-12/net/mac80211/rx.c:4068
ieee80211_rx_napi+0x8c/0x8a4 [mac80211]()

[  936.410974] Modules linked in: pppoe ppp_async iptable_nat pppox
ppp_generic nf_nat_ipv4 nf_conntrack_ipv6 nf_conntrack_ipv4 ipt_REJECT
ipt_MASQUERADE xt_time xt_tcpudp xt_tcpmss xt_statisth
[  936.557402] CPU: 0 PID: 0 Comm: swapper/0 Tainted: GW
4.4.13 #2

[  936.557754] Hardware name: Qualcomm (Flattened Device Tree)

[  936.564889] [] (unwind_backtrace) from []
(show_stack+0x10/0x14)

[  936.570270] [] (show_stack) from []
(dump_stack+0x88/0x9c)

[  936.578252] [] (dump_stack) from []
(warn_slowpath_common+0x94/0xb0)

[  936.585282] [] (warn_slowpath_common) from []
(warn_slowpath_null+0x1c/0x24)

[  936.593565] [] (warn_slowpath_null) from []
(ieee80211_rx_napi+0x8c/0x8a4 [mac80211])

[  936.602400] [] (ieee80211_rx_napi [mac80211]) from []
(ath10k_htt_t2h_msg_handler+0x930/0x98c [ath10k_core])

[  936.611811] [] (ath10k_htt_t2h_msg_handler [ath10k_core]) from
[] (ath10k_htt_txrx_compl_task+0x9bc/0x115c [ath10k_core])

[  936.623422] [] (ath10k_htt_txrx_compl_task [ath10k_core]) from
[] (tasklet_action+0xb8/0x144)

[  936.635978] [] (tasklet_action) from []
(__do_softirq+0xe0/0x21c)

[  936.646216] [] (__do_softirq) from []
(irq_exit+0x98/0xec)

[  936.654033] [] (irq_exit) from []
(__handle_domain_irq+0xbc/0xe4)

[  936.661149] [] (__handle_domain_irq) from []
(gic_handle_irq+0x54/0x94)

[  936.669048] [] (gic_handle_irq) from []
(__irq_svc+0x54/0x90)

[  936.677200] Exception stack(0xc0775f50 to 0xc0775f98)

[  936.684840] 5f40: 0001 
 c020b4a0

[  936.689884] 5f60: c0774000 c0776480 c0682740   c07702e4
c0775fa8 c0776488

[  936.698041] 5f80: c0776140 c0775fa0 c0219d54 c0219d58 6013 

[  936.706195] [] (__irq_svc) from []
(arch_cpu_idle+0x34/0x50)

[  936.712623] [] (arch_cpu_idle) from []
(cpu_startup_entry+0x178/0x24c)

[  936.720266] [] (cpu_startup_entry) from []
(start_kernel+0x434/0x440)

[  936.728400] ---[ end trace d771ca9672150ac3 ]---   


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ath10k-ct: Update to latest 10.4.3 CT firmware for 9980 chipsets.

2016-06-21 Thread Ben Greear

On 06/21/2016 11:55 AM, Adrian Panella wrote:

Hi Ben,


-Original Message-
From: Ben Greear 

This works around regressions added in the 4.7 kernel.


Tried it but still have the recurrent stack trace warning we had after the
last compat-wireless update.
This was the most "visible" regression we were experiencing we the updated
ath10k drivers. Which other problems are you addressing?

I'm not exactly sure, but it seems that the trace is now a little less
frequent.


I think your splat is a kernel/driver issue, not firmware related.  Working on
a patch to enable my driver now...

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] squashfs4: use upstream xz compression header format

2016-06-21 Thread Hauke Mehrtens
In the upstream kernel and the upstream squashfs4 tools the xz
compression header looks the following:
struct disk_comp_opts {
__le32 dictionary_size;
__le32 flags;
};

We added some other members and also moved some existing members. Place
the members which are already in upstream header at the same position
as in that kernel and add our own at the end. The kernel should not
have a problem when there are some additional members and just ignore
them.

Signed-off-by: Hauke Mehrtens 
---
 .../520-squashfs_update_xz_comp_opts.patch | 25 --
 .../520-squashfs_update_xz_comp_opts.patch | 25 --
 .../520-squashfs_update_xz_comp_opts.patch | 25 --
 .../patches/160-expose_lzma_xz_options.patch   |  2 +-
 4 files changed, 1 insertion(+), 76 deletions(-)
 delete mode 100644 
target/linux/generic/patches-3.18/520-squashfs_update_xz_comp_opts.patch
 delete mode 100644 
target/linux/generic/patches-4.1/520-squashfs_update_xz_comp_opts.patch
 delete mode 100644 
target/linux/generic/patches-4.4/520-squashfs_update_xz_comp_opts.patch

diff --git 
a/target/linux/generic/patches-3.18/520-squashfs_update_xz_comp_opts.patch 
b/target/linux/generic/patches-3.18/520-squashfs_update_xz_comp_opts.patch
deleted file mode 100644
index ad11b30..000
--- a/target/linux/generic/patches-3.18/520-squashfs_update_xz_comp_opts.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From f31b7c0efa255dd17a5f584022a319387f09b0d8 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski 
-Date: Tue, 12 Apr 2011 19:55:41 +0200
-Subject: [PATCH] squashfs: update xz compressor options struct.
-
-Update the xz compressor options struct to match the squashfs userspace
-one.

- fs/squashfs/xz_wrapper.c |4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
 a/fs/squashfs/xz_wrapper.c
-+++ b/fs/squashfs/xz_wrapper.c
-@@ -40,8 +40,10 @@ struct squashfs_xz {
- };
- 
- struct disk_comp_opts {
--  __le32 dictionary_size;
-   __le32 flags;
-+  __le16 bit_opts;
-+  __le16 fb;
-+  __le32 dictionary_size;
- };
- 
- struct comp_opts {
diff --git 
a/target/linux/generic/patches-4.1/520-squashfs_update_xz_comp_opts.patch 
b/target/linux/generic/patches-4.1/520-squashfs_update_xz_comp_opts.patch
deleted file mode 100644
index ad11b30..000
--- a/target/linux/generic/patches-4.1/520-squashfs_update_xz_comp_opts.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From f31b7c0efa255dd17a5f584022a319387f09b0d8 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski 
-Date: Tue, 12 Apr 2011 19:55:41 +0200
-Subject: [PATCH] squashfs: update xz compressor options struct.
-
-Update the xz compressor options struct to match the squashfs userspace
-one.

- fs/squashfs/xz_wrapper.c |4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
 a/fs/squashfs/xz_wrapper.c
-+++ b/fs/squashfs/xz_wrapper.c
-@@ -40,8 +40,10 @@ struct squashfs_xz {
- };
- 
- struct disk_comp_opts {
--  __le32 dictionary_size;
-   __le32 flags;
-+  __le16 bit_opts;
-+  __le16 fb;
-+  __le32 dictionary_size;
- };
- 
- struct comp_opts {
diff --git 
a/target/linux/generic/patches-4.4/520-squashfs_update_xz_comp_opts.patch 
b/target/linux/generic/patches-4.4/520-squashfs_update_xz_comp_opts.patch
deleted file mode 100644
index ad11b30..000
--- a/target/linux/generic/patches-4.4/520-squashfs_update_xz_comp_opts.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From f31b7c0efa255dd17a5f584022a319387f09b0d8 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski 
-Date: Tue, 12 Apr 2011 19:55:41 +0200
-Subject: [PATCH] squashfs: update xz compressor options struct.
-
-Update the xz compressor options struct to match the squashfs userspace
-one.

- fs/squashfs/xz_wrapper.c |4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
 a/fs/squashfs/xz_wrapper.c
-+++ b/fs/squashfs/xz_wrapper.c
-@@ -40,8 +40,10 @@ struct squashfs_xz {
- };
- 
- struct disk_comp_opts {
--  __le32 dictionary_size;
-   __le32 flags;
-+  __le16 bit_opts;
-+  __le16 fb;
-+  __le32 dictionary_size;
- };
- 
- struct comp_opts {
diff --git a/tools/squashfs4/patches/160-expose_lzma_xz_options.patch 
b/tools/squashfs4/patches/160-expose_lzma_xz_options.patch
index 2fbd954..9e1c1fb 100644
--- a/tools/squashfs4/patches/160-expose_lzma_xz_options.patch
+++ b/tools/squashfs4/patches/160-expose_lzma_xz_options.patch
@@ -40,6 +40,7 @@
 +
 +
 +struct lzma_opts {
++  uint32_t dict_size;
 +  uint32_t flags;
 +#define LZMA_OPT_FLT_MASK 0x
 +#define LZMA_OPT_PRE_OFF  16
@@ -53,7 +54,6 @@
 +#define LZMA_OPT_PB_OFF   6
 +#define LZMA_OPT_PB_MASK  (0x7 << LZMA_OPT_PB_OFF)
 +  uint16_t fb;
-+  uint32_t dict_size;
 +};
 +
 +#if __BYTE_ORDER == __BIG_ENDIAN
-- 
2.8.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] kernel: fix missing break in ubi auto-mounting patch

2016-06-21 Thread Hauke Mehrtens
Signed-off-by: Hauke Mehrtens 
---
 .../492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch  | 3 ++-
 .../492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch  | 3 ++-
 .../492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch  | 5 +++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/target/linux/generic/patches-3.18/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
 
b/target/linux/generic/patches-3.18/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
index e4f31fd..3f2b439 100644
--- 
a/target/linux/generic/patches-3.18/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
+++ 
b/target/linux/generic/patches-3.18/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
@@ -11,7 +11,7 @@ Signed-off-by: Daniel Golle 
 
 --- a/init/do_mounts.c
 +++ b/init/do_mounts.c
-@@ -433,7 +433,27 @@ retry:
+@@ -433,7 +433,28 @@ retry:
  out:
put_page(page);
  }
@@ -29,6 +29,7 @@ Signed-off-by: Daniel Golle 
 +  case -EACCES:
 +  flags |= MS_RDONLY;
 +  tried++;
++  break;
 +  default:
 +  return err;
 +  }
diff --git 
a/target/linux/generic/patches-4.1/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
 
b/target/linux/generic/patches-4.1/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
index 005de3f..f6c71a2 100644
--- 
a/target/linux/generic/patches-4.1/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
+++ 
b/target/linux/generic/patches-4.1/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
@@ -11,7 +11,7 @@ Signed-off-by: Daniel Golle 
 
 --- a/init/do_mounts.c
 +++ b/init/do_mounts.c
-@@ -438,7 +438,27 @@ retry:
+@@ -438,7 +438,28 @@ retry:
  out:
put_page(page);
  }
@@ -29,6 +29,7 @@ Signed-off-by: Daniel Golle 
 +  case -EACCES:
 +  flags |= MS_RDONLY;
 +  tried++;
++  break;
 +  default:
 +  return err;
 +  }
diff --git 
a/target/linux/generic/patches-4.4/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
 
b/target/linux/generic/patches-4.4/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
index d21e6d2..ab8b8bb 100644
--- 
a/target/linux/generic/patches-4.4/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
+++ 
b/target/linux/generic/patches-4.4/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
@@ -11,7 +11,7 @@ Signed-off-by: Daniel Golle 
 
 --- a/init/do_mounts.c
 +++ b/init/do_mounts.c
-@@ -438,7 +438,27 @@ retry:
+@@ -438,7 +438,28 @@ retry:
  out:
put_page(page);
  }
@@ -29,6 +29,7 @@ Signed-off-by: Daniel Golle 
 +  case -EACCES:
 +  flags |= MS_RDONLY;
 +  tried++;
++  break;
 +  default:
 +  return err;
 +  }
@@ -40,7 +41,7 @@ Signed-off-by: Daniel Golle 
  #ifdef CONFIG_ROOT_NFS
  
  #define NFSROOT_TIMEOUT_MIN   5
-@@ -532,6 +552,10 @@ void __init mount_root(void)
+@@ -532,6 +553,10 @@ void __init mount_root(void)
change_floppy("root floppy");
}
  #endif
-- 
2.8.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] TR-069 and OpenWrt Meeting Videos

2016-06-21 Thread Eric Schultz
I've posted the recordings of the TR-069 and OpenWrt Meetings from June
10 and June 17. Check them out via the links below if you're interested
in the discussion.

* June 10 - https://youtu.be/U2SiveQwKm8
* June 17 - https://youtu.be/Hvqi1EFs_U0

We'll be having another meeting this week on June 24 at 7AM PT as well;
everyone interested is welcome to join. Be on the lookout for the
connection info in the next few days.

Thanks everyone,

Eric

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] ar71xx - please help test

2016-06-21 Thread Arjen de Korte

Citeren John Crispin :


Hi,

i have moved all the profiles into the image building code. i have done
some basic testing and already got a bit of feedback from others.

it would be nice if people could help test the following patch from my
staging tree

https://git.lede-project.org/?p=lede/blogic/staging.git;a=commit;h=75773d43cd44ee70e293343fad11db654c35a4ed


Patch checked with r762 on a Netgear WNDR-4300. All is well (with the  
already mentioned whitespace issues when applying the patch).


Arjen



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [RFC] Support ath10k-ct out-of-tree driver.

2016-06-21 Thread greearb
From: Ben Greear 

This lets one use the ath10k-ct driver instead of the built-in
ath10k driver from the upstream kernel (or backports).

Signed-off-by: Ben Greear 
---

This has been lightly tested with ath10k-ct firmware on 9880
hardware.

*THIS PATCH BREAKS ath9k*  because I am compiling ath10k against
my own ath.ko, and so load my own ath.ko.  I am not sure the
best way to fix this:  Compile my own ath* modules to replace
upstream, or fix just my ath10k sub-dir to build on it's own
and link against standard ath module

 package/firmware/ath10k-firmware/Makefile |  2 +-
 package/kernel/ath-ct/Makefile| 60 +++
 2 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 package/kernel/ath-ct/Makefile

diff --git a/package/firmware/ath10k-firmware/Makefile 
b/package/firmware/ath10k-firmware/Makefile
index fcd6167..635aede 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -28,7 +28,7 @@ define Package/ath10k-firmware-default
   CATEGORY:=Kernel modules
   SUBMENU:=$(WMENU)
   URL:=$(PKG_SOURCE_URL)
-  DEPENDS:=kmod-ath10k
+  DEPENDS:=
 endef
 
 define Package/ath10k-firmware-qca988x
diff --git a/package/kernel/ath-ct/Makefile b/package/kernel/ath-ct/Makefile
new file mode 100644
index 000..ded41a7
--- /dev/null
+++ b/package/kernel/ath-ct/Makefile
@@ -0,0 +1,60 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ath-ct
+PKG_VERSION:=2016-06-21
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=
+
+PKG_SOURCE_URL:=https://github.com/greearb/ath-ct.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=7531f0b1798a4af500eb1860f7fd9dcaa727d3fb
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+
+PKG_MAINTAINER:=Ben Greear 
+PKG_BUILD_PARALLEL:=1
+
+STAMP_CONFIGURED_DEPENDS := 
$(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/ath-ct
+  SUBMENU:=Wireless Drivers
+  TITLE:=ath10k-ct driver optimized for CT ath10k firmware
+  DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT @PCI_SUPPORT
+  FILES:=\
+   $(PKG_BUILD_DIR)/ath.ko \
+   $(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
+   $(PKG_BUILD_DIR)/ath10k/ath10k_core.ko
+  AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
+endef
+
+NOSTDINC_FLAGS = \
+   -I$(PKG_BUILD_DIR) \
+   -I$(PKG_BUILD_DIR)/ath10k \
+   -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
+   -I$(STAGING_DIR)/usr/include/mac80211-backport \
+   -I$(STAGING_DIR)/usr/include/mac80211/uapi \
+   -I$(STAGING_DIR)/usr/include/mac80211 \
+   -include backport/autoconf.h \
+   -include backport/backport.h
+
+ifdef CONFIG_PACKAGE_MAC80211_MESH
+  NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
+endif
+
+define Build/Compile
+   +CONFIG_ATH_COMMON=m CONFIG_ATH_DEBUG=m \
+ CONFIG_ATH10K=m CONFIG_ATH10K_DEBUGFS=m CONFIG_MAC80211_DEBUGFS=m 
CONFIG_ATH10K_PCI=m \
+ $(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
+   ARCH="$(LINUX_KARCH)" \
+   CROSS_COMPILE="$(TARGET_CROSS)" \
+   SUBDIRS="$(PKG_BUILD_DIR)" \
+   NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
+   modules
+endef
+
+$(eval $(call KernelPackage,ath-ct))
-- 
2.4.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] ar71xx - please help test

2016-06-21 Thread Christian Lamparter
On Tuesday, June 21, 2016 10:23:46 AM John Crispin wrote:
> it would be nice if people could help test the following patch from my
> staging tree
> 
I tested the a patched sysupgrade for:
 - WD's My Net Wi-Fi Range Extender (MYNETREXT)
 - Netgear's WNDR3700 v2 (WNDR3700)
 - TP-Link's Archer C7 v1(ARCHERC7) 

All three updates were successful.

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] packages: prefer http over git for git protocol

2016-06-21 Thread Hauke Mehrtens
In company networks everything except the http and https protocol is
often causes problems, because the network administrators try to block
everything else. To make it easier to use LEDE in company networks use
the https/http protocol for git access when possible.

Signed-off-by: Hauke Mehrtens 
---
 package/boot/uboot-pxa/Makefile   | 2 +-
 package/devel/trace-cmd/Makefile  | 2 +-
 package/firmware/am33x-cm3/Makefile   | 2 +-
 package/firmware/linux-firmware/Makefile  | 2 +-
 package/kernel/acx-mac80211/Makefile  | 2 +-
 package/kernel/kmod-sched-cake/Makefile   | 2 +-
 package/network/services/authsae/Makefile | 2 +-
 package/network/services/hostapd/Makefile | 2 +-
 package/network/services/odhcpd/Makefile  | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/package/boot/uboot-pxa/Makefile b/package/boot/uboot-pxa/Makefile
index 9dae1af..23e84c8 100644
--- a/package/boot/uboot-pxa/Makefile
+++ b/package/boot/uboot-pxa/Makefile
@@ -13,7 +13,7 @@ PKG_VERSION:=2011.08.25
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/ashcharles/verdex-uboot.git
+PKG_SOURCE_URL:=https://github.com/ashcharles/verdex-uboot.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=ca6bf3ef6ac5f5132a359b43dfa31e07076b74b7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
diff --git a/package/devel/trace-cmd/Makefile b/package/devel/trace-cmd/Makefile
index 6ed6673..9391092 100644
--- a/package/devel/trace-cmd/Makefile
+++ b/package/devel/trace-cmd/Makefile
@@ -5,7 +5,7 @@ PKG_VERSION:=v2.4.2
 PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
+PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=01f8e669cb035aa911f1ee0e3f94d535cbcca78f
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/package/firmware/am33x-cm3/Makefile 
b/package/firmware/am33x-cm3/Makefile
index 6f6d050..8bfeb45 100644
--- a/package/firmware/am33x-cm3/Makefile
+++ b/package/firmware/am33x-cm3/Makefile
@@ -14,7 +14,7 @@ PKG_RELEASE:=1
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=git://arago-project.org/git/projects/am33x-cm3.git
+PKG_SOURCE_URL:=http://arago-project.org/git/projects/am33x-cm3.git
 PKG_SOURCE_VERSION:=32cf44e25b5828b87af6dceebc3a49fed5d858ac
 PKG_MD5SUM:=40a6b7edae5e5cfff99bebde2bf20b97
 
diff --git a/package/firmware/linux-firmware/Makefile 
b/package/firmware/linux-firmware/Makefile
index e1e1a47..15ee4ae 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -16,7 +16,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
-PKG_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
+PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
 PKG_MIRROR_MD5SUM:=ca4d289ad9380471cae376fc7dd3660a
 
 PKG_MAINTAINER:=Felix Fietkau 
diff --git a/package/kernel/acx-mac80211/Makefile 
b/package/kernel/acx-mac80211/Makefile
index c5c020d..8fce374 100644
--- a/package/kernel/acx-mac80211/Makefile
+++ b/package/kernel/acx-mac80211/Makefile
@@ -14,7 +14,7 @@ PKG_VERSION:=20140216
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=git://git.code.sf.net/p/acx100/acx-mac80211
+PKG_SOURCE_URL:=http://git.code.sf.net/p/acx100/acx-mac80211
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
diff --git a/package/kernel/kmod-sched-cake/Makefile 
b/package/kernel/kmod-sched-cake/Makefile
index e5fe79b..b8dd764 100644
--- a/package/kernel/kmod-sched-cake/Makefile
+++ b/package/kernel/kmod-sched-cake/Makefile
@@ -13,7 +13,7 @@ PKG_VERSION:=2016-05-31
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/dtaht/sch_cake
+PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git
 PKG_SOURCE_VERSION:=292b57c714f0f9a856c5822b7b3b9fb931873db7
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
diff --git a/package/network/services/authsae/Makefile 
b/package/network/services/authsae/Makefile
index d74cfef..df16054 100644
--- a/package/network/services/authsae/Makefile
+++ b/package/network/services/authsae/Makefile
@@ -12,7 +12,7 @@ PKG_VERSION:=2014-06-09
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/cozybit/authsae.git
+PKG_SOURCE_URL:=https://github.com/cozybit/authsae.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=8531ab158910a525d4bcbb3ad02c08342f6987f2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
diff --git a

Re: [LEDE-DEV] ar71xx - please help test

2016-06-21 Thread Ted Hess
On Tue, 2016-06-21 at 10:23 +0200, John Crispin wrote:
> Hi,
> 
> i have moved all the profiles into the image building code. i have done
> some basic testing and already got a bit of feedback from others.
> 
> it would be nice if people could help test the following patch from my
> staging tree
> 
> https://git.lede-project.org/?p=lede/blogic/staging.git;a=commit;h=75773d43cd4
> 4ee70e293343fad11db654c35a4ed
> 
>   John
> 
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

Built and tested OK on Ubiquiti RSPRO w/ both 2.4GHz and 5GHz Wireless cards.

/ted


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] Support Candela-Tech ath10k and ath9k out-of-tree driver.

2016-06-21 Thread greearb
From: Ben Greear 

This lets one use the ath9k and ath10k driver instead of the built-in
ath10k/ath9k driver from the upstream kernel (or backports).

For ath10k, this should be a drop-in replacement, as well as enabling
better CT firmware support.

For ath9k, this enables some 5Mhz channel and 4.9Ghz support,
but may loose some existing patches that LEDE carries for ath9k.

Signed-off-by: Ben Greear 
---
 package/firmware/ath10k-firmware/Makefile |  2 +-
 package/kernel/ath-ct/Makefile| 74 +++
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 package/kernel/ath-ct/Makefile

diff --git a/package/firmware/ath10k-firmware/Makefile 
b/package/firmware/ath10k-firmware/Makefile
index fcd6167..635aede 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -28,7 +28,7 @@ define Package/ath10k-firmware-default
   CATEGORY:=Kernel modules
   SUBMENU:=$(WMENU)
   URL:=$(PKG_SOURCE_URL)
-  DEPENDS:=kmod-ath10k
+  DEPENDS:=
 endef
 
 define Package/ath10k-firmware-qca988x
diff --git a/package/kernel/ath-ct/Makefile b/package/kernel/ath-ct/Makefile
new file mode 100644
index 000..4441c14
--- /dev/null
+++ b/package/kernel/ath-ct/Makefile
@@ -0,0 +1,74 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ath-ct
+PKG_VERSION:=2016-06-21
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=
+
+PKG_SOURCE_URL:=https://github.com/greearb/ath-ct.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=b003b75d885595fbc18f4fd9b3aef9189a63f21e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+
+PKG_MAINTAINER:=Ben Greear 
+PKG_BUILD_PARALLEL:=1
+
+STAMP_CONFIGURED_DEPENDS := 
$(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/ath-ct
+  SUBMENU:=Wireless Drivers
+  TITLE:=ath10k-ct driver optimized for CT ath10k firmware
+  DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT @PCI_SUPPORT
+  FILES:=\
+   $(PKG_BUILD_DIR)/ath.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_hw.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_common.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_htc.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_hw.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k.ko \
+   $(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
+   $(PKG_BUILD_DIR)/ath10k/ath10k_core.ko
+  AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
+endef
+
+NOSTDINC_FLAGS = \
+   -I$(PKG_BUILD_DIR) \
+   -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
+   -I$(STAGING_DIR)/usr/include/mac80211-backport \
+   -I$(STAGING_DIR)/usr/include/mac80211/uapi \
+   -I$(STAGING_DIR)/usr/include/mac80211 \
+   -include backport/autoconf.h \
+   -include backport/backport.h
+
+ifdef CONFIG_PACKAGE_MAC80211_MESH
+  NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
+endif
+
+NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS -DCONFIG_MAC80211_DEBUGFS 
-DCONFIG_ATH10K_DEBUG -DCONFIG_ATH10K_AHB
+NOSTDINC_FLAGS += -DCONFIG_ATH9K_PCI -DCONFIG_ATH9K_DEBUGFS 
-DCONFIG_ATH9K_DFS_DEBUGFS -DCONFIG_ATH9K_CHANNEL_CONTEXT
+NOSTDINC_FLAGS += -DCONFIG_ATH9K_HTC_DEBUGFS -DCONFIG_ATH_DEBUG 
-DCONFIG_ATH9K_BTCOEX_SUPPORT
+NOSTDINC_FLAGS += -DCONFIG_ATH9K_RFKILL -DCONFIG_ATH9K_DYNACK 
-DCONFIG_ATH9K_HWRNG
+NOSTDINC_FLAGS += -DSTANDALONE_CT
+
+define Build/Compile
+   +CONFIG_ATH_COMMON=m CONFIG_ATH_DEBUG=y \
+CONFIG_ATH9K=m CONFIG_ATH9K_HW=m CONFIG_ATH9K_COMMON=m 
CONFIG_ATH9K_PCI=y \
+ CONFIG_ATH9K_HTC=m CONFIG_ATH9K_HTC_DEBUGFS=y CONFIG_ATH9K_RFKILL=y 
CONFIG_ATH9K_DYNACK=y \
+ CONFIG_ATH9K_DEBUGFS=y CONFIG_ATH9K_DFS_DEBUGFS=y 
CONFIG_ATH9K_BTCOEX_SUPPORT=y CONFIG_ATH9K_STATION_STATISTICS=m \
+ CONFIG_ATH9K_CHANNEL_CONTEXT=y CONFIG_ATH9K_HWRNG=y \
+ CONFIG_ATH10K=m CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y 
CONFIG_ATH10K_PCI=m CONFIG_ATH10K_AHB=y \
+ $(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
+   ARCH="$(LINUX_KARCH)" \
+   CROSS_COMPILE="$(TARGET_CROSS)" \
+   SUBDIRS="$(PKG_BUILD_DIR)" \
+   NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
+   modules
+endef
+
+$(eval $(call KernelPackage,ath-ct))
-- 
2.4.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] Support Candela-Tech ath10k and ath9k out-of-tree driver.

2016-06-21 Thread David Lang
I'll point out that there is a lot of work being done on these drivers right now 
in terms of making significant changes to how they do buffering that in 
increasing network speed as well as reducing latency


search the follwoing lists for [make-wifi-fast] to see the details and 
benchmarks

make-wifi-f...@lists.bufferbloat.net, 
ath9k-de...@venema.h4ckr.net,linux-wirel...@vger.kernel.org

David Lang

 On Tue, 21 Jun 2016, 
gree...@candelatech.com wrote:



Date: Tue, 21 Jun 2016 15:00:17 -0700
From: gree...@candelatech.com
To: lede-dev@lists.infradead.org
Cc: Ben Greear 
Subject: [LEDE-DEV] [PATCH] Support Candela-Tech ath10k and ath9k   
out-of-tree
driver.

From: Ben Greear 

This lets one use the ath9k and ath10k driver instead of the built-in
ath10k/ath9k driver from the upstream kernel (or backports).

For ath10k, this should be a drop-in replacement, as well as enabling
better CT firmware support.

For ath9k, this enables some 5Mhz channel and 4.9Ghz support,
but may loose some existing patches that LEDE carries for ath9k.

Signed-off-by: Ben Greear 
---
package/firmware/ath10k-firmware/Makefile |  2 +-
package/kernel/ath-ct/Makefile| 74 +++
2 files changed, 75 insertions(+), 1 deletion(-)
create mode 100644 package/kernel/ath-ct/Makefile

diff --git a/package/firmware/ath10k-firmware/Makefile 
b/package/firmware/ath10k-firmware/Makefile
index fcd6167..635aede 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -28,7 +28,7 @@ define Package/ath10k-firmware-default
  CATEGORY:=Kernel modules
  SUBMENU:=$(WMENU)
  URL:=$(PKG_SOURCE_URL)
-  DEPENDS:=kmod-ath10k
+  DEPENDS:=
endef

define Package/ath10k-firmware-qca988x
diff --git a/package/kernel/ath-ct/Makefile b/package/kernel/ath-ct/Makefile
new file mode 100644
index 000..4441c14
--- /dev/null
+++ b/package/kernel/ath-ct/Makefile
@@ -0,0 +1,74 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ath-ct
+PKG_VERSION:=2016-06-21
+PKG_RELEASE=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=
+
+PKG_SOURCE_URL:=https://github.com/greearb/ath-ct.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=b003b75d885595fbc18f4fd9b3aef9189a63f21e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+
+PKG_MAINTAINER:=Ben Greear 
+PKG_BUILD_PARALLEL:=1
+
+STAMP_CONFIGURED_DEPENDS := 
$(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/ath-ct
+  SUBMENU:=Wireless Drivers
+  TITLE:=ath10k-ct driver optimized for CT ath10k firmware
+  DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT @PCI_SUPPORT
+  FILES:=\
+   $(PKG_BUILD_DIR)/ath.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_hw.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_common.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_htc.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k_hw.ko \
+   $(PKG_BUILD_DIR)/ath9k/ath9k.ko \
+   $(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
+   $(PKG_BUILD_DIR)/ath10k/ath10k_core.ko
+  AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
+endef
+
+NOSTDINC_FLAGS = \
+   -I$(PKG_BUILD_DIR) \
+   -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
+   -I$(STAGING_DIR)/usr/include/mac80211-backport \
+   -I$(STAGING_DIR)/usr/include/mac80211/uapi \
+   -I$(STAGING_DIR)/usr/include/mac80211 \
+   -include backport/autoconf.h \
+   -include backport/backport.h
+
+ifdef CONFIG_PACKAGE_MAC80211_MESH
+  NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
+endif
+
+NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS -DCONFIG_MAC80211_DEBUGFS 
-DCONFIG_ATH10K_DEBUG -DCONFIG_ATH10K_AHB
+NOSTDINC_FLAGS += -DCONFIG_ATH9K_PCI -DCONFIG_ATH9K_DEBUGFS 
-DCONFIG_ATH9K_DFS_DEBUGFS -DCONFIG_ATH9K_CHANNEL_CONTEXT
+NOSTDINC_FLAGS += -DCONFIG_ATH9K_HTC_DEBUGFS -DCONFIG_ATH_DEBUG 
-DCONFIG_ATH9K_BTCOEX_SUPPORT
+NOSTDINC_FLAGS += -DCONFIG_ATH9K_RFKILL -DCONFIG_ATH9K_DYNACK 
-DCONFIG_ATH9K_HWRNG
+NOSTDINC_FLAGS += -DSTANDALONE_CT
+
+define Build/Compile
+   +CONFIG_ATH_COMMON=m CONFIG_ATH_DEBUG=y \
+CONFIG_ATH9K=m CONFIG_ATH9K_HW=m CONFIG_ATH9K_COMMON=m 
CONFIG_ATH9K_PCI=y \
+ CONFIG_ATH9K_HTC=m CONFIG_ATH9K_HTC_DEBUGFS=y CONFIG_ATH9K_RFKILL=y 
CONFIG_ATH9K_DYNACK=y \
+ CONFIG_ATH9K_DEBUGFS=y CONFIG_ATH9K_DFS_DEBUGFS=y 
CONFIG_ATH9K_BTCOEX_SUPPORT=y CONFIG_ATH9K_STATION_STATISTICS=m \
+ CONFIG_ATH9K_CHANNEL_CONTEXT=y CONFIG_ATH9K_HWRNG=y \
+ CONFIG_ATH10K=m CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y 
CONFIG_ATH10K_PCI=m CONFIG_ATH10K_AHB=y \
+ $(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
+   ARCH="$(LINUX_KARCH)" \
+   CROSS_COMPILE="$(TARGET_CROSS)" \
+   SUBDIRS="$(PKG_BUILD_DIR)" \
+   NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
+   modules
+endef
+
+$(eval $(call KernelPackage,ath-ct))



___

Re: [LEDE-DEV] [PATCH] Support Candela-Tech ath10k and ath9k out-of-tree driver.

2016-06-21 Thread David Lang

On Tue, 21 Jun 2016, Ben Greear wrote:


On 06/21/2016 03:04 PM, David Lang wrote:
I'll point out that there is a lot of work being done on these drivers 
right now in terms of making significant changes to how they do buffering 
that in

increasing network speed as well as reducing latency

search the follwoing lists for [make-wifi-fast] to see the details and 
benchmarks
make-wifi-f...@lists.bufferbloat.net, 
ath9k-de...@venema.h4ckr.net,linux-wirel...@vger.kernel.org


Yes, and I will pull that stuff into my tree as it becomes stable and/or as I 
have time.


It seems I have little chance to ever get my ath10k patches in the upsteam 
kernel, so this is the

best I can think of for now.

It might be best to entirely decouple my ath10k from ath9k so folks can use 
stock (LEDE) ath9k

but my ath10k.  Maybe I simply had some typo in my first attempt at this.

I figure Felix will know better how to make this all work, so this patch 
should probably

wait for him to comment on and/or fix.


One more thing that I didn't really see in the patch (but I may have skimmed 
over it)


What is the difference/improvement between the stock driver and the Candela-Tech 
driver? (i.e. as someone configuring LEDE, why would I pick your driver?)


David Lang

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] Support Candela-Tech ath10k and ath9k out-of-tree driver.

2016-06-21 Thread Ben Greear

On 06/21/2016 03:04 PM, David Lang wrote:

I'll point out that there is a lot of work being done on these drivers right 
now in terms of making significant changes to how they do buffering that in
increasing network speed as well as reducing latency

search the follwoing lists for [make-wifi-fast] to see the details and 
benchmarks
make-wifi-f...@lists.bufferbloat.net, 
ath9k-de...@venema.h4ckr.net,linux-wirel...@vger.kernel.org


Yes, and I will pull that stuff into my tree as it becomes stable and/or as I 
have time.

It seems I have little chance to ever get my ath10k patches in the upsteam 
kernel, so this is the
best I can think of for now.

It might be best to entirely decouple my ath10k from ath9k so folks can use 
stock (LEDE) ath9k
but my ath10k.  Maybe I simply had some typo in my first attempt at this.

I figure Felix will know better how to make this all work, so this patch should 
probably
wait for him to comment on and/or fix.

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] apu2 + Candela firmware/driver LEDE tree is available.

2016-06-21 Thread Ben Greear

In case someone wants to try out my patches by just cloning a tree:

https://github.com/greearb/lede-source-ct

The README has some notes on how to easily build for the 'apu2' platform,
and normal build infrastructure is supported as well.

I am likely to rebase this often as I have time to sync with upstream.

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] apu2 + Candela firmware/driver LEDE tree is available.

2016-06-21 Thread Ben Greear

On 06/21/2016 03:45 PM, Ben Greear wrote:

In case someone wants to try out my patches by just cloning a tree:

https://github.com/greearb/lede-source-ct

The README has some notes on how to easily build for the 'apu2' platform,
and normal build infrastructure is supported as well.

I am likely to rebase this often as I have time to sync with upstream.


Oh, and if someone happens to like the buildme.sh logic, I'll be happy to accept
patches for other targets and/or general improvements to the buildme.sh script 
or other
features only in this particular fork of the lede tree.

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] Support Candela-Tech ath10k and ath9k out-of-tree driver.

2016-06-21 Thread Ben Greear

On 06/21/2016 03:15 PM, David Lang wrote:

On Tue, 21 Jun 2016, Ben Greear wrote:


On 06/21/2016 03:04 PM, David Lang wrote:

I'll point out that there is a lot of work being done on these drivers right 
now in terms of making significant changes to how they do buffering that in
increasing network speed as well as reducing latency

search the follwoing lists for [make-wifi-fast] to see the details and 
benchmarks
make-wifi-f...@lists.bufferbloat.net, 
ath9k-de...@venema.h4ckr.net,linux-wirel...@vger.kernel.org


Yes, and I will pull that stuff into my tree as it becomes stable and/or as I 
have time.

It seems I have little chance to ever get my ath10k patches in the upsteam 
kernel, so this is the
best I can think of for now.

It might be best to entirely decouple my ath10k from ath9k so folks can use 
stock (LEDE) ath9k
but my ath10k.  Maybe I simply had some typo in my first attempt at this.

I figure Felix will know better how to make this all work, so this patch should 
probably
wait for him to comment on and/or fix.


One more thing that I didn't really see in the patch (but I may have skimmed 
over it)

What is the difference/improvement between the stock driver and the 
Candela-Tech driver? (i.e. as someone configuring LEDE, why would I pick your 
driver?)

David Lang



The main reason is that it better supports CT ath10k firmware:

http://www.candelatech.com/ath10k-10.1.php
http://www.candelatech.com/ath10k-10.4.php

See the features list down this page a bit.  It is at least mostly up to date.
If you are not using my firmware, then I am not sure my driver will give
you much benefit over stock.

Firmware (10.1) release notes here:

http://www.candelatech.com/downloads/ath10k-fw-beta/release_notes.txt

One of the nice features for me is that I can get much better 'core' dumps out 
of
my firmware when using this driver, so I expect I can debug firmware crashes
more thoroughly.

For folks on this list, the IBSS support and capturing more frames in monitor
mode might be a key benefit.

Thanks,
Ben

--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev