[OpenWrt-Devel] [PATCH] bcm53xx: add restart support

2014-07-30 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki 
---
 .../131-ARM-BCM5301X-add-restart-support.patch | 74 ++
 1 file changed, 74 insertions(+)
 create mode 100644 
target/linux/bcm53xx/patches-3.14/131-ARM-BCM5301X-add-restart-support.patch

diff --git 
a/target/linux/bcm53xx/patches-3.14/131-ARM-BCM5301X-add-restart-support.patch 
b/target/linux/bcm53xx/patches-3.14/131-ARM-BCM5301X-add-restart-support.patch
new file mode 100644
index 000..7fdbaa3
--- /dev/null
+++ 
b/target/linux/bcm53xx/patches-3.14/131-ARM-BCM5301X-add-restart-support.patch
@@ -0,0 +1,74 @@
+From 28b11a8b1258214b3b5d58bb6e3bbcb0fc9fd4fe Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= 
+Date: Thu, 31 Jul 2014 07:28:05 +0200
+Subject: [PATCH] ARM: BCM5301X: add restart support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Rafał Miłecki 
+---
+ arch/arm/mach-bcm/bcm_5301x.c | 31 +++
+ 1 file changed, 31 insertions(+)
+
+diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c
+index edff697..e349897 100644
+--- a/arch/arm/mach-bcm/bcm_5301x.c
 b/arch/arm/mach-bcm/bcm_5301x.c
+@@ -12,9 +12,26 @@
+ #include 
+ #include 
+ 
++#include 
+ 
+ static bool first_fault = true;
+ 
++static struct bcma_bus *bcm5301x_get_bcma_bus(void)
++{
++  struct device_node *np;
++  struct platform_device *pdev;
++
++  np = of_find_compatible_node(NULL, NULL, "brcm,bus-aix");
++  if (!np)
++  return NULL;
++
++  pdev = of_find_device_by_node(np);
++  if (!pdev)
++  return NULL;
++
++  return platform_get_drvdata(pdev);
++}
++
+ static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
+struct pt_regs *regs)
+ {
+@@ -49,6 +66,19 @@ static void __init bcm5301x_dt_init(void)
+   of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ }
+ 
++static void bcm5301x_restart(enum reboot_mode mode, const char *cmd)
++{
++  struct bcma_bus *bus = bcm5301x_get_bcma_bus();
++
++  if (bus)
++  bcma_chipco_watchdog_timer_set(&bus->drv_cc, 1);
++  else
++  pr_warn("Unable to access bcma bus\n");
++
++  while (1)
++  ;
++}
++
+ static const char __initconst *bcm5301x_dt_compat[] = {
+   "brcm,bcm4708",
+   NULL,
+@@ -57,5 +87,6 @@ static const char __initconst *bcm5301x_dt_compat[] = {
+ DT_MACHINE_START(BCM5301X, "BCM5301X")
+   .init_early = bcm5301x_init_early,
+   .init_machine   = bcm5301x_dt_init,
++  .restart= bcm5301x_restart,
+   .dt_compat  = bcm5301x_dt_compat,
+ MACHINE_END
+-- 
+1.8.4.5
+
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [ar71xx] oolite: corrected directionality of button GPIOs

2014-07-30 Thread Brent Thomson
The reset button on the GS-Oolite v1.0 was reversed. That is, it
registered `release' when first depressed and `press' when released.
This resulted in the device being sent back to factory defaults the
instant the button was depressed (because the `press' time was zero
and the resulting interval was longer than the factory reset timeout),
rather than only when the button is held for XX seconds and then
released. Buttons 6 & 7 were similarly inverted. Now they're not ;-)

Signed-off-by: Brent Thomson 

---
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
index 3d85f24..c6cb61c 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c
@@ -54,7 +54,7 @@ static struct gpio_keys_button gs_oolite_gpio_keys[]
__initdata = {
.code   = KEY_RESTART,
.debounce_interval = GS_OOLITE_KEYS_DEBOUNCE_INTERVAL,
.gpio   = GS_OOLITE_GPIO_BTN_RESET,
-   .active_low = 1,
+   .active_low = 0,
},
{
.desc   = "BTN_6",
@@ -62,7 +62,7 @@ static struct gpio_keys_button gs_oolite_gpio_keys[]
__initdata = {
.code   = BTN_6,
.debounce_interval = GS_OOLITE_KEYS_DEBOUNCE_INTERVAL,
.gpio   = GS_OOLITE_GPIO_BTN6,
-   .active_low = 1,
+   .active_low = 0,
},
{
.desc   = "BTN_7",
@@ -70,7 +70,7 @@ static struct gpio_keys_button gs_oolite_gpio_keys[]
__initdata = {
.code   = BTN_7,
.debounce_interval = GS_OOLITE_KEYS_DEBOUNCE_INTERVAL,
.gpio   = GS_OOLITE_GPIO_BTN7,
-   .active_low = 1,
+   .active_low = 0,
},
 };
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Make phy fixups patch generic

2014-07-30 Thread Sergey Ryazanov
Hi Florian,

2014-07-31 2:14 GMT+04:00 Florian Fainelli :
> Hi Sergey,
>
> 2014-07-30 15:09 GMT-07:00 Sergey Ryazanov :
>> Hello Hauke,
>>
>> could you move your patch, which fix fixups call [1] from brcm47xx
>> target to the generic patches, since mvswitch driver suffers from the
>> same problem?
>>
>> 1. 
>> https://dev.openwrt.org/browser/trunk/target/linux/brcm47xx/patches-3.14/960-fix-phy-device.patch
>
> It's fixed upstream now BTW:
> http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=d92f5dec6325079c550889883af51db1b77d5623
>
> expect a backport to the 3.14 stable tree anytime soon.
>
I missed that. Thank you!

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


Re: [OpenWrt-Devel] Make phy fixups patch generic

2014-07-30 Thread Florian Fainelli
Hi Sergey,

2014-07-30 15:09 GMT-07:00 Sergey Ryazanov :
> Hello Hauke,
>
> could you move your patch, which fix fixups call [1] from brcm47xx
> target to the generic patches, since mvswitch driver suffers from the
> same problem?
>
> 1. 
> https://dev.openwrt.org/browser/trunk/target/linux/brcm47xx/patches-3.14/960-fix-phy-device.patch

It's fixed upstream now BTW:
http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=d92f5dec6325079c550889883af51db1b77d5623

expect a backport to the 3.14 stable tree anytime soon.
--
Florian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Rebuilding qemu depending on glib-2

2014-07-30 Thread Ning Ye
I am trying to rebuild qemu-img with the latest stable version 2.0.0.  I can
build it on my host, but it depends on glib2 and libffi, which are under
feeds/packages/libs/  How can I make sure those feeds are downloaded and
build for qemu, which is under tools?  I would hate to duplicate the glib2
to the host directory.  Any suggestions?  Thanks.

 

Ning

 

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


[OpenWrt-Devel] Make phy fixups patch generic

2014-07-30 Thread Sergey Ryazanov
Hello Hauke,

could you move your patch, which fix fixups call [1] from brcm47xx
target to the generic patches, since mvswitch driver suffers from the
same problem?

1. 
https://dev.openwrt.org/browser/trunk/target/linux/brcm47xx/patches-3.14/960-fix-phy-device.patch

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


[OpenWrt-Devel] [PATCH] ramips: Fix LEDs on the Kingston MLW221

2014-07-30 Thread L. D. Pinney

From: L. D. Pinney 

LED Fix up for the Kingston Mobilelite Wireless (MLW-221)

http://wiki.openwrt.org/toh/kingston/mlw221
  
Signed-off-by: L. D. Pinney 

---
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 0887606..4cd5acf 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -74,7 +74,7 @@ get_status_led() {
status_led="m4:blue:status"
;;
mlw221)
-   status_led="kingston:green:status"
+   status_led="kingston:blue:system"
;;
mofi3500-3gn)
status_led="mofi3500-3gn:green:status"
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 
b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
index 359281e..e92a12e 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -115,6 +115,7 @@ case $board in
;;
mlw221)
set_wifi_led "kingston:blue:wifi"
+   ucidef_set_led_default "system" "system" "kingston:blue:system" 
"1"
;;
mofi3500-3gn)
set_usb_led "mofi3500-3gn:green:usb"diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 0887606..4cd5acf 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -74,7 +74,7 @@ get_status_led() {
 		status_led="m4:blue:status"
 		;;
 	mlw221)
-		status_led="kingston:green:status"
+		status_led="kingston:blue:system"
 		;;
 	mofi3500-3gn)
 		status_led="mofi3500-3gn:green:status"
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
index 359281e..e92a12e 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -115,6 +115,7 @@ case $board in
 		;;
 	mlw221)
 		set_wifi_led "kingston:blue:wifi"
+		ucidef_set_led_default "system" "system" "kingston:blue:system" "1"
 		;;
 	mofi3500-3gn)
 		set_usb_led "mofi3500-3gn:green:usb"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] netifd: GRE tunnel support

2014-07-30 Thread Hans Dedecker
Adds support for gre, gretap, grev6 and grev6tap tunnels

Signed-off-by: Hans Dedecker 
---
 system-dummy.c |2 +-
 system-linux.c |  190 +---
 system.c   |1 +
 system.h   |3 +-
 tunnel.c   |2 +-
 5 files changed, 186 insertions(+), 12 deletions(-)

diff --git a/system-dummy.c b/system-dummy.c
index 8bcebc1..8e420e1 100644
--- a/system-dummy.c
+++ b/system-dummy.c
@@ -235,7 +235,7 @@ time_t system_get_rtime(void)
return 0;
 }
 
-int system_del_ip_tunnel(const char *name)
+int system_del_ip_tunnel(const char *name, struct blob_attr *attr)
 {
return 0;
 }
diff --git a/system-linux.c b/system-linux.c
index ea3a138..2d65cef 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -806,7 +806,7 @@ nla_put_failure:
return -ENOMEM;
 }
 
-static int system_link_del(struct device *dev)
+static int system_link_del(const char *ifname)
 {
struct nl_msg *msg;
struct ifinfomsg iim = {
@@ -820,13 +820,13 @@ static int system_link_del(struct device *dev)
return -1;
 
nlmsg_append(msg, &iim, sizeof(iim), 0);
-   nla_put_string(msg, IFLA_IFNAME, dev->ifname);
+   nla_put_string(msg, IFLA_IFNAME, ifname);
return system_rtnl_call(msg);
 }
 
 int system_macvlan_del(struct device *macvlan)
 {
-   return system_link_del(macvlan);
+   return system_link_del(macvlan->ifname);
 }
 
 static int system_vlan(struct device *dev, int id)
@@ -912,7 +912,7 @@ nla_put_failure:
 
 int system_vlandev_del(struct device *vlandev)
 {
-   return system_link_del(vlandev);
+   return system_link_del(vlandev->ifname);
 }
 
 static void
@@ -1654,9 +1654,173 @@ static int tunnel_ioctl(const char *name, int cmd, void 
*p)
return ioctl(sock_ioctl, cmd, &ifr);
 }
 
-int system_del_ip_tunnel(const char *name)
+static int system_add_gre_tunnel(const char *name, const char *kind,
+const unsigned int link, struct blob_attr 
**tb, bool v6)
 {
-   return tunnel_ioctl(name, SIOCDELTUNNEL, NULL);
+   struct nl_msg *nlm;
+   struct ifinfomsg ifi = { .ifi_family = AF_UNSPEC, };
+   struct blob_attr *cur;
+   uint32_t ikey = 0, okey = 0;
+   uint16_t iflags = 0, oflags = 0;
+   int ret = 0, ttl = 64;
+
+   nlm = nlmsg_alloc_simple(RTM_NEWLINK, NLM_F_REQUEST | NLM_F_REPLACE | 
NLM_F_CREATE);
+   if (!nlm)
+   return -1;
+
+   nlmsg_append(nlm, &ifi, sizeof(ifi), 0);
+   nla_put_string(nlm, IFLA_IFNAME, name);
+
+   struct nlattr *linkinfo = nla_nest_start(nlm, IFLA_LINKINFO);
+   if (!linkinfo) {
+   ret = -ENOMEM;
+   goto failure;
+   }
+
+   nla_put_string(nlm, IFLA_INFO_KIND, kind);
+   struct nlattr *infodata = nla_nest_start(nlm, IFLA_INFO_DATA);
+   if (!infodata) {
+   ret = -ENOMEM;
+   goto failure;
+   }
+
+   if (link)
+   nla_put_u32(nlm, IFLA_GRE_LINK, link);
+
+   if ((cur = tb[TUNNEL_ATTR_TTL]))
+   ttl = blobmsg_get_u32(cur);
+
+   nla_put_u8(nlm, IFLA_GRE_TTL, ttl);
+
+   if ((cur = tb[TUNNEL_ATTR_INFO]) && (blobmsg_type(cur) == 
BLOBMSG_TYPE_STRING)) {
+   uint8_t icsum, ocsum, iseqno, oseqno;
+   if (sscanf(blobmsg_get_string(cur), "%u,%u,%hhu,%hhu,%hhu,%hhu",
+   &ikey, &okey, &icsum, &ocsum, &iseqno, &oseqno) < 6) {
+   ret = -EINVAL;
+   goto failure;
+   }
+
+   if (ikey)
+   iflags |= GRE_KEY;
+
+   if (okey)
+   oflags |= GRE_KEY;
+
+   if (icsum)
+   iflags |= GRE_CSUM;
+
+   if (ocsum)
+   oflags |= GRE_CSUM;
+
+   if (iseqno)
+   iflags |= GRE_SEQ;
+
+   if (oseqno)
+   oflags |= GRE_SEQ;
+   }
+
+   if (v6) {
+   struct in6_addr in6buf;
+   if ((cur = tb[TUNNEL_ATTR_LOCAL])) {
+   if (inet_pton(AF_INET6, blobmsg_data(cur), &in6buf) < 
1) {
+   ret = -EINVAL;
+   goto failure;
+   }
+   nla_put(nlm, IFLA_GRE_LOCAL, sizeof(in6buf), &in6buf);
+   }
+
+   if ((cur = tb[TUNNEL_ATTR_REMOTE])) {
+   if (inet_pton(AF_INET6, blobmsg_data(cur), &in6buf) < 
1) {
+   ret = -EINVAL;
+   goto failure;
+   }
+   nla_put(nlm, IFLA_GRE_REMOTE, sizeof(in6buf), &in6buf);
+   }
+   nla_put_u8(nlm, IFLA_GRE_ENCAP_LIMIT, 4);
+   } else {
+   struct in_addr inbuf;
+   bool set_df = true;
+
+   if ((cur = tb[TUNNEL_ATTR_LOCAL])) {
+   if

[OpenWrt-Devel] [PATCH 2/3] netifd: Allow to add link devices which can be marked as non external

2014-07-30 Thread Hans Dedecker

Signed-off-by: Hans Dedecker 
---
 interface.c |   14 --
 interface.h |3 +--
 ubus.c  |   29 +++--
 wireless.c  |2 +-
 4 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/interface.c b/interface.c
index ed60959..8627d97 100644
--- a/interface.c
+++ b/interface.c
@@ -835,8 +835,8 @@ interface_remove_link(struct interface *iface, struct 
device *dev)
return 0;
 }
 
-int
-interface_add_link(struct interface *iface, struct device *dev)
+static int
+interface_add_link(struct interface *iface, struct device *dev, bool link_ext)
 {
struct device *mdev = iface->main_dev.dev;
 
@@ -853,21 +853,23 @@ interface_add_link(struct interface *iface, struct device 
*dev)
return UBUS_STATUS_NOT_SUPPORTED;
}
 
-   device_add_user(&iface->ext_dev, dev);
+   if (link_ext)
+   device_add_user(&iface->ext_dev, dev);
+
interface_set_main_dev(iface, dev);
iface->main_dev.hotplug = true;
return 0;
 }
 
 int
-interface_handle_link(struct interface *iface, const char *name, bool add)
+interface_handle_link(struct interface *iface, const char *name, bool add, 
bool link_ext)
 {
struct device *dev;
int ret;
 
device_lock();
 
-   dev = device_get(name, add ? 2 : 0);
+   dev = device_get(name, add ? (link_ext ? 2 : 1) : 0);
if (!dev) {
ret = UBUS_STATUS_NOT_FOUND;
goto out;
@@ -879,7 +881,7 @@ interface_handle_link(struct interface *iface, const char 
*name, bool add)
device_set_config(dev, &simple_device_type, 
iface->config);
 
system_if_apply_settings(dev, &dev->settings, 
dev->settings.flags);
-   ret = interface_add_link(iface, dev);
+   ret = interface_add_link(iface, dev, link_ext);
} else {
ret = interface_remove_link(iface, dev);
}
diff --git a/interface.h b/interface.h
index 1cd7e96..90087fc 100644
--- a/interface.h
+++ b/interface.h
@@ -177,9 +177,8 @@ void interface_set_l3_dev(struct interface *iface, struct 
device *dev);
 void interface_add_user(struct interface_user *dep, struct interface *iface);
 void interface_remove_user(struct interface_user *dep);
 
-int interface_add_link(struct interface *iface, struct device *dev);
 int interface_remove_link(struct interface *iface, struct device *dev);
-int interface_handle_link(struct interface *iface, const char *name, bool add);
+int interface_handle_link(struct interface *iface, const char *name, bool add, 
bool link_ext);
 
 void interface_add_error(struct interface *iface, const char *subsystem,
 const char *code, const char **data, int n_data);
diff --git a/ubus.c b/ubus.c
index 2522cfa..161fbe7 100644
--- a/ubus.c
+++ b/ubus.c
@@ -812,23 +812,40 @@ netifd_handle_dump(struct ubus_context *ctx, struct 
ubus_object *obj,
return 0;
 }
 
+enum {
+   DEV_LINK_NAME,
+   DEV_LINK_EXT,
+   __DEV_LINK_MAX,
+};
+
+static const struct blobmsg_policy dev_link_policy[__DEV_LINK_MAX] = {
+   [DEV_LINK_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING },
+   [DEV_LINK_EXT] = { .name = "link-ext", .type = BLOBMSG_TYPE_BOOL },
+};
+
 static int
 netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
   struct ubus_request_data *req, const char *method,
   struct blob_attr *msg)
 {
-   struct blob_attr *tb[__DEV_MAX];
+   struct blob_attr *tb[__DEV_LINK_MAX];
+   struct blob_attr *cur;
struct interface *iface;
bool add = !strncmp(method, "add", 3);
+   bool link_ext = true;
 
iface = container_of(obj, struct interface, ubus);
 
-   blobmsg_parse(dev_policy, __DEV_MAX, tb, blob_data(msg), blob_len(msg));
+   blobmsg_parse(dev_link_policy, __DEV_LINK_MAX, tb, blob_data(msg), 
blob_len(msg));
 
-   if (!tb[DEV_NAME])
+   if (!tb[DEV_LINK_NAME])
return UBUS_STATUS_INVALID_ARGUMENT;
 
-   return interface_handle_link(iface, blobmsg_data(tb[DEV_NAME]), add);
+   cur = tb[DEV_LINK_EXT];
+   if (cur)
+   link_ext = !!blobmsg_get_u8(cur);
+
+   return interface_handle_link(iface, blobmsg_data(tb[DEV_LINK_NAME]), 
add, link_ext);
 }
 
 
@@ -919,8 +936,8 @@ static struct ubus_method iface_object_methods[] = {
{ .name = "status", .handler = netifd_handle_status },
{ .name = "prepare", .handler = netifd_handle_iface_prepare },
{ .name = "dump", .handler = netifd_handle_dump },
-   UBUS_METHOD("add_device", netifd_iface_handle_device, dev_policy ),
-   UBUS_METHOD("remove_device", netifd_iface_handle_device, dev_policy ),
+   UBUS_METHOD("add_device", netifd_iface_handle_device, dev_link_policy ),
+   UBUS_METHOD("remove_device", netifd_iface_handle_device, 
dev_link_policy ),
{ .name = "notify_proto", .handler = neti

[OpenWrt-Devel] [PATCH 1/3] netifd: Set device down based on being a non external device in device_release

2014-07-30 Thread Hans Dedecker
Line up the device state manipulation by checking the external device parameter 
consistent and not the hotplug device parameter

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

diff --git a/device.c b/device.c
index b16f156..26b020f 100644
--- a/device.c
+++ b/device.c
@@ -254,7 +254,7 @@ void device_release(struct device_user *dep)
return;
 
device_broadcast_event(dev, DEV_EVENT_TEARDOWN);
-   if (!dep->hotplug)
+   if (!dev->external)
dev->set_state(dev, false);
device_broadcast_event(dev, DEV_EVENT_DOWN);
 }
-- 
1.7.9.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] gre: Generic Routing Encapsulation package support

2014-07-30 Thread Hans Dedecker
The package supports Generic Routing Encapsulation support by registering 
following protocol kinds:
-gre
-gretap
-grev6
-grev6tap

Following options are valid for gre and gretap kinds:
-ipaddr
-peeraddr
-df
-mtu
-ttl
-tunlink
-zone
-ikey
-okey
-icsum
-ocsum
-iseqno
-oseqno

The gretap kind supports additionally the network option

Following options are valid for grev6 and grev6tap kinds:
-ip6addr
-peer6addr
-weakif
-mtu
-ttl
-tunlink
-zone
-ikey
-okey
-icsum
-ocsum
-iseqno
-oseqno

The grev6tap kind supports additionally the network option

Typical network config for a GREv4 tunnel :

config interface 'gre'
option peeraddr '172.16.18.240'
option mtu '1400'
option proto 'gre'
option tunlink 'wan'
option zone 'tunnel'

Typical network config for a GREv4 tap tunnel :

config interface 'gretap'
option peeraddr '195.207.5.79'
option mtu '1400'
option proto 'gretap'
option zone 'tunnel'
option tunlink 'wan'
option network 'wlan_ap'

I added myself as maintainer for the moment; feel free to change.

Signed-off-by: Hans Dedecker 
---
 package/network/config/gre/Makefile |   64 +
 package/network/config/gre/files/gre.sh |  235 +++
 2 files changed, 299 insertions(+)
 create mode 100644 package/network/config/gre/Makefile
 create mode 100755 package/network/config/gre/files/gre.sh

diff --git a/package/network/config/gre/Makefile 
b/package/network/config/gre/Makefile
new file mode 100644
index 000..efca464
--- /dev/null
+++ b/package/network/config/gre/Makefile
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gre
+PKG_VERSION:=1
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gre/Default
+  SECTION:=net
+  CATEGORY:=Network
+  MAINTAINER:=Hans Dedecker 
+endef
+
+define Package/gre
+$(call Package/gre/Default)
+  TITLE:=Generic Routing Encapsulation config support
+endef
+
+define Package/gre/description
+ Generic Routing Encapsulation config support (IPv4 and IPv6) in 
/etc/config/network.
+endef
+
+define Package/grev4
+$(call Package/gre/Default)
+  TITLE:=Generic Routing Encapsulation (IPv4) config support
+  DEPENDS:=@(PACKAGE_gre) +kmod-gre
+endef
+
+define Package/grev4/description
+ Generic Routing Encapsulation config support (IPv4) in /etc/config/network.
+endef
+
+define Package/grev6
+$(call Package/gre/Default)
+  TITLE:=Generic Routing Encapsulation (IPv6) config support
+  DEPENDS:=@(PACKAGE_gre) +kmod-ipv6 +kmod-ip6-gre
+endef
+
+define Package/grev6/description
+ Generic Routing Encapsulation config support (IPv6) in /etc/config/network.
+endef
+
+define Build/Compile
+endef
+
+define Build/Configure
+endef
+
+define Package/gre/install
+   $(INSTALL_DIR) $(1)/lib/netifd/proto
+   $(INSTALL_BIN) ./files/gre.sh $(1)/lib/netifd/proto/gre.sh
+endef
+
+$(eval $(call BuildPackage,gre))
+$(eval $(call BuildPackage,grev4))
+$(eval $(call BuildPackage,grev6))
diff --git a/package/network/config/gre/files/gre.sh 
b/package/network/config/gre/files/gre.sh
new file mode 100755
index 000..38c0fc4
--- /dev/null
+++ b/package/network/config/gre/files/gre.sh
@@ -0,0 +1,235 @@
+#!/bin/sh
+
+[ -n "$INCLUDE_ONLY" ] || {
+   . /lib/functions.sh
+   . /lib/functions/network.sh
+   . ../netifd-proto.sh
+   init_proto "$@"
+}
+
+gre_generic_setup() {
+   local cfg="$1"
+   local mode="$2"
+   local local="$3"
+   local remote="$4"
+   local link="$5"
+   local mtu ttl zone ikey okey icsum ocsum iseqno oseqno
+   json_get_vars mtu ttl zone ikey okey icsum ocsum iseqno oseqno
+
+   [ -z "$zone" ] && zone="wan"
+
+   proto_init_update "$link" 1
+
+   proto_add_tunnel
+   json_add_string mode "$mode"
+   json_add_int mtu "${mtu:-1280}"
+   [ -n "$df" ] && json_add_boolean df "$df"
+   json_add_int ttl "${ttl:-64}"
+   json_add_string local "$local"
+   json_add_string remote "$remote"
+   [ -n "$tunlink" ] && json_add_string link "$tunlink"
+   json_add_string info 
"${ikey:-0},${okey:-0},${icsum:-0},${ocsum:-0},${iseqno:-0},${oseqno:-0}"
+   proto_close_tunnel
+
+   proto_add_data
+   [ -n "$zone" ] && json_add_string zone "$zone"
+   proto_close_data
+
+   proto_send_update "$cfg"
+}
+
+gre_setup() {
+   local cfg="$1"
+   local mode="$2"
+
+   local ipaddr peeraddr
+   json_get_vars df ipaddr peeraddr tunlink
+
+   [ -z "$peeraddr" ] && {
+   proto_notify_error "$cfg" "MISSING_ADDRESS"
+   proto_block_restart "$cfg"
+   exit
+   }
+
+   ( proto_add_host_dependency "$cfg" "0.0.0.0" "$tunlink" )
+
+

[OpenWrt-Devel] [PATCH] odhcp6c: Fix white space typo in dhcpv6.script

2014-07-30 Thread Hans Dedecker

Signed-off-by: Hans Dedecker 
---
 package/network/ipv6/odhcp6c/files/dhcpv6.script |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script 
b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index 68946a3..5ab9a1e 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -113,7 +113,7 @@ setup_interface () {
[ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate 
"$IFACE_MAP_DELEGATE"
json_close_object
ubus call network add_dynamic "$(json_dump)"
-   elif [ -n "$AFTR_IP " -a "$IFACE_DSLITE" != 0 -a -f 
/lib/netifd/proto/dslite.sh ]; then
+   elif [ -n "$AFTR_IP" -a "$IFACE_DSLITE" != 0 -a -f 
/lib/netifd/proto/dslite.sh ]; then
[ -z "$IFACE_DSLITE" -o "$IFACE_DSLITE" = 1 ] && 
IFACE_DSLITE=${INTERFACE}_dslite
json_init
json_add_string name "$IFACE_DSLITE"
-- 
1.7.9.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] netifd: suppress fw3 warnings in dhcp script

2014-07-30 Thread Hans Dedecker

Signed-off-by: Hans Dedecker 
---
 .../config/netifd/files/lib/netifd/dhcp.script |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script 
b/package/network/config/netifd/files/lib/netifd/dhcp.script
index db3fc01..593fb93 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -50,7 +50,7 @@ setup_interface () {
ip6rd="${ip6rd#* }"
local ip6rdbr="${ip6rd%% *}"
 
-   [ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE)
+   [ -n "$ZONE" ] || ZONE=$(fw3 -q network $INTERFACE)
[ -z "$IFACE6RD" -o "$IFACE6RD" = 1 ] && 
IFACE6RD=${INTERFACE}_6rd
 
json_init
-- 
1.7.9.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] AllWinner/sunxi platform support status

2014-07-30 Thread Yaroslav Syrytsia
Hi,

Have you looked to https://github.com/nekromant/openwrt-sunxi ?

30.07.2014, 13:28, "Derek & Vicky" :
> Anyone?
> On 07/26/2014 11:25 AM, Derek Werthmuller wrote:
>>  I'm looking at using one of the sunxi targets over the rpi for more
>>  ram and cpu power.
>>  The primary candidate is the Bannana Pi and the cubiboards.  Using the
>>  A20 processor.  For my application I need the Ethernet and USB
>>  features to be stable.
>>
>>  ANyone use either of these platforms and can make a recommendation?
>>  Openwrt works well on?... quality of the hardware?..  Both cores
>>  recognized.?  Potential longevity of the product/community behind them.
>>
>>  I see both of these system in trunk
>>  http://downloads.openwrt.org/snapshots/trunk/sunxi/
>>  So I assume that they both build, and boot to some level of functionality.
>>
>>  Thanks
>> Derek
>
> ___
> 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] AllWinner/sunxi platform support status

2014-07-30 Thread Derek & Vicky

Anyone?
On 07/26/2014 11:25 AM, Derek Werthmuller wrote:
I'm looking at using one of the sunxi targets over the rpi for more 
ram and cpu power.
The primary candidate is the Bannana Pi and the cubiboards.  Using the 
A20 processor.  For my application I need the Ethernet and USB 
features to be stable.


ANyone use either of these platforms and can make a recommendation?  
Openwrt works well on?... quality of the hardware?..  Both cores 
recognized.?  Potential longevity of the product/community behind them.


I see both of these system in trunk 
http://downloads.openwrt.org/snapshots/trunk/sunxi/

So I assume that they both build, and boot to some level of functionality.

Thanks
   Derek


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


Re: [OpenWrt-Devel] Polipo not pre-compiled in Barrier Breaker rc2?

2014-07-30 Thread Gabriel Kerneis
David,

On Wed, Jul 30, 2014 at 10:56:41AM +0100, Gabriel Kerneis wrote:
> [Cc: openwrt-devel]
> 
> On Tue, Jul 29, 2014 at 07:32:47PM +0100, David Bonnes wrote:
> > On 29 July 2014 17:22, Juliusz Chroboczek 
> > wrote:
> > > > I was unable to test [polipo] on BB rc1 because it is not in the
> > > > list of pre-compiled packages!
> > >
> > > Yes it is.  Did you forget to run opkg update?
> >
> > Hmmm, I get a good result with the latest snapshot (r41846), but both RC1 or
> > RC2 (RC2 was released today)!!
> 
> Polipo has been migrated to the new (github-based, community-maintained)
> package feed:
> https://github.com/openwrt/packages
> 
> But that feed should be enabled by default in BB. Could an openwrt
> maintainer shed some light on why polipo does not seem to appear in the
> pre-compiled packages for BB rc2?

It looks like you have been a bit to eager to try the RC2 build and
report this issue :-)

  "Please bear with us for a while longer, RC2 is not yet announced
  because the feeds are still building. We will do an announcement on the
  mailing list and in the news forum / openwrt.org frontpage when its done
  which should be today hopefully."
  https://forum.openwrt.org/viewtopic.php?pid=242127#p242127

So hopefully everything should be okay in a little while.

Sorry for the noise,
-- 
Gabriel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Polipo not pre-compiled in Barrier Breaker rc2?

2014-07-30 Thread Gabriel Kerneis
[Cc: openwrt-devel]

On Tue, Jul 29, 2014 at 07:32:47PM +0100, David Bonnes wrote:
> On 29 July 2014 17:22, Juliusz Chroboczek 
> wrote:
> > > I was unable to test [polipo] on BB rc1 because it is not in the
> > > list of pre-compiled packages!
> >
> > Yes it is.  Did you forget to run opkg update?
>
> Hmmm, I get a good result with the latest snapshot (r41846), but both RC1 or
> RC2 (RC2 was released today)!!

Polipo has been migrated to the new (github-based, community-maintained)
package feed:
https://github.com/openwrt/packages

But that feed should be enabled by default in BB. Could an openwrt
maintainer shed some light on why polipo does not seem to appear in the
pre-compiled packages for BB rc2?

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