Re: [OpenWrt-Devel] 090-backport_netfilter_rtcache.patch and IPsec routing/connection errors/packet loss

2014-12-22 Thread Stijn Tintel
On 20-12-14 00:04, Andre Valentin wrote:
 Hi!

 If I enable this patch/module, I get strange errors with my OpenWRT based 
 IPsec router. Packets are accepted and then lost, and not encrypted. Only the 
 first comes through, especially if stateless
 protocolls (udp, icmp) are used.

I noticed this as well, both with 3.14 kernel + backported patch, and
with 3.18 kernel + patch. Reporting it to netfilter-devel and netdev
lists is still on my todo list. Feel free to beat me to it

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


[OpenWrt-Devel] [PATCH] kernel/generic: fix warnings if libata-ledtrig is disabled

2014-12-22 Thread Daniel Golle
accidentally #if was used instead of #ifdef, thus gcc warned
about CONFIG_ATA_LEDS being undefined...

Signed-off-by: Daniel Golle dan...@makrotopia.org
---
 target/linux/generic/patches-3.14/834-ledtrig-libata.patch | 10 +-
 target/linux/generic/patches-3.18/834-ledtrig-libata.patch | 10 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/target/linux/generic/patches-3.14/834-ledtrig-libata.patch 
b/target/linux/generic/patches-3.14/834-ledtrig-libata.patch
index b015d7a..ec61ed9 100644
--- a/target/linux/generic/patches-3.14/834-ledtrig-libata.patch
+++ b/target/linux/generic/patches-3.14/834-ledtrig-libata.patch
@@ -57,7 +57,7 @@ index 5c84fb5..eb49e02 100644
return block;
  }
  
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +#define LIBATA_BLINK_DELAY 20 /* ms */
 +static inline void ata_led_act(struct ata_port *ap)
 +{
@@ -77,7 +77,7 @@ index 5c84fb5..eb49e02 100644
break;
}
}
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  ata_led_act(ap);
 +#endif
  
@@ -87,7 +87,7 @@ index 5c84fb5..eb49e02 100644
ap-stats.unhandled_irq = 1;
ap-stats.idle_irq = 1;
  #endif
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  ap-ledtrig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
 +#endif
ata_sff_port_init(ap);
@@ -97,7 +97,7 @@ index 5c84fb5..eb49e02 100644
  
kfree(ap-pmp_link);
kfree(ap-slave_link);
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  if (ap-ledtrig) {
 +  led_trigger_unregister(ap-ledtrig);
 +  kfree(ap-ledtrig);
@@ -110,7 +110,7 @@ index 5c84fb5..eb49e02 100644
host-ports[i]-print_id = atomic_inc_return(ata_print_id);
host-ports[i]-local_port_no = i + 1;
}
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  for (i = 0; i  host-n_ports; i++) {
 +  if (unlikely(!host-ports[i]-ledtrig))
 +  continue;
diff --git a/target/linux/generic/patches-3.18/834-ledtrig-libata.patch 
b/target/linux/generic/patches-3.18/834-ledtrig-libata.patch
index b015d7a..ec61ed9 100644
--- a/target/linux/generic/patches-3.18/834-ledtrig-libata.patch
+++ b/target/linux/generic/patches-3.18/834-ledtrig-libata.patch
@@ -57,7 +57,7 @@ index 5c84fb5..eb49e02 100644
return block;
  }
  
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +#define LIBATA_BLINK_DELAY 20 /* ms */
 +static inline void ata_led_act(struct ata_port *ap)
 +{
@@ -77,7 +77,7 @@ index 5c84fb5..eb49e02 100644
break;
}
}
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  ata_led_act(ap);
 +#endif
  
@@ -87,7 +87,7 @@ index 5c84fb5..eb49e02 100644
ap-stats.unhandled_irq = 1;
ap-stats.idle_irq = 1;
  #endif
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  ap-ledtrig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
 +#endif
ata_sff_port_init(ap);
@@ -97,7 +97,7 @@ index 5c84fb5..eb49e02 100644
  
kfree(ap-pmp_link);
kfree(ap-slave_link);
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  if (ap-ledtrig) {
 +  led_trigger_unregister(ap-ledtrig);
 +  kfree(ap-ledtrig);
@@ -110,7 +110,7 @@ index 5c84fb5..eb49e02 100644
host-ports[i]-print_id = atomic_inc_return(ata_print_id);
host-ports[i]-local_port_no = i + 1;
}
-+#if CONFIG_ATA_LEDS
++#ifdef CONFIG_ATA_LEDS
 +  for (i = 0; i  host-n_ports; i++) {
 +  if (unlikely(!host-ports[i]-ledtrig))
 +  continue;
-- 
2.2.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: bump to 3.18.1

2014-12-22 Thread Daniel Golle
Signed-off-by: Daniel Golle dan...@makrotopia.org
---
 include/kernel-version.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 931d540..2443e64 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -7,14 +7,14 @@ LINUX_VERSION-3.8  = .13
 LINUX_VERSION-3.10 = .58
 LINUX_VERSION-3.13 = .7
 LINUX_VERSION-3.14 = .26
-LINUX_VERSION-3.18 =
+LINUX_VERSION-3.18 = .1
 
 LINUX_KERNEL_MD5SUM-3.3.8   = f1058f64eed085deb44f10cee8541d50
 LINUX_KERNEL_MD5SUM-3.8.13  = 2af19d06cd47ec459519159cdd10542d
 LINUX_KERNEL_MD5SUM-3.10.58 = 3ff3478b6351143cef22d4b81cf48b01
 LINUX_KERNEL_MD5SUM-3.13.7  = 370adced5e5c1cb1d0d621c2dae2723f
 LINUX_KERNEL_MD5SUM-3.14.26 = 9a91a9c507c9efb68c7075e151c30fa7
-LINUX_KERNEL_MD5SUM-3.18= 9e854df51ca3fef8bfe566dbd7b89241
+LINUX_KERNEL_MD5SUM-3.18.1  = 79c9b73a01e1dce0a4c28828496ef02c
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
-- 
2.2.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mvsw6171: note support for 88E6172 switches

2014-12-22 Thread Nikita Nazarenko

Hello Claudio.

6172 not so similar to 6171 as it may seem. 6172 more similar to 
6352/6240/6176 - they described in one functional specification datasheet.


For example - any record in VTU _require_ correct STU record. 6171 
driver doesn't care about stu. Without it 802.1q vlans doesn't work.


I can send my 6172/6176 driver for 3.10 kernel, but for now it require 
little work for prepare to merge it.


Best regards
Nazarenko Nikita

On 19.12.2014 22:21, Claudio Leite wrote:

The '6171 and '6172 are similar enough to work
without any changes to the code.

Signed-off-by: Claudio Leite lei...@staticky.com
---
  target/linux/generic/files/drivers/net/phy/mvsw6171.h| 2 +-
  target/linux/generic/patches-3.14/733-phy_mvsw6171.patch | 2 +-
  target/linux/generic/patches-3.18/733-phy_mvsw6171.patch | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/mvsw6171.h 
b/target/linux/generic/files/drivers/net/phy/mvsw6171.h
index 2b9ef97..38442c1 100644
--- a/target/linux/generic/files/drivers/net/phy/mvsw6171.h
+++ b/target/linux/generic/files/drivers/net/phy/mvsw6171.h
@@ -192,7 +192,7 @@ enum {
  
  #define MV_IDENT_MASK			0xffc0

  #define MV_IDENT_VALUE0x1700
-#define MV_IDENT_STR   MV88E6171
+#define MV_IDENT_STR   MV88E617x
  
  #define MV_PVID_MASK			0x0fff
  
diff --git a/target/linux/generic/patches-3.14/733-phy_mvsw6171.patch b/target/linux/generic/patches-3.14/733-phy_mvsw6171.patch

index 991828d..b6fbb1c 100644
--- a/target/linux/generic/patches-3.14/733-phy_mvsw6171.patch
+++ b/target/linux/generic/patches-3.14/733-phy_mvsw6171.patch
@@ -5,7 +5,7 @@
select ETHERNET_PACKET_MANGLE
   
  +config MVSW6171_PHY

-+  tristate Driver for Marvell 88E6171 switches
++  tristate Driver for Marvell 88E6171/6172 switches
  + select SWCONFIG
  +
   config IP17XX_PHY
diff --git a/target/linux/generic/patches-3.18/733-phy_mvsw6171.patch 
b/target/linux/generic/patches-3.18/733-phy_mvsw6171.patch
index 2911647..0df13fe 100644
--- a/target/linux/generic/patches-3.18/733-phy_mvsw6171.patch
+++ b/target/linux/generic/patches-3.18/733-phy_mvsw6171.patch
@@ -5,7 +5,7 @@
select ETHERNET_PACKET_MANGLE
   
  +config MVSW6171_PHY

-+  tristate Driver for Marvell 88E6171 switches
++  tristate Driver for Marvell 88E6171/6172 switches
  + select SWCONFIG
  +
   config IP17XX_PHY

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


[OpenWrt-Devel] [PATCH 1/2] scripts: fix recursive dependencies that might be caused by using conditional dependencies.

2014-12-22 Thread Yousong Zhou
`kmod-ipt-ipset' has a `DEPENDS' value of 
`@(!(TARGET_ps3||TARGET_pxcab)||BROKEN)'.
Recursive dependency will occur if another package conditionally depends
on it with something like `+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset'
which will produce the following kconfig content.

config PACKAGE_dnsmasq-full
...
depends on !(PACKAGE_dnsmasq_full_ipset) || 
(!(TARGET_ps3||TARGET_pxcab)||BROKEN)

if PACKAGE_dnsmasq-full
...
config PACKAGE_dnsmasq_full_ipset
bool Build with ipset support.
default y
...
endif

And mconf will complain with

tmp/.config-package.in:127:error: recursive dependency detected!
tmp/.config-package.in:127: symbol PACKAGE_dnsmasq-full depends on 
PACKAGE_dnsmasq_full_ipset
tmp/.config-package.in:157: symbol PACKAGE_dnsmasq_full_ipset 
depends on PACKAGE_dnsmasq-full

Signed-off-by: Yousong Zhou yszhou4t...@gmail.com
---
 scripts/metadata.pl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index f3d04db..a2465d1 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -500,7 +500,7 @@ sub mconf_depends {
};
$flags =~ /@/ or $depend = PACKAGE_$depend;
if ($condition) {
-   if ($m =~ /select/) {
+   if ($m =~ /select/ or $condition = $depend) {
next if $depend eq $condition;
$depend = $depend if $condition;
} else {
-- 
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 2/2] dnsmasq: fix dependency problems of the dnsmasq-full variant.

2014-12-22 Thread Yousong Zhou
This patch tries to

 - Let the DHCPv6 feature depend on CONFIG_IPV6.
 - Conditionally select libnettle, kmod-ipv6, kmod-ipt-ipset only if the
   corresponding features are enabled.
 - Install `trust-anchors.conf` only if DNSSEC is selected.

Big thanks goes to Frank Schäfer fschaefer@googlemail.com for
providing necessary information on connections and dependency relations
between these CONFIGs and packages.

Signed-off-by: Yousong Zhou yszhou4t...@gmail.com
---
 package/network/services/dnsmasq/Makefile |   37 -
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile 
b/package/network/services/dnsmasq/Makefile
index 2da593d..7603228 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -47,7 +47,7 @@ endef
 define Package/dnsmasq-full
 $(call Package/dnsmasq/Default)
   TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPSET)
-  DEPENDS:=@IPV6 +kmod-ipv6 +libnettle
+  DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle 
+PACKAGE_dnsmasq_full_dhcpv6:kmod-ipv6 
+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset
   VARIANT:=full
 endef
 
@@ -64,7 +64,8 @@ endef
 define Package/dnsmasq-full/description
 $(call Package/dnsmasq/description)
 
-This is a variant with DHCPv6, DNSSEC, Authroitative DNS and IPSET support
+This is a fully configurable variant with DHCPv6, DNSSEC, Authroitative DNS and
+IPSET support on by default.
 endef
 
 define Package/dnsmasq/conffiles
@@ -73,21 +74,21 @@ define Package/dnsmasq/conffiles
 endef
 
 define Package/dnsmasq/config/Default
-  if PACKAGE_$(1)-$(2)
-  config PACKAGE_dnsmasq_$(2)_dhcpv6
-bool Build with DHCPv6 support.
-default y
-  config PACKAGE_dnsmasq_$(2)_dnssec
-bool Build with DNSSEC support.
-default y
-  config PACKAGE_dnsmasq_$(2)_auth
-bool Build with the facility to act as an authoritative DNS server.
-default y
-  config PACKAGE_dnsmasq_$(2)_ipset
-bool Build with ipset support.
-select PACKAGE_kmod-ipt-ipset
-default y
-  endif
+   if PACKAGE_$(1)-$(2)
+   config PACKAGE_dnsmasq_$(2)_dhcpv6
+   bool Build with DHCPv6 support.
+   depends on IPV6
+   default y
+   config PACKAGE_dnsmasq_$(2)_dnssec
+   bool Build with DNSSEC support.
+   default y
+   config PACKAGE_dnsmasq_$(2)_auth
+   bool Build with the facility to act as an authoritative DNS 
server.
+   default y
+   config PACKAGE_dnsmasq_$(2)_ipset
+   bool Build with ipset support.
+   default y
+   endif
 endef
 
 Package/dnsmasq-full/config=$(call Package/dnsmasq/config/Default,dnsmasq,full)
@@ -137,8 +138,10 @@ Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
 
 define Package/dnsmasq-full/install
 $(call Package/dnsmasq/install,$(1))
+ifneq ($(CONFIG_PACKAGE_dnsmasq_full_dnssec),)
$(INSTALL_DIR) $(1)/usr/share/dnsmasq
$(INSTALL_DATA) $(PKG_BUILD_DIR)/trust-anchors.conf 
$(1)/usr/share/dnsmasq
+endif
 endef
 
 $(eval $(call BuildPackage,dnsmasq))
-- 
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 fstools] libblkid-tiny: add btrfs probe info

2014-12-22 Thread Daniel Golle
This only adds the magic for btrfs to show btrfs volumes in
block detect.

In order to properly support btrfs with more than one device and avoid
trying to mount the same device group once for each instance we have to
make sure that only one device per group will be mounted (btrfs then
automatically detects all other devices of the group).
For unmounting, the opposite should be applied: umount if called for
any of the devices in a mounted device group, unmount the filesystem.

Signed-off-by: Daniel Golle dan...@makrotopia.org
---
 libblkid-tiny/btrfs.c | 92 +++
 libblkid-tiny/libblkid-tiny.c |  1 +
 2 files changed, 93 insertions(+)
 create mode 100644 libblkid-tiny/btrfs.c

diff --git a/libblkid-tiny/btrfs.c b/libblkid-tiny/btrfs.c
new file mode 100644
index 000..a95bd21
--- /dev/null
+++ b/libblkid-tiny/btrfs.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2009 Karel Zak k...@redhat.com
+ *
+ * This file may be redistributed under the terms of the
+ * GNU Lesser General Public License.
+ */
+#include stdio.h
+#include stdlib.h
+#include unistd.h
+#include string.h
+#include stdint.h
+
+#include superblocks.h
+
+struct btrfs_super_block {
+   uint8_t csum[32];
+   uint8_t fsid[16];
+   uint64_t bytenr;
+   uint64_t flags;
+   uint8_t magic[8];
+   uint64_t generation;
+   uint64_t root;
+   uint64_t chunk_root;
+   uint64_t log_root;
+   uint64_t log_root_transid;
+   uint64_t total_bytes;
+   uint64_t bytes_used;
+   uint64_t root_dir_objectid;
+   uint64_t num_devices;
+   uint32_t sectorsize;
+   uint32_t nodesize;
+   uint32_t leafsize;
+   uint32_t stripesize;
+   uint32_t sys_chunk_array_size;
+   uint64_t chunk_root_generation;
+   uint64_t compat_flags;
+   uint64_t compat_ro_flags;
+   uint64_t incompat_flags;
+   uint16_t csum_type;
+   uint8_t root_level;
+   uint8_t chunk_root_level;
+   uint8_t log_root_level;
+   struct btrfs_dev_item {
+   uint64_t devid;
+   uint64_t total_bytes;
+   uint64_t bytes_used;
+   uint32_t io_align;
+   uint32_t io_width;
+   uint32_t sector_size;
+   uint64_t type;
+   uint64_t generation;
+   uint64_t start_offset;
+   uint32_t dev_group;
+   uint8_t seek_speed;
+   uint8_t bandwidth;
+   uint8_t uuid[16];
+   uint8_t fsid[16];
+   } __attribute__ ((__packed__)) dev_item;
+   uint8_t label[256];
+} __attribute__ ((__packed__));
+
+static int probe_btrfs(blkid_probe pr, const struct blkid_idmag *mag)
+{
+   struct btrfs_super_block *bfs;
+
+   bfs = blkid_probe_get_sb(pr, mag, struct btrfs_super_block);
+   if (!bfs)
+   return errno ? -errno : 1;
+
+   if (*bfs-label)
+   blkid_probe_set_label(pr,
+   (unsigned char *) bfs-label,
+   sizeof(bfs-label));
+
+   blkid_probe_set_uuid(pr, bfs-fsid);
+   blkid_probe_set_uuid_as(pr, bfs-dev_item.uuid, UUID_SUB);
+
+   return 0;
+}
+
+const struct blkid_idinfo btrfs_idinfo =
+{
+   .name   = btrfs,
+   .usage  = BLKID_USAGE_FILESYSTEM,
+   .probefunc  = probe_btrfs,
+   .minsz  = 1024 * 1024,
+   .magics =
+   {
+ { .magic = _BHRfS_M, .len = 8, .sboff = 0x40, .kboff = 64 },
+ { NULL }
+   }
+};
diff --git a/libblkid-tiny/libblkid-tiny.c b/libblkid-tiny/libblkid-tiny.c
index a01a43e..570cd73 100644
--- a/libblkid-tiny/libblkid-tiny.c
+++ b/libblkid-tiny/libblkid-tiny.c
@@ -167,6 +167,7 @@ static const struct blkid_idinfo *idinfos[] =
jffs2_idinfo,
hfsplus_idinfo,
hfs_idinfo,
+   btrfs_idinfo,
 };
 
 int probe_block(char *block, struct blkid_struct_probe *pr)
-- 
2.2.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] is there something preventing me from watching github openwrt/packages?

2014-12-22 Thread Robert P. J. Day

  just tried to watch github repo openwrt/packages, the Watch
selector went to a greyed-out Unwatch for several seconds, then i
got the error Something went wrong with that request. Please try
again.

  do i need any special properties on my github account to watch that
(or any other openwrt) repo? apologies if this is a silly question.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday

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


[OpenWrt-Devel] [BB] Backport: Fix LED definitions for the DRAGINO2 board

2014-12-22 Thread Vittorio Gambaletta
Backport r42897 to Barrier Breaker.

This patch fixes LED definitions for the DRAGINO2 board.

1. It renames the Router/USB led to System, as it is now marked SYS on the 
board.
2. It gives control of the LAN and WAN leds and some other GPIOs to Linux.
3. It fixes the active_low property for the LAN and WAN leds.
4. It sets up WLAN, LAN and WAN leds in the UCI defaults.
5. It allows usage of the System led by the diag.sh script, so it will be used 
to indicate boot and failsafe status.

Signed-off-by: Vittorio Gambaletta open...@vittgam.net


--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -62,6 +62,9 @@ get_status_led() {
dir-835-a1)
status_led=d-link:amber:power
;;
+   dragino2)
+   status_led=dragino2:red:system
+   ;;
eap300v2)
status_led=engenius:blue:power
;;
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -65,6 +65,12 @@ db120)
ucidef_set_led_usbdev usb USB db120:green:usb 1-1
;;
 
+dragino2)
+   ucidef_set_led_wlan wlan WLAN dragino2:red:wlan phy0tpt
+   ucidef_set_led_netdev lan LAN dragino2:red:lan eth0
+   ucidef_set_led_netdev wan WAN dragino2:red:wan eth1
+   ;;
+
 eap300v2)
ucidef_set_led_netdev lan LAN engenius:blue:lan eth0
ucidef_set_led_wlan wlan WLAN engenius:blue:wlan phy0tpt
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dragino2.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dragino2.c
@@ -3,6 +3,7 @@
  *
  *  Copyright (C) 2011-2012 Gabor Juhos juh...@openwrt.org
  *  Copyright (C) 2012 Elektra Wagenrad elek...@villagetelco.org
+ *  Copyright (C) 2014 Vittorio Gambaletta open...@vittgam.net
  *
  *  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
@@ -27,12 +28,12 @@
 #define DRAGINO2_GPIO_LED_WAN  17
 
 /*
- * The following GPIO is actually named Router on the board.
- * However, since the Router feature is not supported as of yet
- * we use it to display USB activity.
+ * The following GPIO is named SYS on newer revisions of the the board.
+ * It was previously used to indicate USB activity, even though it was
+ * named Router.
  */
 
-#define DRAGINO2_GPIO_LED_USB  28
+#define DRAGINO2_GPIO_LED_SYS  28
 #define DRAGINO2_GPIO_BTN_JUMPSTART11
 #define DRAGINO2_GPIO_BTN_RESET12
 
@@ -46,23 +47,23 @@
 
 static struct gpio_led dragino2_leds_gpio[] __initdata = {
{
-   .name   = dragino2:red:lan,
-   .gpio   = DRAGINO2_GPIO_LED_LAN,
-   .active_low = 0,
-   },
-   {
.name   = dragino2:red:wlan,
.gpio   = DRAGINO2_GPIO_LED_WLAN,
.active_low = 0,
},
-   {
+   {
.name   = dragino2:red:wan,
.gpio   = DRAGINO2_GPIO_LED_WAN,
-   .active_low = 0,
+   .active_low = 1,
},
{
-   .name   = dragino2:red:usb,
-   .gpio   = DRAGINO2_GPIO_LED_USB,
+   .name   = dragino2:red:lan,
+   .gpio   = DRAGINO2_GPIO_LED_LAN,
+   .active_low = 1,
+   },
+   {
+   .name   = dragino2:red:system,
+   .gpio   = DRAGINO2_GPIO_LED_SYS,
.active_low = 0,
},
 };
@@ -99,15 +100,23 @@ static void __init dragino2_common_setup(void)
 
ath79_register_mdio(0, 0x0);
 
-   /* Enable GPIO15 and GPIO16 and possibly GPIO26 and GPIO27 */
-   ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
-   AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN);
+   /* Enable GPIO13, GPIO14, GPIO15, GPIO16 and GPIO17 */
+   ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+   AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+   AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+   AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+   AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
 
-   /* LAN ports */
+   /* LAN port */
ath79_register_eth(1);
 
/* WAN port */
ath79_register_eth(0);
+
+   /* Enable GPIO26 and GPIO27 */
+   ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP,
+  ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP) |
+  AR933X_BOOTSTRAP_MDIO_GPIO_EN);
 }
 
 static void __init dragino2_setup(void)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org

[OpenWrt-Devel] [PATCH] [v3] hostapd: Add uapsd option to netifd.sh

2014-12-22 Thread Vittorio Gambaletta
The uapsd option sets the uapsd_advertisement_enabled flag in hostapd.

The check for phy support is already implemented here in hostapd since 2011:
http://w1.fi/cgit/hostap/commit/?id=70619a5d8a3d32faa43d66bcb1b670cacf0c243e

So this can be safely set to 1 as default.

Signed-off-by: Vittorio Gambaletta open...@vittgam.net

--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -100,7 +100,7 @@
 
 hostapd_common_add_bss_config() {
config_add_string 'bssid:macaddr' 'ssid:string'
-   config_add_boolean wds wmm hidden
+   config_add_boolean wds wmm uapsd hidden
 
config_add_int maxassoc max_inactivity
config_add_boolean disassoc_low_ack isolate short_preamble
@@ -163,7 +163,7 @@
maxassoc max_inactivity disassoc_low_ack isolate auth_cache \
wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 \
wps_device_type wps_device_name wps_manufacturer wps_pin \
-   macfilter ssid wmm hidden short_preamble rsn_preauth \
+   macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
iapp_interface
 
set_default isolate 0
@@ -173,6 +173,7 @@
set_default disassoc_low_ack 1
set_default hidden 0
set_default wmm 1
+   set_default uapsd 1
 
append bss_conf ctrl_interface=/var/run/hostapd
if [ $isolate -gt 0 ]; then
@@ -189,6 +190,7 @@
append bss_conf preamble=$short_preamble $N
append bss_conf wmm_enabled=$wmm $N
append bss_conf ignore_broadcast_ssid=$hidden $N
+   append bss_conf uapsd_advertisement_enabled=$uapsd $N
 
[ $wpa -gt 0 ]  {
[ -n $wpa_group_rekey  ]  append bss_conf 
wpa_group_rekey=$wpa_group_rekey $N
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] is there something preventing me from watching github openwrt/packages?

2014-12-22 Thread Steven Barth
You can watch any repository you like. If something goes wrong its 
probably either github's or your browser's (or its addons') fault.

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


[OpenWrt-Devel] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-22 Thread Tomer Eliyahu
Hi,

We are software developers, part of Marvell's cellular platform
infrastructure team.

Our team has been working on a project named fastpath for speeding
up IP forwarding in embedded systems.
The initial version (fastpath v1) has already been successfully
deployed in our latest pxa1801 (cellular modem) based products.

We are in the final stages of fastpath v2 development, which is
completely hardware independent and requires minimal changes in the
generic networking code (the project consists of a kernel module and a
single kernel patch); despite being hardware independent, fastpath v2
already achieved the same level of performance (as fastpath v1) and
even increased stability.

Our development platform is running openwrt Barrier Breaker (r43694),
so naturally we chose to suggest this to the openwrt development
community first.

You can find a brief description of our fastpath solution below.

We are anxious to hear your thoughts/comments and will gladly share the code.

Best Regards,

Ram Marzin r...@marvell.com
Tomer Eliyahu tom...@marvell.com


Fastpath in a nutshell
--

The basic concept of fastpath is to optimize the data-plane while
keeping the control-plane in the generic networking stack.
This is a known concept in the industry which is commonly used in
embedded systems [1], but so far we couldn't find any open source
implementation for it.

Fast path implements an optimized data-plane, which replaces the
generic data-plane forwarding code for selected connections. The
data-plane implementation includes a straight forward optimized packet
processing engine which handles all the required packet manipulation
for IP forwarding, such as decrement ttl/hop count, checksum
adjustment, MAC header encapsulation and dummy NAT (TCP/UDP traffic
which does not carry any L3/L4 information in the packet payload).

As noted above, the control-plane is handled by the generic networking
stack, with the only exception of learning new connections and marking
the valid ones as fastpath - some connections can't participate in
fastpath, such as any non-dummy NAT connections (e.g. FTP control
port), local traffic, and any protocol which is not supported (e.g.
IPv6 extensions, IPSec, IPv4 fragmanted packets, etc.).
Needless to say that ALL non-fastpath connections / protocols will
work as is, i.e. they simply won't go through fastpath.

As a rule of thumb, it is safe to assume that in most of the cases,
90% of the data will go through fastpath. In our experiments on
pxa1801, fastpath alone *almost doubled* the performance (both
Throughput and MIPS consumption) for TCP/UDP IPv4/IPv6 forwarding.

References
[1] 
http://www.embedded.com/design/operating-systems/4403058/Accelerating-network-packet-processing-in-Linux
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-22 Thread Felix Fietkau
On 2014-12-22 15:06, Tomer Eliyahu wrote:
 Hi,
 
 We are software developers, part of Marvell's cellular platform
 infrastructure team.
 
 Our team has been working on a project named fastpath for speeding
 up IP forwarding in embedded systems.
 The initial version (fastpath v1) has already been successfully
 deployed in our latest pxa1801 (cellular modem) based products.
 
 We are in the final stages of fastpath v2 development, which is
 completely hardware independent and requires minimal changes in the
 generic networking code (the project consists of a kernel module and a
 single kernel patch); despite being hardware independent, fastpath v2
 already achieved the same level of performance (as fastpath v1) and
 even increased stability.
Sounds good.

 Our development platform is running openwrt Barrier Breaker (r43694),
 so naturally we chose to suggest this to the openwrt development
 community first.
Have you considered proposing it for inclusing in Linux upstream as well?
By the way, we're not accepting features into the Barrier Breaker branch
that haven't already been implemented in trunk.
I would suggest doing development on trunk first, and backporting for
your own use later. While it may be a bit more effort initially, in the
long run this will make it a lot easier for you to keep up to date with
the changes that we're making in OpenWrt while you're developing
features for your products.

 You can find a brief description of our fastpath solution below.
 
 We are anxious to hear your thoughts/comments and will gladly share the code.
Please do. Having done some network stack performance work myself, I'm
looking forward to reviewing your implementation.

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


[OpenWrt-Devel] [PATCH] netifd: Add mldversion config support

2014-12-22 Thread Hans Dedecker
Config support to set the MLD host version on device level; possible values are 
:
1 : MLDv1
2 : MLDv2

Signed-off-by: Hans Dedecker dedec...@gmail.com
---
 device.c   | 11 +++
 device.h   |  3 +++
 system-dummy.c |  6 ++
 system-linux.c | 34 ++
 system.h   |  1 +
 5 files changed, 55 insertions(+)

diff --git a/device.c b/device.c
index 6cdfb49..2d2671f 100644
--- a/device.c
+++ b/device.c
@@ -42,6 +42,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] 
= {
[DEV_ATTR_RPFILTER] = { .name = rpfilter, .type = BLOBMSG_TYPE_STRING 
},
[DEV_ATTR_ACCEPTLOCAL] = { .name = acceptlocal, .type = 
BLOBMSG_TYPE_BOOL },
[DEV_ATTR_IGMPVERSION] = { .name = igmpversion, .type = 
BLOBMSG_TYPE_INT32 },
+   [DEV_ATTR_MLDVERSION] = { .name = mldversion, .type = 
BLOBMSG_TYPE_INT32 },
 };
 
 const struct uci_blob_param_list device_attr_list = {
@@ -160,6 +161,7 @@ device_merge_settings(struct device *dev, struct 
device_settings *n)
n-rpfilter = s-flags  DEV_OPT_RPFILTER ? s-rpfilter : os-rpfilter;
n-acceptlocal = s-flags  DEV_OPT_ACCEPTLOCAL ? s-acceptlocal : 
os-acceptlocal;
n-igmpversion = s-flags  DEV_OPT_IGMPVERSION ? s-igmpversion : 
os-igmpversion;
+   n-mldversion = s-flags  DEV_OPT_MLDVERSION ? s-mldversion : 
os-mldversion;
n-flags = s-flags | os-flags;
 }
 
@@ -222,6 +224,13 @@ device_init_settings(struct device *dev, struct blob_attr 
**tb)
DPRINTF(Failed to resolve igmpversion: %d\n, 
blobmsg_get_u32(cur));
}
 
+   if ((cur = tb[DEV_ATTR_MLDVERSION])) {
+   if (system_resolve_mldversion(blobmsg_get_u32(cur), 
s-mldversion))
+   s-flags |= DEV_OPT_MLDVERSION;
+   else
+   DPRINTF(Failed to resolve mldversion: %d\n, 
blobmsg_get_u32(cur));
+   }
+
device_set_disabled(dev, disabled);
 }
 
@@ -765,6 +774,8 @@ device_dump_status(struct blob_buf *b, struct device *dev)
blobmsg_add_u8(b, acceptlocal, st.acceptlocal);
if (st.flags  DEV_OPT_IGMPVERSION)
blobmsg_add_u32(b, igmpversion, st.igmpversion);
+   if (st.flags  DEV_OPT_MLDVERSION)
+   blobmsg_add_u32(b, mldversion, st.mldversion);
}
 
s = blobmsg_open_table(b, statistics);
diff --git a/device.h b/device.h
index a83cac8..0772f5f 100644
--- a/device.h
+++ b/device.h
@@ -36,6 +36,7 @@ enum {
DEV_ATTR_RPFILTER,
DEV_ATTR_ACCEPTLOCAL,
DEV_ATTR_IGMPVERSION,
+   DEV_ATTR_MLDVERSION,
__DEV_ATTR_MAX,
 };
 
@@ -72,6 +73,7 @@ enum {
DEV_OPT_RPFILTER= (1  5),
DEV_OPT_ACCEPTLOCAL = (1  6),
DEV_OPT_IGMPVERSION = (1  7),
+   DEV_OPT_MLDVERSION  = (1  8),
 };
 
 /* events broadcasted to all users of a device */
@@ -122,6 +124,7 @@ struct device_settings {
unsigned int rpfilter;
bool acceptlocal;
unsigned int igmpversion;
+   unsigned int mldversion;
 };
 
 /*
diff --git a/system-dummy.c b/system-dummy.c
index 9542d3c..20282f7 100644
--- a/system-dummy.c
+++ b/system-dummy.c
@@ -221,6 +221,12 @@ bool system_resolve_igmpversion(const unsigned int 
version, unsigned int *id)
return true;
 }
 
+bool system_resolve_mldversion(const unsigned int version, unsigned int *id)
+{
+   *id = 0;
+   return true;
+}
+
 int system_add_iprule(struct iprule *rule)
 {
return 0;
diff --git a/system-linux.c b/system-linux.c
index 7beae09..d6f7f07 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -280,6 +280,11 @@ static void system_set_igmpversion(struct device *dev, 
const char *val)
system_set_dev_sysctl(/proc/sys/net/ipv4/conf/%s/force_igmp_version, 
dev-ifname, val);
 }
 
+static void system_set_mldversion(struct device *dev, const char *val)
+{
+   system_set_dev_sysctl(/proc/sys/net/ipv6/conf/%s/force_mld_version, 
dev-ifname, val);
+}
+
 static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
 {
int fd = -1, ret = -1;
@@ -332,6 +337,12 @@ static int system_get_igmpversion(struct device *dev, char 
*buf, const size_t bu
dev-ifname, buf, buf_sz);
 }
 
+static int system_get_mldversion(struct device *dev, char *buf, const size_t 
buf_sz)
+{
+   return 
system_get_dev_sysctl(/proc/sys/net/ipv6/conf/%s/force_mld_version,
+   dev-ifname, buf, buf_sz);
+}
+
 // Evaluate netlink messages
 static int cb_rtnl_event(struct nl_msg *msg, void *arg)
 {
@@ -1001,6 +1012,11 @@ system_if_get_settings(struct device *dev, struct 
device_settings *s)
s-igmpversion = strtoul(buf, NULL, 0);
s-flags |= DEV_OPT_IGMPVERSION;
}
+
+   if (!system_get_mldversion(dev, buf, sizeof(buf))) {
+   s-mldversion = strtoul(buf, NULL, 0);
+   s-flags |= DEV_OPT_MLDVERSION;
+   

Re: [OpenWrt-Devel] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-22 Thread Rafał Miłecki
On 22 December 2014 at 15:06, Tomer Eliyahu tomereliya...@gmail.com wrote:
 We are anxious to hear your thoughts/comments and will gladly share the code.

So... can we get it?

I guess we've just gained open source implementation of the
hyper-secret Broadcom's CTF technology :P
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] scripts: fix recursive dependencies that might be caused by using conditional dependencies.

2014-12-22 Thread Felix Fietkau
On 2014-12-22 11:29, Yousong Zhou wrote:
 `kmod-ipt-ipset' has a `DEPENDS' value of 
 `@(!(TARGET_ps3||TARGET_pxcab)||BROKEN)'.
 Recursive dependency will occur if another package conditionally depends
 on it with something like `+PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset'
 which will produce the following kconfig content.
 
   config PACKAGE_dnsmasq-full
   ...
   depends on !(PACKAGE_dnsmasq_full_ipset) || 
 (!(TARGET_ps3||TARGET_pxcab)||BROKEN)
 
   if PACKAGE_dnsmasq-full
   ...
   config PACKAGE_dnsmasq_full_ipset
   bool Build with ipset support.
   default y
   ...
   endif
 
 And mconf will complain with
 
   tmp/.config-package.in:127:error: recursive dependency detected!
   tmp/.config-package.in:127: symbol PACKAGE_dnsmasq-full depends on 
 PACKAGE_dnsmasq_full_ipset
   tmp/.config-package.in:157: symbol PACKAGE_dnsmasq_full_ipset 
 depends on PACKAGE_dnsmasq-full
 
 Signed-off-by: Yousong Zhou yszhou4t...@gmail.com
 ---
  scripts/metadata.pl |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/scripts/metadata.pl b/scripts/metadata.pl
 index f3d04db..a2465d1 100755
 --- a/scripts/metadata.pl
 +++ b/scripts/metadata.pl
 @@ -500,7 +500,7 @@ sub mconf_depends {
   };
   $flags =~ /@/ or $depend = PACKAGE_$depend;
   if ($condition) {
 - if ($m =~ /select/) {
 + if ($m =~ /select/ or $condition = $depend) {
This doesn't look right to me. It seems to be overwriting $condition.
Did you mean eq instead of =?

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


Re: [OpenWrt-Devel] [PATCH 1/3] ustream: add function ustream_read().

2014-12-22 Thread Felix Fietkau
On 2014-12-16 22:15, Yousong Zhou wrote:
 It can be used to fill caller specified buffer area with data already in
 ustream read buffer.  Useful in the following use pattern.
 
   int available = ustream_pending_data(s, false);
   if (available = sizeof(struct msghdr)) {
   struct msghdr h;
   ustream_read(s, h, sizeof(h));
   }
 
 Signed-off-by: Yousong Zhou yszhou4t...@gmail.com
 ---
  ustream.c |   24 
  ustream.h |5 +
  2 files changed, 29 insertions(+)
 
 diff --git a/ustream.c b/ustream.c
 index 828a025..f1db809 100644
 --- a/ustream.c
 +++ b/ustream.c
 @@ -333,6 +333,30 @@ char *ustream_get_read_buf(struct ustream *s, int 
 *buflen)
   return data;
  }
  
 +int ustream_read(struct ustream *s, char *buf, int buflen)
 +{
 + int len = 0;
 + int chunk_len;
 + struct ustream_buf *sbuf;
 +
 + if (!s-r.head) {
 + return 0;
 + }
 +
 + sbuf = s-r.head;
 + do {
 + chunk_len = sbuf-tail - sbuf-data;
 + if (chunk_len  buflen)
 + chunk_len = buflen;
 + memcpy(buf[len], sbuf-data, chunk_len);
 + buflen -= chunk_len;
 + len += chunk_len;
 + sbuf = sbuf-next;
 + } while (buflen  sbuf);
 +
 + return len;
 +}
 +
I'd expect ustream_read() to consume the data it has read.
It should also probably just use ustream_get_read_buf() and
ustream_consume() instead of open-coding its functionality.

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


[OpenWrt-Devel] [PATCH] netifd: Handle link down event in interface setup state as well

2014-12-22 Thread Hans Dedecker
Signed-off-by: Hans Dedecker dedec...@gmail.com
---
 interface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/interface.c b/interface.c
index 4b5405e..83d7f94 100644
--- a/interface.c
+++ b/interface.c
@@ -271,6 +271,7 @@ interface_check_state(struct interface *iface)
 
switch (iface-state) {
case IFS_UP:
+   case IFS_SETUP:
if (!iface-enabled || !link_state) {
interface_proto_event(iface-proto, PROTO_CMD_TEARDOWN, 
false);
mark_interface_down(iface);
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/3] json_script: fix logic invert of handle_expr_not().

2014-12-22 Thread Felix Fietkau
On 2014-12-16 22:15, Yousong Zhou wrote:
 Signed-off-by: Yousong Zhou yszhou4t...@gmail.com
Applied this one and patch 3/3.

Thanks,

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


Re: [OpenWrt-Devel] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-22 Thread Tomer Eliyahu
 Have you considered proposing it for inclusing in Linux upstream as well?
Yes - we plan to propose it to netfilter-devel at a later stage, after
upgrading to Kernel 3.14 (our kernel is currently based on 3.10),
which is required for adding nftables support to fastpath's rules
handling.

 By the way, we're not accepting features into the Barrier Breaker branch
 that haven't already been implemented in trunk.
 I would suggest doing development on trunk first, and backporting for
 your own use later. While it may be a bit more effort initially, in the
 long run this will make it a lot easier for you to keep up to date with
 the changes that we're making in OpenWrt while you're developing
 features for your products.
This is indeed the preferred method, but unfortunately we are
currently bound to Barrier Breaker.
We will however prepare the package for the trunk, after uploading the
sources to GitHub.

 Please do. Having done some network stack performance work myself, I'm
 looking forward to reviewing your implementation.
Will do, stay posted.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mvsw6171: note support for 88E6172 switches

2014-12-22 Thread Nikita Nazarenko
This patch is a dirty modification of mv6171 driver and must be merged 
with it in future. mv6171 and 6172 are similar enough to be merged in 
one driver.


Significant differences:
* struct vlan_state in struct mv6172_state contains additional field 
port_state which contain STU port information. It can be useful for 6171 
driver;
* mvsv6172_vtu_program contain STU record creation for each vlan from 
port_state field. That isn't best practice of STU usage, but simpliest;
* mvsw6172_set_vlan_ports contain filling  port_state for each port in 
vlan with forwarding state.

* probe function contain check for 6176 or 6172 chip id
* constants in mv6172.h renamed and rearranged to conform with datasheet 
naming


other changes mostly for debugging and error/statistic collecting

What can be done better:
* Retrieve statistics from stats counter
* implement interrupt support in addition to polling switch busy flag
* Better STU and ATU support, but that is a complicated task affecting 
swconfig and netlink interface between kernel and userspace.

* Support for Provider and DSA modes. also complicated for same reason
* Many other nice features that can be utilized with marvell switches

Best regards
Nikita Nazarenko

---
 .../linux/generic/files/drivers/net/phy/mvsw6172.c | 1200 


 .../linux/generic/files/drivers/net/phy/mvsw6172.h |  262 +
 .../generic/patches-3.10/733-phy_mvsw6172.patch|   24 +
 3 files changed, 1486 insertions(+)
 create mode 100644 target/linux/generic/files/drivers/net/phy/mvsw6172.c
 create mode 100644 target/linux/generic/files/drivers/net/phy/mvsw6172.h
 create mode 100644 
target/linux/generic/patches-3.10/733-phy_mvsw6172.patch


diff --git a/target/linux/generic/files/drivers/net/phy/mvsw6172.c 
b/target/linux/generic/files/drivers/net/phy/mvsw6172.c

new file mode 100644
index 000..b6b68a4
--- /dev/null
+++ b/target/linux/generic/files/drivers/net/phy/mvsw6172.c
@@ -0,0 +1,1200 @@
+/*
+ * Marvell 88E6172 switch driver
+ *
+ * Copyright (c) 2014 Nikita Nazarenko nnazare...@radiofid.com
+ * Based on code (c) 2014 Claudio Leite lei...@staticky.com
+ * Based on code (c) 2008 Felix Fietkau n...@openwrt.org
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License v2 as published by the
+ * Free Software Foundation
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/list.h
+#include linux/mii.h
+#include linux/phy.h
+#include linux/of.h
+#include linux/of_mdio.h
+#include linux/delay.h
+#include linux/switch.h
+#include linux/device.h
+#include linux/platform_device.h
+
+#include mvsw6172.h
+
+MODULE_DESCRIPTION(Marvell 88E6172 Switch driver);
+MODULE_AUTHOR(Nikita Nazarenko nnazare...@radiofid.com);
+MODULE_LICENSE(GPL v2);
+MODULE_ALIAS(platform:mvsw6172);
+
+/*
+ * Register access is done through direct or indirect addressing,
+ * depending on how the switch is physically connected.
+ *
+ * Direct addressing: all port and global registers directly
+ *   accessible via an address/register pair
+ *
+ * Indirect addressing: switch is mapped at a single address,
+ *   port and global registers accessible via a single command/data
+ *   register pair
+ */
+
+static int
+mvsw61xx_wait_mask_raw(struct mii_bus *bus, int addr,
+int reg, u16 mask, u16 val)
+{
+int i = 100;
+u16 r;
+
+do {
+r = bus-read(bus, addr, reg);
+if ((r  mask) == val)
+return 0;
+} while (--i  0);
+
+return -ETIMEDOUT;
+}
+
+static u16
+r16(struct mii_bus *bus, bool indirect, int base_addr, int addr, int reg)
+{
+u16 ind_addr;
+
+if (!indirect)
+return bus-read(bus, addr, reg);
+
+/* Indirect read: First, make sure switch is free */
+mvsw61xx_wait_mask_raw(bus, base_addr, MV_INDIRECT_REG_CMD,
+MV_INDIRECT_INPROGRESS, 0);
+
+/* Load address and request read */
+ind_addr = MV_INDIRECT_READ | (addr  MV_INDIRECT_ADDR_S) | reg;
+bus-write(bus, base_addr, MV_INDIRECT_REG_CMD,
+ind_addr);
+
+/* Wait until it's ready */
+mvsw61xx_wait_mask_raw(bus, base_addr, MV_INDIRECT_REG_CMD,
+MV_INDIRECT_INPROGRESS, 0);
+
+/* Read the requested data */
+return bus-read(bus, base_addr, MV_INDIRECT_REG_DATA);
+}
+
+static void
+w16(struct mii_bus *bus, bool indirect, int base_addr, int addr,
+int reg, u16 val)
+{
+u16 ind_addr;
+
+if (!indirect) {
+bus-write(bus, addr, reg, val);
+return;
+}
+
+/* Indirect write: First, make sure switch is free */
+mvsw61xx_wait_mask_raw(bus, base_addr, MV_INDIRECT_REG_CMD,
+MV_INDIRECT_INPROGRESS, 0);
+
+/* Load the data to be written */
+bus-write(bus, base_addr, MV_INDIRECT_REG_DATA, val);
+
+/* Wait again for switch to be free */
+mvsw61xx_wait_mask_raw(bus, base_addr, MV_INDIRECT_REG_CMD,
+MV_INDIRECT_INPROGRESS, 0);
+
+/* Load 

Re: [OpenWrt-Devel] [PATCH RFC] brcm47xx: support for flashing CHK and CyberTAN images

2014-12-22 Thread Rafał Miłecki
On 15 December 2014 at 13:17, Rafał Miłecki zaj...@gmail.com wrote:
 This will allow simple sysupgrade-s including simpler reverting to the
 original firmware.

I guess noone plans to NACK this? :)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-22 Thread Roman Yeryomin
On 22 December 2014 at 16:06, Tomer Eliyahu tomereliya...@gmail.com wrote:

 Our team has been working on a project named fastpath for speeding
 up IP forwarding in embedded systems.
 The initial version (fastpath v1) has already been successfully
 deployed in our latest pxa1801 (cellular modem) based products.

 We are in the final stages of fastpath v2 development, which is
 completely hardware independent and requires minimal changes in the
 generic networking code (the project consists of a kernel module and a
 single kernel patch); despite being hardware independent, fastpath v2
 already achieved the same level of performance (as fastpath v1) and
 even increased stability.


Did I read it right - it relies on hw (to offload the cpu) but is hw
independent?
Does it mean you support Octeon or Realtek fastpath hw too?

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


[OpenWrt-Devel] Kernel 3.15 - zRAM LZ4 Compression

2014-12-22 Thread Fernando Frediani
Perhaps someone have seen this from 3.15 notes that it now supports LZ4 for
zRAM Compression which increases the performance even more.

Is anyone extensively using it on their BB or CC builds and beleives this
would be significantlly benefitial or not that much ?

A note from the Kernel release:



1.7. zram: LZ4 compression support, improved performance

Zram is a memory compression mechanism added in Linux 3.14 that is used in
Android, Cyanogenmod, Chrome OS, Lubuntu and other projects. In this
release zram brings support for the LZ4 compression algorithm, which is
better than the current available LZO in some cases.

This release also adds performance improvements to concurrent compression
of multiple compression streams, and the ability to switch the compression
algorithm in /sys/block/zram0/comp_algorithm



Best regards,

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


Re: [OpenWrt-Devel] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-22 Thread Ram Marzin
 Did I read it right - it relies on hw (to offload the cpu) but is hw 
 independent?
 Does it mean you support Octeon or Realtek fastpath hw too?

No, it does not rely on hardware, it is a pure SW solution.

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


Re: [OpenWrt-Devel] Introducing fastpath - Kernel module for speeding up IP forwarding

2014-12-22 Thread Hauke Mehrtens
On 12/22/2014 05:43 PM, Ram Marzin wrote:
 Did I read it right - it relies on hw (to offload the cpu) but is hw 
 independent?
 Does it mean you support Octeon or Realtek fastpath hw too?
 
 No, it does not rely on hardware, it is a pure SW solution.
 
 - Ram

Would it be possible to add some hardware support to it? Many network
SoCs do have some hardware network engine which supports NAT and some
similar easy stuff in hardware. This would be a second step after the
normal fastpath stuff would be integrated in OpenWrt and working. It
would be very helpful to have some generic layer to control some
hardware network support engine.

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


[OpenWrt-Devel] [PATCH uqmi] Fix logical expression which is always true

2014-12-22 Thread Sławomir Demeszko
Signed-off-by: Sławomir Demeszko s.demes...@wireless-instruments.com
---
 commands-wms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands-wms.c b/commands-wms.c
index 02874f0..1b4373f 100644
--- a/commands-wms.c
+++ b/commands-wms.c
@@ -560,7 +560,7 @@ pdu_encode_number(unsigned char *dest, const char *str, 
bool smsc)
}
 
for (i = 0; str[i]; i++) {
-   if (str[i] = '0' || str[i] = '9')
+   if (str[i] = '0'  str[i] = '9')
continue;
 
ascii = true;
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] backport ubi-utils mirror md5sum

2014-12-22 Thread Alexander Couzens
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

hi felix,

can you please backport this patch from trunk to bb?
it's the same git rev.

best,
lynxis

commit 00704db9750b224f7ad12ed3128660831ca66504
Author: nbd nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73
Date:   Mon Dec 22 14:32:41 2014 +

ubi-utils: add mirror md5sum

Signed-off-by: Felix Fietkau n...@openwrt.org

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43761 
3c298f89-4303-0410-b956-a3cf2f4a3e73

- -- 
Alexander Couzens

mail: lyn...@fe80.eu
jabber: lyn...@jabber.ccc.de
mobile: +4915123277221
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJUmFX1AAoJEMKenaag34YEdsEP/Rm6rOf/+N33ttuTCEwi+5uQ
qtrKvYY0jWHxCpNsRg8HMTzRp1JQA158G/wTPzagXKCTXL+RMifblLcuVBPyGy1r
+kscCQKguc/58hitNlmy8TBggR0efg5c4ZUOa1e/nFJrE6qHS9eIkRrGU1q6cg9i
hPVbVVXft6YfCw0I2cecscZotAyoVBXo4JI8uu0UcX/Ngxme2yf77GoNE3s1zTAO
9y4k2E2AWZonUKk3qqCmZPb/HYbO6awWw+1Xu/vNxj+Y+aJ6jUZb+svrYUm+nLZc
cAhAJ7H3x3evabOehGvNR6MyZNUKBL/7YHHocGfRW4wlO8uS2z5GB+pkMP+QMatO
8xuWzP1tjz6cqXUav/XXzp9Y+wVkhw0i0quysriaa3iX/KGwV8ca9JowHiYiwqKg
Pw+MREz9gjIl44nifDSrgY18zWyFO2JCtQYJPpFYgB99rO1fJsF5UUtRqIW7OuMY
GFjmEJHXSryCCXQVu+pKCgnLnC4VP6qKl69KY8sGieB8kr0UlQGOCIgzlVN12XB1
dQUF9kaLYRjaP0zhgKInlgrM/EP26gXNLbZFJ9x5WDE6Oi/xO6IAjA6Uuq2kAMvx
Gioc75A9FPoHyqNwYox8yrVxcQui+zzJNmtbBYuaKjIVeR4Gv4ChaH4GdsRJSfdJ
geWDYun8tbe6uujEpn8j
=VkEJ
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] backport ubi-utils mirror md5sum

2014-12-22 Thread Felix Fietkau
On 2014-12-22 18:33, Alexander Couzens wrote:
 hi felix,
 
 can you please backport this patch from trunk to bb?
 it's the same git rev.
Done.

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


[OpenWrt-Devel] [PATCH uqmi] Fix improper length of sms message stored in User Data Length field

2014-12-22 Thread Sławomir Demeszko
Signed-off-by: Sławomir Demeszko s.demes...@wireless-instruments.com
---
 commands-wms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands-wms.c b/commands-wms.c
index 1b4373f..798e012 100644
--- a/commands-wms.c
+++ b/commands-wms.c
@@ -591,7 +591,7 @@ pdu_encode_data(unsigned char *dest, const char *str)
 
dest[len++] = 0;
len += pdu_encode_7bit_str(dest[len], str);
-   dest[0] = len - 1;
+   dest[0] = strlen(str);
 
return len;
 }
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uhttpd: Fix possible memory leaks when generating directory listing

2014-12-22 Thread Andrej Krpic
scandir() call requires free() of each returned dirent structure
and parent list. Code constructing HTML response of directory
listing is missing a call to free in some cases.

Signed-off-by: Andrej Krpic a...@tnode.com
---
 file.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/file.c b/file.c
index 6b3bb82..60dfdfa 100644
--- a/file.c
+++ b/file.c
@@ -479,11 +479,11 @@ static void list_entries(struct client *cl, struct dirent 
**files, int count,
bool dir = !!(files[i]-d_type  DT_DIR);
 
if (name[0] == '.'  name[1] == 0)
-   continue;
+   goto next;
 
sprintf(file, %s, name);
if (stat(local_path, s))
-   continue;
+   goto next;
 
if (!dir) {
suffix = ;
@@ -492,7 +492,7 @@ static void list_entries(struct client *cl, struct dirent 
**files, int count,
}
 
if (!(s.st_mode  mode))
-   continue;
+   goto next;
 
uh_chunk_printf(cl,
listronga href='%s%s%s'%s/a%s
@@ -505,6 +505,7 @@ static void list_entries(struct client *cl, struct dirent 
**files, int count,
type, s.st_size / 1024.0);
 
*file = 0;
+next:
free(files[i]);
}
 }
-- 
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 uqmi] Making smsc number optional

2014-12-22 Thread Sławomir Demeszko
If smsc number is not provided before sending sms then
operator's default stored on simcard will be used.

Signed-off-by: Sławomir Demeszko s.demes...@wireless-instruments.com
---
 commands-wms.c | 10 +++---
 commands-wms.h |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/commands-wms.c b/commands-wms.c
index 798e012..e3bcbc8 100644
--- a/commands-wms.c
+++ b/commands-wms.c
@@ -612,12 +612,12 @@ cmd_wms_send_message_prepare(struct qmi_dev *qmi, struct 
qmi_request *req, struc
unsigned char protocol_id = 0x00;
unsigned char dcs = 0x00;
 
-   if (!_send.smsc || !*_send.smsc || !_send.target || !*_send.target) {
+   if (!_send.target || !*_send.target) {
uqmi_add_error(Missing argument);
return QMI_CMD_EXIT;
}
 
-   if (strlen(_send.smsc)  16 || strlen(_send.target)  16 || strlen(arg) 
 160) {
+   if ((_send.smsc  strlen(_send.smsc)  16) || strlen(_send.target)  
16 || strlen(arg)  160) {
uqmi_add_error(Argument too long);
return QMI_CMD_EXIT;
}
@@ -625,7 +625,11 @@ cmd_wms_send_message_prepare(struct qmi_dev *qmi, struct 
qmi_request *req, struc
if (_send.flash)
dcs |= 0x10;
 
-   cur += pdu_encode_number(cur, _send.smsc, true);
+   if (!_send.smsc || !*_send.smsc)
+   *(cur++) = 0;
+   else
+   cur += pdu_encode_number(cur, _send.smsc, true);
+
*(cur++) = first_octet;
*(cur++) = 0; /* reference */
 
diff --git a/commands-wms.h b/commands-wms.h
index 07191da..83e6614 100644
--- a/commands-wms.h
+++ b/commands-wms.h
@@ -14,7 +14,7 @@
  --get-message id:   Get SMS message at index 
id\n \
  --get-raw-message id:   Get SMS raw message 
contents at index id\n \
  --send-message data:Send SMS message (use 
options below)\n \
-   --send-message-smsc nr:   SMSC number (required)\n \
+   --send-message-smsc nr:   SMSC number\n \
--send-message-target nr: Destination number 
(required)\n \
--send-message-flash:   Send as Flash SMS\n \
 
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] uhttpd: Fix possible memory leaks when generating directory listing

2014-12-22 Thread Felix Fietkau
On 2014-12-22 18:55, Andrej Krpic wrote:
 scandir() call requires free() of each returned dirent structure
 and parent list. Code constructing HTML response of directory
 listing is missing a call to free in some cases.
 
 Signed-off-by: Andrej Krpic a...@tnode.com
Applied, thanks.

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


Re: [OpenWrt-Devel] [PATCH uqmi] Making smsc number optional

2014-12-22 Thread Felix Fietkau
On 2014-12-22 19:47, Sławomir Demeszko wrote:
 If smsc number is not provided before sending sms then
 operator's default stored on simcard will be used.
 
 Signed-off-by: Sławomir Demeszko s.demes...@wireless-instruments.com
Applied all 3, thanks.

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


Re: [OpenWrt-Devel] [PATCH uqmi] Fix encoding phone number on sending sms

2014-12-22 Thread Felix Fietkau
On 2014-12-18 16:12, Sławomir Demeszko wrote:
 Return proper length of encoded phone number with odd count of digits,
 without this patch number is encoded in memory but length returned
 by function is not incremented and sms cannot be send.
 
 Signed-off-by: Sławomir Demeszko s.demes...@wireless-instruments.com
Applied, thanks.

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


Re: [OpenWrt-Devel] [PATCH v2 4/4] oxnas: sata_oxnas: make irq handler more readable

2014-12-22 Thread Felix Fietkau
On 2014-12-18 18:17, Daniel Golle wrote:
 safed one level of indention by using 'continue' instead of a
 lengthy if-clause.
 
 Signed-off-by: Daniel Golle dan...@makrotopia.org
 v2: use logic-AND instead of '?' operator when checking for hw bug 6320
Applied all 4, thanks.

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


Re: [OpenWrt-Devel] [PATCH 1/2] scripts: fix recursive dependencies that might be caused by using conditional dependencies.

2014-12-22 Thread Yousong Zhou
On 22 December 2014 at 22:42, Felix Fietkau n...@openwrt.org wrote:
 This doesn't look right to me. It seems to be overwriting $condition.
 Did you mean eq instead of =?

Should be `=` in this case.  But the patch now looks wrong anyway.  I
will try digging through it.

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


Re: [OpenWrt-Devel] [PATCH 1/2] scripts: fix recursive dependencies that might be caused by using conditional dependencies.

2014-12-22 Thread Yousong Zhou
On 23 December 2014 at 09:38, Yousong Zhou yszhou4t...@gmail.com wrote:
 Should be `=` in this case.  But the patch now looks wrong anyway.  I

Should be `eq' !  Dizzy in the morning, sorry.

 will try digging through it.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] oxnas: clk-oxnas: rework pllb enable function

2014-12-22 Thread Daniel Golle
kernel lock debugging unveiled that we should not call
of_reset_control_get inside a clock's enable operation (see below)

move of_reset_control_* previously used in pllb_clk_enable to new
pllb_clk_prepare and pllb_clk_unprepare functions.
use a container to carry runtime information.

[ cut here ]
WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2742 
lockdep_trace_alloc+0xb8/0xfc()
DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.26 #6
[c001a6ac] (unwind_backtrace) from [c0016dec] (show_stack+0x10/0x14)
[c0016dec] (show_stack) from [c0194f68] (dump_stack+0x7c/0x94)
[c0194f68] (dump_stack) from [c0021b50] (warn_slowpath_common+0x68/0x8c)
[c0021b50] (warn_slowpath_common) from [c0021ba4] 
(warn_slowpath_fmt+0x30/0x40)
[c0021ba4] (warn_slowpath_fmt) from [c0061b30] 
(lockdep_trace_alloc+0xb8/0xfc)
[c0061b30] (lockdep_trace_alloc) from [c00cb740] 
(kmem_cache_alloc+0x1c/0xf8)
[c00cb740] (kmem_cache_alloc) from [c01d33c8] 
(of_reset_control_get+0xe8/0x12c)
[c01d33c8] (of_reset_control_get) from [c0269228] 
(pllb_clk_enable+0x14/0xbc)
[c0269228] (pllb_clk_enable) from [c0265738] (__clk_enable+0x54/0xa0)
[c0265738] (__clk_enable) from [c0265acc] (clk_enable+0x18/0x2c)
[c0265acc] (clk_enable) from [c04325f8] (oxnas_pcie_probe+0x3b8/0x6a0)
[c04325f8] (oxnas_pcie_probe) from [c01f2510] (platform_drv_probe+0x18/0x48)
[c01f2510] (platform_drv_probe) from [c01f1070] 
(driver_probe_device+0xd8/0x24c)
[c01f1070] (driver_probe_device) from [c01f1298] (__driver_attach+0x70/0x94)
[c01f1298] (__driver_attach) from [c01ef728] (bus_for_each_dev+0x4c/0x98)
[c01ef728] (bus_for_each_dev) from [c01f0818] (bus_add_driver+0xcc/0x1e8)
[c01f0818] (bus_add_driver) from [c01f169c] (driver_register+0xa0/0xe8)
[c01f169c] (driver_register) from [c01f2568] 
(platform_driver_probe+0x20/0xa4)
[c01f2568] (platform_driver_probe) from [c0013a3c] 
(do_one_initcall+0x90/0x140)
[c0013a3c] (do_one_initcall) from [c0421d38] 
(kernel_init_freeable+0x1e4/0x2c0)
[c0421d38] (kernel_init_freeable) from [c000c214] (kernel_init+0x8/0x104)
[c000c214] (kernel_init) from [c0008768] (ret_from_fork+0x14/0x2c)
---[ end trace 5f17ed2f61e0683f ]---

Signed-off-by: Daniel Golle dan...@makrotopia.org
---
 target/linux/oxnas/files/drivers/clk/clk-oxnas.c | 73 ++--
 1 file changed, 54 insertions(+), 19 deletions(-)

diff --git a/target/linux/oxnas/files/drivers/clk/clk-oxnas.c 
b/target/linux/oxnas/files/drivers/clk/clk-oxnas.c
index 8d80c4f..08eaeee 100644
--- a/target/linux/oxnas/files/drivers/clk/clk-oxnas.c
+++ b/target/linux/oxnas/files/drivers/clk/clk-oxnas.c
@@ -28,6 +28,14 @@
 
 #define MHZ (1000 * 1000)
 
+struct clk_oxnas_pllb {
+   struct clk_hw hw;
+   struct device_node *devnode;
+   struct reset_control *rstc;
+};
+
+#define to_clk_oxnas_pllb(_hw) container_of(_hw, struct clk_oxnas_pllb, hw)
+
 static unsigned long plla_clk_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
 {
@@ -67,48 +75,72 @@ static struct clk_hw plla_hw = {
.init = clk_plla_init,
 };
 
-static struct device_node *node_pllb;
+static int pllb_clk_is_prepared(struct clk_hw *hw)
+{
+   struct clk_oxnas_pllb *pllb = to_clk_oxnas_pllb(hw);
+
+   return !!pllb-rstc;
+}
 
-int pllb_clk_enable(struct clk_hw *hw)
+static int pllb_clk_prepare(struct clk_hw *hw)
 {
-   struct reset_control *rstc;
+   struct clk_oxnas_pllb *pllb = to_clk_oxnas_pllb(hw);
 
-   rstc = of_reset_control_get(node_pllb, NULL);
-   if (IS_ERR(rstc))
-   return PTR_ERR(rstc);
+   pllb-rstc = of_reset_control_get(pllb-devnode, NULL);
+
+   return IS_ERR(pllb-rstc) ? PTR_ERR(pllb-rstc) : 0;
+}
+
+static void pllb_clk_unprepare(struct clk_hw *hw)
+{
+   struct clk_oxnas_pllb *pllb = to_clk_oxnas_pllb(hw);
+
+   BUG_ON(IS_ERR(pllb-rstc));
+
+   reset_control_put(pllb-rstc);
+   pllb-rstc = NULL;
+}
+
+static int pllb_clk_enable(struct clk_hw *hw)
+{
+   struct clk_oxnas_pllb *pllb = to_clk_oxnas_pllb(hw);
+
+   BUG_ON(IS_ERR(pllb-rstc));
 
/* put PLL into bypass */
oxnas_register_set_mask(SEC_CTRL_PLLB_CTRL0, BIT(PLLB_BYPASS));
wmb();
udelay(10);
-   reset_control_assert(rstc);
+   reset_control_assert(pllb-rstc);
udelay(10);
/* set PLL B control information */
writel((1  PLLB_ENSAT) | (1  PLLB_OUTDIV) | (2  PLLB_REFDIV),
SEC_CTRL_PLLB_CTRL0);
-   reset_control_deassert(rstc);
-   reset_control_put(rstc);
+   reset_control_deassert(pllb-rstc);
udelay(100);
oxnas_register_clear_mask(SEC_CTRL_PLLB_CTRL0, BIT(PLLB_BYPASS));
 
return 0;
 }
 
-void pllb_clk_disable(struct clk_hw *hw)
+static void pllb_clk_disable(struct clk_hw *hw)
 {
-   struct reset_control *rstc;
+   struct clk_oxnas_pllb *pllb = to_clk_oxnas_pllb(hw);
+
+   BUG_ON(IS_ERR(pllb-rstc));
 
/* put PLL 

Re: [OpenWrt-Devel] [PATCH 1/1] package: contrib: add smstools3 package

2014-12-22 Thread drEagle
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello Jiri,

Le 21/12/2014 08:48, Jiri Slachta a écrit :
 Hello Gerald,
 
 I would recommend you to resend the patch to the openwrt packages repository 
 on
 github as a pull request.

Is there any another method to contribute that using github ?

 Please follow the Contributing Guidelines[1] for packages in OpenWrt package 
 repository. In your Makefile the PKG_MAINTAINER is not defined and the 
 PKG_RELEASE 
 should be reset to 1 since the package Makefile is at its initial version.

Read and applied.

Regards,
Gérald

 Kind regards,
 Jiri Slachta
 
 [1] https://github.com/openwrt/packages/blob/master/CONTRIBUTING.md
 
 Dne 21.12.2014 v 08:09 Gerald Kerma napsal(a):
 Add smstools3 package from http://smstools3.kekekasvi.com/
 
 Signed-off-by: Gerald Kerma drea...@doukki.net
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEcBAEBAgAGBQJUmQT8AAoJEIoWzNw2mnfM18wH/AzuFJJlly4UKr3QZr/QPX1w
O+SFkY7gkKzEEzyFFGlTFJQl6RjU7trdeI0KtEteWXHbPzWmLygN08AY1fzFZ+dg
5qdxl0rBlO5QAM+T9eQt7UvkrqN0g+lMn9HpP4q0w3uEkKXuvHi/kqiWKYuHmROG
E4h8E4KuAeNp6PQVsk2eNiM1QQfZaXpakiQzVr0Cx3DUqZlPOwKapTM2qd64rkLU
OQg+eZwG4OOHSG7Nle7gR43o/QWYnXzEkPahg9ceFNGI3sjY+Et+0Lm2LunI93D5
WBoZ4mGzKz34oRmZkJMYMR5cZ0fFLmj9u+8m6Js3CwI7QOayJ3/f1rjkEMdkc+A=
=Re2k
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Linksys WRT54G / 16mb / wifi / lowmem / concurrency

2014-12-22 Thread Bastian Bittorf
* Felix Fietkau n...@openwrt.org [17.12.2014 11:34]:
  there are no problems and even 4000 kb free ram.
  I havent opened a ticket on bugtracker, because it
  is no bug 8-)
 Please test if putting http://nbd.name/990-test.patch into
 package/kernel/mac80211/patches reduces or fixes these allocation
 failure messages.

I did a lot of tests now and it's working without issues now, thanks.
if somebody want to play with a stripped down firmware, here it is:

http://intercity-vpn.de/files/openwrt/openwrt-wrt54g-squashfs-r43768.bin

it simply starts meshing with OLSR on LAN and Wifi/channel5.

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