[OpenWrt-Devel] [CC 15.05-rc3] libevent: Security update (CVE-2014-6272)

2015-09-01 Thread jow
The libevent package has been rebuilt and was uploaded to the Chaos
Calmer 15.05 Release Candicate 3 repository due to a reported security
issue.


VERSION

1.4.14b-2 => 1.4.15-1


CHANGELOG

[Tue, 1 Sep 2015 19:55:47 +0200 b721a1d]

This update fixes CVE-2014-6272. Change of source URL was needed,
because the older location does not contain the latest version.


CHANGES

 libs/libevent/Makefile |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)


REFERENCES

 * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6272
 * 
https://github.com/openwrt/packages/commit/b721a1d8ccbdf5076021ca499aaa06d102fb4dc9
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [BB 14.07] libevent: Security update (CVE-2014-6272)

2015-09-01 Thread jow
The libevent package has been rebuilt and was uploaded to the Barrier
Breaker 14.07 repository due to a reported security issue.


VERSION

1.4.14b-2 => 1.4.15-1


CHANGELOG

[Tue, 1 Sep 2015 19:56:29 +0200 a77f672]

This update fixes CVE-2014-6272. Change of source URL was needed,
because the older location does not contain the latest version.


CHANGES

 libs/libevent/Makefile |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)


REFERENCES

 * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6272
 * 
https://github.com/openwrt/packages/commit/a77f6728a4c5291e4780d8789b31a4dff383b7dd
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uci: add import call

2015-09-01 Thread Alexander Couzens
similiar to import from uci cli.
import removes all old configs and import the new config.

example:
ubus call uci import \
  '{"config": "dhcp", "values": { "srv": { ".type": "host", ".name": "srv", 
"mac": "00:11:22:33:44:55", "ip": "192.168.1.2" } } }'
---
 uci.c | 152 ++
 1 file changed, 152 insertions(+)

changelog:
- cleanup whitespace/tab indention
- add {} around to make it more readable
- implement same coding style than file.c

diff --git a/uci.c b/uci.c
index 8b5dafd..c59f24d 100644
--- a/uci.c
+++ b/uci.c
@@ -32,6 +32,21 @@ static struct ubus_context *apply_ctx;
 static char apply_sid[RPC_SID_LEN + 1];
 
 enum {
+   RPC_ADD_TYPE,
+   RPC_ADD_NAME,
+   RPC_ADD_ANONYMOUS,
+   RPC_ADD_INDEX,
+   __RPC_ADD_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_add_section_policy[__RPC_ADD_MAX] = 
{
+   [RPC_ADD_TYPE]  = { .name = ".type",   .type = 
BLOBMSG_TYPE_STRING },
+   [RPC_ADD_NAME]  = { .name = ".name",   .type = 
BLOBMSG_TYPE_STRING },
+   [RPC_ADD_ANONYMOUS] = { .name = ".anonymous",  .type = 
BLOBMSG_TYPE_BOOL   },
+   [RPC_ADD_INDEX] = { .name = ".index",  .type = 
BLOBMSG_TYPE_INT32  },
+};
+
+enum {
RPC_G_CONFIG,
RPC_G_SECTION,
RPC_G_OPTION,
@@ -90,6 +105,20 @@ static const struct blobmsg_policy 
rpc_uci_set_policy[__RPC_S_MAX] = {
 };
 
 enum {
+   RPC_I_CONFIG,
+   RPC_I_VALUES,
+   RPC_I_SESSION,
+   __RPC_I_MAX,
+};
+
+static const struct blobmsg_policy rpc_uci_import_policy[__RPC_I_MAX] = {
+   [RPC_I_CONFIG]  = { .name = "config",   .type = BLOBMSG_TYPE_STRING },
+   [RPC_I_VALUES]  = { .name = "values",   .type = BLOBMSG_TYPE_TABLE  },
+   [RPC_I_SESSION] = { .name = "ubus_rpc_session",
+   .type = BLOBMSG_TYPE_STRING },
+};
+
+enum {
RPC_D_CONFIG,
RPC_D_SECTION,
RPC_D_TYPE,
@@ -179,6 +208,9 @@ static const struct blobmsg_policy 
rpc_uci_rollback_policy[__RPC_B_MAX] = {
.type = BLOBMSG_TYPE_STRING },
 };
 
+static void
+rpc_uci_merge_delete(struct blob_attr *opt, struct uci_ptr *ptr);
+
 /*
  * Turn uci error state into ubus return code
  */
@@ -659,8 +691,10 @@ rpc_uci_add(struct ubus_context *ctx, struct ubus_object 
*obj,
{
case BLOBMSG_TYPE_ARRAY:
blobmsg_for_each_attr(elem, cur, rem2)
+   {
if (rpc_uci_format_blob(elem, 
))
uci_add_list(cursor, );
+   }
break;
 
default:
@@ -729,6 +763,123 @@ rpc_uci_merge_set(struct blob_attr *opt, struct uci_ptr 
*ptr)
 }
 
 static int
+rpc_uci_add_section(struct uci_package *p, struct blob_attr *msg)
+{
+   struct uci_section *s;
+   struct uci_ptr ptr = { 0 };
+   struct blob_attr *cur, *elem;
+   struct blob_attr *tb[__RPC_ADD_MAX];
+   int rem, rem2;
+
+   blobmsg_parse(rpc_uci_add_section_policy, __RPC_ADD_MAX, tb,
+ blobmsg_data(msg), blobmsg_len(msg));
+
+   ptr.package = p->e.name;
+
+   if (!tb[RPC_ADD_TYPE])
+   goto out;
+
+   /* add named section */
+   if (tb[RPC_ADD_NAME])
+   {
+   ptr.section = blobmsg_data(tb[RPC_ADD_NAME]);
+   ptr.value = blobmsg_data(tb[RPC_ADD_TYPE]);
+   ptr.option = NULL;
+
+   if (rpc_uci_lookup() || uci_set(cursor, ))
+   goto out;
+   } else {
+   if (uci_add_section(cursor, p, blobmsg_data(tb[RPC_ADD_TYPE]), 
) || !s)
+   goto out;
+
+   ptr.section = s->e.name;
+   }
+
+   blobmsg_for_each_attr(cur, msg, rem)
+   {
+   if (!strcmp(blobmsg_name(cur), ".type") ||
+   !strcmp(blobmsg_name(cur), ".anonymous") ||
+   !strcmp(blobmsg_name(cur), ".name") ||
+   !strcmp(blobmsg_name(cur), ".index"))
+   continue;
+   ptr.o = NULL;
+   ptr.option = blobmsg_name(cur);
+
+   if (rpc_uci_lookup() || !ptr.s)
+   continue;
+
+   switch (blobmsg_type(cur))
+   {
+   case BLOBMSG_TYPE_ARRAY:
+   blobmsg_for_each_attr(elem, cur, rem2)
+   if (rpc_uci_format_blob(elem, 
))
+   uci_add_list(cursor, );
+   break;
+
+   default:
+   if (rpc_uci_format_blob(cur, ))
+   uci_set(cursor, );
+   break;
+   }
+   }
+
+

[OpenWrt-Devel] [PATCH] kernel: bridge, multicast-to-unicast: fix echoes on STA

2015-09-01 Thread Linus Lüssing
Currently, multicast packets from an STA are sent to any according
multicast listener directly through the bridge multicast-to-unicast
feature. Unfortunately, so far this includes the originating STA, too,
resulting in multicast packets being echo'ed back to the originating STA
if it itself is a multicast listener for that group.

This behaviour breaks IPv6 duplicate address detection: An IPv6 Neighbor
Solicitation for IPv6 Duplicate Address Detection is being echo'ed back,
resulting in the host falsely detecting an address collision, which
makes the node unable to claim an IPv6 address and use IPv6 in general.

Mac80211 unfortunately only prevents the echoes for us for multicast
frames. For the multicast frames cast to a unicast destination we'll
need to take care of excluding the originator ourselves.

Signed-off-by: Linus Lüssing 
---
 .../645-bridge_multicast_to_unicast.patch  |   35 +++-
 .../645-bridge_multicast_to_unicast.patch  |   11 --
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git 
a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch 
b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
index 1e070d9..a40abb5 100644
--- a/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
+++ b/target/linux/generic/patches-3.18/645-bridge_multicast_to_unicast.patch
@@ -133,7 +133,7 @@
if (err)
break;
}
-@@ -1407,7 +1433,8 @@ br_multicast_leave_group(struct net_brid
+@@ -1406,7 +1432,8 @@ br_multicast_leave_group(struct net_brid
 struct net_bridge_port *port,
 struct br_ip *group,
 struct bridge_mcast_other_query *other_query,
@@ -143,7 +143,7 @@
  {
struct net_bridge_mdb_htable *mdb;
struct net_bridge_mdb_entry *mp;
-@@ -1457,7 +1484,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1456,7 +1483,7 @@ br_multicast_leave_group(struct net_brid
for (pp = >ports;
 (p = mlock_dereference(*pp, br)) != NULL;
 pp = >next) {
@@ -152,7 +152,7 @@
continue;
  
rcu_assign_pointer(*pp, p->next);
-@@ -1491,7 +1518,7 @@ br_multicast_leave_group(struct net_brid
+@@ -1490,7 +1517,7 @@ br_multicast_leave_group(struct net_brid
for (p = mlock_dereference(mp->ports, br);
 p != NULL;
 p = mlock_dereference(p->next, br)) {
@@ -161,7 +161,7 @@
continue;
  
if (!hlist_unhashed(>mglist) &&
-@@ -1509,8 +1536,8 @@ out:
+@@ -1508,8 +1535,8 @@ out:
  
  static void br_ip4_multicast_leave_group(struct net_bridge *br,
 struct net_bridge_port *port,
@@ -172,7 +172,7 @@
  {
struct br_ip br_group;
struct bridge_mcast_own_query *own_query;
-@@ -1525,14 +1552,14 @@ static void br_ip4_multicast_leave_group
+@@ -1524,14 +1551,14 @@ static void br_ip4_multicast_leave_group
br_group.vid = vid;
  
br_multicast_leave_group(br, port, _group, >ip4_other_query,
@@ -189,7 +189,7 @@
  {
struct br_ip br_group;
struct bridge_mcast_own_query *own_query;
-@@ -1547,7 +1574,7 @@ static void br_ip6_multicast_leave_group
+@@ -1546,7 +1573,7 @@ static void br_ip6_multicast_leave_group
br_group.vid = vid;
  
br_multicast_leave_group(br, port, _group, >ip6_other_query,
@@ -198,7 +198,7 @@
  }
  #endif
  
-@@ -1556,6 +1583,7 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1555,6 +1582,7 @@ static int br_multicast_ipv4_rcv(struct
 struct sk_buff *skb,
 u16 vid)
  {
@@ -206,7 +206,7 @@
struct sk_buff *skb2 = skb;
const struct iphdr *iph;
struct igmphdr *ih;
-@@ -1629,7 +1657,8 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1628,7 +1656,8 @@ static int br_multicast_ipv4_rcv(struct
case IGMP_HOST_MEMBERSHIP_REPORT:
case IGMPV2_HOST_MEMBERSHIP_REPORT:
BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
@@ -216,7 +216,7 @@
break;
case IGMPV3_HOST_MEMBERSHIP_REPORT:
err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
-@@ -1638,7 +1667,8 @@ static int br_multicast_ipv4_rcv(struct
+@@ -1637,7 +1666,8 @@ static int br_multicast_ipv4_rcv(struct
err = br_ip4_multicast_query(br, port, skb2, vid);
break;
case IGMP_HOST_LEAVE_MESSAGE:
@@ -226,7 +226,7 @@
break;
}
  
-@@ -1656,6 +1686,7 @@ static int br_multicast_ipv6_rcv(struct
+@@ -1655,6 +1685,7 @@ static int br_multicast_ipv6_rcv(struct
 struct sk_buff *skb,
 u16 vid)
  {
@@ -234,7 +234,7 @@
struct sk_buff *skb2;
const struct ipv6hdr *ip6h;
u8 icmp6_type;
-@@ -1765,7 +1796,9 

Re: [OpenWrt-Devel] [PATCH] dnsmasq: support hostid ipv6 address suffix option

2015-09-01 Thread Kevin Darbyshire-Bryant
Please ignore the patch. Just woken in middle of night and realised I've done 
something mind numbingly stupid. Will fix tomorrow!


--
Cheers,

ke...@darbyshire-bryant.me.uk

Sent from my phone, apologies for brevity, spelling & top posting

> On 1 Sep 2015, at 21:03, Kevin Darbyshire-Bryant 
>  wrote:
> 
> Add support for hostid dhcp config entry to dnsmasq. This allows
> specification of dhcpv6 hostid suffix and works in the same way as
> odhcpd.
> 
> Entries in auto generated dnsmasq.conf should conform to:
> 
> dhcp-host=mm:mm:mm:mm:mm:mm,IPv4addr,[::V6:su:ff:ix],hostname
> 
> example based on sample config/dhcp entry:
> 
> config host
>option name 'Kermit'
>option mac 'E0:3F:49:A1:D4:AA'
>option ip '192.168.235.4'
>option hostid '4'
> 
> dhcp-host=E0:3F:49:A1:D4:AA,192.168.235.4,[::00:00:00:04],Kermit
> 
> Signed-off-by: Kevin Darbyshire-Bryant 
> ---
> Proper thanks to jow_laptop for lots of help with this
> 
> .../network/services/dnsmasq/files/dnsmasq.init| 29 +-
> 1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
> b/package/network/services/dnsmasq/files/dnsmasq.init
> index ab64e88..58c301f 100644
> --- a/package/network/services/dnsmasq/files/dnsmasq.init
> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
> @@ -23,6 +23,27 @@ xappend() {
>echo "${value#--}" >> $CONFIGFILE
> }
> 
> +hex_to_hostid() {
> +local var="$1"
> +local hex="${2#0x}" # strip optional "0x" prefix
> +
> +if [ -n "${hex//[0-9a-fA-F]/}" ]; then
> +# is invalid hex literal
> +return 1
> +fi
> +
> +# convert into host id
> +export "$var=$(
> +printf "%02x:%02x:%02x:%02x\n"  \
> +$(((0x$hex >> 24) % 256)) \
> +$(((0x$hex >> 16) % 256)) \
> +$(((0x$hex >>  8) % 256)) \
> +$(( 0x$hex% 256))
> +)"
> +
> +return 0
> +}
> +
> dhcp_calc() {
>local ip="$1"
>local res=0
> @@ -329,10 +350,16 @@ dhcp_host_add() {
> 
>config_get tag "$cfg" tag
> 
> +config_get hostid "$cfg" hostid
> +
> +if [ -n "$hostid" ]; then
> +hex_to_hostid hostid "$hostid"
> +fi
> +
>config_get_bool broadcast "$cfg" broadcast 0
>[ "$broadcast" = "0" ] && broadcast=
> 
> -xappend 
> "--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip}${name:+,$name}"
> +xappend 
> "--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}"
> }
> 
> dhcp_tag_add() {
> -- 
> 1.9.1
> 


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


[OpenWrt-Devel] Ubus request through AJAX issue

2015-09-01 Thread Lazar Demin
Hi,

I have a site running on my openwrt device, and I am using AJAX to make
ubus calls to my custom rpcd ubus scripts.

The issue I'm seeing is that some of my ubus ajax calls work, but one
particular method doesn't work at all, it doesn't get run on my device and
the ajax call returns an array with one element set to 2.

I've tried running the ubus call directly from the command line with the
same json parameters as from the ajax call, and it executes correctly,
making this even more confusing...

Has anyone experienced something like this before? Can anyone point me in
the right direction?

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


[OpenWrt-Devel] [PATCH] dnsmasq: support hostid ipv6 address suffix option

2015-09-01 Thread Kevin Darbyshire-Bryant
Add support for hostid dhcp config entry to dnsmasq. This allows
specification of dhcpv6 hostid suffix and works in the same way as
odhcpd.

Entries in auto generated dnsmasq.conf should conform to:

dhcp-host=mm:mm:mm:mm:mm:mm,IPv4addr,[::V6:su:ff:ix],hostname

example based on sample config/dhcp entry:

config host
option name 'Kermit'
option mac 'E0:3F:49:A1:D4:AA'
option ip '192.168.235.4'
option hostid '4'

dhcp-host=E0:3F:49:A1:D4:AA,192.168.235.4,[::00:00:00:04],Kermit

Signed-off-by: Kevin Darbyshire-Bryant 
---
Proper thanks to jow_laptop for lots of help with this

 .../network/services/dnsmasq/files/dnsmasq.init| 29 +-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
b/package/network/services/dnsmasq/files/dnsmasq.init
index ab64e88..58c301f 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -23,6 +23,27 @@ xappend() {
echo "${value#--}" >> $CONFIGFILE
 }
 
+hex_to_hostid() {
+local var="$1"
+local hex="${2#0x}" # strip optional "0x" prefix
+
+if [ -n "${hex//[0-9a-fA-F]/}" ]; then
+# is invalid hex literal
+return 1
+fi
+
+# convert into host id
+export "$var=$(
+printf "%02x:%02x:%02x:%02x\n"  \
+$(((0x$hex >> 24) % 256)) \
+$(((0x$hex >> 16) % 256)) \
+$(((0x$hex >>  8) % 256)) \
+$(( 0x$hex% 256))
+)"
+
+return 0
+}
+
 dhcp_calc() {
local ip="$1"
local res=0
@@ -329,10 +350,16 @@ dhcp_host_add() {
 
config_get tag "$cfg" tag
 
+   config_get hostid "$cfg" hostid
+
+   if [ -n "$hostid" ]; then
+   hex_to_hostid hostid "$hostid"
+   fi
+
config_get_bool broadcast "$cfg" broadcast 0
[ "$broadcast" = "0" ] && broadcast=
 
-   xappend 
"--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip}${name:+,$name}"
+   xappend 
"--dhcp-host=$macs${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}"
 }
 
 dhcp_tag_add() {
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Fwd: AR9344 OpenWrt (Scanning Device)

2015-09-01 Thread John kerry
 I am using openwrt + luci 0.11.1

[image: Inline image 1]

When we do scan Its takes too much time to display the scanning device list
and some times its fail to display

On Tue, Sep 1, 2015 at 4:38 PM, Bruno Randolf  wrote:

> Hello John,
>
> Not sure what exactly you are referring to with scanning, but my tool
> called "horst" may help to quickly get an overview of what's happening
> in the "air"... It needs a monitor interface however.
>
> http://br1.einfach.org/tech/horst/
>
> bruno
>
> On 09/01/2015 04:23 AM, John kerry wrote:
> > Hi,
> >
> > I am working on AR9344 openWrt project. When I am doing scanning the
> > device wireless It's taking very long time to display the Scanning
> devices.
> >
> > Could anyone help me, how I can reduce the delay.
> >
> > Thanks,
> >
> >
> > ___
> > 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] ubus: potential regression in request processing

2015-09-01 Thread Zefir Kurtisi
On 08/31/2015 07:19 PM, Felix Fietkau wrote:
> On 2015-08-31 19:02, Zefir Kurtisi wrote:
>> On 08/27/2015 02:17 PM, Felix Fietkau wrote:
>>> [...]
>>> This change (mostly untested) might fix the issue while still preserving
>>> processing of pending notifications, what do you think?
>>>
>>> [...]
>>
>> Thank you for the suggestion, Felix. Alas, while trying to dig deeper, I 
>> noticed
>> another recent modification that bricked my host-based test environment.
>>
>> I use to test and debug ubus based modules on host, which so far worked as
>> expected. Moving ubus and libubox to HEAD, there seem some undocumented
>> requirements introduced to get the system running again.
>>
>> Here's how to reproduce:
>> * build on host
>> * run ubusd -s /tmp/ubus.sock
>> * run examples/server -s /tmp/ubus.sock
>> => server fails to register
>>
>>
>> Must be something with access rights to directories, since the same sources 
>> work
>> on target as expected - with the only difference being run as root.
> Can't reproduce this on my host (tried on Mac OS X and Linux).
> 
> - Felix
> 
Hm, strange. Ubuntu 15.10 here, what I observe is:

* upon server registration, ubusd_create_object() calls ubusd_acl_check()
* when examples/server is run as root, ubusd_acl_check() is left early because 
of
if (!cl->gid && !cl->uid)
return 0;
* when examples/server is run as non-root
  * ubusd_acl_check() returns an error since there are no ACLs
  * registration fails with 'Failed to add object: Invalid argument'


In your tests, do you have any ACLs set? Is this the intended behaviour for the
ACL functionality, i.e. either run as root or provide correct ACLs?


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


Re: [OpenWrt-Devel] [PATCH] opkg: Extend 'opkg list' command to optionally display package size

2015-09-01 Thread Hannu Nyman
I created a Luci implementation that utilises this opkg change to show the 
.ipk size to the user in GUI:

https://github.com/openwrt/luci/issues/19#issuecomment-136397807


On 30.8.2015 17:37, Hannu Nyman wrote:
... Luci might be extended to utilize the new options to e.g. answer 
https://github.com/openwrt/luci/issues/19



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


[OpenWrt-Devel] [PATCH 6/6] malta: set CPU_TYPE:=24kc.

2015-09-01 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 target/linux/malta/Makefile |1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile
index 9352dfa..0cce15e 100644
--- a/target/linux/malta/Makefile
+++ b/target/linux/malta/Makefile
@@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk
 
 BOARD:=malta
 BOARDNAME:=MIPS Malta CoreLV board (qemu)
+CPU_TYPE:=24kc
 SUBTARGETS:=le be #le64 be64
 INITRAMFS_EXTRA_FILES:=
 MAINTAINER:=Florian Fainelli 
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/6] ppp: cleanup fetching values for several parameters

2015-09-01 Thread Felix Fietkau
On 2015-09-01 14:14, Yousong Zhou wrote:
> Signed-off-by: Yousong Zhou 
> ---
>  package/network/services/ppp/files/ppp.sh |4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/package/network/services/ppp/files/ppp.sh 
> b/package/network/services/ppp/files/ppp.sh
> index a6389a8..b970f29 100755
> --- a/package/network/services/ppp/files/ppp.sh
> +++ b/package/network/services/ppp/files/ppp.sh
> @@ -86,6 +86,7 @@ ppp_generic_setup() {
>   local localip
>  
>   json_get_vars ipv6 demand keepalive keepalive_adaptive username 
> password pppd_options pppname unnumbered
> + json_get_vars connect disconnect mtu
>   if [ "$ipv6" = 0 ]; then
>   ipv6=""
>   elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
> @@ -98,7 +99,6 @@ ppp_generic_setup() {
>   else
>   demand=""
>   fi
> - [ -n "$mtu" ] || json_get_var mtu mtu
>   [ -n "$pppname" ] || pppname="${proto:-ppp}-$config"
>   [ -n "$unnumbered" ] && {
>   local subnets
> @@ -117,8 +117,6 @@ ppp_generic_setup() {
>   [ "${lcp_failure:-0}" -lt 1 ] && lcp_failure=""
>   [ "$lcp_interval" != "$keepalive" ] || lcp_interval=5
>   [ "${keepalive_adaptive:-1}" -lt 1 ] && lcp_adaptive=""
> - [ -n "$connect" ] || json_get_var connect connect
> - [ -n "$disconnect" ] || json_get_var disconnect disconnect
The point of that code was to allow callers of that function to override
these values. Did you check all callers?

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


Re: [OpenWrt-Devel] [PATCH 6/6] malta: set CPU_TYPE:=24kc.

2015-09-01 Thread Florian Fainelli
Le 1 sept. 2015 05:22, "Yousong Zhou"  a écrit :
>
> Signed-off-by: Yousong Zhou 
> ---
>  target/linux/malta/Makefile |1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile
> index 9352dfa..0cce15e 100644
> --- a/target/linux/malta/Makefile
> +++ b/target/linux/malta/Makefile
> @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk
>
>  BOARD:=malta
>  BOARDNAME:=MIPS Malta CoreLV board (qemu)
> +CPU_TYPE:=24kc

This is certainly valid, but needs to come up with a better explanation as
to why we would want this.

>  SUBTARGETS:=le be #le64 be64
>  INITRAMFS_EXTRA_FILES:=
>  MAINTAINER:=Florian Fainelli 
> --
> 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 mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/6] ppp: cleanup fetching values for several parameters

2015-09-01 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 package/network/services/ppp/files/ppp.sh |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/network/services/ppp/files/ppp.sh 
b/package/network/services/ppp/files/ppp.sh
index a6389a8..b970f29 100755
--- a/package/network/services/ppp/files/ppp.sh
+++ b/package/network/services/ppp/files/ppp.sh
@@ -86,6 +86,7 @@ ppp_generic_setup() {
local localip
 
json_get_vars ipv6 demand keepalive keepalive_adaptive username 
password pppd_options pppname unnumbered
+   json_get_vars connect disconnect mtu
if [ "$ipv6" = 0 ]; then
ipv6=""
elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
@@ -98,7 +99,6 @@ ppp_generic_setup() {
else
demand=""
fi
-   [ -n "$mtu" ] || json_get_var mtu mtu
[ -n "$pppname" ] || pppname="${proto:-ppp}-$config"
[ -n "$unnumbered" ] && {
local subnets
@@ -117,8 +117,6 @@ ppp_generic_setup() {
[ "${lcp_failure:-0}" -lt 1 ] && lcp_failure=""
[ "$lcp_interval" != "$keepalive" ] || lcp_interval=5
[ "${keepalive_adaptive:-1}" -lt 1 ] && lcp_adaptive=""
-   [ -n "$connect" ] || json_get_var connect connect
-   [ -n "$disconnect" ] || json_get_var disconnect disconnect
 
proto_run_command "$config" /usr/sbin/pppd \
nodetach ipparam "$config" \
-- 
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 4/6] generic: fix unrecognized opcode wsbh when building for MIPS16.

2015-09-01 Thread Yousong Zhou
The issue was found and reported by hynman [1] when compiling reaver for ar71xx
(Big Endian MIPS).

{standard input}: Assembler messages:
{standard input}:79: Error: unrecognized opcode `wsbh $2,$2'
{standard input}:90: Error: unrecognized opcode `wsbh $3,$17'
{standard input}:208: Error: unrecognized opcode `wsbh $2,$2'
make[3]: *** [builder.o] Error 1

 [1] 
https://github.com/openwrt/packages/commit/1e29676a8ac74f797f8ca799364681cec575ae6f#commitcomment-12901931

Signed-off-by: Yousong Zhou 
---
 ...recognized-opcode-WSBH-DSBH-DSHD-when-usi.patch |   85 
 ...recognized-opcode-WSBH-DSBH-DSHD-when-usi.patch |   85 
 ...recognized-opcode-WSBH-DSBH-DSHD-when-usi.patch |   85 
 3 files changed, 255 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.18/133-MIPS-Fix-unrecognized-opcode-WSBH-DSBH-DSHD-when-usi.patch
 create mode 100644 
target/linux/generic/patches-4.0/133-MIPS-Fix-unrecognized-opcode-WSBH-DSBH-DSHD-when-usi.patch
 create mode 100644 
target/linux/generic/patches-4.1/133-MIPS-Fix-unrecognized-opcode-WSBH-DSBH-DSHD-when-usi.patch

diff --git 
a/target/linux/generic/patches-3.18/133-MIPS-Fix-unrecognized-opcode-WSBH-DSBH-DSHD-when-usi.patch
 
b/target/linux/generic/patches-3.18/133-MIPS-Fix-unrecognized-opcode-WSBH-DSBH-DSHD-when-usi.patch
new file mode 100644
index 000..2056735
--- /dev/null
+++ 
b/target/linux/generic/patches-3.18/133-MIPS-Fix-unrecognized-opcode-WSBH-DSBH-DSHD-when-usi.patch
@@ -0,0 +1,85 @@
+From f4b20c49109045fc2f58f7b67160f07ebd7f0ea7 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou 
+Date: Thu, 27 Aug 2015 09:58:53 +0800
+Subject: [PATCH] MIPS: Fix unrecognized opcode WSBH/DSBH/DSHD when using
+ MIPS16.
+
+The nomips16 has to be added both as function attribute and assembler
+directive.
+
+When only function attribute was specified, the compiler will inline the
+function when -Os optimization was applied.  The generated assembly code
+was cannot be correctly assembled because ISA mode switch has to be done
+with a jump.
+
+When only ".set nomips" directive was used, the compiled function code
+will be invalid because mixed MIPS16 and MIPS32 instructions were
+generated by gcc.  The result will be like the following,
+
+00403100 <__arch_swab16>:
+  403100:   7c0410a0wsbhv0,a0
+  403104:   e820ea31swc2$0,-5583(at)
+
+while correct code should be
+
+00402650 <__arch_swab16>:
+  402650:   7c0410a0wsbhv0,a0
+  402654:   03e8jr  ra
+  402658:   3042andiv0,v0,0x
+
+Signed-off-by: Yousong Zhou 
+---
+ arch/mips/include/uapi/asm/swab.h |   11 ---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/arch/mips/include/uapi/asm/swab.h 
b/arch/mips/include/uapi/asm/swab.h
+index 8f2d184..4b1044d 100644
+--- a/arch/mips/include/uapi/asm/swab.h
 b/arch/mips/include/uapi/asm/swab.h
+@@ -16,11 +16,14 @@
+ #if (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \
+ defined(_MIPS_ARCH_LOONGSON3A)
+ 
+-static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
++#define __nomips16 __attribute__((nomips16))
++
++static inline __nomips16 __attribute_const__ __u16 __arch_swab16(__u16 x)
+ {
+   __asm__(
+   "   .setpush\n"
+   "   .setarch=mips32r2   \n"
++  "   .setnomips16\n"
+   "   wsbh%0, %1  \n"
+   "   .setpop \n"
+   : "=r" (x)
+@@ -30,11 +33,12 @@ static inline __attribute_const__ __u16 
__arch_swab16(__u16 x)
+ }
+ #define __arch_swab16 __arch_swab16
+ 
+-static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
++static inline __nomips16 __attribute_const__ __u32 __arch_swab32(__u32 x)
+ {
+   __asm__(
+   "   .setpush\n"
+   "   .setarch=mips32r2   \n"
++  "   .setnomips16\n"
+   "   wsbh%0, %1  \n"
+   "   rotr%0, %0, 16  \n"
+   "   .setpop \n"
+@@ -50,11 +54,12 @@ static inline __attribute_const__ __u32 
__arch_swab32(__u32 x)
+  * 64-bit kernel on r2 CPUs.
+  */
+ #ifdef __mips64
+-static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
++static inline __nomips16 __attribute_const__ __u64 __arch_swab64(__u64 x)
+ {
+   __asm__(
+   "   .setpush\n"
+   "   .setarch=mips64r2   \n"
++  "   .setnomips16\n"
+   "   dsbh%0, %1  \n"
+   "   dshd%0, %0  \n"
+   "   .setpop \n"
+-- 
+1.7.10.4
+
diff --git 
a/target/linux/generic/patches-4.0/133-MIPS-Fix-unrecognized-opcode-WSBH-DSBH-DSHD-when-usi.patch
 

[OpenWrt-Devel] [PATCH 5/6] target.mk: add optimization flags for MIPS 24Kc.

2015-09-01 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 include/target.mk |1 +
 1 file changed, 1 insertion(+)

diff --git a/include/target.mk b/include/target.mk
index 3e7f17d..119f88c 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -212,6 +212,7 @@ ifeq ($(DUMP),1)
 CPU_CFLAGS_mips32 = -mips32 -mtune=mips32
 CPU_CFLAGS_mips32r2 = -mips32r2 -mtune=mips32r2
 CPU_CFLAGS_mips64 = -mips64 -mtune=mips64 -mabi=64
+CPU_CFLAGS_24kc = -mips32r2 -mtune=24kc
 CPU_CFLAGS_24kec = -mips32r2 -mtune=24kec
 CPU_CFLAGS_34kc = -mips32r2 -mtune=34kc
 CPU_CFLAGS_74kc = -mips32r2 -mtune=74kc
-- 
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/2] netifd : Apply device settings when existing device becomes external

2015-09-01 Thread Hans Dedecker
Make sure device settings are applied when existing device becomes external

Signed-off-by: Hans Dedecker 
---
 device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/device.c b/device.c
index 4a8db70..0d73138 100644
--- a/device.c
+++ b/device.c
@@ -446,6 +446,7 @@ device_get(const char *name, int create)
dev = avl_find_element(, name, dev, avl);
if (dev) {
if (create > 1 && !dev->external) {
+   system_if_apply_settings(dev, >settings, 
dev->settings.flags);
dev->external = true;
device_set_present(dev, true);
}
-- 
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/6] base-files: set kernel.core_pattern in sysctl.conf

2015-09-01 Thread Yousong Zhou
Move the pattern setting from netifd's service script to
/etc/sysctl.conf.  Put the timestamp component '%t' just after
executable name '%e' for more natural order from output of ls command.

Signed-off-by: Yousong Zhou 
---
 package/base-files/files/etc/sysctl.conf   |2 ++
 package/network/config/netifd/files/etc/init.d/network |1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/sysctl.conf 
b/package/base-files/files/etc/sysctl.conf
index 8f3de1a..2ea1f1a 100644
--- a/package/base-files/files/etc/sysctl.conf
+++ b/package/base-files/files/etc/sysctl.conf
@@ -1,4 +1,6 @@
 kernel.panic=3
+kernel.core.pattern=/tmp/%e.%t.%p.%s.core
+
 net.ipv4.conf.default.arp_ignore=1
 net.ipv4.conf.all.arp_ignore=1
 net.ipv4.ip_forward=1
diff --git a/package/network/config/netifd/files/etc/init.d/network 
b/package/network/config/netifd/files/etc/init.d/network
index 542fc08..bdadbbc 100755
--- a/package/network/config/netifd/files/etc/init.d/network
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -21,7 +21,6 @@ start_service() {
procd_set_param watch network.interface
[ -e /proc/sys/kernel/core_pattern ] && {
procd_set_param limits core="unlimited"
-   echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
}
procd_close_instance
 }
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/6] ppp: cleanup fetching values for several parameters

2015-09-01 Thread Yousong Zhou
On 1 September 2015 at 20:22, Felix Fietkau  wrote:
> On 2015-09-01 14:14, Yousong Zhou wrote:
>> Signed-off-by: Yousong Zhou 
>> ---
>>  package/network/services/ppp/files/ppp.sh |4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/package/network/services/ppp/files/ppp.sh 
>> b/package/network/services/ppp/files/ppp.sh
>> index a6389a8..b970f29 100755
>> --- a/package/network/services/ppp/files/ppp.sh
>> +++ b/package/network/services/ppp/files/ppp.sh
>> @@ -86,6 +86,7 @@ ppp_generic_setup() {
>>   local localip
>>
>>   json_get_vars ipv6 demand keepalive keepalive_adaptive username 
>> password pppd_options pppname unnumbered
>> + json_get_vars connect disconnect mtu
>>   if [ "$ipv6" = 0 ]; then
>>   ipv6=""
>>   elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
>> @@ -98,7 +99,6 @@ ppp_generic_setup() {
>>   else
>>   demand=""
>>   fi
>> - [ -n "$mtu" ] || json_get_var mtu mtu
>>   [ -n "$pppname" ] || pppname="${proto:-ppp}-$config"
>>   [ -n "$unnumbered" ] && {
>>   local subnets
>> @@ -117,8 +117,6 @@ ppp_generic_setup() {
>>   [ "${lcp_failure:-0}" -lt 1 ] && lcp_failure=""
>>   [ "$lcp_interval" != "$keepalive" ] || lcp_interval=5
>>   [ "${keepalive_adaptive:-1}" -lt 1 ] && lcp_adaptive=""
>> - [ -n "$connect" ] || json_get_var connect connect
>> - [ -n "$disconnect" ] || json_get_var disconnect disconnect
> The point of that code was to allow callers of that function to override
> these values. Did you check all callers?
>

Wow, just found out that comgt 3g.sh is utilising this construct.
Sorry, never thought of such a usage.

Cheers.

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


Re: [OpenWrt-Devel] [PATCH 4/6] generic: fix unrecognized opcode wsbh when building for MIPS16.

2015-09-01 Thread Yousong Zhou
On 1 September 2015 at 20:46, Florian Fainelli  wrote:
> Le 1 sept. 2015 05:22, "Yousong Zhou"  a écrit :
>>
>> The issue was found and reported by hynman [1] when compiling reaver for
>> ar71xx
>> (Big Endian MIPS).
>>
>> {standard input}: Assembler messages:
>> {standard input}:79: Error: unrecognized opcode `wsbh $2,$2'
>> {standard input}:90: Error: unrecognized opcode `wsbh $3,$17'
>> {standard input}:208: Error: unrecognized opcode `wsbh $2,$2'
>> make[3]: *** [builder.o] Error 1
>
> Could you submit this to the linux-mips mailing list first so we only get to
> backport an accepted patch?

Okay, will try this path.

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


[OpenWrt-Devel] [PATCH 2/2] netifd: Don't call set_state for external device in device_claim

2015-09-01 Thread Hans Dedecker
The function set_state disable is not called for external devices in 
device_release
which means for external vlan/macvlan devices they won't be deleted.
As a result of this the set_state enable call for external devices by 
device_claim fails
as vlan/macvlan devices cannot be created since the device already exists in 
the kernel.
Therefore move the external device check from device_set_state to device_claim 
so
external vlan/macvlan devices are not created again and can also be external.

Signed-off-by: Hans Dedecker 
---
 device.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/device.c b/device.c
index 0d73138..21b436f 100644
--- a/device.c
+++ b/device.c
@@ -81,9 +81,6 @@ static int set_device_state(struct device *dev, bool state)
return -1;
}
 
-   if (dev->external)
-   return 0;
-
if (state)
system_if_up(dev);
else
@@ -324,7 +321,7 @@ void device_broadcast_event(struct device *dev, enum 
device_event ev)
 int device_claim(struct device_user *dep)
 {
struct device *dev = dep->dev;
-   int ret;
+   int ret = 0;
 
if (dep->claimed)
return 0;
@@ -335,7 +332,9 @@ int device_claim(struct device_user *dep)
return 0;
 
device_broadcast_event(dev, DEV_EVENT_SETUP);
-   ret = dev->set_state(dev, true);
+   if (!dev->external)
+   ret = dev->set_state(dev, true);
+
if (ret == 0)
device_broadcast_event(dev, DEV_EVENT_UP);
else {
-- 
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] [PATCH 4/6] generic: fix unrecognized opcode wsbh when building for MIPS16.

2015-09-01 Thread Florian Fainelli
Le 1 sept. 2015 05:22, "Yousong Zhou"  a écrit :
>
> The issue was found and reported by hynman [1] when compiling reaver for
ar71xx
> (Big Endian MIPS).
>
> {standard input}: Assembler messages:
> {standard input}:79: Error: unrecognized opcode `wsbh $2,$2'
> {standard input}:90: Error: unrecognized opcode `wsbh $3,$17'
> {standard input}:208: Error: unrecognized opcode `wsbh $2,$2'
> make[3]: *** [builder.o] Error 1

Could you submit this to the linux-mips mailing list first so we only get
to backport an accepted patch?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] hostapd: Add eapol_version config option

2015-09-01 Thread Helmut Schaa
Add eapol_version to the openwrt wireless config ssid section.
Only eapol_version=1 and 2 will get passed to hostapd, the default
in hostapd is 2.

This is only useful for really old client devices that don't
accept eapol_version=2.

Signed-off-by: Helmut Schaa 
---
 package/network/services/hostapd/files/netifd.sh | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/netifd.sh 
b/package/network/services/hostapd/files/netifd.sh
index d90ff9b..bdfcbb2 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -120,6 +120,7 @@ hostapd_common_add_bss_config() {
 
config_add_boolean rsn_preauth auth_cache
config_add_int ieee80211w
+   config_add_int eapol_version
 
config_add_string 'auth_server:host' 'server:host'
config_add_string auth_secret
@@ -183,7 +184,7 @@ hostapd_set_bss_options() {
wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 \
wps_device_type wps_device_name wps_manufacturer wps_pin \
macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
-   iapp_interface
+   iapp_interface eapol_version
 
set_default isolate 0
set_default maxassoc 0
@@ -238,6 +239,8 @@ hostapd_set_bss_options() {
[ -e "$wpa_psk_file" ] || touch "$wpa_psk_file"
append bss_conf "wpa_psk_file=$wpa_psk_file" 
"$N"
}
+   [ "$eapol_version" -ge "1" -a "$eapol_version" -le "2" 
] && append bss_conf "eapol_version=$eapol_version" "$N"
+
wps_possible=1
append wpa_key_mgmt "WPA-PSK"
;;
@@ -297,6 +300,8 @@ hostapd_set_bss_options() {
append bss_conf "vlan_file=$vlan_file" 
"$N"
}
}
+
+   [ "$eapol_version" -ge "1" -a "$eapol_version" -le "2" 
] && append bss_conf "eapol_version=$eapol_version" "$N"
;;
wep)
local wep_keyidx=0
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 6/6] malta: set CPU_TYPE:=24kc.

2015-09-01 Thread Yousong Zhou
On Sep 1, 2015 8:44 PM, "Florian Fainelli"  wrote:
>
> Le 1 sept. 2015 05:22, "Yousong Zhou"  a écrit :
> >
> > Signed-off-by: Yousong Zhou 
> > ---
> >  target/linux/malta/Makefile |1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile
> > index 9352dfa..0cce15e 100644
> > --- a/target/linux/malta/Makefile
> > +++ b/target/linux/malta/Makefile
> > @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk
> >
> >  BOARD:=malta
> >  BOARDNAME:=MIPS Malta CoreLV board (qemu)
> > +CPU_TYPE:=24kc
>
> This is certainly valid, but needs to come up with a better explanation
as to why we would want this.

will write more in next version

yousong

>
> >  SUBTARGETS:=le be #le64 be64
> >  INITRAMFS_EXTRA_FILES:=
> >  MAINTAINER:=Florian Fainelli 
> > --
> > 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 mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: enable external amplifier for Xiaomi MiWiFi Mini

2015-09-01 Thread D . Andrei Măceș
Attempt to boost the 2.4 GHz signal, currently very low.

Signed-off-by: D. Andrei Măceș 
---
 target/linux/ramips/dts/MIWIFI-MINI.dts | 5 +
 1 file changed, 5 insertions(+)

diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts 
b/target/linux/ramips/dts/MIWIFI-MINI.dts
index fa9846c..dad99c3 100644
--- a/target/linux/ramips/dts/MIWIFI-MINI.dts
+++ b/target/linux/ramips/dts/MIWIFI-MINI.dts
@@ -113,6 +113,11 @@
ralink,group = "i2c", "rgmii1";
ralink,function = "gpio";
};
+
+   pa {
+   ralink,group = "pa";
+   ralink,function = "pa";
+   };
};
};
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 4/4] mac80211: ath9k: enable hw manual peak calibration for QCA9561

2015-09-01 Thread Matthias Schiffer
On 09/01/2015 06:21 AM, miaoq...@qti.qualcomm.com wrote:
> From: Miaoqing Pan 
> 
> This patch fix https://lists.openwrt.org/pipermail/openwrt-devel/
> 2015-August/034979.html. As the peak detect calibration is set
> incorrectly.
> 
> Signed-off-by: Miaoqing Pan 

Tested-by: Matthias Schiffer 

Thanks a lot :)

> ---
>  ...6-ath9k_enable_hw_manual_peak_calibration.patch | 22 
> ++
>  1 file changed, 22 insertions(+)
>  create mode 100644 
> package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch
> 
> diff --git 
> a/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch
>  
> b/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch
> new file mode 100644
> index 000..8606493
> --- /dev/null
> +++ 
> b/package/kernel/mac80211/patches/546-ath9k_enable_hw_manual_peak_calibration.patch
> @@ -0,0 +1,22 @@
> +--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
>  b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
> +@@ -1249,7 +1249,8 @@ static void ar9003_hw_manual_peak_cal(struct ath_hw 
> *ah, u8 chain, bool is_2g)
> + REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
> +   AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0);
> + 
> +-if (AR_SREV_9003_PCOEM(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah)) {
> ++if (AR_SREV_9003_PCOEM(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah) ||
> ++AR_SREV_9561(ah)) {
> + if (is_2g)
> + REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
> +   AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR,
> +@@ -1640,7 +1641,8 @@ static bool ar9003_hw_init_cal_soc(struct ath_hw *ah,
> + 
> + skip_tx_iqcal:
> + if (run_agc_cal || !(ah->ah_flags & AH_FASTCC)) {
> +-if (AR_SREV_9330_11(ah) || AR_SREV_9531(ah) || 
> AR_SREV_9550(ah)) {
> ++if (AR_SREV_9330_11(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah) 
> ||
> ++AR_SREV_9561(ah)) {
> + for (i = 0; i < AR9300_MAX_CHAINS; i++) {
> + if (!(ah->rxchainmask & (1 << i)))
> + continue;
> 




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


[OpenWrt-Devel] [PATCH procd] hotplug: add BUTTON to environment vars for timeout action

2015-09-01 Thread Günther Kelleter
as done in pressed and released actions

Signed-off-by: Günther Kelleter 
---
 plug/hotplug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plug/hotplug.c b/plug/hotplug.c
index 0c97e4d..b5ebd07 100644
--- a/plug/hotplug.c
+++ b/plug/hotplug.c
@@ -399,6 +399,7 @@ static void handle_button_timeout(struct uloop_timeout *t)
 
b = container_of(t, struct button_timeout, timeout);
blob_buf_init(_buf, 0);
+   blobmsg_add_string(_buf, "BUTTON", b->name);
blobmsg_add_string(_buf, "ACTION", "timeout");
snprintf(seen, sizeof(seen), "%d", b->seen);
blobmsg_add_string(_buf, "SEEN", seen);
-- 
2.4.6.89.g851dcf4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2] netifd: Don't call set_state for external device in device_claim

2015-09-01 Thread Hans Dedecker
On Tue, Sep 1, 2015 at 2:49 PM, Felix Fietkau  wrote:

> On 2015-09-01 14:43, Hans Dedecker wrote:
> > The function set_state disable is not called for external devices in
> device_release
> > which means for external vlan/macvlan devices they won't be deleted.
> > As a result of this the set_state enable call for external devices by
> device_claim fails
> > as vlan/macvlan devices cannot be created since the device already
> exists in the kernel.
> > Therefore move the external device check from device_set_state to
> device_claim so
> > external vlan/macvlan devices are not created again and can also be
> external.
> Why/how do vlan/macvlan devices become external?
>
This use case is driven by an external application which is adding a vlan
device to the bridge.
Initially the vlan device is created as an internal device but not added to
the bridge; later added by an external application via ubus to the bridge.
In this scenario we hit the issue when doing network reload the vlan device
is not anymore an active member of the bridge as vlan set_state enable was
called which failed.
This is a bit similar to a wireless device which has uci device config;
initially it's considered as an internal device by netifd when loading the
config but becomes an external device when the wireless logic adds it to
the bridge.

Hans

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


[OpenWrt-Devel] [PATCH] mvebu: add config and patches for kernel 4.1

2015-09-01 Thread Daniel Golle
Signed-off-by: Daniel Golle 
---
 target/linux/mvebu/config-4.1  | 368 +
 .../patches-4.1/002-add_mamba_powertables.patch| 105 +
 .../mvebu/patches-4.1/003-add_mamba_switch.patch   |  21 +
 .../patches-4.1/005-build_linksys_a385_dts.patch   |  13 +
 ...-mvebu-A385-AP-Enable-the-NAND-controller.patch |  36 ++
 .../050-leds_tlc59116_document_binding.patch   |  53 +++
 .../patches-4.1/051-leds_tlc59116_add_driver.patch | 303 ++
 .../mvebu/patches-4.1/100-find_active_root.patch   |  63 +++
 .../mvebu/patches-4.1/102-revert_i2c_delay.patch   |  17 +
 .../202-gpio_mvebu_add_limited_pwm_support.patch   | 443 +
 ..._extend_mvebu_gpio_documentation_with_pwm.patch |  54 +++
 ...mvebu_xp_add_pwm_properties_to_dtsi_files.patch | 157 
 .../205-arm_mvebu_enable_pwm_in_defconfig.patch|  20 +
 ...rt1900ac_use_pwm-fan_rather_than_gpio-fan.patch |  30 ++
 .../207-armada-385-rd-mtd-partitions.patch |  21 +
 .../208-ARM-mvebu-385-ap-Add-partitions.patch  |  36 ++
 .../mvebu/patches-4.1/300-add_missing_labels.patch |  13 +
 17 files changed, 1753 insertions(+)
 create mode 100644 target/linux/mvebu/config-4.1
 create mode 100644 
target/linux/mvebu/patches-4.1/002-add_mamba_powertables.patch
 create mode 100644 target/linux/mvebu/patches-4.1/003-add_mamba_switch.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/005-build_linksys_a385_dts.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/022-ARM-mvebu-A385-AP-Enable-the-NAND-controller.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/050-leds_tlc59116_document_binding.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/051-leds_tlc59116_add_driver.patch
 create mode 100644 target/linux/mvebu/patches-4.1/100-find_active_root.patch
 create mode 100644 target/linux/mvebu/patches-4.1/102-revert_i2c_delay.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/202-gpio_mvebu_add_limited_pwm_support.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/203-dt_bindings_extend_mvebu_gpio_documentation_with_pwm.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/204-mvebu_xp_add_pwm_properties_to_dtsi_files.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/205-arm_mvebu_enable_pwm_in_defconfig.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/206-mvebu_wrt1900ac_use_pwm-fan_rather_than_gpio-fan.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/207-armada-385-rd-mtd-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-4.1/208-ARM-mvebu-385-ap-Add-partitions.patch
 create mode 100644 target/linux/mvebu/patches-4.1/300-add_missing_labels.patch

diff --git a/target/linux/mvebu/config-4.1 b/target/linux/mvebu/config-4.1
new file mode 100644
index 000..6739c51
--- /dev/null
+++ b/target/linux/mvebu/config-4.1
@@ -0,0 +1,368 @@
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_TICK_BROADCAST=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MULTIPLATFORM=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MVEBU=y
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_ARM=y
+CONFIG_ARMADA_370_CLK=y
+CONFIG_ARMADA_370_XP_TIMER=y
+CONFIG_ARMADA_38X_CLK=y
+CONFIG_ARMADA_XP_CLK=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_ARM_CPUIDLE is not set
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+# CONFIG_ARM_LPAE is not set
+CONFIG_ARM_MVEBU_V7_CPUIDLE=y
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BOUNCE=y
+# CONFIG_CACHE_FEROCEON_L2 is not set
+CONFIG_CACHE_L2X0=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_CLKSRC_OF=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_COMMON_CLK=y
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_CP15=y