Re: [LEDE-DEV] [PATCH] openvpn: add support for various new 2.4 configuration options

2017-01-28 Thread Magnus Kroken

Hi

On 16.01.2017 22.56, Magnus Kroken wrote:

Updates to openvpn.init were included in early OpenVPN 2.4 patch
series, but got lost along the way and were never merged.

Signed-off-by: Magnus Kroken 
---
 .../network/services/openvpn/files/openvpn.init| 43 ++
 1 file changed, 19 insertions(+), 24 deletions(-)


Is it possible to apply this to 17.01 branch as well? If not, 17.01 will 
ship with OpenVPN 2.4.0, but several new options will be unavailable 
when using UCI to configure OpenVPN.


Regards,
/Magnus


diff --git a/package/network/services/openvpn/files/openvpn.init 
b/package/network/services/openvpn/files/openvpn.init
index 0fcdc7e..af9c144 100644
--- a/package/network/services/openvpn/files/openvpn.init
+++ b/package/network/services/openvpn/files/openvpn.init
@@ -95,38 +95,33 @@ start_instance() {

# append flags
append_bools "$s" \
-   auth_nocache auth_user_pass_optional bind ccd_exclusive client 
client_cert_not_required \
-   client_to_client comp_noadapt disable \
-   disable_occ down_pre duplicate_cn fast_io float 
http_proxy_retry \
+   allow_recursive_routing auth_nocache auth_user_pass_optional 
bind ccd_exclusive client client_cert_not_required \
+   client_to_client comp_noadapt disable disable_occ down_pre 
duplicate_cn fast_io float http_proxy_retry \
ifconfig_noexec ifconfig_nowarn ifconfig_pool_linear 
management_forget_disconnect management_hold \
management_query_passwords management_signal mktun mlock 
mtu_test multihome mute_replay_warnings \
-   nobind no_iv no_name_remapping no_replay opt_verify passtos 
persist_key persist_local_ip \
-   persist_remote_ip persist_tun ping_timer_rem pull push_reset \
-   remote_random rmtun route_noexec route_nopull single_session 
socks_proxy_retry \
-   suppress_timestamps tcp_nodelay test_crypto tls_client tls_exit 
tls_server \
+   ncp_disable nobind no_iv no_name_remapping no_replay opt_verify 
passtos persist_key persist_local_ip \
+   persist_remote_ip persist_tun ping_timer_rem pull push_reset 
remote_random rmtun route_noexec route_nopull \
+   single_session socks_proxy_retry suppress_timestamps 
tcp_nodelay test_crypto tls_client tls_exit tls_server \
tun_ipv6 up_delay up_restart username_as_common_name

# append params
append_params "$s" \
cd askpass auth auth_retry auth_user_pass auth_user_pass_verify 
bcast_buffers ca cert capath \
-   chroot cipher client_config_dir client_connect 
client_disconnect comp_lzo connect_freq \
+   chroot cipher client_config_dir client_connect 
client_disconnect comp_lzo compress connect_freq \
connect_retry connect_timeout connect_retry_max crl_verify dev 
dev_node dev_type dh \
-   echo engine explicit_exit_notify fragment group hand_window 
hash_size \
-   http_proxy http_proxy_option http_proxy_timeout ifconfig 
ifconfig_pool \
-   ifconfig_pool_persist ifconfig_push inactive ipchange iroute 
keepalive \
-   key key_method keysize learn_address link_mtu lladdr local log 
log_append \
-   lport management management_log_cache max_clients \
-   max_routes_per_client mode mssfix mtu_disc mute nice 
ns_cert_type ping \
-   ping_exit ping_restart pkcs12 plugin port port_share prng proto 
rcvbuf \
-   redirect_gateway remap_usr1 remote remote_cert_eku 
remote_cert_ku remote_cert_tls \
-   reneg_bytes reneg_pkts reneg_sec \
-   replay_persist replay_window resolv_retry route route_delay 
route_gateway \
-   route_metric route_pre_down route_up rport script_security 
secret server server_bridge setenv shaper sndbuf \
-   socks_proxy status status_version syslog tcp_queue_limit 
tls_auth tls_version_min \
-   tls_cipher tls_remote tls_timeout tls_verify tmp_dir topology 
tran_window \
-   tun_mtu tun_mtu_extra txqueuelen user verb down push up \
-   verify_x509_name x509_username_field \
-   ifconfig_ipv6 route_ipv6 server_ipv6 ifconfig_ipv6_pool 
ifconfig_ipv6_push iroute_ipv6
+   ecdh_curve echo engine explicit_exit_notify fragment group 
hand_window hash_size http_proxy \
+   http_proxy_option http_proxy_timeout ifconfig ifconfig_pool 
ifconfig_pool_persist ifconfig_push \
+   inactive ipchange iroute keepalive key key_method keysize 
learn_address link_mtu lladdr local \
+   log log_append lport management management_log_cache 
max_clients max_routes_per_client mode \
+   mssfix mtu_disc mute ncp_ciphers nice ns_cert_type ping 
ping_exit ping_restart pkcs12 plugin \
+   port port_share prng proto pull_filter rcvbuf redirect_gateway 
remap_

Re: [LEDE-DEV] LEDE-17.01 Final Release Notes available

2017-01-28 Thread Jaap Buurman
Great job on the release notes! One minor thing that I think looks
nicer would be the removal of "nothing specific" after "improved
performance", since it adds no additional information. But that's just
me.

Also about the following: "Improvements to the WiFi stack eliminating
bufferbloat on ath9k (and some ath10k) chipsets"

Is this about the Airtime Fairness Patch? AFAIK this is only for ath9k
and not for ath10k? Or am I mixing things up here?

While're talking about 17.01 anyway when are the first RCs coming out btw? :)

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] x86: add GPIO to FEATURES so kmod-leds-apu2 gets exposed

2017-01-28 Thread Stijn Segers
Nevermind me, I forgot to backport 
e3271d545d8f29f42a79d7cd5595858e67eb95e7 to 17.01... So please ignore 
this!


Another reason not to be messing with computers past midnight >_>

Stijn

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Finding Release snapshots/URLs for the "Release"

2017-01-28 Thread Jo-Philipp Wich
Hi Rich,

> 1) When I got to downloads.lede-project.org, I see the following
> directory structure: [...] I do NOT see any targets under the
> /releases directory. Why?

I intentionally hid the "17.01-SNAPSHOTS" directory because it is not a
fixed (as in non-moving) build, it merely reflects the build output of
the current branch HEAD.

> 2) Why doesn't the /releases directory mirror the /snapshots
> directory?

Because releases are structured slightly differently.

> 3) I have discovered that the release images are available
> /releases/17.01-SNAPSHOT/  Is this what we should document?

No, please do not document that particular directory, see below.

> 4) It's really confusing to talk about (and document) the release
> candidates and the daily "trunk" builds. Currently, image file names
> for stable build candidates contain the word "snapshot", while trunk
> builds (in the /snapshots directory) do not:

Those images are not stable build candidates but merely release branch
snapshots, thats why they contain the word "snapshot" and also why
they're currently hidden from the toplevel directory.

I instructed the buildbot to produce tagged rc1 builds today, those will
be true, fixed release candidate images which do not move.

Once built, those images will appear in /releases/17.01.0-rc1/ and
remain unchanged. In addition to that, there will be a corresponding
"v17.01.0-rc1" tag in the repository which can be used to reproduce this
particular images.

The /releases/17.01.[0-9]* directories (once existing) which are not
hidden are the ones that should be documented and referred to as fixed
builds.

> 5) What is the naming scheme for the final 17.01 image URLs?

The RCs will be:

/releases/17.01.0-rc[0-9]*/targets/$target/$subtarget/lede-17.01.0-rc[0-9]*-r-XXX-$target-$subtarget-*.bin

The finals will be:

/releases/17.01.0/targets/$target/$subtarget/lede-17.01.0-r-XXX-$target-$subtarget-*.bin

> 6) When we release a new version (say, 17.06), what will those URLs
> be?

The RCs will be:

/releases/17.06.0-rc[0-9]*/targets/$target/$subtarget/lede-17.06.0-rc[0-9]*-r-XXX-$target-$subtarget-*.bin

The finals will be:

/releases/17.06.0/targets/$target/$subtarget/lede-17.06.0-r-XXX-$target-$subtarget-*.bin

> We'll adjust the documentation to match the results of this
> discussion. Thanks.

I appreciate your efforts on this, thank you :)

~ Jo

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] mxs: remove stale references to obsolete kernel module packages

2017-01-28 Thread Michael Heimpold
Commit 29443e2 (mxs: remove modules.mk, select drivers in the kernel config)
missed to remove these references, so cleanup it now.

Signed-off-by: Michael Heimpold 
---
 target/linux/mxs/Makefile   | 2 --
 target/linux/mxs/profiles/01-duckbill.mk| 3 +--
 target/linux/mxs/profiles/02-olinuxino-maxi.mk  | 6 ++
 target/linux/mxs/profiles/03-olinuxino-micro.mk | 5 +
 4 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/target/linux/mxs/Makefile b/target/linux/mxs/Makefile
index ede5d6c..447c333 100644
--- a/target/linux/mxs/Makefile
+++ b/target/linux/mxs/Makefile
@@ -22,6 +22,4 @@ endef
 
 include $(INCLUDE_DIR)/target.mk
 
-DEFAULT_PACKAGES += kmod-wdt-stmp3xxx
-
 $(eval $(call BuildTarget))
diff --git a/target/linux/mxs/profiles/01-duckbill.mk 
b/target/linux/mxs/profiles/01-duckbill.mk
index 6b1dc18..cab379a 100644
--- a/target/linux/mxs/profiles/01-duckbill.mk
+++ b/target/linux/mxs/profiles/01-duckbill.mk
@@ -10,8 +10,7 @@ define Profile/duckbill
   FEATURES+=usbgadget
   PACKAGES+= \
-dnsmasq -firewall -ppp -ip6tables -iptables -6relayd -mtd 
uboot-envtools \
-   kmod-leds-gpio kmod-ledtrig-timer kmod-usb-mxs-phy -kmod-ipt-nathelper \
-   kmod-i2c-mxs kmod-spi-mxs uboot-mxs-duckbill
+   kmod-leds-gpio kmod-ledtrig-timer -kmod-ipt-nathelper uboot-mxs-duckbill
 endef
 
 define Profile/duckbill/Description
diff --git a/target/linux/mxs/profiles/02-olinuxino-maxi.mk 
b/target/linux/mxs/profiles/02-olinuxino-maxi.mk
index 7885d1f..59d0376 100644
--- a/target/linux/mxs/profiles/02-olinuxino-maxi.mk
+++ b/target/linux/mxs/profiles/02-olinuxino-maxi.mk
@@ -8,10 +8,8 @@
 define Profile/olinuxino-maxi
   NAME:=Olimex OLinuXino Maxi/Mini boards
   PACKAGES += imx-bootlets uboot-mxs-mx23_olinuxino \
- kmod-usb-mxs-phy kmod-usb-net kmod-usb-net-smsc95xx \
- kmod-gpio-mcp23s08 kmod-leds-gpio kmod-ledtrig-heartbeat 
kmod-rtc-stmp3xxx \
- kmod-sound-core kmod-sound-soc-mxs kmod-iio-mxs-lradc 
kmod-crypto-hw-dcp \
- kmod-i2c-mxs kmod-spi-mxs
+ kmod-usb-net kmod-usb-net-smsc95xx kmod-gpio-mcp23s08 \
+ kmod-leds-gpio kmod-ledtrig-heartbeat kmod-sound-core
 endef
 
 define Profile/olinuxino-maxi/Description
diff --git a/target/linux/mxs/profiles/03-olinuxino-micro.mk 
b/target/linux/mxs/profiles/03-olinuxino-micro.mk
index 356a877..535f6b5 100644
--- a/target/linux/mxs/profiles/03-olinuxino-micro.mk
+++ b/target/linux/mxs/profiles/03-olinuxino-micro.mk
@@ -8,10 +8,7 @@
 define Profile/olinuxino-micro
   NAME:=Olimex OLinuXino Micro/Nano boards
   PACKAGES += imx-bootlets uboot-mxs-mx23_olinuxino \
- kmod-usb-mxs-phy kmod-gpio-mcp23s08 kmod-leds-gpio \
- kmod-ledtrig-heartbeat kmod-rtc-stmp3xxx \
- kmod-iio-mxs-lradc kmod-crypto-hw-dcp \
- kmod-i2c-mxs kmod-spi-mxs
+ kmod-gpio-mcp23s08 kmod-leds-gpio kmod-ledtrig-heartbeat
 endef
 
 define Profile/olinuxino-micro/Description
-- 
2.7.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2] ramips: add support for RATOC REX-WIFISD2

2017-01-28 Thread FUKAUMI Naoki
RATOC REX-WIFISD2 is a battery-powered wireless SD card reader with

 - MT7620A + MT7610E
 - 64MiB DDR2 SDRAM
 - 16MiB SPI flash
 - 2T2R 11b/g/n + 1T1R 11ac/a/n Wi-Fi
 - 1x 10/100Mbps ethernet switch
 - 1x SD card
 - 1x USB 2.0
 - 2x programmable LED
 - 1x button

stock firmware is very similar to HooToo Tripmate travel routers. you
can do almost anything as a root user with telnet and/or shell script
(factory image or "EnterRouterMode.sh") on stock firmware.

"EnterRouterMode.sh" will be the easiest way to install. put the
following shell script into SD card (or USB storage) as
"EnterRouterMode.sh" with "kernel.bin" and "rootfs.bin" files.

 
 #!/bin/sh

 dir=`dirname $0`

 mtd_write write ${dir}/kernel.bin Kernel_RootFS
 mtd_write -r write ${dir}/rootfs.bin Rootfs
 

it will be run automatically when SD card is mounted on stock firmware.

TFTP can also be used to flash kernel and rootfs. it will be run by
press & hold RESET button while power on. (serverip=10.10.10.254)

you may use all partitions between "kernel" and "rootfs" as a single
"firmware" partition (please edit dts yourself), but "params" partition
should be kept if you want to restore stock firmware.

Signed-off-by: FUKAUMI Naoki 
---
Changes in v2:
- add "read-only" property to "params", "user_backup", and "user" partitions

 .../linux/ramips/base-files/etc/board.d/02_network |   1 +
 target/linux/ramips/base-files/etc/diag.sh |   3 +-
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/REX-WIFISD2.dts| 148 +
 target/linux/ramips/image/mt7620.mk|  10 ++
 6 files changed, 165 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/REX-WIFISD2.dts

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 91f1aaa..b27954f 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -192,6 +192,7 @@ ramips_setup_interfaces()
mzk-ex750np|\
na930|\
pbr-d1|\
+   rex-wifisd2|\
wli-tx4-ag300n|\
wmr-300|\
wrh-300cr)
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 9499833..84031d1 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -41,7 +41,8 @@ get_status_led() {
xdxrn502j)
status_led="$board:green:power"
;;
-   3g-6200nl)
+   3g-6200nl|\
+   rex-wifisd2)
status_led="$board:green:internet"
;;
a5-v11|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 8292da1..5ab46de 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -406,6 +406,9 @@ ramips_board_detect() {
*"RE6500")
name="re6500"
;;
+   *"REX-WIFISD2")
+   name="rex-wifisd2"
+   ;;
*"RN502J")
name="xdxrn502j"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index c6ad8ca..05d2759 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -113,6 +113,7 @@ platform_check_image() {
px-4885|\
rb750gr3|\
re6500|\
+   rex-wifisd2|\
rp-n53|\
rt5350f-olinuxino|\
rt5350f-olinuxino-evb|\
diff --git a/target/linux/ramips/dts/REX-WIFISD2.dts 
b/target/linux/ramips/dts/REX-WIFISD2.dts
new file mode 100644
index 000..4d8819a
--- /dev/null
+++ b/target/linux/ramips/dts/REX-WIFISD2.dts
@@ -0,0 +1,148 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+#include 
+#include 
+
+/ {
+   compatible = "ratoc,rex-wifisd2", "ralink,mt7620a-soc";
+   model = "RATOC REX-WIFISD2";
+
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   internet {
+   label = "rex-wifisd2:green:internet";
+   gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
+   };
+
+   wifi {
+   label = "rex-wifisd2:blue:wifi";
+   gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+   };
+   };
+};
+
+&ehci {
+   status = "okay";
+};
+
+ðernet {
+   mtd-mac-

[LEDE-DEV] [PATCH v4 1/3] firmware-utils: improve tools for Buffalo DHP series

2017-01-28 Thread FUKAUMI Naoki
some of Buffalo DHP series use slightly different trx magic, buffalo-enc,
buffalo-tag, and factory image begin with 'bgn'.

this patch adds support for building those images.

Signed-off-by: FUKAUMI Naoki 
---
Changes in v4:
Changes in v3:
- no change

Changes in v2:
- refresh everything to make rules simple

 include/image-commands.mk  | 33 +
 tools/firmware-utils/Makefile  |  1 +
 tools/firmware-utils/src/buffalo-enc.c | 26 +--
 tools/firmware-utils/src/buffalo-lib.h | 20 
 tools/firmware-utils/src/buffalo-tag.c | 46 --
 tools/firmware-utils/src/mkdhpimg.c| 85 ++
 tools/firmware-utils/src/trx.c | 13 +-
 7 files changed, 215 insertions(+), 9 deletions(-)
 create mode 100644 tools/firmware-utils/src/mkdhpimg.c

diff --git a/include/image-commands.mk b/include/image-commands.mk
index e0f2918..7d124ec 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -11,6 +11,39 @@ define Build/uImage
@mv $@.new $@
 endef
 
+define Build/buffalo-enc
+   $(eval product=$(word 1,$(1)))
+   $(eval version=$(word 2,$(1)))
+   $(eval args=$(wordlist 3,$(words $(1)),$(1)))
+   $(STAGING_DIR_HOST)/bin/buffalo-enc \
+   -p $(product) -v $(version) $(args) \
+   -i $@ -o $@.new
+   mv $@.new $@
+endef
+
+define Build/buffalo-enc-tag
+   $(call Build/buffalo-enc,'' '' -S 152 $(1))
+endef
+
+define Build/buffalo-tag-dhp
+   $(eval product=$(word 1,$(1)))
+   $(eval region=$(word 2,$(1)))
+   $(eval language=$(word 3,$(1)))
+   $(STAGING_DIR_HOST)/bin/buffalo-tag \
+   -d 0x0100 -w 1 \
+   -a $(BUFFALO_TAG_PLATFORM) \
+   -v $(BUFFALO_TAG_VERSION) -m $(BUFFALO_TAG_MINOR) \
+   -b $(product) -p $(product) \
+   -r $(region) -r $(region) -l $(language) \
+   -I $@ -o $@.new
+   mv $@.new $@
+endef
+
+define Build/buffalo-dhp-image
+   $(STAGING_DIR_HOST)/bin/mkdhpimg $@ $@.new
+   mv $@.new $@
+endef
+
 define Build/netgear-chk
$(STAGING_DIR_HOST)/bin/mkchkimg \
-o $@.new \
diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index 69cba69..2504678 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -80,6 +80,7 @@ define Host/Compile
$(call cc,jcgimage, -lz -Wall)
$(call cc,mkbuffaloimg, -Wall)
$(call cc,zyimage, -Wall)
+   $(call cc,mkdhpimg buffalo-lib, -Wall)
 endef
 
 define Host/Install
diff --git a/tools/firmware-utils/src/buffalo-enc.c 
b/tools/firmware-utils/src/buffalo-enc.c
index 794659e..08fad4e 100644
--- a/tools/firmware-utils/src/buffalo-enc.c
+++ b/tools/firmware-utils/src/buffalo-enc.c
@@ -35,6 +35,7 @@ static char *product;
 static char *version;
 static int do_decrypt;
 static int offset;
+static int size;
 
 void usage(int status)
 {
@@ -54,6 +55,7 @@ void usage(int status)
 "  -v set version to \n"
 "  -h  show this screen\n"
 "  -O  Offset of encrypted data in file (decryption)\n"
+"  -S  Size of unencrypted data in file (encryption)\n"
);
 
exit(status);
@@ -118,7 +120,7 @@ out:
 static int encrypt_file(void)
 {
struct enc_param ep;
-   ssize_t src_len;
+   ssize_t src_len, tail_dst, tail_len, tail_src;
unsigned char *buf;
uint32_t hdrlen;
ssize_t totlen = 0;
@@ -131,8 +133,12 @@ static int encrypt_file(void)
goto out;
}
 
-   totlen = enc_compute_buf_len(product, version, src_len);
-   hdrlen = enc_compute_header_len(product, version);
+   if (size) {
+   tail_dst = enc_compute_buf_len(product, version, size);
+   tail_len = src_len - size;
+   totlen = tail_dst + tail_len;
+   } else
+   totlen = enc_compute_buf_len(product, version, src_len);
 
buf = malloc(totlen);
if (buf == NULL) {
@@ -140,12 +146,21 @@ static int encrypt_file(void)
goto out;
}
 
+   hdrlen = enc_compute_header_len(product, version);
+
err = read_file_to_buf(ifname, &buf[hdrlen], src_len);
if (err) {
ERR("unable to read from file '%s'", ofname);
goto free_buf;
}
 
+   if (size) {
+   tail_src = hdrlen + size;
+   memmove(&buf[tail_dst], &buf[tail_src], tail_len);
+   memset(&buf[tail_src], 0, tail_dst - tail_src);
+   src_len = size;
+   }
+
memset(&ep, '\0', sizeof(ep));
ep.key = (unsigned char *) crypt_key;
ep.seed = seed;
@@ -241,7 +256,7 @@ int main(int argc, char *argv[])
while ( 1 ) {
int c;
 
-   c = getopt(argc, argv, "adi:m:o:hlp:v:k:O:r:s:");
+   c = getopt(argc, argv, "adi:m:o:hlp:v:k:O:r:s:S:");
if (c == -1)
   

[LEDE-DEV] [PATCH v4 2/3] bcm53xx: build factory images for WZR-900DHP series

2017-01-28 Thread FUKAUMI Naoki
only factory images for DHP-EU and DHP2-JP (fw ver. 2.x) are built.

this will not work for DHP-JP/AP/TW (fw ver. 1.x) because they use
different buffalo_csum() formula.

Signed-off-by: FUKAUMI Naoki 
---
Changes in v4:
- no change

Changes in v3:
- renumbered, no change

Changes in v2:
- refresh everything to make rules simple

 target/linux/bcm53xx/image/Makefile | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/target/linux/bcm53xx/image/Makefile 
b/target/linux/bcm53xx/image/Makefile
index e7a628b..75d1644 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -38,6 +38,17 @@ define Build/bcm53xx-tplink-safeloader
rm $@.trx
 endef
 
+define Build/buffalo-wzr-header
+   $(eval product=$(word 1,$(1)))
+   $(eval region=$(word 2,$(1)))
+   ( \
+   echo 
$(product)_$(BUFFALO_TAG_VERSION)_$(BUFFALO_TAG_MINOR)_$(region)_$(BUFFALO_TAG_PLATFORM);
 \
+   echo filelen=$$(stat -c%s $@); \
+   cat $@ \
+   ) > $@.new
+   mv $@.new $@
+endef
+
 define Build/trx-serial
$(STAGING_DIR_HOST)/bin/trx \
-o $@.new \
@@ -85,6 +96,7 @@ define Build/seama-nand
 endef
 
 DEVICE_VARS += PRODUCTID SIGNATURE NETGEAR_BOARD_ID NETGEAR_REGION TPLINK_BOARD
+DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR
 
 BRCMFMAC_43602A1 := kmod-brcmfmac brcmfmac-firmware-43602a1-pcie
 BRCMFMAC_4366B1 := kmod-brcmfmac brcmfmac-firmware-4366b1-pcie
@@ -149,6 +161,20 @@ endef
 TARGET_DEVICES += buffalo-wzr-600dhp2
 
 define Device/buffalo-wzr-900dhp
+  BUFFALO_TAG_PLATFORM := bcm
+  BUFFALO_TAG_VERSION := 9.99
+  BUFFALO_TAG_MINOR := 9.99
+  IMAGES += factory-DHP-EU.bin factory-DHP2-JP.bin
+  IMAGE/factory-DHP-EU.bin := \
+   append-ubi | trx-nand | buffalo-wzr-header WZR-900DHP EU | \
+   buffalo-enc WZR-900DHP $$(BUFFALO_TAG_VERSION) | \
+   buffalo-tag-dhp WZR-900DHP EU mlang20 | buffalo-enc-tag | \
+   buffalo-dhp-image
+  IMAGE/factory-DHP2-JP.bin := \
+   append-ubi | trx-nand | buffalo-wzr-header WZR-900DHP2 JP | \
+   buffalo-enc WZR-900DHP2 $$(BUFFALO_TAG_VERSION) | \
+   buffalo-tag-dhp WZR-900DHP2 JP jp | buffalo-enc-tag | \
+   buffalo-dhp-image
   DEVICE_TITLE := Buffalo WZR-900DHP
   DEVICE_PACKAGES := kmod-b43 $(USB3_PACKAGES)
 endef
-- 
2.7.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v4 3/3] ramips: add support for Buffalo WCR-1166DS

2017-01-28 Thread FUKAUMI Naoki
Buffalo WCR-1166DS is a small wireless router with

 - MT7628AN + MT7612E
 - 64MiB DDR2 SDRAM
 - 16MiB SPI flash
 - 2T2R 11ac/a/b/g/n Wi-Fi
 - 2x 10/100M ethernet switch
 - 8x programmable LED
 - 3x button
 - UART pad on PCB (J2: 3.3V, GND, TX, RX)

factory image can be installed via stock web UI.

due to the "dual image" function in the bootloader, the second half of
the SPI flash ("firmware2" partition) cannot be used as a part of the
file system.

Signed-off-by: FUKAUMI Naoki 
---
Changes in v4:
- rebase and resolve conflict

Changes in v3:
- added

 .../linux/ramips/base-files/etc/board.d/02_network |  15 +-
 target/linux/ramips/base-files/etc/diag.sh |  11 +-
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   9 +-
 target/linux/ramips/dts/WCR-1166DS.dts | 172 +
 target/linux/ramips/image/Makefile |   3 +-
 target/linux/ramips/image/mt7628.mk|  16 ++
 target/linux/ramips/mt7628/config-4.4  |   1 +
 ...r-custom-trx-magic-for-Buffalo-WCR-1166DS.patch |  30 
 9 files changed, 245 insertions(+), 15 deletions(-)
 create mode 100644 target/linux/ramips/dts/WCR-1166DS.dts
 create mode 100644 
target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index b27954f..282624f 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -264,6 +264,10 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
;;
+   wcr-1166ds)
+   ucidef_add_switch "switch0" \
+   "3:lan" "4:wan" "6@eth0"
+   ;;
wcr-150gn)
ucidef_add_switch "switch0" \
"0:lan" "6t@eth0"
@@ -411,6 +415,12 @@ ramips_setup_macs()
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 5)
;;
+   wcr-1166ds|\
+   wsr-1166)
+   local index="$(find_mtd_index "board_data")"
+   wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
+   lan_mac=$wan_mac
+   ;;
wcr-150gn)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
@@ -428,11 +438,6 @@ ramips_setup_macs()
wlr-6000)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
;;
-   wsr-1166)
-   local index="$(find_mtd_index "board_data")"
-   wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
-   lan_mac=$wan_mac
-   ;;
*)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 84031d1..f6bae00 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -220,6 +220,12 @@ get_status_led() {
zbt-wr8305rt)
status_led="$board:green:sys"
;;
+   wcr-1166ds|\
+   whr-300hp2|\
+   wsr-1166|\
+   wsr-600)
+   status_led="$board:green:power"
+   ;;
wcr-150gn|\
wl-351)
status_led="$board:amber:power"
@@ -234,11 +240,6 @@ get_status_led() {
wizfi630a)
status_led="$board::run"
;;
-   whr-300hp2|\
-   wsr-1166|\
-   wsr-600)
-   status_led="$board:green:power"
-   ;;
wrtnode2r | \
wrtnode2p | \
wrtnode)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 5ab46de..71b31f6 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -502,6 +502,9 @@ ramips_board_detect() {
*"W502U")
name="w502u"
;;
+   *"WCR-1166DS")
+   name="wcr-1166ds"
+   ;;
*"WCR-150GN")
name="wcr-150gn"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 05d2759..a43d370 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -227,6 +227,11 @@ platform_check_image() {
}
return 0
;;
+   ubnt-erx)
+   nand_do_platform_check "$board" "$1"
+   return $?;
+   ;;
+   wcr-1166ds|\
wsr-1166)

Re: [LEDE-DEV] [PATCH] ar71xx: prepare jffs2 partition properly in factory.bin for BHR-4GRV2

2017-01-28 Thread Naoki FUKAUMI
can someone handle this for 17.01?

On Fri, Dec 9, 2016 at 5:53 PM, FUKAUMI Naoki  wrote:
> "pad-rootfs" is required just after "append-rootfs".
>
> Signed-off-by: FUKAUMI Naoki 
> ---
>  target/linux/ar71xx/image/generic.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/linux/ar71xx/image/generic.mk 
> b/target/linux/ar71xx/image/generic.mk
> index 6ceabeb..b1d9af9 100644
> --- a/target/linux/ar71xx/image/generic.mk
> +++ b/target/linux/ar71xx/image/generic.mk
> @@ -704,6 +704,6 @@ define Device/bhr-4grv2
>MTDPARTS := 
> spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x5(firmware)
>IMAGES := sysupgrade.bin factory.bin
>IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 
> (ROOTFS_SIZE) | append-kernel | check-size (IMAGE_SIZE)
> -  IMAGE/factory.bin = append-kernel | pad-to (KERNEL_SIZE) | 
> append-rootfs | mkbuffaloimg
> +  IMAGE/factory.bin = append-kernel | pad-to (KERNEL_SIZE) | 
> append-rootfs | pad-rootfs | mkbuffaloimg
>  endef
>  TARGET_DEVICES += bhr-4grv2
> --
> 2.7.4
>

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] lantiq: fix unaligned access in xrx200_poll_rx()

2017-01-28 Thread Alexander Couzens
Signed-off-by: Alexander Couzens 
---
 .../lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch 
b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
index 4e60f30302..acaadba984 100644
--- a/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
+++ b/target/linux/lantiq/patches-4.4/0025-NET-MIPS-lantiq-adds-xrx200-net.patch
@@ -1190,8 +1190,8 @@ Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
 +  if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) == LTQ_DMA_C) {
 +#ifdef SW_ROUTING
 +  struct sk_buff *skb = ch->skb[ch->dma.desc];
-+  u32 *special_tag = (u32*)skb->data;
-+  int port = (special_tag[1] >> SPPID_SHIFT) & SPPID_MASK;
++  u8 *special_tag = (u8*)skb->data;
++  int port = (special_tag[7] >> SPPID_SHIFT) & SPPID_MASK;
 +  xrx200_hw_receive(ch, priv->hw->port_map[port]);
 +#else
 +  xrx200_hw_receive(ch, 0);
-- 
2.11.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] netifd: "bridge: disable IGMP snooping by default"

2017-01-28 Thread Felix Fietkau
On 2017-01-26 21:38, Linus Lüssing wrote:
> Hi Felix, thanks and I really appreciate your efforts to create a
> successful, stable and first LEDE release :). So if it's going to
> be disabled in that first LEDE release, that'd be fine by me.
> 
> Nevertheless, Jow or Felix, could you forward the tickets which
> seemed related to bridge multicast snooping to me? So I can check
> whether it should be disabled in Gluon, too. (we took some
> precautions with a robustness variable of 3 instead of 2 and way
> lower querier intervals in Gluon, but not sure what kind of issues
> were reported for LEDE)
Hi Linus,

here's a ticket that just confirms issues with the IGMP snooping patch:
https://bugs.lede-project.org/index.php?do=details&task_id=253#comment1477

Please follow up with the bug reporters there and let me know if you
need any help.

Thanks,

- Felix

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] openvpn: add support for various new 2.4 configuration options

2017-01-28 Thread Felix Fietkau
On 2017-01-28 10:30, Magnus Kroken wrote:
> Hi
> 
> On 16.01.2017 22.56, Magnus Kroken wrote:
>> Updates to openvpn.init were included in early OpenVPN 2.4 patch
>> series, but got lost along the way and were never merged.
>>
>> Signed-off-by: Magnus Kroken 
>> ---
>>  .../network/services/openvpn/files/openvpn.init| 43 
>> ++
>>  1 file changed, 19 insertions(+), 24 deletions(-)
> 
> Is it possible to apply this to 17.01 branch as well? If not, 17.01 will 
> ship with OpenVPN 2.4.0, but several new options will be unavailable 
> when using UCI to configure OpenVPN.
Done.

- Felix


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ar71xx: prepare jffs2 partition properly in factory.bin for BHR-4GRV2

2017-01-28 Thread Felix Fietkau
On 2017-01-28 17:08, Naoki FUKAUMI wrote:
> can someone handle this for 17.01?
Done.

- Felix


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Finding Release snapshots/URLs for the "Release"

2017-01-28 Thread Rich Brown
Hi Jo,

Thanks for all this information. I'll propagate it to the forum, since many 
people are asking.

> On Jan 28, 2017, at 9:35 AM, Jo-Philipp Wich  wrote:
> 
> Hi Rich,
> 
>> 1) When I got to downloads.lede-project.org, I see the following
>> directory structure: [...] I do NOT see any targets under the
>> /releases directory. Why?
> 
> I intentionally hid the "17.01-SNAPSHOTS" directory because it is not a
> fixed (as in non-moving) build, it merely reflects the build output of
> the current branch HEAD.
> 
>> 2) Why doesn't the /releases directory mirror the /snapshots
>> directory?
> 
> Because releases are structured slightly differently.

I understand now.

>> 3) I have discovered that the release images are available
>> /releases/17.01-SNAPSHOT/  Is this what we should document?
> 
> No, please do not document that particular directory, see below.

OK. I have a recommendation re: naming & directories. 

Perhaps we should create /releases/17.01.0-rc1/ now. Its sole contents (today) 
could be a README text file with text like this:

= /releases/17.01.0-rc1/README.txt =
2017-01-dd

There are no LEDE 17.01.0-rc1 build images at this time. 

However, we are building snapshots for testing in preparation for the 
17.01.0-rc1 build. 
Those snapshots are saved in the hidden /releases/17.01-SNAPSHOT/ directory.

Once we create the LEDE 17.01.0-rc1 build, this directory will contain its 
image files and packages.
=
 
Once the 17.01.0-rc1 files have been created, the README.txt file could be 
updated to say:

= /releases/17.01.0-rc1/README.txt =

2017-01-dd

The files in this directory are the LEDE 17.01.0-rc1 snapshots.
They are release candidates for the LEDE 17.01.0 build, and will never be 
updated.

However, we are building snapshots for testing in preparation for the 
17.01.0-rc2 build. 
Those snapshots are saved in the hidden directory /releases/17.01-SNAPSHOT/
=

>> 4) It's really confusing to talk about (and document) the release
>> candidates and the daily "trunk" builds. Currently, image file names
>> for stable build candidates contain the word "snapshot", while trunk
>> builds (in the /snapshots directory) do not:
> 
> Those images are not stable build candidates but merely release branch
> snapshots, thats why they contain the word "snapshot" and also why
> they're currently hidden from the toplevel directory.
> 
> I instructed the buildbot to produce tagged rc1 builds today, those will
> be true, fixed release candidate images which do not move.

How soon do you expect the /releases/17.01.0-rc1/ images to be available?

> Once built, those images will appear in /releases/17.01.0-rc1/ and
> remain unchanged. In addition to that, there will be a corresponding
> "v17.01.0-rc1" tag in the repository which can be used to reproduce this
> particular images.
> 
> The /releases/17.01.[0-9]* directories (once existing) which are not
> hidden are the ones that should be documented and referred to as fixed
> builds.
> 
>> 5) What is the naming scheme for the final 17.01 image URLs?
> 
> The RCs will be:
> 
> /releases/17.01.0-rc[0-9]*/targets/$target/$subtarget/lede-17.01.0-rc[0-9]*-r-XXX-$target-$subtarget-*.bin
> 
> The finals will be:
> 
> /releases/17.01.0/targets/$target/$subtarget/lede-17.01.0-r-XXX-$target-$subtarget-*.bin
> 
>> 6) When we release a new version (say, 17.06), what will those URLs
>> be?
> 
> The RCs will be:
> 
> /releases/17.06.0-rc[0-9]*/targets/$target/$subtarget/lede-17.06.0-rc[0-9]*-r-XXX-$target-$subtarget-*.bin
> 
> The finals will be:
> 
> /releases/17.06.0/targets/$target/$subtarget/lede-17.06.0-r-XXX-$target-$subtarget-*.bin

This is a good, and easily understood/described plan. Thanks!

Rich

>> We'll adjust the documentation to match the results of this
>> discussion. Thanks.
> 
> I appreciate your efforts on this, thank you :)
> 
> ~ Jo
> 
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] LEDE-17.01 Final Release Notes available

2017-01-28 Thread Rich Brown
Hi Jaap,

> On Jan 28, 2017, at 6:36 AM, Jaap Buurman  wrote:
> 
> Great job on the release notes! One minor thing that I think looks
> nicer would be the removal of "nothing specific" after "improved
> performance", since it adds no additional information. But that's just
> me.

Thanks for the kind words. I left "nothing specific" there as an attempt to 
lure people into writing something. :-) I would expect to remove that text for 
the final version.

Note to other readers: I have not been following all the LEDE enhancements 
carefully. Please do check the Release Notes to make sure that your hard work 
has been represented fairly. Check out: 
https://lede-project.org/playground/draft-release-notes

> Also about the following: "Improvements to the WiFi stack eliminating
> bufferbloat on ath9k (and some ath10k) chipsets"
> 
> Is this about the Airtime Fairness Patch? AFAIK this is only for ath9k
> and not for ath10k? Or am I mixing things up here?

I am not sure. I was hoping someone who has been following this more closely 
would weigh in.

> While're talking about 17.01 anyway when are the first RCs coming out btw? :)

jow just clarified the situation for the naming of directories and image files. 
In that note, he also said that just switched the buildbot to produce tagged 
rc1 builds, so I imagine they will come out soon.

> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] kmodloader: fix out-of-order module loading

2017-01-28 Thread Christian Lamparter via Lede-dev
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.--- Begin Message ---
Currently, kmodloader is trying to load all modules during
boot. This is because all the modules (and not just those
which start with a number) are set to probe.

Signed-off-by: Christian Lamparter 
---
The load_modprobe() seems to be necessary, since I've also hit
a hang with 4.9 caused by nf_nat_ipv6.ko. This is because it
calls request_module for nf_conntrack_ipv6. So the order in
the /etc/modprobe.d/ files is still important.

I have the following options enabled:

CONFIG_PACKAGE_kmod-ip6tables-extra=y
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
CONFIG_PACKAGE_kmod-ipt-ipsec=y
CONFIG_PACKAGE_kmod-ipt-nat-extra=y
CONFIG_PACKAGE_kmod-ipt-nat6=y

I fixed this by adding nf_conntrack_ipv6 to NF_CONNTRACK6
in modules/netfilter.mk. No idea if this is also a problem
on 4.4 or not.
---
 kmodloader.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kmodloader.c b/kmodloader.c
index 729027a..bf8c36c 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -933,10 +933,11 @@ static int main_loader(int argc, char **argv)
 
if (opts)
m->opts = strdup(opts);
-   m->state = PROBE;
-   if (basename(gl.gl_pathv[j])[0] - '0' <= 9)
-   load_modprobe();
 
+   if (basename(gl.gl_pathv[j])[0] - '0' <= 9) {
+   m->state = PROBE;
+   load_modprobe();
+   }
}
free(mod);
fclose(fp);
-- 
2.11.0


--- End Message ---
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] libubox: Fix -Wsign-compare and sign conversion warnings

2017-01-28 Thread Rosen Penev
While at it, also add -Wextra and -Wno-unused-parameter to the
CFLAGS. Compile tested on 32 and 64-bit x86.

Signed-off by: Rosen Penev 
---
 CMakeLists.txt |  3 +--
 base64.c   |  6 +++---
 blob.c | 12 ++--
 blob.h |  8 
 blobmsg.c  |  2 +-
 kvlist.c   |  2 +-
 usock.c|  6 +++---
 7 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57804cf..44032df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,8 +3,7 @@ INCLUDE(CheckLibraryExists)
 INCLUDE(CheckFunctionExists)
 
 PROJECT(ubox C)
-ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
-
+ADD_DEFINITIONS(-Os -Wall -Wextra -Werror --std=gnu99 -g3 
-Wmissing-declarations -Wno-unused-parameter)
 OPTION(BUILD_LUA "build Lua plugin" ON)
 OPTION(BUILD_EXAMPLES "build examples" ON)
 
diff --git a/base64.c b/base64.c
index 4186ce8..f4cb5c6 100644
--- a/base64.c
+++ b/base64.c
@@ -142,7 +142,6 @@ int b64_encode(const void *_src, size_t srclength,
size_t datalength = 0;
u_char input[3] = {0};
u_char output[4];
-   int i;
 
while (2 < srclength) {
input[0] = *src++;
@@ -167,7 +166,7 @@ int b64_encode(const void *_src, size_t srclength,
if (0 != srclength) {
/* Get what's left. */
input[0] = input[1] = input[2] = '\0';
-   for (i = 0; i < srclength; i++)
+   for (size_t i = 0; i < srclength; i++)
input[i] = *src++;
 
output[0] = input[0] >> 2;
@@ -200,7 +199,8 @@ int b64_decode(const void *_src, void *dest, size_t 
targsize)
 {
const char *src = _src;
unsigned char *target = dest;
-   int tarindex, state, ch;
+   int state, ch;
+   size_t tarindex;
u_char nextbyte;
char *pos;
 
diff --git a/blob.c b/blob.c
index 03d5e9c..45c3204 100644
--- a/blob.c
+++ b/blob.c
@@ -186,7 +186,7 @@ blob_nest_end(struct blob_buf *buf, void *cookie)
buf->head = attr;
 }
 
-static const int blob_type_minlen[BLOB_ATTR_LAST] = {
+static const size_t blob_type_minlen[BLOB_ATTR_LAST] = {
[BLOB_ATTR_STRING] = 1,
[BLOB_ATTR_INT8] = sizeof(uint8_t),
[BLOB_ATTR_INT16] = sizeof(uint16_t),
@@ -222,18 +222,18 @@ blob_parse(struct blob_attr *attr, struct blob_attr 
**data, const struct blob_at
 {
struct blob_attr *pos;
int found = 0;
-   int rem;
+   unsigned int rem;
 
memset(data, 0, sizeof(struct blob_attr *) * max);
blob_for_each_attr(pos, attr, rem) {
-   int id = blob_id(pos);
-   int len = blob_len(pos);
+   unsigned int id = blob_id(pos);
+   unsigned int len = blob_len(pos);
 
-   if (id >= max)
+   if ((int)id >= max)
continue;
 
if (info) {
-   int type = info[id].type;
+   unsigned int type = info[id].type;
 
if (type < BLOB_ATTR_LAST) {
if (!blob_check_type(blob_data(pos), len, type))
diff --git a/blob.h b/blob.h
index a092f5d..3f069da 100644
--- a/blob.h
+++ b/blob.h
@@ -154,25 +154,25 @@ blob_get_u64(const struct blob_attr *attr)
 static inline int8_t
 blob_get_int8(const struct blob_attr *attr)
 {
-   return blob_get_u8(attr);
+   return (int8_t)blob_get_u8(attr);
 }
 
 static inline int16_t
 blob_get_int16(const struct blob_attr *attr)
 {
-   return blob_get_u16(attr);
+   return (int16_t)blob_get_u16(attr);
 }
 
 static inline int32_t
 blob_get_int32(const struct blob_attr *attr)
 {
-   return blob_get_u32(attr);
+   return (int32_t)blob_get_u32(attr);
 }
 
 static inline int64_t
 blob_get_int64(const struct blob_attr *attr)
 {
-   return blob_get_u64(attr);
+   return (int64_t)blob_get_u64(attr);
 }
 
 static inline const char *
diff --git a/blobmsg.c b/blobmsg.c
index c2bb717..1eddf23 100644
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -67,7 +67,7 @@ int blobmsg_check_array(const struct blob_attr *attr, int 
type)
 {
struct blob_attr *cur;
bool name;
-   int rem;
+   unsigned int rem;
int size = 0;
 
switch (blobmsg_type(attr)) {
diff --git a/kvlist.c b/kvlist.c
index a7b6ea0..66fc8cd 100644
--- a/kvlist.c
+++ b/kvlist.c
@@ -75,7 +75,7 @@ bool kvlist_set(struct kvlist *kv, const char *name, const 
void *data)
 {
struct kvlist_node *node;
char *name_buf;
-   int len = kv->get_len(kv, data);
+   size_t len = kv->get_len(kv, data);
 
node = calloc_a(sizeof(struct kvlist_node) + len,
&name_buf, strlen(name) + 1);
diff --git a/usock.c b/usock.c
index 0ce5390..c159a76 100644
--- a/usock.c
+++ b/usock.c
@@ -33,7 +33,7 @@
 #include "usock.h"
 #include "utils.h"
 
-static void usock_set_flags(int sock, unsigned int type)
+static void usock_set_flags(int sock, int type)
 {
if 

[LEDE-DEV] [PATCH] libubox: Fix -Wsign-compare and sign conversion warnings

2017-01-28 Thread Rosen Penev
While at it, also add -Wextra and -Wno-unused-parameter to the
CFLAGS. Compile tested on 32 and 64-bit x86.

Signed-off by: Rosen Penev 
---
 CMakeLists.txt |  3 +--
 base64.c   |  6 +++---
 blob.c | 12 ++--
 blob.h |  8 
 blobmsg.c  |  2 +-
 blobmsg_json.c |  4 ++--
 json_script.c  | 17 +
 kvlist.c   |  2 +-
 usock.c|  6 +++---
 9 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57804cf..44032df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,8 +3,7 @@ INCLUDE(CheckLibraryExists)
 INCLUDE(CheckFunctionExists)
 
 PROJECT(ubox C)
-ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
-
+ADD_DEFINITIONS(-Os -Wall -Wextra -Werror --std=gnu99 -g3 
-Wmissing-declarations -Wno-unused-parameter)
 OPTION(BUILD_LUA "build Lua plugin" ON)
 OPTION(BUILD_EXAMPLES "build examples" ON)
 
diff --git a/base64.c b/base64.c
index 4186ce8..f4cb5c6 100644
--- a/base64.c
+++ b/base64.c
@@ -142,7 +142,6 @@ int b64_encode(const void *_src, size_t srclength,
size_t datalength = 0;
u_char input[3] = {0};
u_char output[4];
-   int i;
 
while (2 < srclength) {
input[0] = *src++;
@@ -167,7 +166,7 @@ int b64_encode(const void *_src, size_t srclength,
if (0 != srclength) {
/* Get what's left. */
input[0] = input[1] = input[2] = '\0';
-   for (i = 0; i < srclength; i++)
+   for (size_t i = 0; i < srclength; i++)
input[i] = *src++;
 
output[0] = input[0] >> 2;
@@ -200,7 +199,8 @@ int b64_decode(const void *_src, void *dest, size_t 
targsize)
 {
const char *src = _src;
unsigned char *target = dest;
-   int tarindex, state, ch;
+   int state, ch;
+   size_t tarindex;
u_char nextbyte;
char *pos;
 
diff --git a/blob.c b/blob.c
index 03d5e9c..45c3204 100644
--- a/blob.c
+++ b/blob.c
@@ -186,7 +186,7 @@ blob_nest_end(struct blob_buf *buf, void *cookie)
buf->head = attr;
 }
 
-static const int blob_type_minlen[BLOB_ATTR_LAST] = {
+static const size_t blob_type_minlen[BLOB_ATTR_LAST] = {
[BLOB_ATTR_STRING] = 1,
[BLOB_ATTR_INT8] = sizeof(uint8_t),
[BLOB_ATTR_INT16] = sizeof(uint16_t),
@@ -222,18 +222,18 @@ blob_parse(struct blob_attr *attr, struct blob_attr 
**data, const struct blob_at
 {
struct blob_attr *pos;
int found = 0;
-   int rem;
+   unsigned int rem;
 
memset(data, 0, sizeof(struct blob_attr *) * max);
blob_for_each_attr(pos, attr, rem) {
-   int id = blob_id(pos);
-   int len = blob_len(pos);
+   unsigned int id = blob_id(pos);
+   unsigned int len = blob_len(pos);
 
-   if (id >= max)
+   if ((int)id >= max)
continue;
 
if (info) {
-   int type = info[id].type;
+   unsigned int type = info[id].type;
 
if (type < BLOB_ATTR_LAST) {
if (!blob_check_type(blob_data(pos), len, type))
diff --git a/blob.h b/blob.h
index a092f5d..3f069da 100644
--- a/blob.h
+++ b/blob.h
@@ -154,25 +154,25 @@ blob_get_u64(const struct blob_attr *attr)
 static inline int8_t
 blob_get_int8(const struct blob_attr *attr)
 {
-   return blob_get_u8(attr);
+   return (int8_t)blob_get_u8(attr);
 }
 
 static inline int16_t
 blob_get_int16(const struct blob_attr *attr)
 {
-   return blob_get_u16(attr);
+   return (int16_t)blob_get_u16(attr);
 }
 
 static inline int32_t
 blob_get_int32(const struct blob_attr *attr)
 {
-   return blob_get_u32(attr);
+   return (int32_t)blob_get_u32(attr);
 }
 
 static inline int64_t
 blob_get_int64(const struct blob_attr *attr)
 {
-   return blob_get_u64(attr);
+   return (int64_t)blob_get_u64(attr);
 }
 
 static inline const char *
diff --git a/blobmsg.c b/blobmsg.c
index c2bb717..1eddf23 100644
--- a/blobmsg.c
+++ b/blobmsg.c
@@ -67,7 +67,7 @@ int blobmsg_check_array(const struct blob_attr *attr, int 
type)
 {
struct blob_attr *cur;
bool name;
-   int rem;
+   unsigned int rem;
int size = 0;
 
switch (blobmsg_type(attr)) {
diff --git a/blobmsg_json.c b/blobmsg_json.c
index ca9dd1a..c46890c 100644
--- a/blobmsg_json.c
+++ b/blobmsg_json.c
@@ -146,7 +146,7 @@ static bool blobmsg_puts(struct strbuf *s, const char *c, 
int len)
 static void add_separator(struct strbuf *s)
 {
const char *indent_chars = "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
-   int len;
+   size_t len;
 
if (!s->indent)
return;
@@ -280,7 +280,7 @@ static void blobmsg_format_json_list(struct strbuf *s, 
struct blob_attr *attr, i
 {
struct blob_attr *pos;
bool first = true;
-   int rem = len;
+   unsigned int rem = len;
 
   

Re: [LEDE-DEV] LEDE-17.01 Final Release Notes available

2017-01-28 Thread Weedy
On 28 January 2017 at 15:56, Rich Brown  wrote:
> Hi Jaap,
>
>> On Jan 28, 2017, at 6:36 AM, Jaap Buurman  wrote:
>> Also about the following: "Improvements to the WiFi stack eliminating
>> bufferbloat on ath9k (and some ath10k) chipsets"
>>
>> Is this about the Airtime Fairness Patch? AFAIK this is only for ath9k
>> and not for ath10k? Or am I mixing things up here?
>
> I am not sure. I was hoping someone who has been following this more closely 
> would weigh in.

As far as I know the make-wifi-fast work was done in stages. Something like:
Phase 1: Reducing buffering all over the stack/drivers. Pretty sure
atk10k got some of this
Phase 2: Replace most/all txqueue stuff with fq_codel inside the
driver. I know Toke made patches for ath10k, I don't know if upstream
accepted them
Phase 3: Air time fairness stuff. Only for ath9k, and I don't know if
ath10k can ever get this since the chip firmware is basically a full
operating system and it does whatever it wants too.

NB: I'm just a user, not a dev. But I like WiFi things and try to keep informed.

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev