[OpenWrt-Devel] [PATCH v2] [netifd] Changes for more readability.

2015-05-24 Thread Yousong Zhou
 - "ifname" for Linux interface name.
 - "interface" for netifd defined logical interface names as in
   /etc/config/network.
 - A few comments and variable renames for better readability.

Signed-off-by: Yousong Zhou 
---
v2 <- v1

- Drop the ev (type cast + pointer dereference) change in v1.
- Reword the comment for alias interface.

 device.h  |3 +++
 interface.c   |4 ++--
 interface.h   |1 +
 proto-shell.c |8 
 ubus.c|2 +-
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/device.h b/device.h
index 3001f10..7f0f9d1 100644
--- a/device.h
+++ b/device.h
@@ -154,8 +154,11 @@ struct device {
struct blob_attr *config;
bool config_pending;
bool sys_present;
+   /* DEV_EVENT_ADD */
bool present;
+   /* DEV_EVENT_UP */
int active;
+   /* DEV_EVENT_LINK_UP */
bool link_active;
 
bool external;
diff --git a/interface.c b/interface.c
index 5166c0c..baf521a 100644
--- a/interface.c
+++ b/interface.c
@@ -647,7 +647,7 @@ interface_handle_config_change(struct interface *iface)
 }
 
 static void
-interface_proto_cb(struct interface_proto_state *state, enum 
interface_proto_event ev)
+interface_proto_event_cb(struct interface_proto_state *state, enum 
interface_proto_event ev)
 {
struct interface *iface = state->iface;
 
@@ -706,7 +706,7 @@ void interface_set_proto_state(struct interface *iface, 
struct interface_proto_s
if (!state)
return;
 
-   state->proto_event = interface_proto_cb;
+   state->proto_event = interface_proto_event_cb;
state->iface = iface;
 }
 
diff --git a/interface.h b/interface.h
index 8eeb7db..6f9112c 100644
--- a/interface.h
+++ b/interface.h
@@ -120,6 +120,7 @@ struct interface {
 
struct list_head users;
 
+   /* for alias interface */
const char *parent_ifname;
struct interface_user parent_iface;
 
diff --git a/proto-shell.c b/proto-shell.c
index bac57e0..bb6edc8 100644
--- a/proto-shell.c
+++ b/proto-shell.c
@@ -52,7 +52,7 @@ struct proto_shell_handler {
 struct proto_shell_dependency {
struct list_head list;
 
-   char *interface;
+   char *ifname;
struct proto_shell_state *proto;
struct interface_user dep;
 
@@ -111,8 +111,8 @@ proto_shell_update_host_dep(struct proto_shell_dependency 
*dep)
if (dep->dep.iface)
goto out;
 
-   if (dep->interface[0])
-   iface = vlist_find(&interfaces, dep->interface, iface, node);
+   if (dep->ifname[0])
+   iface = vlist_find(&interfaces, dep->ifname, iface, node);
 
iface = interface_ip_add_target_route(&dep->host, dep->v6, iface);
if (!iface)
@@ -695,7 +695,7 @@ proto_shell_add_host_dependency(struct proto_shell_state 
*state, struct blob_att
}
 
dep->proto = state;
-   dep->interface = strcpy(ifname, ifname_str);
+   dep->ifname = strcpy(ifname, ifname_str);
 
dep->dep.cb = proto_shell_if_up_cb;
interface_add_user(&dep->dep, NULL);
diff --git a/ubus.c b/ubus.c
index 422b652..c7a329a 100644
--- a/ubus.c
+++ b/ubus.c
@@ -843,7 +843,7 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct 
ubus_object *obj,
 
cur = tb[DEV_LINK_EXT];
if (cur)
-   link_ext = !!blobmsg_get_u8(cur);
+   link_ext = blobmsg_get_bool(cur);
 
return interface_handle_link(iface, blobmsg_data(tb[DEV_LINK_NAME]), 
add, link_ext);
 }
-- 
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] sunxi: remove kernel symbol

2015-05-24 Thread Dirk Neukirchen

unify config across platforms
RESOURCE_COUNTERS is deactive on all platforms

Signed-off-by: Dirk Neukirchen 
---
 target/linux/sunxi/config-3.18 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/sunxi/config-3.18 b/target/linux/sunxi/config-3.18
index ddc3f7a..fde6a78 100644
--- a/target/linux/sunxi/config-3.18
+++ b/target/linux/sunxi/config-3.18
@@ -386,7 +386,6 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
 # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
 CONFIG_RELAY=y
 CONFIG_RESET_CONTROLLER=y
-CONFIG_RESOURCE_COUNTERS=y
 # CONFIG_RFKILL_REGULATOR is not set
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] sunxi: remove kernel symbol

2015-05-24 Thread Dirk Neukirchen

unify config across platforms
CPUSETS is deactive on all platforms
according to description enabling does not make sense on embedded targets

Signed-off-by: Dirk Neukirchen 
---
 target/linux/sunxi/config-3.18 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/sunxi/config-3.18 b/target/linux/sunxi/config-3.18
index fde6a78..2112816 100644
--- a/target/linux/sunxi/config-3.18
+++ b/target/linux/sunxi/config-3.18
@@ -92,7 +92,6 @@ CONFIG_CONNECTOR=y
 CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_COREDUMP=y
 CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
-CONFIG_CPUSETS=y
 CONFIG_CPU_32v6K=y
 CONFIG_CPU_32v7=y
 CONFIG_CPU_ABRT_EV7=y
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: remove duplicate symbols

2015-05-24 Thread Dirk Neukirchen

are already included in general kernel config

Signed-off-by: Dirk Neukirchen 
---
 target/linux/imx6/config-3.18  | 2 --
 target/linux/omap/config-3.18  | 2 --
 target/linux/oxnas/config-3.18 | 2 --
 target/linux/oxnas/config-4.0  | 2 --
 4 files changed, 8 deletions(-)

diff --git a/target/linux/imx6/config-3.18 b/target/linux/imx6/config-3.18
index 83bfd0d..8c5b5c0 100644
--- a/target/linux/imx6/config-3.18
+++ b/target/linux/imx6/config-3.18
@@ -142,7 +142,6 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_MXC=y
-# CONFIG_GPIO_SYSCON is not set
 CONFIG_GPIO_SYSFS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
@@ -217,7 +216,6 @@ CONFIG_IRQ_WORK=y
 CONFIG_JBD=y
 CONFIG_JBD2=y
 # CONFIG_LEDS_REGULATOR is not set
-# CONFIG_LEDS_SYSCON is not set
 CONFIG_LIBFDT=y
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
diff --git a/target/linux/omap/config-3.18 b/target/linux/omap/config-3.18
index a06a350..7a96057 100644
--- a/target/linux/omap/config-3.18
+++ b/target/linux/omap/config-3.18
@@ -196,7 +196,6 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_OMAP=y
-# CONFIG_GPIO_SYSCON is not set
 CONFIG_GPIO_TPS65910=y
 CONFIG_GPIO_TWL4030=y
 # CONFIG_GPIO_TWL6040 is not set
@@ -291,7 +290,6 @@ CONFIG_LCD_CLASS_DEVICE=y
 # CONFIG_LCD_VGG2432A4 is not set
 CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_REGULATOR is not set
-# CONFIG_LEDS_SYSCON is not set
 CONFIG_LIBFDT=y
 CONFIG_LOGO=y
 CONFIG_LOGO_LINUX_CLUT224=y
diff --git a/target/linux/oxnas/config-3.18 b/target/linux/oxnas/config-3.18
index 379b2b0..7486503 100644
--- a/target/linux/oxnas/config-3.18
+++ b/target/linux/oxnas/config-3.18
@@ -111,7 +111,6 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
-# CONFIG_GPIO_SYSCON is not set
 CONFIG_GPIO_SYSFS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
@@ -200,7 +199,6 @@ CONFIG_KGDB_SERIAL_CONSOLE=y
 # CONFIG_KGDB_TESTS is not set
 # CONFIG_LDM_DEBUG is not set
 CONFIG_LDM_PARTITION=y
-# CONFIG_LEDS_SYSCON is not set
 # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
 # CONFIG_LEDS_TRIGGER_NETDEV is not set
 # CONFIG_LEDS_TRIGGER_TIMER is not set
diff --git a/target/linux/oxnas/config-4.0 b/target/linux/oxnas/config-4.0
index b0bb7ea..50e7664 100644
--- a/target/linux/oxnas/config-4.0
+++ b/target/linux/oxnas/config-4.0
@@ -117,7 +117,6 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
-# CONFIG_GPIO_SYSCON is not set
 CONFIG_GPIO_SYSFS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
@@ -212,7 +211,6 @@ CONFIG_KGDB_SERIAL_CONSOLE=y
 # CONFIG_KGDB_TESTS is not set
 # CONFIG_LDM_DEBUG is not set
 CONFIG_LDM_PARTITION=y
-# CONFIG_LEDS_SYSCON is not set
 # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
 # CONFIG_LEDS_TRIGGER_NETDEV is not set
 # CONFIG_LEDS_TRIGGER_TIMER is not set
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: arm64: psci: move psci firmware calls out of line

2015-05-24 Thread Dirk Neukirchen

- fixes build error on arm64 with FTRACE enabled
- upstream ticket says gcc5 but both linaro gcc variants
OpenWrt is using seem to be affected

backport upstream change f5e0a12ca2d939e47995f73428d9bf1ad372b289
for Kernel 3.18

only compile tested

Signed-off-by: Dirk Neukirchen 
---
 ...psci_move_psci_firmware_calls_out_of_line.patch | 124 +
 1 file changed, 124 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch

diff --git 
a/target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch
 
b/target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch
new file mode 100644
index 000..1db9d5f
--- /dev/null
+++ 
b/target/linux/generic/patches-3.18/090-from_4.0_arm64_psci_move_psci_firmware_calls_out_of_line.patch
@@ -0,0 +1,124 @@
+From f5e0a12ca2d939e47995f73428d9bf1ad372b289 Mon Sep 17 00:00:00 2001
+From: Will Deacon 
+Date: Wed, 25 Feb 2015 12:10:35 +
+Subject: arm64: psci: move psci firmware calls out of line
+
+An arm64 allmodconfig fails to build with GCC 5 due to __asmeq
+assertions in the PSCI firmware calling code firing due to mcount
+preambles breaking our assumptions about register allocation of function
+arguments:
+
+  /tmp/ccDqJsJ6.s: Assembler messages:
+  /tmp/ccDqJsJ6.s:60: Error: .err encountered
+  /tmp/ccDqJsJ6.s:61: Error: .err encountered
+  /tmp/ccDqJsJ6.s:62: Error: .err encountered
+  /tmp/ccDqJsJ6.s:99: Error: .err encountered
+  /tmp/ccDqJsJ6.s:100: Error: .err encountered
+  /tmp/ccDqJsJ6.s:101: Error: .err encountered
+
+This patch fixes the issue by moving the PSCI calls out-of-line into
+their own assembly files, which are safe from the compiler's meddling
+fingers.
+
+Reported-by: Andy Whitcroft 
+Signed-off-by: Will Deacon 
+Signed-off-by: Catalin Marinas 
+
+--- /dev/null
 b/arch/arm64/kernel/psci-call.S
+@@ -0,0 +1,28 @@
++/*
++ * 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.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * Copyright (C) 2015 ARM Limited
++ *
++ * Author: Will Deacon 
++ */
++
++#include 
++
++/* int __invoke_psci_fn_hvc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */
++ENTRY(__invoke_psci_fn_hvc)
++  hvc #0
++  ret
++ENDPROC(__invoke_psci_fn_hvc)
++
++/* int __invoke_psci_fn_smc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */
++ENTRY(__invoke_psci_fn_smc)
++  smc #0
++  ret
++ENDPROC(__invoke_psci_fn_smc)
+--- a/arch/arm64/kernel/psci.c
 b/arch/arm64/kernel/psci.c
+@@ -57,6 +57,9 @@ static struct psci_operations psci_ops;
+ static int (*invoke_psci_fn)(u64, u64, u64, u64);
+ typedef int (*psci_initcall_t)(const struct device_node *);
+ 
++asmlinkage int __invoke_psci_fn_hvc(u64, u64, u64, u64);
++asmlinkage int __invoke_psci_fn_smc(u64, u64, u64, u64);
++
+ enum psci_function {
+   PSCI_FN_CPU_SUSPEND,
+   PSCI_FN_CPU_ON,
+@@ -109,40 +112,6 @@ static void psci_power_state_unpack(u32
+   PSCI_0_2_POWER_STATE_AFFL_SHIFT;
+ }
+ 
+-/*
+- * The following two functions are invoked via the invoke_psci_fn pointer
+- * and will not be inlined, allowing us to piggyback on the AAPCS.
+- */
+-static noinline int __invoke_psci_fn_hvc(u64 function_id, u64 arg0, u64 arg1,
+-   u64 arg2)
+-{
+-  asm volatile(
+-  __asmeq("%0", "x0")
+-  __asmeq("%1", "x1")
+-  __asmeq("%2", "x2")
+-  __asmeq("%3", "x3")
+-  "hvc#0\n"
+-  : "+r" (function_id)
+-  : "r" (arg0), "r" (arg1), "r" (arg2));
+-
+-  return function_id;
+-}
+-
+-static noinline int __invoke_psci_fn_smc(u64 function_id, u64 arg0, u64 arg1,
+-   u64 arg2)
+-{
+-  asm volatile(
+-  __asmeq("%0", "x0")
+-  __asmeq("%1", "x1")
+-  __asmeq("%2", "x2")
+-  __asmeq("%3", "x3")
+-  "smc#0\n"
+-  : "+r" (function_id)
+-  : "r" (arg0), "r" (arg1), "r" (arg2));
+-
+-  return function_id;
+-}
+-
+ static int psci_get_version(void)
+ {
+   int err;
+--- a/arch/arm64/kernel/Makefile
 b/arch/arm64/kernel/Makefile
+@@ -14,8 +14,9 @@ CFLAGS_REMOVE_return_address.o = -pg
+ arm64-obj-y   := cputable.o debug-monitors.o entry.o irq.o fpsimd.o   
\
+  entry-fpsimd.o process.o ptrace.o setup.o signal.o   
\
+  sys.o stacktrace.o t

[OpenWrt-Devel] [PATCH] sunxi: enable CONFIG_EXPERT

2015-05-24 Thread Dirk Neukirchen

- only sunxi has this disabled
- unify kernel configuration across platforms

Signed-off-by: Dirk Neukirchen 
---
 target/linux/sunxi/config-3.18 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/sunxi/config-3.18 b/target/linux/sunxi/config-3.18
index 2112816..5e191cf 100644
--- a/target/linux/sunxi/config-3.18
+++ b/target/linux/sunxi/config-3.18
@@ -153,7 +153,6 @@ CONFIG_ELF_CORE=y
 # CONFIG_EMBEDDED is not set
 CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
-# CONFIG_EXPERT is not set
 CONFIG_EXT4_FS=y
 CONFIG_FRAME_POINTER=y
 CONFIG_FRAME_WARN=2048
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: add missing symbol

2015-05-24 Thread Dirk Neukirchen
NET_SCTPPROBE is missing when enabling KPROBES

Signed-off-by: Dirk Neukirchen 
---
 target/linux/generic/config-3.18 | 1 +
 target/linux/generic/config-4.0  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index 7a38dee..17a6303 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -2483,6 +2483,7 @@ CONFIG_NET_SCH_FQ_CODEL=y
 # CONFIG_NET_SCH_SFQ is not set
 # CONFIG_NET_SCH_TBF is not set
 # CONFIG_NET_SCH_TEQL is not set
+# CONFIG_NET_SCTPPROBE is not set
 # CONFIG_NET_TCPPROBE is not set
 # CONFIG_NET_TEAM is not set
 # CONFIG_NET_TULIP is not set
diff --git a/target/linux/generic/config-4.0 b/target/linux/generic/config-4.0
index c3bb7fc..48f0281 100644
--- a/target/linux/generic/config-4.0
+++ b/target/linux/generic/config-4.0
@@ -2523,6 +2523,7 @@ CONFIG_NET_SCH_FQ_CODEL=y
 # CONFIG_NET_SCH_SFQ is not set
 # CONFIG_NET_SCH_TBF is not set
 # CONFIG_NET_SCH_TEQL is not set
+# CONFIG_NET_SCTPPROBE is not set
 # CONFIG_NET_SWITCHDEV is not set
 # CONFIG_NET_TCPPROBE is not set
 # CONFIG_NET_TEAM is not set
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mac80211: remove wlcore patch

2015-05-24 Thread Dirk Neukirchen

- does not compile (omap target)
- 4.1 suppose to carry changes according to:
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/333547.html

Signed-off-by: Dirk Neukirchen 
---
 ...0-wlcore-Add-support-for-DT-platform-data.patch | 139 -
 1 file changed, 139 deletions(-)
 delete mode 100644 
package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch

diff --git 
a/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch
 
b/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch
deleted file mode 100644
index 856dea8..000
--- 
a/package/kernel/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-When running with DT, we no longer have a board file that can set up the
-platform data for wlcore. Allow this data to be passed from DT.
-
-Since some platforms use a gpio-irq, add support for passing either the
-irq number or the gpio number. For the latter case, the driver will
-request the gpio and convert it to the irq number. If an irq is
-specified, it'll be used as is.
-
-[Arik - the pdev_data pointer does not belong to us and is freed when
-the device is released. Dereference to our private data first.]
-
-Signed-off-by: Ido Yariv 
-Signed-off-by: Arik Nemtsov 

- drivers/net/wireless/ti/wlcore/sdio.c | 71 ---
- include/linux/wl12xx.h|  3 +-
- 2 files changed, 67 insertions(+), 7 deletions(-)
-
 a/drivers/net/wireless/ti/wlcore/sdio.c
-+++ b/drivers/net/wireless/ti/wlcore/sdio.c
-@@ -34,6 +34,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include "wlcore.h"
- #include "wl12xx_80211.h"
-@@ -214,6 +215,61 @@ static struct wl1271_if_operations sdio_
-   .set_block_size = wl1271_sdio_set_block_size,
- };
- 
-+static const struct of_device_id wlcore_of_match[] = {
-+  {
-+  .compatible = "wlcore",
-+  },
-+  {}
-+};
-+MODULE_DEVICE_TABLE(of, wlcore_of_match);
-+
-+static struct wl12xx_platform_data *get_platform_data(struct device *dev)
-+{
-+  struct wl12xx_platform_data *pdata;
-+  struct device_node *np;
-+  u32 gpio;
-+
-+  pdata = wl12xx_get_platform_data();
-+  if (!IS_ERR(pdata))
-+  return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
-+
-+  np = of_find_matching_node(NULL, wlcore_of_match);
-+  if (!np) {
-+  dev_err(dev, "No platform data set\n");
-+  return NULL;
-+  }
-+
-+  pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
-+  if (!pdata) {
-+  dev_err(dev, "Can't allocate platform data\n");
-+  return NULL;
-+  }
-+
-+  if (of_property_read_u32(np, "irq", &pdata->irq)) {
-+  if (!of_property_read_u32(np, "gpio", &gpio) &&
-+  !gpio_request_one(gpio, GPIOF_IN, "wlcore_irq")) {
-+  pdata->gpio = gpio;
-+  pdata->irq = gpio_to_irq(gpio);
-+  }
-+  }
-+
-+  /* Optional fields */
-+  pdata->use_eeprom = of_property_read_bool(np, "use-eeprom");
-+  of_property_read_u32(np, "board-ref-clock", &pdata->board_ref_clock);
-+  of_property_read_u32(np, "board-tcxo-clock", &pdata->board_tcxo_clock);
-+  of_property_read_u32(np, "platform-quirks", &pdata->platform_quirks);
-+
-+  return pdata;
-+}
-+
-+static void del_platform_data(struct wl12xx_platform_data *pdata)
-+{
-+  if (pdata->gpio)
-+  gpio_free(pdata->gpio);
-+
-+  kfree(pdata);
-+}
-+
- static int wl1271_probe(struct sdio_func *func,
- const struct sdio_device_id *id)
- {
-@@ -245,10 +301,10 @@ static int wl1271_probe(struct sdio_func
-   /* Use block mode for transferring over one block size of data */
-   func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
- 
--  pdev_data.pdata = wl12xx_get_platform_data();
--  if (IS_ERR(pdev_data.pdata)) {
--  ret = PTR_ERR(pdev_data.pdata);
--  dev_err(glue->dev, "missing wlan platform data: %d\n", ret);
-+  pdev_data.pdata = get_platform_data(&func->dev);
-+  if (!pdev_data.pdata) {
-+  ret = -EINVAL;
-+  dev_err(glue->dev, "missing wlan platform data\n");
-   goto out_free_glue;
-   }
- 
-@@ -279,7 +335,7 @@ static int wl1271_probe(struct sdio_func
-   if (!glue->core) {
-   dev_err(glue->dev, "can't allocate platform_device");
-   ret = -ENOMEM;
--  goto out_free_glue;
-+  goto out_free_pdata;
-   }
- 
-   glue->core->dev.parent = &func->dev;
-@@ -313,6 +369,9 @@ static int wl1271_probe(struct sdio_func
- out_dev_put:
-   platform_device_put(glue->core);
- 
-+out_free_pdata:
-+  del_platform_data(pdev_data->pdata);
-+
- out_free_glue:
-   kfree(glue);
- 
-@@ -323,11 +382,14 @@ out:
- static void wl1271_remove(struct sdio_func *func)
- {
- 

[OpenWrt-Devel] [PATCH] x86: add missing symbol

2015-05-24 Thread Dirk Neukirchen

X86_DECODER_SELFTEST is missing when KPROBES is enabled

Signed-off-by: Dirk Neukirchen 
---
 target/linux/x86/config-3.18 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/x86/config-3.18 b/target/linux/x86/config-3.18
index d7a2d61..82a8211 100644
--- a/target/linux/x86/config-3.18
+++ b/target/linux/x86/config-3.18
@@ -384,6 +384,7 @@ CONFIG_X86_ALIGNMENT_16=y
 # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
 # CONFIG_X86_CPUFREQ_NFORCE2 is not set
 # CONFIG_X86_CPUID is not set
+# CONFIG_X86_DECODER_SELFTEST is not set
 # CONFIG_X86_EXTENDED_PLATFORM is not set
 CONFIG_X86_F00F_BUG=y
 CONFIG_X86_FEATURE_NAMES=y
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: remove and unify symbols

2015-05-24 Thread Dirk Neukirchen

CONFIG_NET_NS is enabled by default in config/Config-kernel.in
and only some arch are setting/disabling it for
unknown reasons

Signed-off-by: Dirk Neukirchen 
---
 target/linux/malta/config-3.18 | 1 -
 target/linux/sunxi/config-3.18 | 1 -
 target/linux/uml/config/i386   | 1 -
 target/linux/uml/config/x86_64 | 1 -
 target/linux/x86/config-3.18   | 1 -
 5 files changed, 5 deletions(-)

diff --git a/target/linux/malta/config-3.18 b/target/linux/malta/config-3.18
index d9757de..4e6357d 100644
--- a/target/linux/malta/config-3.18
+++ b/target/linux/malta/config-3.18
@@ -169,7 +169,6 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NAMESPACES=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NET_FLOW_LIMIT=y
-# CONFIG_NET_NS is not set
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 CONFIG_NO_HZ=y
 CONFIG_NO_HZ_COMMON=y
diff --git a/target/linux/sunxi/config-3.18 b/target/linux/sunxi/config-3.18
index 5e191cf..a5e3533 100644
--- a/target/linux/sunxi/config-3.18
+++ b/target/linux/sunxi/config-3.18
@@ -302,7 +302,6 @@ CONFIG_NEED_DMA_MAP_STATE=y
 # CONFIG_NEON is not set
 # CONFIG_NET_CLS_CGROUP is not set
 CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NET_NS=y
 CONFIG_NET_PTP_CLASSIFY=y
 CONFIG_NET_VENDOR_ALLWINNER=y
 CONFIG_NLS=y
diff --git a/target/linux/uml/config/i386 b/target/linux/uml/config/i386
index 67081a5..611c7ae 100644
--- a/target/linux/uml/config/i386
+++ b/target/linux/uml/config/i386
@@ -89,7 +89,6 @@ CONFIG_MPENTIUMII=y
 # CONFIG_MWINCHIPC6 is not set
 CONFIG_NAMESPACES=y
 CONFIG_NEED_PER_CPU_KM=y
-# CONFIG_NET_NS is not set
 CONFIG_NLS=y
 # CONFIG_NOCONFIG_CHAN is not set
 CONFIG_NO_DMA=y
diff --git a/target/linux/uml/config/x86_64 b/target/linux/uml/config/x86_64
index d23612e..e9d9c5e 100644
--- a/target/linux/uml/config/x86_64
+++ b/target/linux/uml/config/x86_64
@@ -77,7 +77,6 @@ CONFIG_MODULES_USE_ELF_RELA=y
 # CONFIG_MPSC is not set
 CONFIG_NAMESPACES=y
 CONFIG_NEED_PER_CPU_KM=y
-# CONFIG_NET_NS is not set
 CONFIG_NLS=y
 # CONFIG_NOCONFIG_CHAN is not set
 CONFIG_NO_DMA=y
diff --git a/target/linux/x86/config-3.18 b/target/linux/x86/config-3.18
index 82a8211..8420ff9 100644
--- a/target/linux/x86/config-3.18
+++ b/target/linux/x86/config-3.18
@@ -280,7 +280,6 @@ CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
 CONFIG_NEED_SG_DMA_LENGTH=y
 # CONFIG_NET5501 is not set
-# CONFIG_NET_NS is not set
 CONFIG_NOHIGHMEM=y
 CONFIG_NO_BOOTMEM=y
 CONFIG_NR_CPUS=1
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] sunxi: remove kernel symbol

2015-05-24 Thread Felix Fietkau
On 2015-05-24 11:01, Dirk Neukirchen wrote:
> 
> unify config across platforms
> RESOURCE_COUNTERS is deactive on all platforms
> 
> Signed-off-by: Dirk Neukirchen 
> ---
Removing target/subtarget kernel config lines individually does not make
any sense. These files are generated by make kernel_menuconfig or make
kernel_oldconfig.

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


[OpenWrt-Devel] [PATCH] netifd: bump to current HEAD

2015-05-24 Thread Daniel Golle
This introduces a new config parameter "no-proto-task" useful for
xl2tpd.

Signed-off-by: Daniel Golle 
---
 package/network/config/netifd/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/config/netifd/Makefile 
b/package/network/config/netifd/Makefile
index 839b5b1..c943e69 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,13 +1,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_VERSION:=2015-05-19
+PKG_VERSION:=2015-05-23
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=http://git.openwrt.org/project/netifd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=9936bbfb3c8f6e39a3bc1f2418180caaca476aaa
+PKG_SOURCE_VERSION:=c68587663ef18fa87841be0a5281264361fab411
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MAINTAINER:=Felix Fietkau 
 # PKG_MIRROR_MD5SUM:=
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info

2015-05-24 Thread Sylwester Petela



W dniu 2015-05-23 o 23:22, Aleksander Wałęski pisze:

Sylwester Petela  gmail.com> writes:



W dniu 2015-05-05 o 09:31, Johannes Berg pisze:

On Tue, 2015-05-05 at 09:28 +0200, Sylwester Petela wrote:


[  458.772000] DSL[00]: WARNING - Data Path counters are not

supported

for the FE!

That seems pretty harmless - the driver code is really really ugly
though. Probably should just remove the message.

Cannot find witch function this message is referring to, need to
investigate more.

I found it in Martin's drv_dsl_cpe_api_vrx repository.


vectoring and ReTx works acording to friend but system log shows

some

errors as well like on my ADSL line but not so many.

What firmware/driver combination was this with?

xcpe_567517_562301.bin: VDSL over ISDN incl. vectoring support for
VRX200, version: 6.7.5 | ADSL Annex A for VRX200, version: 6.2.3

4.15.2 -app/control;  1.4.5 -mei

Ok, I'll give that a try as soon as I've removed this from my

productive

env.

Or perhaps I'll just put another image on a separate extroot since I
have extroot setup anyway.


Yes slow but why ? Because of load or because of hardware, Zyxel on
stock openwrt driver can achieve 80Mbps without that much load.

Not sure, perhaps the CPU is just slow?

johannes


Anyone got a clue how to disable warnings ? Tried to disable PM

counters

but without any luck.

[   47.436000] DSL[00]: PM NE processing out of Poll Cycle!
[   47.636000] DSL[00]: Unsupported message with MsgID=0x0245!
[   47.64] DSL[00]: Unsupported message with MsgID=0x1C44!
[   47.644000] DSL[00]: WARNING - Saving PM Channel Counters for FE

are

not supported!
[   47.652000] DSL[00]: WARNING - Saving PM Line Performance Counters
for FE are not supported!
[   70.76] DSL[00]: MEI_InternalXtmSwhowtimeEntrySignal(nFast=0,
nIntl=928000)
[   70.768000] enter showtime, cell rate: 0 - 2188, 1 - 2188, xdata
addr: 0x86d1
[   70.784000] enter showtime, cell rate: 0 - 2188, 1 - 2188, xdata
addr: 0x86d1
[   70.792000] DSL[00]: WARNING - Data Path counters are not supported
for the FE!
[   71.792000] DSL[00]: WARNING - FE line failures retrieving not
supported by the FW in ADSL mode!
[   72.436000] pppoe-wan: renamed from ppp0
[   72.80] DSL[00]: WARNING - FE line failures retrieving not
supported by the FW in ADSL mode!
(...)
[  106.792000] DSL[00]: WARNING - Data Path counters are not supported
for the FE!
[  107.064000] DSL[00]: WARNING - FE line failures retrieving not
supported by the FW in ADSL mode!
[  108.072000] DSL[00]: WARNING - FE line failures retrieving not
supported by the FW in ADSL mode!



Not sure if this helps, but some modules seem to accept debug_level
parameter at load. In GPL tarbal for W8980 (http://www.tp-
link.com/resources/gpl/GPL_TD-W8980.tar.gz) i found this line:
#insmod /lib/modules/drv_dsl_cpe_api.ko debug_level=3
Also, there are references in code to this:
https://github.com/xdarklight/lib_ifxos/search?q=debug_level

Also, using binwalk, I was able to extract dsl firmware from latest
W9980 firmware update (TD-W9980_V1_150507).

filename: xcpe_574306_571801.bin
version: 5.7.4.3.0.6-5.7.1.8.0.1
sha1sum: f8a13f16f5ead64bb0d2d551fbef8f1a838322f7
filesize: 923152
Firmware1:
 PLATFORM: 5
 PLATFORM_STR: VRX200
 APPLICATION_TYPE: 6
 APPLICATION_TYPE_STR: VDSL over IDSN
 VERSION_STR: 7.4.3
 RELEASE_STATUS: 0
 RELEASE_STATUS_STR: Release
Firmware2:
 PLATFORM: 5
 PLATFORM_STR: VRX200
 APPLICATION_TYPE: 1
 APPLICATION_TYPE_STR: ADSL Annex A
 VERSION_STR: 7.1.8
 RELEASE_STATUS: 0
 RELEASE_STATUS_STR: Release

Might be useful as it seems to be newest version reported so far.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Was quite obvious but I've missed it, default debug level have been 
changed since 4.11.4 so adding/changing:


--enable-error_print \
--disable-warning_print \
--enable-debug-prints=no \

gets rid of all warnings except of errors so on ADSL even with ReTx 
enabled console is silent and CPU usage dropped down to earlier level, I 
cannot test VDSL so if anyone can check it and post some results. 
Working with newest binary xcpe_574306_571801 from TP-LINK.


Newest trunk with patches from xdarklight, packages from DrayTek.

Full log: http://pastebin.com/KtwqydD8
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Chaos Calmer 15.05-rc1

2015-05-24 Thread Steven Barth
Ok thanks for the suggestion. I added some ietf references to the homepage.

Cheers,

Steven

Am 22. Mai 2015 16:29:12 MESZ, schrieb Michael Richardson :
>
>Steven Barth  wrote:
>>> Steven Barth  wrote:
>>> > - Added support for 464XLAT (CLAT)
>>>
>>> Is this signaled in some way by DHCPv6?
>>> If so, I imagine that there is an RFC# which says how it works,
>could be
> >> listed here, so that google will find CC when people look for it...
>
>> There seems to be no standardized RFC for this yet, as Bjorn pointed
>out.
>
>All I'm suggesting is that it say:
>
>- Added support for 464XLAT (CLAT) based upon RFC6877
>  (includes using heuristic to discover the PLAT side)
>
>if one supported the new DHCPv6 option, then one would say instead:
>
>- Added support for 464XLAT (CLAT) based upon RFC6877
>  (includes using heuristic to discover the PLAT side,
>and supporting DHCPv6 option in
>draft-cui-intarea-464xlat-prefix-dhcp-00)
>
>
>it's just google fodder so that IETF people can find the code, and
>OpenWRT people can find the specification :-)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info

2015-05-24 Thread Martin Blumenstingl
> Was quite obvious but I've missed it, default debug level have been changed
Excellent catch, I should have noticed it when I removed "-DDSL_DEBUG_DISABLE"

> Newest trunk with patches from xdarklight, packages from DrayTek.
What do you mean exactly with "packages from DrayTek"?

> Full log: http://pastebin.com/KtwqydD8
Looks clean :-)

I am currently updating my patch to include your configuration change.
To make that applying the patch easier I have also tagged the versions on github
(I used a "-custom" suffix to indicate that it's not 1:1 lantiq's version).
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [package] opkg: Fix --force-checksum when using SHA256

2015-05-24 Thread Florian Fieber
Allow installing packages with mismatching SHA256 checksums via

$ opkg install --force-checksum $PACKAGE

Signed-off-by: Florian Fieber 
---
 .../240-fix-force-checksum-for-sha256.patch| 31 ++
 1 file changed, 31 insertions(+)
 create mode 100644 
package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch

diff --git 
a/package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch 
b/package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch
new file mode 100644
index 000..8af4d40
--- /dev/null
+++ b/package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch
@@ -0,0 +1,31 @@
+--- a/libopkg/opkg_install.c
 b/libopkg/opkg_install.c
+@@ -1364,12 +1364,22 @@ opkg_install_pkg(pkg_t *pkg, int from_up
+  file_sha256 = file_sha256sum_alloc(pkg->local_filename);
+  if (file_sha256 && strcmp(file_sha256, pkg->sha256sum))
+  {
+-  opkg_msg(ERROR, "Package %s sha256sum mismatch. "
+-  "Either the opkg or the package index are corrupt. "
+-  "Try 'opkg update'.\n",
+-  pkg->name);
+-  free(file_sha256);
+-  return -1;
++  if (!conf->force_checksum)
++  {
++  opkg_msg(ERROR,
++   "Package %s sha256sum mismatch. "
++   "Either the opkg or the package index are corrupt. 
"
++   "Try 'opkg update'.\n",
++   pkg->name);
++  free(file_sha256);
++  return -1;
++  }
++  else
++  {
++  opkg_msg(NOTICE,
++   "Ignored %s sha256sum mismatch.\n",
++   pkg->name);
++  }
+  }
+if (file_sha256)
+   free(file_sha256);
-- 
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] lantiq DSL drivers / firmware info

2015-05-24 Thread olewales
On Sun, May 24, 2015 at 5:15 PM, Martin Blumenstingl
 wrote:
>> Was quite obvious but I've missed it, default debug level have been changed
> Excellent catch, I should have noticed it when I removed "-DDSL_DEBUG_DISABLE"

This might come in handy for DSL tinkerers, though. Probably should be
made mencuonfig option

>> Newest trunk with patches from xdarklight, packages from DrayTek.
> What do you mean exactly with "packages from DrayTek"?
>
>> Full log: http://pastebin.com/KtwqydD8
> Looks clean :-)
>
> I am currently updating my patch to include your configuration change.
> To make that applying the patch easier I have also tagged the versions on 
> github
> (I used a "-custom" suffix to indicate that it's not 1:1 lantiq's version).

Waiting impatiently for this new patch. For now I can say that I have
problems with old driver combined with newest TP-LINK dsl firmware on
VDSL line. Once I establish known working configuration I'll build fw
with latest driver and test again.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info

2015-05-24 Thread Martin Blumenstingl
> Waiting impatiently for this new patch. For now I can say that I have
> problems with old driver combined with newest TP-LINK dsl firmware on
> VDSL line. Once I establish known working configuration I'll build fw
> with latest driver and test again.
New patch is ready: [0]

Let me know if VDSL works with this driver for you.
Then we can think of how to get the new version into OpenWrt.


[0] https://gist.github.com/xdarklight/2986587133d97892a4b3/download
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ncurses: Fix building with gcc 5.1

2015-05-24 Thread Martin Blumenstingl
This patch is taken from the gentoo guys who extracted this from a large
upstream commit (with many unrelated changes).

Signed-off-by: Martin Blumenstingl 
---
 package/libs/ncurses/Makefile  |  2 +-
 .../ncurses/patches/102-ncurses-5.9-gcc-5.patch| 46 ++
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch

diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile
index 13c7962..1f7ea9b 100644
--- a/package/libs/ncurses/Makefile
+++ b/package/libs/ncurses/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ncurses
 PKG_VERSION:=5.9
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch 
b/package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch
new file mode 100644
index 000..2448229
--- /dev/null
+++ b/package/libs/ncurses/patches/102-ncurses-5.9-gcc-5.patch
@@ -0,0 +1,46 @@
+https://bugs.gentoo.org/545114
+
+extracted from the upstream change (which had many unrelated commits in one)
+
+From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001
+From: "Thomas E. Dickey" 
+Date: Sun, 7 Dec 2014 03:10:09 +
+Subject: [PATCH] ncurses 5.9 - patch 20141206
+
++ modify MKlib_gen.sh to work around change in development version of
+  gcc introduced here:
+ https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+ https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
+  (reports by Marcus Shawcroft, Maohui Lei).
+
+diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
+index d8cc3c9..b91398c 100755
+--- a/ncurses/base/MKlib_gen.sh
 b/ncurses/base/MKlib_gen.sh
+@@ -474,11 +474,22 @@ sed -n -f $ED1 \
+   -e 's/gen_$//' \
+   -e 's/  / /g' >>$TMP
+ 
++cat >$ED1  $ED2
++cat $ED2 >$TMP
++
+ $preprocessor $TMP 2>/dev/null \
+-| sed \
+-  -e 's/  / /g' \
+-  -e 's/^ //' \
+-  -e 's/_Bool/NCURSES_BOOL/g' \
++| sed -f $ED1 \
+ | $AWK -f $AW2 \
+ | sed -f $ED3 \
+ | sed \
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] scripts/feeds: return error status from feed updating (alternative approach)

2015-05-24 Thread Hannu Nyman

scripts/feeds: return error status from feed update

This patch is a modified version of the patch being discussed at here:
https://patchwork.ozlabs.org/patch/471303/from Martin Strbacka 



My version modifies scripts/feeds so that an error with one of the feeds just 
raises the error flag, but script continues and tries to update the other 
feeds. After all feeds have been updated, the script returns 1 if at least 
one feed failed, and 0 on success with all feeds. The user can then utilise 
the status in his build script, if he wants.


signed-off-by: Hannu Nyman 

Index: scripts/feeds
===
--- scripts/feeds   (revision 45743)
+++ scripts/feeds   (working copy)
@@ -687,6 +687,7 @@
my %opts;
my $feed_name;
my $perform_update=1;
+   my $failed=0;
 
$ENV{SCAN_COOKIE} = $$;
$ENV{OPENWRT_VERBOSE} = 's';
@@ -711,8 +712,7 @@
if ( ($#ARGV == -1) or $opts{a}) {
foreach my $feed (@feeds) {
my ($type, $name, $src) = @$feed;
-   next unless update_feed($type, $name, $src, 
$perform_update) == 1;
-   last;
+   update_feed($type, $name, $src, $perform_update) == 0 
or $failed=1;
}
} else {
while ($feed_name = shift @ARGV) {
@@ -721,7 +721,7 @@
if($feed_name ne $name) {
next;
}
-   update_feed($type, $name, $src, 
$perform_update);
+   update_feed($type, $name, $src, 
$perform_update) == 0 or $failed=1;
}
}
}
@@ -728,7 +728,7 @@
 
refresh_config();
 
-   return 0;
+   return $failed;
 }
 
 sub feed_config() {
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] scripts/feeds: Return non-zero return code if updating of a feed failed.

2015-05-24 Thread Hannu Nyman

On 22.5.2015 16:59, John Crispin wrote:

also i am not sure if we want the script to abort if one of the feeds
has failed



I have submitted an alternative version that simplifies the code and just 
returns the error information, but tries to update all feeds despite failure 
at one of them.


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


[OpenWrt-Devel] [PATCH] ar71xx: Add Support for the Bitmain Antminer S1

2015-05-24 Thread L. D. Pinney
This patch adds support for the Bitmain Antminer S1 Cryptocurrency Miner

http://wiki.openwrt.org/toh/bitmain/s1

Signed-off-by: L. D. Pinney 
Acked-by: James Hilliard 
---

 target/linux/ar71xx/base-files/etc/diag.sh 
   |  3 ++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
   |  5 
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
   |  1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   
   |  3 ++
 target/linux/ar71xx/config-3.18
   |  1 +
 target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c   
   | 98 +
 target/linux/ar71xx/generic/profiles/antminer.mk   
   | 17 +++
 target/linux/ar71xx/image/Makefile 
   | 10 ++-
 
target/linux/ar71xx/patches-3.18/904-MIPS-ath79-bitmain-antminer-s1-support.patch
 | 39 
 tools/firmware-utils/src/mktplinkfw.c  
   |  6 
 10 files changed, 182 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 0553251..f6e4a87 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -12,6 +12,9 @@ get_status_led() {
all0305)
status_led="eap7660d:green:ds4"
;;
+   antminer-s1)
+   status_led="bitmain:green:system"
+   ;;
ap132)
status_led="ap132:green:status"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index 41b..19814f4 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -31,6 +31,11 @@ all0315n)
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0315n:green:rssihigh" 
"wlan0" "70" "100" "-69" "8"
;;
 
+antminer-s1)
+   ucidef_set_led_default "sys" "SYS" "bitmain:green:sys" "0"
+   ucidef_set_led_wlan "wlan" "WLAN" "bitmain:green:wlan" "phy0tpt"
+   ;;
+
 ap113)
ucidef_set_led_usbdev "usb" "USB" "ap113:green:usb" "1-1"
;;
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 f5c6865..9fdaca0 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -343,6 +343,7 @@ wp543)
ucidef_set_interface_lan "eth0"
;;
 
+antminer-s1 |\
 dir-505-a1)
ucidef_set_interface_lan "eth1"
;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index d5dd561..06c6e53 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -107,6 +107,9 @@ tplink_board_detect() {
"015300"*)
model="EasyLink EL-MINI"
;;
+   "04440001"*)
+   model="BITMAIN ANTMINER S1"
+   ;;
"12"*)
model="MERCURY MAC1200R"
;;
diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18
index 543b77e..1960060 100644
--- a/target/linux/ar71xx/config-3.18
+++ b/target/linux/ar71xx/config-3.18
@@ -40,6 +40,7 @@ CONFIG_ATH79_MACH_AP83=y
 CONFIG_ATH79_MACH_AP96=y
 CONFIG_ATH79_MACH_ARCHER_C7=y
 CONFIG_ATH79_MACH_AW_NR580=y
+CONFIG_ATH79_MACH_ANTMINER_S1=y
 CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
 CONFIG_ATH79_MACH_CAP4200AG=y
 CONFIG_ATH79_MACH_CARAMBOLA2=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c
new file mode 100644
index 000..27ed760
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-antminer-s1.c
@@ -0,0 +1,98 @@
+/*
+ *   Bitmain Antminer S1 board support
+ *
+ *  Copyright (C) 2015 L. D. Pinney 
+ *
+ *  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.
+ */
+
+#include 
+
+#include 
+#include 
+
+#include "common.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+#include "dev-usb.h"
+
+#define ANTMINER_S1_GPIO_BTN_RESET 11
+
+#define ANTMINER_S1_GPIO_LED_SYSTEM23
+#define ANTMINER_S1_GPIO_LED_WLAN  0
+#define ANTMINER_S1_GPIO_USB_POWER 8
+
+#define ANTMINER_S1_KEYSPOLL_INTERVAL  20  /* msecs */
+#define ANTMINER_S1_KEYSDEBOUNCE_INTERVAL (3 * ANTM

[OpenWrt-Devel] [PATCH] zram-swap: set a high priority for the swap

2015-05-24 Thread Juan Orti Alcaine
The zram swap must be activated with a higher priority than
disk-based swap, so it is used before any other.
This patch activates the zram-based swap with a priority of 100.

Signed-off-by: Juan Orti Alcaine 
---
 package/system/zram-swap/files/zram.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index 23de915..b26ee0d 100644
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -100,7 +100,7 @@ start()
zram_reset "$zram_dev" "enforcing defaults"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename 
$zram_dev )/disksize"
mkswap "$zram_dev"
-   swapon "$zram_dev"
+   swapon -p 100 "$zram_dev"
} done
 }
 
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info

2015-05-24 Thread Aleksander Wałęski
Good news! It works.
Furthermore, I could only get it to work on my line with this new
driver. I tried old driver with 6 different firmwares (VDSL fw
versions: 3.2.8, 3.4.A, 4.6.D, 4.7.9, 6.8.4, 7.4.3). Older ones got me
as far as "full_init [0x380]" but then process was interrupted and
started all over again. I suspect that DSLAM I am connected to could
not negotiate parameters it wanted from modem. Newer firmwares on the
other hand just sit at "idle request [0xFF]". Probably they are not
compatible with old driver version. This is quite interesting because
they are reports from people running openwrt Lantiq devices on VDSL2
lines from my ISP (Orange Polska).

With the new driver and lastest firmware (from W9980) I got showtime
right away, I didn't even have to touch any configuration. As I
discovered, that's because this combination of driver/firmware
(probably mostly firmware) seems to ignore all magic numbers passed by
dsl_control. It behaves the same regardless of what I provide to
vdsl_cpe_control as init bits (-i) or low level configuration file
(-l). -M parameter also seems unnecessary. Firmware either has some
hard coded values which match my connection, or more likely, it
performs autodetection of line parameters. This makes sense because
W9980 is sold worldwide and has to support all configurations
imaginable. Unfortunately TP-LINK firmware seems to be mostly bunch of
binaries talking to one another (in this case /lib/libcmm.so seems to
call dsl_cpe_control) so passive analysis is not easy. Maybe someone
could try to spy on firmware running on actual device.

This of course should be confirmed by few people (preferably on vastly
different connections) before sending patch upstream, but if it turns
out to be true it will greatly simplify xDSL configuration on Lantiq
devices. My dsl_control script currently looks like this (also on
pastebin if line wraping messes with it: http://pastebin.com/G0jUQMxL)

---

#!/bin/sh /etc/rc.common
# Copyright (C) 2015 OpenWrt.org

# needs to start before the atm layer which starts at 50
START=48

EXTRA_COMMANDS="status lucistat"
EXTRA_HELP="status  Get DSL status information
lucistat  Get status information if lua friendly format"

SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1

[ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
XDSL_CTRL=vdsl_cpe_control


start() {

config_load network
config_get firmware dsl firmware
config_get xfer_mode dsl xfer_mode

[ -z "${xfer_mode}" ] && xfer_mode=ptm

case "${xfer_mode}" in
atm)
insmod ltq_atm_vr9
;;
*)
insmod ltq_ptm_vr9
;;
esac



[ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin
[ -f "${firmware}" ] || {
echo failed to find $firmware
return 1
}

service_start /sbin/vdsl_cpe_control \
-i  \
-n /sbin/dsl_notify.sh \
-f ${firmware} \
-A /lib/firmware/vdsl.scr
}

stop() {
DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
DSL_INTERFACE_STATUS="DOWN" \
/sbin/dsl_notify.sh

service_stop /sbin/vdsl_cpe_control
}

---

Got rid of most of the things. Whats left:
1. Module loading. Tried to just load both modules even if we don't
use them but then kernel complains about IRQ conflict and crashes
badly soon afterwards.
2. Firmware path. Hardcoding this would not be very elegant but we
could remove it from network configuration file while reworking
firmware installation script (it will be necessary eventually)
3. dsl_notify stuff
4. -i command line switch. No "init bits" need to follow but it seems
that it has to be there.
5. VDSL autoboot script (more on that below).

TP-LINK includes vdsl.scr, which according to comment, enables ReTx in
both directions. I have not noticed any change in my setup after
enabling this but it think we should include this to maintain
potentially the same performance.



On the side note. Lantiq modem achieves a bit lower sync rates than
router provided by my ISP (about 22Mbit / 3.5Mbit vs 25Mbit/4Mbit) but
I am willing to make this sacrifice for having full control over
hardware and configuration. I am seriously concerned about performance
though. I managed to get 130Mbit/s from iperf over wired connection. I
have yet to check NAT/routing performance but routing between subnets
on gigabit ethernet I was hoping to do seems to be out of question.

On Sun, May 24, 2015 at 6:04 PM, Martin Blumenstingl
 wrote:
>> Waiting impatiently for this new patch. For now I can say that I have
>> problems with old driver combined with newest TP-LINK dsl firmware on
>> VDSL line. Once I establish known working configuration I'll build fw
>> with latest driver and test again.
> New patch is ready: [0]

Re: [OpenWrt-Devel] lantiq DSL drivers / firmware info

2015-05-24 Thread Sylwester Petela



W dniu 2015-05-25 o 08:00, Aleksander Wałęski pisze:

Good news! It works.
Furthermore, I could only get it to work on my line with this new
driver. I tried old driver with 6 different firmwares (VDSL fw
versions: 3.2.8, 3.4.A, 4.6.D, 4.7.9, 6.8.4, 7.4.3). Older ones got me
as far as "full_init [0x380]" but then process was interrupted and
started all over again. I suspect that DSLAM I am connected to could
not negotiate parameters it wanted from modem. Newer firmwares on the
other hand just sit at "idle request [0xFF]". Probably they are not
compatible with old driver version. This is quite interesting because
they are reports from people running openwrt Lantiq devices on VDSL2
lines from my ISP (Orange Polska).

With the new driver and lastest firmware (from W9980) I got showtime
right away, I didn't even have to touch any configuration. As I
discovered, that's because this combination of driver/firmware
(probably mostly firmware) seems to ignore all magic numbers passed by
dsl_control. It behaves the same regardless of what I provide to
vdsl_cpe_control as init bits (-i) or low level configuration file
(-l). -M parameter also seems unnecessary. Firmware either has some
hard coded values which match my connection, or more likely, it
performs autodetection of line parameters. This makes sense because
W9980 is sold worldwide and has to support all configurations
imaginable. Unfortunately TP-LINK firmware seems to be mostly bunch of
binaries talking to one another (in this case /lib/libcmm.so seems to
call dsl_cpe_control) so passive analysis is not easy. Maybe someone
could try to spy on firmware running on actual device.

This of course should be confirmed by few people (preferably on vastly
different connections) before sending patch upstream, but if it turns
out to be true it will greatly simplify xDSL configuration on Lantiq
devices. My dsl_control script currently looks like this (also on
pastebin if line wraping messes with it: http://pastebin.com/G0jUQMxL)

---

#!/bin/sh /etc/rc.common
# Copyright (C) 2015 OpenWrt.org

# needs to start before the atm layer which starts at 50
START=48

EXTRA_COMMANDS="status lucistat"
EXTRA_HELP="status  Get DSL status information
 lucistat  Get status information if lua friendly format"

SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1

[ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
XDSL_CTRL=vdsl_cpe_control


start() {

 config_load network
 config_get firmware dsl firmware
 config_get xfer_mode dsl xfer_mode

 [ -z "${xfer_mode}" ] && xfer_mode=ptm

 case "${xfer_mode}" in
 atm)
 insmod ltq_atm_vr9
 ;;
 *)
 insmod ltq_ptm_vr9
 ;;
 esac



 [ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin
 [ -f "${firmware}" ] || {
 echo failed to find $firmware
 return 1
 }

 service_start /sbin/vdsl_cpe_control \
 -i  \
 -n /sbin/dsl_notify.sh \
 -f ${firmware} \
 -A /lib/firmware/vdsl.scr
}

stop() {
 DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
 DSL_INTERFACE_STATUS="DOWN" \
 /sbin/dsl_notify.sh

 service_stop /sbin/vdsl_cpe_control
}

---

Got rid of most of the things. Whats left:
1. Module loading. Tried to just load both modules even if we don't
use them but then kernel complains about IRQ conflict and crashes
badly soon afterwards.
2. Firmware path. Hardcoding this would not be very elegant but we
could remove it from network configuration file while reworking
firmware installation script (it will be necessary eventually)
Getting rid of init script isn't good probably, as original driver in 
UGW passes the same commands (mostly) to dsl_control.
Firmware dir is also in original UGW init script, moving it from config 
to init doesn't make any difference.

3. dsl_notify stuff
4. -i command line switch. No "init bits" need to follow but it seems
that it has to be there.
5. VDSL autoboot script (more on that below).

TP-LINK includes vdsl.scr, which according to comment, enables ReTx in
both directions. I have not noticed any change in my setup after
enabling this but it think we should include this to maintain
potentially the same performance.


General init is made by script (Low-level config, etc.) Rest is 
calculated from API or by firmware (mostly firmware bits) (see My 
earlier problem with ReTx on ADSL) You can see it in this log 
http://pastebin.com/ne1aELff






On the side note. Lantiq modem achieves a bit lower sync rates than
router provided by my ISP (about 22Mbit / 3.5Mbit vs 25Mbit/4Mbit) but
I am willing to make this sacrifice for having full control over
hardware and configuration. I am seriously concerned about performance
thou