[OpenWrt-Devel] [PATCH RESEND 2/5] system-linux: Fix macvlan delete via netlink

2014-06-18 Thread Hans Dedecker
Fix macvlan delete via netlink as netlink attribute IFLA_IFNAME data size was 
incorrect (size reject by the kernel) and NLM_F_REQUEST flag was missing.
In addition some minor improvements (attribute IFLA_INFO_KIND can be left out 
as RTM_DELLINK does not require the attribute)

Signed-off-by: Hans Dedecker 
---
 system-linux.c |   19 +--
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/system-linux.c b/system-linux.c
index ea71f65..4d0f4c9 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -691,7 +691,7 @@ int system_macvlan_add(struct device *macvlan, struct 
device *dev, struct macvla
 {
struct nl_msg *msg;
struct nlattr *linkinfo, *data;
-   struct ifinfomsg iim = { .ifi_family = AF_INET };
+   struct ifinfomsg iim = { .ifi_family = AF_UNSPEC, };
int ifindex = system_if_resolve(dev);
int i, rv;
static const struct {
@@ -716,13 +716,13 @@ int system_macvlan_add(struct device *macvlan, struct 
device *dev, struct macvla
 
if (cfg->flags & MACVLAN_OPT_MACADDR)
nla_put(msg, IFLA_ADDRESS, sizeof(cfg->macaddr), cfg->macaddr);
-   nla_put(msg, IFLA_IFNAME, IFNAMSIZ, macvlan->ifname);
+   nla_put_string(msg, IFLA_IFNAME, macvlan->ifname);
nla_put_u32(msg, IFLA_LINK, ifindex);
 
if (!(linkinfo = nla_nest_start(msg, IFLA_LINKINFO)))
goto nla_put_failure;
 
-   nla_put(msg, IFLA_INFO_KIND, strlen("macvlan"), "macvlan");
+   nla_put_string(msg, IFLA_INFO_KIND, "macvlan");
 
if (!(data = nla_nest_start(msg, IFLA_INFO_DATA)))
goto nla_put_failure;
@@ -754,20 +754,19 @@ nla_put_failure:
 int system_macvlan_del(struct device *macvlan)
 {
struct nl_msg *msg;
-   struct ifinfomsg iim;
-
-   iim.ifi_family = AF_INET;
-   iim.ifi_index  = 0;
+   struct ifinfomsg iim = {
+   .ifi_family = AF_UNSPEC,
+   .ifi_index = 0,
+   };
 
-   msg = nlmsg_alloc_simple(RTM_DELLINK, 0);
+   msg = nlmsg_alloc_simple(RTM_DELLINK, NLM_F_REQUEST);
 
if (!msg)
return -1;
 
nlmsg_append(msg, &iim, sizeof(iim), 0);
 
-   nla_put(msg, IFLA_INFO_KIND, strlen("macvlan"), "macvlan");
-   nla_put(msg, IFLA_IFNAME, sizeof(macvlan->ifname), macvlan->ifname);
+   nla_put_string(msg, IFLA_IFNAME, macvlan->ifname);
 
system_rtnl_call(msg);
 
-- 
1.7.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH RESEND 2/5] netifd: Fix macvlan delete via netlink

2014-06-18 Thread Hans Dedecker
Fix macvlan delete via netlink as netlink attribute IFLA_IFNAME data size was 
incorrect (size reject by the kernel) and NLM_F_REQUEST flag was missing.
In addition some minor improvements (attribute IFLA_INFO_KIND can be left out 
as RTM_DELLINK does not require the attribute)

Signed-off-by: Hans Dedecker 
---
 system-linux.c |   19 +--
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/system-linux.c b/system-linux.c
index ea71f65..4d0f4c9 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -691,7 +691,7 @@ int system_macvlan_add(struct device *macvlan, struct 
device *dev, struct macvla
 {
struct nl_msg *msg;
struct nlattr *linkinfo, *data;
-   struct ifinfomsg iim = { .ifi_family = AF_INET };
+   struct ifinfomsg iim = { .ifi_family = AF_UNSPEC, };
int ifindex = system_if_resolve(dev);
int i, rv;
static const struct {
@@ -716,13 +716,13 @@ int system_macvlan_add(struct device *macvlan, struct 
device *dev, struct macvla
 
if (cfg->flags & MACVLAN_OPT_MACADDR)
nla_put(msg, IFLA_ADDRESS, sizeof(cfg->macaddr), cfg->macaddr);
-   nla_put(msg, IFLA_IFNAME, IFNAMSIZ, macvlan->ifname);
+   nla_put_string(msg, IFLA_IFNAME, macvlan->ifname);
nla_put_u32(msg, IFLA_LINK, ifindex);
 
if (!(linkinfo = nla_nest_start(msg, IFLA_LINKINFO)))
goto nla_put_failure;
 
-   nla_put(msg, IFLA_INFO_KIND, strlen("macvlan"), "macvlan");
+   nla_put_string(msg, IFLA_INFO_KIND, "macvlan");
 
if (!(data = nla_nest_start(msg, IFLA_INFO_DATA)))
goto nla_put_failure;
@@ -754,20 +754,19 @@ nla_put_failure:
 int system_macvlan_del(struct device *macvlan)
 {
struct nl_msg *msg;
-   struct ifinfomsg iim;
-
-   iim.ifi_family = AF_INET;
-   iim.ifi_index  = 0;
+   struct ifinfomsg iim = {
+   .ifi_family = AF_UNSPEC,
+   .ifi_index = 0,
+   };
 
-   msg = nlmsg_alloc_simple(RTM_DELLINK, 0);
+   msg = nlmsg_alloc_simple(RTM_DELLINK, NLM_F_REQUEST);
 
if (!msg)
return -1;
 
nlmsg_append(msg, &iim, sizeof(iim), 0);
 
-   nla_put(msg, IFLA_INFO_KIND, strlen("macvlan"), "macvlan");
-   nla_put(msg, IFLA_IFNAME, sizeof(macvlan->ifname), macvlan->ifname);
+   nla_put_string(msg, IFLA_IFNAME, macvlan->ifname);
 
system_rtnl_call(msg);
 
-- 
1.7.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Howto force mips64

2014-06-18 Thread John Crispin
Hi Martin,

you win the medal as contributor of the day ... i have been fighting
with octeon on and off for almost a month. i just dumped my own series
of patches which tried to fix up uclibc and simple did what you wrote
in the mail and i have a functional image for octeon :)

i just tested this on an esr-lite which seems to work without your
kernel patches. what board are you running on ?

John

On 17/06/2014 11:24, Martin Fäcknitz wrote:
> force mips64 support is quite simple: set
> 
> CPU_CFLAGS_octeon=-march=octeon -mabi=64
> 
> inside target/linux/octeon/Makefile and replace the same line in 
> include/target.mk. Finally you have to add the following patch:
> 
> diff --git
> a/target/linux/octeon/patches-3.10/-cn61xx_support.patch 
> b/target/linux/octeon/patches-3.10/-cn61xx_support.patch new
> file mode 100644 index 000..18d2f3d --- /dev/null +++
> b/target/linux/octeon/patches-3.10/-cn61xx_support.patch @@
> -0,0 +1,47 @@ +Index:
> b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c 
> +===
>
> 
+--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c2014-05-06
> 15:24:06.0 +0200 
> b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c   2014-05-06 
> 15:25:14.0 +0200 +@@ -75,6 +75,8 @@ + int
> cvmx_helper_board_get_mii_address(int ipd_port) + { + switch
> (cvmx_sysinfo_get()->board_type) { ++ case 20003: ++  return -1; +
> case CVMX_BOARD_TYPE_SIM: +   /* Simulator doesn't have MII */ +
> return -1; +Index:
> b/arch/mips/cavium-octeon/executive/cvmx-helper.c 
> +===
>
> 
+--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c  2014-01-25
> 17:27:55.0 +0100 
> b/arch/mips/cavium-octeon/executive/cvmx-helper.c 2014-05-06 
> 15:25:47.0 +0200 +@@ -83,7 +83,7 @@ +  */ + int
> cvmx_helper_get_number_of_interfaces(void) + { +- if
> (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX)) 
> ++if (OCTEON_IS_MODEL(OCTEON_CN56XX) ||
> OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN61XX)) +
> return 4; +   else +  return 3; +@@ -121,7 +121,8 @@ + +  if
> (interface == 3) { +  if (OCTEON_IS_MODEL(OCTEON_CN56XX) +-
> || OCTEON_IS_MODEL(OCTEON_CN52XX)) ++ ||
> OCTEON_IS_MODEL(OCTEON_CN52XX) ++ ||
> OCTEON_IS_MODEL(OCTEON_CN6XXX)) + return
> CVMX_HELPER_INTERFACE_MODE_LOOP; +else +  return
> CVMX_HELPER_INTERFACE_MODE_DISABLED; +@@ -152,7 +153,9 @@ + +
> mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); + +- if
> (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
> { ++  if (OCTEON_IS_MODEL(OCTEON_CN61XX)) { ++return
> CVMX_HELPER_INTERFACE_MODE_SGMII; ++  } else if
> (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
> { +   switch (mode.cn56xx.mode) { +   case 0: +   
> return
> CVMX_HELPER_INTERFACE_MODE_DISABLED;
> 
> uclibc's mips64 support is broken, so you have to use glibc.
> gcc-4.8 doesn't work for me (invalid TLS related code), therefore
> use gcc-4.6.
> 
> greets
> 
> On 16.06.2014 23:26, Edison Figueira Junior wrote:
>> hello, I can be a beta test if you want :-)
>> 
>> Enviada do meu iPhone
>> 
>>> Em 04/06/2014, às 10:05, John Crispin 
>>> escreveu:
>>> 
>>> octeon is currently only partially working. we will push a fix
>>> to trunk in the next few days. experimental patch is currently
>>> in testing. please be patient for a few dyas
>>> 
>>> 
 On 04/06/2014 14:36, Edison Figueira Junior wrote: Howto
 force to use mips64 for target octeon?
 
 
 
 
 ___
 openwrt-devel mailing list openwrt-devel@lists.openwrt.org 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>>
 
___
>>> openwrt-devel mailing list openwrt-devel@lists.openwrt.org 
>>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
>>> 
___
>> openwrt-devel mailing list openwrt-devel@lists.openwrt.org 
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>> 
> 
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Add terminfo file in ncurses

2014-06-18 Thread John Crispin


On 12/06/2014 20:26, Jonathan Bennett wrote:
> Ran into a problem with my Fedora Linux machine, SSHing into an
> Openwrt router. Fedora sets terminfo to xterm-256color, but ncurses
> doesn't include that file in the firmware. This causes a few
> unintended problems, namely nano fails to launch. Attached patch
> adds xterm-256color to the files installed by ncurses.
> 
> Signed-off-by: Jonathan Bennett  >
> 
> 


Hi,

patchwork picked up a patch with broken whitespaces -->
http://patchwork.openwrt.org/patch/5644/

can you resend the patch using "git send-email" this will make sure
that we receive valid patch.

John



















> 
> diff --git a/package/libs/ncurses/Makefile
> b/package/libs/ncurses/Makefile index 62ffdfb..26b7bf5 100644 ---
> a/package/libs/ncurses/Makefile +++
> b/package/libs/ncurses/Makefile @@ -101,7 +101,7 @@ ifneq
> ($(HOST_OS),FreeBSD) mv dir (echo -ne "\xdir"); \ done
> \ ) -for file in a/ansi d/dumb l/linux r/rxvt r/rxvt-unicode
> s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \ +for file in
> a/ansi d/dumb l/linux r/rxvt r/rxvt-unicode s/screen v/vt100
> v/vt102 x/xterm x/xterm-color x/xterm-256color; do \ $(INSTALL_DIR)
> $(1)/usr/share/terminfo/`dirname file`; \ $(CP)
> $(PKG_INSTALL_DIR)/usr/share/terminfo/file \ 
> $(1)/usr/share/terminfo/file; \
> 
> 
> 
> ___ openwrt-devel
> mailing list openwrt-devel@lists.openwrt.org 
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v3] ar71xx: Add support for MikroTik RouterBOARD SXT Lite

2014-06-18 Thread John Crispin
Hi,

this patch is generated against the wrong root directory making "git
am" fail. i had to use patch -p0 to manually apply it. Please make
sure to send a valid patch the next time.

John




On 11/06/2014 23:05, Matthew Reeve wrote:
> This patch adds support for the MikroTik RouterBOARD SXT Lite.
> 
> The new RB911L series is also supported as a result.
> 
> v2 of this patch fixes the wmac offset to match what is on the 
> sticker. v3 refreshes the patch against r41148 and defines the 
> power led as the status led in diag.sh
> 
> Signed-off-by: Matthew Reeve 
> 
> --- 
> target/linux/ar71xx/patches-3.10/712-MIPS-ath79-add-RBSXTLite-support.patch
>
> 
2014-05-12 18:49:06.902842033 + +++
> target/linux/ar71xx/patches-3.10/712-MIPS-ath79-add-RBSXTLite-support.patch
>
> 
2014-05-21 20:34:52.209118569 + @@ -0,0 +1,38 @@ +---
> a/arch/mips/ath79/Kconfig 2014-05-21 20:25:24.801106234 +  
> b/arch/mips/ath79/Kconfig 2014-05-21 20:28:20.489109814 + +@@ 
> -442,6 +442,14 @@ config ATH79_MACH_RB2011 +  select 
> ATH79_ROUTERBOOT +select RLE_DECOMPRESS + ++config 
> ATH79_MACH_RBSXTLITE ++   bool "MikroTik RouterBOARD SXT Lite" ++ 
> select SOC_AR934x ++  select ATH79_DEV_ETH ++ select ATH79_DEV_NFC 
> ++select ATH79_DEV_WMAC ++select ATH79_ROUTERBOOT ++ + config 
> ATH79_MACH_WNDAP360 + bool "NETGEAR WNDAP360 board support" + 
> select SOC_AR71XX +--- a/arch/mips/ath79/machtypes.h  2014-05-21 
> 20:25:24.801106234 +  b/arch/mips/ath79/machtypes.h 
> 2014-05-21 20:30:04.829111865 + +@@ -91,6 +91,8 @@ enum 
> ath79_mach_type { +   ATH79_MACH_RB_2011G,/* Mikrotik RouterBOARD 
> 2011UAS-2HnD */ + ATH79_MACH_RB_2011L,/* Mikrotik RouterBOARD 
> 2011L */ +ATH79_MACH_RB_2011US,   /* Mikrotik RouterBOARD 2011UAS 
> */ ++ ATH79_MACH_RB_SXTLITE2ND,   /* Mikrotik RouterBOARD SXT Lite 
> 2nD */ ++ ATH79_MACH_RB_SXTLITE5ND,   /* Mikrotik RouterBOARD SXT 
> Lite 5nD */ + ATH79_MACH_RW2458N, /* Redwave RW2458N */ + 
> ATH79_MACH_TEW_632BRP,/* TRENDnet TEW-632BRP */ + 
> ATH79_MACH_TEW_673GRU,/* TRENDnet TEW-673GRU */ +--- 
> a/arch/mips/ath79/Makefile2014-05-21 20:25:24.801106234 +
>  b/arch/mips/ath79/Makefile   2014-05-21 20:31:37.169113830 +
> +@@ -83,6 +83,7 @@ obj-$(CONFIG_ATH79_MACH_RB750) += mach- + 
> obj-$(CONFIG_ATH79_MACH_RB91X)+= mach-rb91x.o + 
> obj-$(CONFIG_ATH79_MACH_RB95X)+= mach-rb95x.o + 
> obj-$(CONFIG_ATH79_MACH_RB2011)   += mach-rb2011.o 
> ++obj-$(CONFIG_ATH79_MACH_RBSXTLITE)  += mach-rbsxtlite.o + 
> obj-$(CONFIG_ATH79_MACH_RW2458N)  += mach-rw2458n.o + 
> obj-$(CONFIG_ATH79_MACH_TEW_632BRP)   += mach-tew-632brp.o + 
> obj-$(CONFIG_ATH79_MACH_TEW_673GRU)   += mach-tew-673gru.o --- 
> target/linux/ar71xx/files/arch/mips/ath79/mach-rbsxtlite.c 
> 2014-05-12 18:49:06.902842033 + +++ 
> target/linux/ar71xx/files/arch/mips/ath79/mach-rbsxtlite.c 
> 2014-05-21 19:50:48.073064837 + @@ -0,0 +1,238 @@ +/* + * 
> MikroTik RouterBOARD SXT Lite support + * + *  Copyright (C) 2012 
> Stijn Tintel  + *  Copyright (C) 2012 Gabor 
> Juhos  + *  Copyright (C) 2013 Vyacheslav 
> Adamanov  + * + *  This program is free 
> software; you can redistribute it and/or modify it + *  under the 
> terms of the GNU General Public License version 2 as published + * 
> by the Free Software Foundation. + */ + +#define pr_fmt(fmt) 
> "sxtlite: " fmt + +#include  +#include 
> +#include  +#include 
>  +#include  +#include 
>  +#include  +#include 
>  +#include  +#include 
>  +#include  +#include 
>  + +#include  +#include 
>  +#include "common.h" +#include 
> "dev-ap9x-pci.h" +#include "dev-gpio-buttons.h" +#include 
> "dev-leds-gpio.h" +#include "dev-eth.h" +#include "dev-m25p80.h" 
> +#include "dev-nfc.h" +#include "dev-wmac.h" +#include "dev-usb.h"
>  +#include "machtypes.h" +#include "routerboot.h" +#include 
>  + +#define SXTLITE_GPIO_NAND_NCE  14 
> +#define SXTLITE_GPIO_LED_USER 3 +#define SXTLITE_GPIO_LED_1 13 
> +#define SXTLITE_GPIO_LED_2 12 +#define SXTLITE_GPIO_LED_3 4 
> +#define SXTLITE_GPIO_LED_4 21 +#define SXTLITE_GPIO_LED_5 18 
> +#define SXTLITE_GPIO_LED_POWER 11 + +#define SXTLITE_GPIO_BUZZER 
> 19 + +#define SXTLITE_GPIO_BTN_RESET 15 + +#define 
> SXTLITE_KEYS_POLL_INTERVAL 20 +#define 
> SXTLITE_KEYS_DEBOUNCE_INTERVAL (3 * SXTLITE_KEYS_POLL_INTERVAL) + 
> +static struct mtd_partition rbsxtlite_nand_partitions[] = { +{ + 
> .name   = "booter", + .offset = 0, +  .size   = (256 * 1024), 
> + 
> .mask_flags = MTD_WRITEABLE, +}, +{ + .name   = 
> "kernel", + 
> .offset = (256 * 1024), + .size   = (4 * 1024 * 1024) - (256 * 
> 1024), +  }, +{ + .name   = "rootfs", +   .offset 
> = 
> MTDPART_OFS_NXTBLK, + .size   = MTDPART_SIZ_FULL, +   }, +}; + 
> +static struct gpi

Re: [OpenWrt-Devel] [PATCH v2 0/5] DNSSEC support

2014-06-18 Thread Steven Barth

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


Re: [OpenWrt-Devel] [PATCH 09/28] Remove ATHEROS_AR231X

2014-06-18 Thread Sergey Ryazanov
Hi Paul,

2014-06-18 14:25 GMT+04:00 Paul Bolle :
> Jiri, Nick, Luis, John,
>
> On Wed, 2014-04-16 at 13:20 +0400, Sergey Ryazanov wrote:
>> 2014-04-15 21:08 GMT+04:00 Paul Bolle :
>> > On Thu, 2014-02-13 at 15:14 -0500, John W. Linville wrote:
>> >> On Wed, Feb 12, 2014 at 02:50:30PM +0400, Sergey Ryazanov wrote:
>> >> > John, can you delay the merging of this patch for a few months, I will
>> >> > try to prepare the necessary patches to add AR231x architecture to the
>> >> > kernel and send them to linux-mips.
>> >>
>> >> OK -- looking forward to your patches.
>> >
>> > So am I. Is there any news on this front?
>> >
>>
>> Work still in progress :(
>
> ATHEROS_AR231X and the things depending on it, like AHB bus support,
> have been discussed for three years now. When will you (re)consider a
> patch to remove all currently dead code?
>
> And to state the obvious: AHB bus support, and the other code depending
> on ATHEROS_AR231X, can always be re-added once ATHEROS_AR231X gets added
> to the tree.
>

Work in progress, I don't stop it. Just work is progressing slower
than I had planned. I am already cleanup the code (mostly checkpatch
errors and warnings) and send patches to OpenWRT tree. Further I plan
to simplify initialization and I will be ready to send patches
upstream.

I need a couple of weeks for this. Is its reasonable time to not make
a mess of remove/add commits?

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


Re: [OpenWrt-Devel] [PATCH 1/5] netifd: Fix vlan delete via netlink

2014-06-18 Thread Steven Barth

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


Re: [OpenWrt-Devel] [Patch] [Resend] Add terminfo file in ncurses

2014-06-18 Thread Steven Barth

Ah sorry, seems I forgot to send a reply here.
I noticed your initial patch was mangled but since it was trivial I 
applied it manually already:

https://dev.openwrt.org/changeset/41212

Thanks and Cheers,

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


Re: [OpenWrt-Devel] [PATCH] lantiq: make loading pci fixup data from cal_data work again

2014-06-18 Thread John Crispin


On 17/06/2014 19:06, Ben Mulvihill wrote:
> Changeset 40948 restored an older (and uglier!) version of the code
> for reading the athxk calibration partition on lantiq xway boards.
> As a result pci fixups stored in this partition are no longer
> applied, breaking wireless on the BTHOMEHUBV2B and (I imagine) on
> the DGN3500. This is a minimal patch to restore this functionality
> for ath9k without reverting any of the other changes in changeset
> 40948.
> 
> Note for John Crispin: I guess you won't want to apply this patch
> if you are planning to check changeset 40948 anyway yourself. I
> produced it for my own use and thought I might as well send it in
> in case it was any use to anyone.
> 
> Ben Mulvihill

thanks for looking into this. looks like you picked up the missing
pieces. i am building a test image just now with this patch applied on
top of trunk. i managed to find a dgn3500 last night and will pick it
up in an hour. if this work, i will simply merge your patch and hope
that all boards are now working. once BB is out the door i will rework
this code and make it aligned with the eep loading code used on
ralink/mtk.

John




> 
> 
> --- a/arch/mips/lantiq/xway/ath_eep.c 2014-06-16 12:10:10.413893209
> +0200 +++ b/arch/mips/lantiq/xway/ath_eep.c   2014-06-16
> 12:10:26.366264625 +0200 @@ -35,6 +35,7 @@ static int
> ath9k_pci_plat_dev_init(struc return 0; }
> 
> +static int ath9k_eep_load; int __init of_ath9k_eeprom_probe(struct
> platform_device *pdev) { struct device_node *np =
> pdev->dev.of_node, *mtd_np; @@ -117,6 +118,13 @@ int __init
> of_ath9k_eeprom_probe(struct ltq_pci_ath_fixup(pci_slot,
> ath9k_pdata.eeprom_data);
> 
> dev_info(&pdev->dev, "pci slot: %u\n", pci_slot); +
> if (ath9k_eep_load) { +struct pci_dev *d =
> NULL; +while ((d =
> pci_get_device(PCI_VENDOR_ID_ATHEROS, +
> PCI_ANY_ID, d)) != NULL) +
> pci_fixup_device(pci_fixup_early, d); +} + }
> 
> dev_info(&pdev->dev, "loaded ath9k eeprom\n"); @@ -139,9 +147,22 @@
> static struct platform_driver ath9k_eepr
> 
> static int __init of_ath9k_eeprom_init(void) { -  return
> platform_driver_probe(&ath9k_eeprom_driver,
> of_ath9k_eeprom_probe); +int ret =
> platform_driver_probe(&ath9k_eeprom_driver,
> of_ath9k_eeprom_probe); + +if (ret) +
> ath9k_eep_load = 1; + +return ret; +} + +static int __init
> of_ath9k_eeprom_init_late(void) +{ +if (!ath9k_eep_load) +
> return 0; +return
> platform_driver_probe(&ath9k_eeprom_driver,
> of_ath9k_eeprom_probe); } -arch_initcall(of_ath9k_eeprom_init); 
> +late_initcall(of_ath9k_eeprom_init_late); 
> +subsys_initcall(of_ath9k_eeprom_init);
> 
> 
> static int ath5k_pci_plat_dev_init(struct pci_dev *dev) 
> ___ 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] Initial Support for Ubiquiti UniFi, Outdoor Plus

2014-06-18 Thread and...@polkaspots.com

This setup works for me.
The only thing that I'm not sure, if if I did the magic number in the 
correct way.


diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh

index 80f9090..fa22c14 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -199,6 +199,9 @@ get_status_led() {
uap-pro)
status_led="ubnt:white:dome"
;;
+   unifi-outdoor-plus)
+   status_led="ubnt:blue:front"
+;;
whr-g301n | \
whr-hp-g300n | \
whr-hp-gn | \
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network

index 156433b..f2739b8 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -276,6 +276,7 @@ pb44 |\
 routerstation|\
 ubnt-unifi-outdoor|\
 unifi-outdoor|\
+unifi-outdoor-plus|\
 nanostation-m|\
 unifi|\
 tl-wr710n |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh

index 23f2ecf..091fd38 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -600,6 +600,9 @@ ar71xx_board_detect() {
;;
*"UniFiAP Outdoor")
name="unifi-outdoor"
+   ;;
+   *"UniFiAP Outdoor Plus")
+name="unifi-outdoor-plus"
;;
*WP543)
name="wp543"
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh

index 4e698c6..1c3ac6a 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -286,6 +286,7 @@ platform_check_image() {

return 0
;;
+   unifi-outdoor-plus | \
uap-pro)
[ "$magic_long" != "19852003" ] && {
echo "Invalid image type."
@@ -389,6 +390,7 @@ platform_do_upgrade() {
om2p-lc)
platform_do_upgrade_openmesh "$ARGV"
;;
+   unifi-outdoor-plus | \
uap-pro)
MTD_CONFIG_ARGS="-s 0x18"
default_do_upgrade "$ARGV"
diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile

index d0ee363..1fadb96 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1171,6 +1171,7 @@ $(eval $(call 
SingleProfile,TPLINK-LZMA,64kraw,MW4530RV1,mw4530r-v1,TL-WDR4300,t
 $(eval $(call 
SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))


 $(eval $(call 
SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
+$(eval $(call 
SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-U20,ttyS0,115200,BZ,BZ,ar7240))


 $(eval $(call 
SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))


@@ -1228,7 +1229,7 @@ $(eval $(call MultiProfile,TLWR842,TLWR842V1 
TLWR842V2))
 $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 
TLWR941NV6))

 $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
 $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 
TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
-$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO 
UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTUNIFI UBNTUNIFIOUTDOOR 
UAPPRO))
+$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO 
UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTUNIFI UBNTUNIFIOUTDOOR 
UBNTUNIFIOUTDOORPLUS UAPPRO))
 $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 
WNDRMAC WNDRMACV2))

 $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
 $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))




I think this has been already submitted but Im adding it here as well 
just in case.


http://patchwork.openwrt.org/patch/5643/


Adding support for en25qh128

--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -762,6 +762,7 @@ static const struct spi_device_id m25p_i
{ "en25q32b", INFO(0x1c3016, 0, 64 * 1024,  64, 0) },
{ "en25p64", INFO(0x1c2017, 0, 64 * 1024, 128, 0) },
{ "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) },
+   { "en25qh128", INFO(0x1c7018, 0, 64 * 1024, 256, 0) },
{ "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) },

/* ESMT */

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


[OpenWrt-Devel] [Patch][BCM63XX][V2][RFC] Select HW_RANDOM_BCM63XX only in the SoCs that support it.

2014-06-18 Thread José Vázquez Fernández

Select HW_RANDOM_BCM63XX only in the SoCs that support it.

Only BCM6368, BCM6362 and BCM63268 have a hardware random numbers
generator, so, if none of these are selected, don't compile it.

Tested with BCM6358 and BCM6328 successfully with both 3.10 and 3.14 
kernels.


Signed off by: José Vázquez Fernández 

diff -urN a/arch/mips/bcm63xx/Kconfig b/arch/mips/bcm63xx/Kconfig
--- a/arch/mips/bcm63xx/Kconfig 2014-06-02 16:00:48.0 +0200
+++ b/arch/mips/bcm63xx/Kconfig 2014-06-18 17:06:30.119106246 +0200
@@ -60,6 +60,7 @@
select HW_HAS_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+   select BCM_RNG

 config BCM63XX_CPU_6368
bool "support 6368 CPU"
@@ -67,6 +68,7 @@
select HW_HAS_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+   select BCM_RNG

 config BCM63XX_CPU_63268
bool "support 63268 CPU"
@@ -74,6 +76,10 @@
select HW_HAS_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+   select BCM_RNG
 endmenu

+config BCM_RNG
+   bool
+
 source "arch/mips/bcm63xx/boards/Kconfig"
diff -urN a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
--- a/drivers/char/hw_random/Kconfig2014-05-31 21:34:37.0 +0200
+++ b/drivers/char/hw_random/Kconfig2014-06-18 17:03:53.127017691 +0200
@@ -75,7 +75,7 @@

 config HW_RANDOM_BCM63XX
tristate "Broadcom BCM63xx Random Number Generator support"
-   depends on HW_RANDOM && BCM63XX
+   depends on HW_RANDOM && (BCM_RNG || COMPILE_TEST)
default HW_RANDOM
---help---
  This driver provides kernel-side support for the Random Number
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC netifd] Out-of-sync reference counter causes seg. fault

2014-06-18 Thread Kristian Evensen
From: Kristian Evensen 

Hello,

I have written a small tool which automatically adds/removes a usb LAN dongle
from uci. When the USB device is inserted, I add entries to UCI (using libuci)
and do network reload (using libubus). When the device is removed, I remove the
UCI-entries and do reload again.

This all works fine. However, when I connect the device a second time, netifd
crashes with a seg. fault. The problem seems to be that the reference counter is
not reduced properly when device remove, and device is not properly removed from
internal data structures.

The missing reference counter update seems to be in device_release(). After
adding a call to device_remove_user() here, the reference counter is correct,
device is correctly removed and netifd is stable. I have also tested by
adding/removing other types of network devices, and netifd seems to work fine.

However, I am not familiar enough with the internal architecture of netifd to
know if this is a correct fix or just a dirty hack. If this is a hack, does
anyone have any feedback or hints to how I can properly solve this issue?

-Kristian
---
 device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/device.c b/device.c
index 7d606c6..f44a891 100644
--- a/device.c
+++ b/device.c
@@ -250,6 +250,8 @@ void device_release(struct device_user *dep)
D(DEVICE, "Release %s %s, new active count: %d\n", dev->type->name, 
dev->ifname, dev->active);
assert(dev->active >= 0);
 
+   device_remove_user(dep);
+
if (dev->active)
return;
 
-- 
1.8.3.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC] ramips: cleanup some rt305x profiles

2014-06-18 Thread Daniel Golle
rename HW5503G profile to HW550-3G to match name in image/Makefile
This does fix for #16599, however, are profile names allowed to
containes dashes?
If not, dashes will have to be removed in profiles for asus, aztech
and uplevel boards.

(also move both asus boards to asus.mk)

---
 target/linux/ramips/rt305x/profiles/asus.mk| 27 ++
 target/linux/ramips/rt305x/profiles/aztech.mk  |  4 ++--
 .../rt305x/profiles/n10-plus.mk(revision 0)| 17 --
 target/linux/ramips/rt305x/profiles/n13u.mk| 17 --
 4 files changed, 29 insertions(+), 36 deletions(-)
 create mode 100644 target/linux/ramips/rt305x/profiles/asus.mk
 delete mode 100644 target/linux/ramips/rt305x/profiles/n10-plus.mk
(revision 0)
 delete mode 100644 target/linux/ramips/rt305x/profiles/n13u.mk

diff --git a/target/linux/ramips/rt305x/profiles/asus.mk 
b/target/linux/ramips/rt305x/profiles/asus.mk
new file mode 100644
index 000..fcf4aa4
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/asus.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/RT-N10-PLUS
+   NAME:=Asus RT-N10+
+   PACKAGES:=kmod-leds-gpio wpa
+endef
+
+define Profile/RT-N10-PLUS/Description
+   Package set for Asus RT-N10+.
+endef
+
+define Profile/RT-N13U
+   NAME:=Asus RT-N13U
+   PACKAGES:=kmod-leds-gpio kmod-rt2800-pci wpad-mini 
kmod-usb-rt305x-dwc_otg
+endef
+
+define Profile/RT-N13U/Description
+   Package set for Asus RT-N13U.
+endef
+
+$(eval $(call Profile,RT-N10-PLUS))
+$(eval $(call Profile,RT-N13U))
diff --git a/target/linux/ramips/rt305x/profiles/aztech.mk 
b/target/linux/ramips/rt305x/profiles/aztech.mk
index ab2d8cb..10bc80b 100644
--- a/target/linux/ramips/rt305x/profiles/aztech.mk
+++ b/target/linux/ramips/rt305x/profiles/aztech.mk
@@ -5,7 +5,7 @@
 # See /LICENSE for more information.
 #
 
-define Profile/HW5503G
+define Profile/HW550-3G
NAME:=Aztech HW550-3G
PACKAGES:=\
kmod-usb-core kmod-usb-rt305x-dwc_otg \
@@ -16,4 +16,4 @@ define Profile/HW5503G/Description
Package set for Aztech HW550-3G
 endef
 
-$(eval $(call Profile,HW5503G))
+$(eval $(call Profile,HW550-3G))
diff --git a/target/linux/ramips/rt305x/profiles/n10-plus.mk(revision 0) 
b/target/linux/ramips/rt305x/profiles/n10-plus.mk(revision 0)
deleted file mode 100644
index 8c122f7..000
--- a/target/linux/ramips/rt305x/profiles/n10-plus.mk(revision 0)   
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/RT-N10-PLUS
-NAME:=Asus RT-N10+
-PACKAGES:=kmod-leds-gpio wpa
-endef
-
-define Profile/RT-N10-PLUS/Description
-Package set for Asus RT-N10+.
-endef
-
-$(eval $(call Profile,RT-N10-PLUS))
diff --git a/target/linux/ramips/rt305x/profiles/n13u.mk 
b/target/linux/ramips/rt305x/profiles/n13u.mk
deleted file mode 100644
index 6c81722..000
--- a/target/linux/ramips/rt305x/profiles/n13u.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/RT-N13U
-   NAME:=Asus RT-N13U
-   PACKAGES:=kmod-leds-gpio kmod-rt2800-pci wpad-mini 
kmod-usb-rt305x-dwc_otg
-endef
-
-define Profile/RT-N13U/Description
-   Package set for Asus RT-N13U.
-endef
-
-$(eval $(call Profile,RT-N13U))
-- 
1.9.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] lantiq: copy rootfs-overlay.ubi to bin/lantiq

2014-06-18 Thread Ben Mulvihill
At the moment, an rootfs.ubi is copied over to bin/lantiq
but rootfs-overlay.ubi is not. This adds it.

Signed-off-by: Ben Mulvihill 
---

--- a/target/linux/lantiq/image/Makefile2014-06-18 20:50:46.799775413 
+0200
+++ b/target/linux/lantiq/image/Makefile2014-06-18 20:51:03.948174681 
+0200
@@ -189,6 +189,7 @@ define Image/Build/ubi
 
 ifneq ($($(PROFILE)_UBI_OPTS),)
$(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs.ubi
+   $(CP) $(KDIR)/root-overlay.ubi 
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-rootfs-overlay.ubi
 endif
 endef
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] /var/state/wireless not being updated any more?

2014-06-18 Thread Shankar Unni
Thanks for the pointers, all!

Let me try with this approach.  I'll probably have to build a wrapper around 
it, since it's being probed from within a C user-space program.

On Jun 16, 2014, at 12:20 PM, Jo-Philipp Wich  wrote:

> Hi,
> 
> the data is cached upon the first call.
> 
> To force a resync, run "network_flush_cache".
> 
> ~ Jow
> 
> ___
> 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] /var/state/wireless not being updated any more?

2014-06-18 Thread Weedy
On Wed, Jun 18, 2014 at 5:48 PM, Shankar Unni 
wrote:

> Thanks for the pointers, all!
>
> Let me try with this approach.  I'll probably have to build a wrapper
> around it, since it's being probed from within a C user-space program.
>

If you're in C shouldn't you use json directly with ubus/procd/whatever
it's called now?


> On Jun 16, 2014, at 12:20 PM, Jo-Philipp Wich  wrote:
>
> > Hi,
> >
> > the data is cached upon the first call.
> >
> > To force a resync, run "network_flush_cache".
> >
> > ~ Jow
> >
> > ___
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel