[OpenWrt-Devel] [PATCH] ca-certificates: update to version 20190110

2019-03-13 Thread Josef Schlehofer
- Tested on Turris MOX, OpenWrt master
- Removed PKG_BUILD_DIR
In build_dir there were two folders
ca-certificates and ca-certificates-20190110 and it failed as files
were in ca-certificates-20190110

Signed-off-by: Josef Schlehofer 
---
 package/system/ca-certificates/Makefile | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/package/system/ca-certificates/Makefile 
b/package/system/ca-certificates/Makefile
index e1c6d41ba1..f449645c77 100644
--- a/package/system/ca-certificates/Makefile
+++ b/package/system/ca-certificates/Makefile
@@ -7,14 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ca-certificates
-PKG_VERSION:=20180409
-PKG_RELEASE:=3
+PKG_VERSION:=20190110
+PKG_RELEASE:=1
 PKG_MAINTAINER:=
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates
-PKG_HASH:=7af6f5bfc619fd29cbf0258c1d95107c38ce840ad6274e343e1e0d971fc72b51
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+PKG_HASH:=ee4bf0f4c6398005f5b5ca4e0b87b82837ac5c3b0280a1cb3a63c47555c3a675
 
 PKG_INSTALL:=1
 
-- 
2.19.1


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


[OpenWrt-Devel] [PATCH 3/3] ramips: ethernet: Replace random_ether_addr with eth_hw_addr_random

2019-03-13 Thread Rosen Penev
eth_hw_addr_random additionally sets addr_assign_type to NET_ADDR_RANDOM.

Signed-off-by: Rosen Penev 
---
 .../files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c 
b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 934ed010bc..c53421c36a 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1348,7 +1348,7 @@ static int __init fe_init(struct net_device *dev)
 
/* If the mac address is invalid, use random mac address  */
if (!is_valid_ether_addr(dev->dev_addr)) {
-   random_ether_addr(dev->dev_addr);
+   eth_hw_addr_random(dev);
dev_err(priv->dev, "generated random MAC address %pM\n",
dev->dev_addr);
}
-- 
2.17.1


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


[OpenWrt-Devel] [PATCH 2/3] ramips: ethernet: Fix NAPI weight for non mt7621 devices

2019-03-13 Thread Rosen Penev
My original fix was to make the code do 16 * 4 as 64 is the limit for NAPI
weight. However this also reduces the weight for non mt7621 devices.

Changed the multiplier to 2 instead.

Signed-off-by: Rosen Penev 
---
 .../drivers/net/ethernet/mediatek/mtk_eth_soc.c   | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c 
b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index d110787731..934ed010bc 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1624,11 +1624,11 @@ static int fe_probe(struct platform_device *pdev)
INIT_WORK(>pending_work, fe_pending_work);
u64_stats_init(>hw_stats->syncp);
 
-   napi_weight = 16;
+   napi_weight = 32;
if (priv->flags & FE_FLAG_NAPI_WEIGHT) {
-   napi_weight *= 4;
-   priv->tx_ring.tx_ring_size *= 4;
-   priv->rx_ring.rx_ring_size *= 4;
+   napi_weight *= 2;
+   priv->tx_ring.tx_ring_size *= 2;
+   priv->rx_ring.rx_ring_size *= 2;
}
netif_napi_add(netdev, >rx_napi, fe_poll, napi_weight);
fe_set_ethtool_ops(netdev);
-- 
2.17.1


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


[OpenWrt-Devel] [PATCH 1/3] ramips: ethernet: Replace alloc_etherdev with devm variant

2019-03-13 Thread Rosen Penev
Allows simplifying the code slightly.

Also get rid of devm_iounmap as it is not necessary.

Tested on GnuBee PC1.

Signed-off-by: Rosen Penev 
---
 .../net/ethernet/mediatek/mtk_eth_soc.c   | 38 ++-
 1 file changed, 11 insertions(+), 27 deletions(-)

diff --git 
a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c 
b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 2e0c8f94ca..d110787731 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1559,16 +1559,13 @@ static int fe_probe(struct platform_device *pdev)
soc->reg_table = fe_reg_table;
 
fe_base = devm_ioremap_resource(>dev, res);
-   if (IS_ERR(fe_base)) {
-   err = -EADDRNOTAVAIL;
-   goto err_out;
-   }
+   if (IS_ERR(fe_base))
+return PTR_ERR(fe_base);
 
-   netdev = alloc_etherdev(sizeof(*priv));
+   netdev = devm_alloc_etherdev(>dev, sizeof(*priv));
if (!netdev) {
-   dev_err(>dev, "alloc_etherdev failed\n");
-   err = -ENOMEM;
-   goto err_iounmap;
+   dev_err(>dev, "devm_alloc_etherdev failed\n");
+   return -ENOMEM;
}
 
SET_NETDEV_DEV(netdev, >dev);
@@ -1578,8 +1575,7 @@ static int fe_probe(struct platform_device *pdev)
netdev->irq = platform_get_irq(pdev, 0);
if (netdev->irq < 0) {
dev_err(>dev, "no IRQ resource found\n");
-   err = -ENXIO;
-   goto err_free_dev;
+   return -ENXIO;
}
 
if (soc->init_data)
@@ -1598,10 +1594,8 @@ static int fe_probe(struct platform_device *pdev)
spin_lock_init(>page_lock);
if (fe_reg_table[FE_REG_FE_COUNTER_BASE]) {
priv->hw_stats = kzalloc(sizeof(*priv->hw_stats), GFP_KERNEL);
-   if (!priv->hw_stats) {
-   err = -ENOMEM;
-   goto err_free_dev;
-   }
+   if (!priv->hw_stats)
+   return -ENOMEM;
spin_lock_init(>hw_stats->stats_lock);
}
 
@@ -1610,15 +1604,13 @@ static int fe_probe(struct platform_device *pdev)
priv->sysclk = clk_get_rate(sysclk);
} else if ((priv->flags & FE_FLAG_CALIBRATE_CLK)) {
dev_err(>dev, "this soc needs a clk for calibration\n");
-   err = -ENXIO;
-   goto err_free_dev;
+   return -ENXIO;
}
 
priv->switch_np = of_parse_phandle(pdev->dev.of_node, 
"mediatek,switch", 0);
if ((priv->flags & FE_FLAG_HAS_SWITCH) && !priv->switch_np) {
dev_err(>dev, "failed to read switch phandle\n");
-   err = -ENODEV;
-   goto err_free_dev;
+   return -ENODEV;
}
 
priv->netdev = netdev;
@@ -1644,7 +1636,7 @@ static int fe_probe(struct platform_device *pdev)
err = register_netdev(netdev);
if (err) {
dev_err(>dev, "error bringing up device\n");
-   goto err_free_dev;
+   return err;
}
 
platform_set_drvdata(pdev, netdev);
@@ -1653,13 +1645,6 @@ static int fe_probe(struct platform_device *pdev)
   netdev->base_addr, netdev->irq);
 
return 0;
-
-err_free_dev:
-   free_netdev(netdev);
-err_iounmap:
-   devm_iounmap(>dev, fe_base);
-err_out:
-   return err;
 }
 
 static int fe_remove(struct platform_device *pdev)
@@ -1673,7 +1658,6 @@ static int fe_remove(struct platform_device *pdev)
cancel_work_sync(>pending_work);
 
unregister_netdev(dev);
-   free_netdev(dev);
platform_set_drvdata(pdev, NULL);
 
return 0;
-- 
2.17.1


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


[OpenWrt-Devel] [PATCH v2] iwinfo: Add support for 802.11ad

2019-03-13 Thread Robert Marko
This patch adds support for identifying, calculating channels from frequency 
and vice versa as well as Lua hwmode for 802.11ad.

Support has been added for channels 1-6.

Changes from v1:
Use strcmp to compare strings.

Signed-off-by: Robert Marko 
---
 include/iwinfo.h |  2 ++
 iwinfo_cli.c |  5 +++--
 iwinfo_lua.c |  3 +++
 iwinfo_nl80211.c | 10 ++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/include/iwinfo.h b/include/iwinfo.h
index 02ad623..9b2ffd1 100644
--- a/include/iwinfo.h
+++ b/include/iwinfo.h
@@ -28,6 +28,7 @@
 #define IWINFO_80211_G   (1 << 2)
 #define IWINFO_80211_N   (1 << 3)
 #define IWINFO_80211_AC  (1 << 4)
+#define IWINFO_80211_AD  (1 << 5)
 
 #define IWINFO_CIPHER_NONE   (1 << 0)
 #define IWINFO_CIPHER_WEP40  (1 << 1)
@@ -54,6 +55,7 @@
 #define IWINFO_FREQ_NO_HT40MINUS   (1 << 3)
 #define IWINFO_FREQ_NO_80MHZ   (1 << 4)
 #define IWINFO_FREQ_NO_160MHZ  (1 << 5)
+#define IWINFO_FREQ_NO_2160MHZ (1 << 6)
 
 extern const char *IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT];
 extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT];
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index 49c9035..6f6c7d1 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -268,12 +268,13 @@ static char * format_hwmodes(int modes)
if (modes <= 0)
snprintf(buf, sizeof(buf), "unknown");
else
-   snprintf(buf, sizeof(buf), "802.11%s%s%s%s%s",
+   snprintf(buf, sizeof(buf), "802.11%s%s%s%s%s%s",
(modes & IWINFO_80211_A) ? "a" : "",
(modes & IWINFO_80211_B) ? "b" : "",
(modes & IWINFO_80211_G) ? "g" : "",
(modes & IWINFO_80211_N) ? "n" : "",
-   (modes & IWINFO_80211_AC) ? "ac" : "");
+   (modes & IWINFO_80211_AC) ? "ac" : "",
+   (modes & IWINFO_80211_AD) ? "ad" : "");
 
return buf;
 }
diff --git a/iwinfo_lua.c b/iwinfo_lua.c
index eebab8e..bb43438 100644
--- a/iwinfo_lua.c
+++ b/iwinfo_lua.c
@@ -518,6 +518,9 @@ static int iwinfo_L_hwmodelist(lua_State *L, int 
(*func)(const char *, int *))
lua_pushboolean(L, hwmodes & IWINFO_80211_AC);
lua_setfield(L, -2, "ac");
 
+   lua_pushboolean(L, hwmodes & IWINFO_80211_AD);
+   lua_setfield(L, -2, "ad");
+
return 1;
}
 
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 5154230..13c69e3 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -568,6 +568,8 @@ static int nl80211_freq2channel(int freq)
return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5;
+   else if(freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6)
+   return (freq - 56160) / 2160;
else
return (freq - 5000) / 5;
 }
@@ -581,6 +583,10 @@ static int nl80211_channel2freq(int channel, const char 
*band)
else if (channel < 14)
return (channel * 5) + 2407;
}
+   else if ( strcmp(band, "ad") == 0)
+   {
+   return 56160 + 2160 * channel;
+   }
else
{
if (channel >= 182 && channel <= 196)
@@ -2800,6 +2806,10 @@ static int nl80211_get_modelist_cb(struct nl_msg *msg, 
void *arg)
}
}
}
+   else if 
(nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]) >= 56160)
+   {
+   m->hw |= IWINFO_80211_AD;
+   }
else if (!(m->hw & IWINFO_80211_AC))
{
m->hw |= IWINFO_80211_A;
-- 
2.20.1


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


Re: [OpenWrt-Devel] [PATCH] ath79: add suport for EnGenius EPG5000

2019-03-13 Thread Tomasz Maciej Nowak
W dniu 06.03.2019 o 21:03, Tomasz Maciej Nowak pisze:
> Hi,
> 
> W dniu 04.03.2019 o 21:54, Petr Štetiar pisze:
>> Tomasz Maciej Nowak  [2019-03-04 15:18:53]:
>>
>>> +   wan {
>>> +   label = "epg5000:blue:wan";
>>> +   gpios = < 22 GPIO_ACTIVE_LOW>;
>>> +   };
>>
>> this LED is marked in ar71xx as `epg5000:amber:wps` any reason for this 
>> change?
> 
> There is no second WPS LED on the device, check the manual 
> https://www.engeniustech.com/resources/EPG5000-user_manual.pdf on page 9. 
> Also the color of it is blue instead of amber. The whole mach file in ar71xx 
> seems to be copy pasta from similar ESR1750 with only name of the device 
> changed throughout the file, and errors replicated. The ESR1750 also doesn't 
> have two WPS LEDs, but I don't know which color it is since I don't own such 
> device.

I was wrong, there is another WPS LED on the PCB, the mach file from ar71xx has 
the correct description. I skimmed to fast with the testing and assumed only 
visible LEDs on the case are valid, therefore assigned them to labels present 
on the case, which was wrong. Sorry for the confusion. Fix sent.

Regards

-- 
TMN

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


[OpenWrt-Devel] [PATCH 3/4] ath79: add leds migration script

2019-03-13 Thread Tomasz Maciej Nowak
With transition from ar71xx to ath79 some of devices change their naming
of LEDs. When upgrading from ar71xx target images this will require the
user to adjust previously working configuration. This commit adds
migration script which can be used to rename old names to new ones.
With this previously working configuration will be automatically
adjusted, wihtout user intervention.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../etc/uci-defaults/04_led_migration | 54 +++
 1 file changed, 54 insertions(+)
 create mode 100644 
target/linux/ath79/base-files/etc/uci-defaults/04_led_migration

diff --git a/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration 
b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
new file mode 100644
index 00..a17702ac10
--- /dev/null
+++ b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+
+LED_OPTIONS_CHANGED=0
+
+. /lib/functions.sh
+
+do_led_update_sysfs()
+{
+   local cfg=$1; shift
+   local tuples="$@"
+   local sysfs
+   local name
+
+   config_get sysfs $cfg sysfs
+   config_get name $cfg name
+
+   [ -z "$sysfs" ] && return
+
+   for tuple in $tuples; do
+   local old=${tuple%=*}
+   local new=${tuple#*=}
+   local new_sysfs
+
+   new_sysfs=$(echo ${sysfs} | sed "s/${old}/${new}/")
+
+   [ "$new_sysfs" = "$sysfs" ] && continue
+
+   uci set system.${cfg}.sysfs="${new_sysfs}"
+   LED_OPTIONS_CHANGED=1
+
+   logger -t led-migration "sysfs option of LED \"${name}\" 
updated to ${new_sysfs}"
+   done;
+}
+
+migrate_leds()
+{
+   config_load system
+   config_foreach do_led_update_sysfs led "$@"
+}
+
+board=$(board_name)
+
+case "$board" in
+*)
+   return 0
+   ;;
+esac
+
+[ "$LED_OPTIONS_CHANGED" = "1" ] && uci commit system
+
+exit 0
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 4/4] ath79: engenius epg5000: add leds migration case

2019-03-13 Thread Tomasz Maciej Nowak
The wireless LEDs names have changed between ar71xx and ath79 targets
from epg5000:blue:wlan2-g and epg5000:blue:wlan-5g to epg5000:blue:wlan2g
and epg5000:blue:wlan5g. Add this case to migration script to
automatically translate those names if defined in system configuration.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../linux/ath79/base-files/etc/uci-defaults/04_led_migration  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration 
b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
index a17702ac10..c73c9daddf 100644
--- a/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
+++ b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
@@ -44,8 +44,8 @@ migrate_leds()
 board=$(board_name)
 
 case "$board" in
-*)
-   return 0
+engenius,epg5000)
+   migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g"
;;
 esac
 
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 1/4] ath79: fix leds description for EnGenius EPG5000

2019-03-13 Thread Tomasz Maciej Nowak
Align the LEDs deffinition with MACH file present in ar71xx target which
has the correct LED functions and colors adescription.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/ath79/dts/qca9558_engenius_epg5000.dts | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts 
b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
index 38cd81a8f8..6179150fdb 100644
--- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
+++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
@@ -30,11 +30,6 @@
default-state = "on";
};
 
-   wan {
-   label = "epg5000:blue:wan";
-   gpios = < 22 GPIO_ACTIVE_LOW>;
-   };
-
wlan2g {
label = "epg5000:blue:wlan2g";
gpios = < 13 GPIO_ACTIVE_LOW>;
@@ -47,7 +42,12 @@
linux,default-trigger = "phy0tpt";
};
 
-   wps {
+   wps_amber {
+   label = "epg5000:amber:wps";
+   gpios = < 22 GPIO_ACTIVE_LOW>;
+   };
+
+   wps_blue {
label = "epg5000:blue:wps";
gpios = < 19 GPIO_ACTIVE_LOW>;
};
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 2/4] ath79: qca955x: add wmac migration hotplug event

2019-03-13 Thread Tomasz Maciej Nowak
When upgrading from ar71xx target images to ath79 based ones, the
integrated wireless interface changes its sysfs path. Therefore the
previous enabled wireless interface will be disabled, which can cause
false complains about it not working. This commit adds hotplug event
which migrates to new path and will keep the wrireless interface
enabled after upgrade.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../etc/hotplug.d/ieee80211/00-wmac-migration | 32 +++
 1 file changed, 32 insertions(+)
 create mode 100644 
target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration

diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration 
b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration
new file mode 100644
index 00..b86db0dbcc
--- /dev/null
+++ b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+WMAC_PATH_CHANGED=0
+
+. /lib/functions.sh
+
+migrate_wmac_path() {
+   local section="$1"
+   local path
+
+   config_get path ${section} path
+   case ${path} in
+   "platform/qca955x_wmac")
+   path="platform/ahb/ahb:apb/1810.wmac"
+   WMAC_PATH_CHANGED=1
+   ;;
+   *)
+   return 0
+   ;;
+   esac
+
+   uci set wireless.${section}.path=${path}
+}
+
+[ "${ACTION}" = "add" ] && {
+   [ ! -e /etc/config/wireless ] && return 0
+
+   config_load wireless
+   config_foreach migrate_wmac_path wifi-device
+
+   [ "${WMAC_PATH_CHANGED}" = "1" ] && uci commit wireless
+}
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH] procd: instance: Support deleting stopped instances

2019-03-13 Thread Kristian Evensen
procd currently does not support deleting a stopped instance. The reason
is that we return in instance_stop(), if pending is set to false. This
patch adds a new function, instance_delete(), which does the necessary
clean-up of an instance. instance_delete() is called before we return in
instance_stop(), as well as when a process that should not be restarted
has exited in instance_exit().

Signed-off-by: Kristian Evensen 
---
 service/instance.c | 23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/service/instance.c b/service/instance.c
index a5742b7..78ac540 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -518,6 +518,16 @@ instance_timeout(struct uloop_timeout *t)
instance_start(in);
 }
 
+static void
+instance_delete(struct service_instance *in)
+{
+   struct service *s = in->srv;
+
+   avl_delete(>instances.avl, >node.avl);
+   instance_free(in);
+   service_stopped(s);
+}
+
 static void
 instance_exit(struct uloop_process *p, int ret)
 {
@@ -539,13 +549,8 @@ instance_exit(struct uloop_process *p, int ret)
instance_removepid(in);
if (in->restart)
instance_start(in);
-   else {
-   struct service *s = in->srv;
-
-   avl_delete(>instances.avl, >node.avl);
-   instance_free(in);
-   service_stopped(s);
-   }
+   else
+   instance_delete(in);
} else if (in->restart) {
instance_start(in);
} else if (in->respawn) {
@@ -569,8 +574,10 @@ instance_exit(struct uloop_process *p, int ret)
 void
 instance_stop(struct service_instance *in, bool halt)
 {
-   if (!in->proc.pending)
+   if (!in->proc.pending) {
+   instance_delete(in);
return;
+   }
in->halt = halt;
in->restart = in->respawn = false;
kill(in->proc.pid, SIGTERM);
-- 
2.19.1


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


[OpenWrt-Devel] [PATCH] iwinfo: Add support for 802.11ad

2019-03-13 Thread Robert Marko
This patch adds support for identifying, calculating channels from frequency 
and vice versa as well as Lua hwmode for 802.11ad.

Support has been added for channels 1-6.

Signed-off-by: Robert Marko 
---
 include/iwinfo.h |  2 ++
 iwinfo_cli.c |  5 +++--
 iwinfo_lua.c |  3 +++
 iwinfo_nl80211.c | 10 ++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/include/iwinfo.h b/include/iwinfo.h
index 02ad623..9b2ffd1 100644
--- a/include/iwinfo.h
+++ b/include/iwinfo.h
@@ -28,6 +28,7 @@
 #define IWINFO_80211_G   (1 << 2)
 #define IWINFO_80211_N   (1 << 3)
 #define IWINFO_80211_AC  (1 << 4)
+#define IWINFO_80211_AD  (1 << 5)
 
 #define IWINFO_CIPHER_NONE   (1 << 0)
 #define IWINFO_CIPHER_WEP40  (1 << 1)
@@ -54,6 +55,7 @@
 #define IWINFO_FREQ_NO_HT40MINUS   (1 << 3)
 #define IWINFO_FREQ_NO_80MHZ   (1 << 4)
 #define IWINFO_FREQ_NO_160MHZ  (1 << 5)
+#define IWINFO_FREQ_NO_2160MHZ (1 << 6)
 
 extern const char *IWINFO_CIPHER_NAMES[IWINFO_CIPHER_COUNT];
 extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT];
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index 49c9035..6f6c7d1 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -268,12 +268,13 @@ static char * format_hwmodes(int modes)
if (modes <= 0)
snprintf(buf, sizeof(buf), "unknown");
else
-   snprintf(buf, sizeof(buf), "802.11%s%s%s%s%s",
+   snprintf(buf, sizeof(buf), "802.11%s%s%s%s%s%s",
(modes & IWINFO_80211_A) ? "a" : "",
(modes & IWINFO_80211_B) ? "b" : "",
(modes & IWINFO_80211_G) ? "g" : "",
(modes & IWINFO_80211_N) ? "n" : "",
-   (modes & IWINFO_80211_AC) ? "ac" : "");
+   (modes & IWINFO_80211_AC) ? "ac" : "",
+   (modes & IWINFO_80211_AD) ? "ad" : "");
 
return buf;
 }
diff --git a/iwinfo_lua.c b/iwinfo_lua.c
index eebab8e..bb43438 100644
--- a/iwinfo_lua.c
+++ b/iwinfo_lua.c
@@ -518,6 +518,9 @@ static int iwinfo_L_hwmodelist(lua_State *L, int 
(*func)(const char *, int *))
lua_pushboolean(L, hwmodes & IWINFO_80211_AC);
lua_setfield(L, -2, "ac");
 
+   lua_pushboolean(L, hwmodes & IWINFO_80211_AD);
+   lua_setfield(L, -2, "ad");
+
return 1;
}
 
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c
index 5154230..ab96f8f 100644
--- a/iwinfo_nl80211.c
+++ b/iwinfo_nl80211.c
@@ -568,6 +568,8 @@ static int nl80211_freq2channel(int freq)
return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5;
+   else if(freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6)
+   return (freq - 56160) / 2160;
else
return (freq - 5000) / 5;
 }
@@ -581,6 +583,10 @@ static int nl80211_channel2freq(int channel, const char 
*band)
else if (channel < 14)
return (channel * 5) + 2407;
}
+   else if ( band = "ad")
+   {
+   return 56160 + 2160 * channel;
+   }
else
{
if (channel >= 182 && channel <= 196)
@@ -2800,6 +2806,10 @@ static int nl80211_get_modelist_cb(struct nl_msg *msg, 
void *arg)
}
}
}
+   else if 
(nla_get_u32(freqs[NL80211_FREQUENCY_ATTR_FREQ]) >= 56160)
+   {
+   m->hw |= IWINFO_80211_AD;
+   }
else if (!(m->hw & IWINFO_80211_AC))
{
m->hw |= IWINFO_80211_A;
-- 
2.20.1


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


[OpenWrt-Devel] [PATCH] netifd: wireless: Add support for 802.11ad

2019-03-13 Thread Robert Marko
This simple patch adds 802.11ad to hwmode list so that netifd-wireless.sh does 
not otherwise overwrite it with the default hwmode=g

Signed-off-by: Robert Marko 
---
 scripts/netifd-wireless.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh
index 991544e..424b3ad 100644
--- a/scripts/netifd-wireless.sh
+++ b/scripts/netifd-wireless.sh
@@ -70,7 +70,7 @@ _wdev_prepare_channel() {
}
 
case "$hwmode" in
-   a|b|g) ;;
+   a|b|g|ad) ;;
*)
if [ "$channel" -gt 14 ]; then
hwmode=a
-- 
2.20.1


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


[OpenWrt-Devel] JFFS2 overlay failed to mount

2019-03-13 Thread Patrick Vorlicek

Maybe someone has a hint for me how this could happen:
[   12.992367] jffs2: notice: (462) jffs2_build_xattr_subsystem: 
complete building xattr subsystem, 4 of xdatum (0 unchecked, 1 orphan) 
and 5 of xref (1 dead, 0 orphan) found.
[   13.008791] block: attempting to load 
/tmp/jffs_cfg/upper/etc/config/fstab

[   13.019944] block: extroot: not configured
[   13.025785] jffs2: Error: unknown compressor "zlib"
[   13.031150] mount_root: failed to mount -t jffs2 /dev/mtdblock6 
/tmp/overlay: Invalid argument
[   13.259080] jffs2: notice: (464) jffs2_build_xattr_subsystem: 
complete building xattr subsystem, 4 of xdatum (0 unchecked, 1 orphan) 
and 5 of xref (1 dead, 0 orphan) found.
[   13.275517] block: attempting to load 
/tmp/jffs_cfg/upper/etc/config/fstab

[   13.286539] block: extroot: not configured
[   13.292087] mount_root: unable to set filesystem state
[   13.297540] mount_root: switching to jffs2 overlay
[   13.302814] mount_root: switching to jffs2 failed - fallback to 
ramoverlay
The first boot is fine, JFFS2 is succesfully created and mounted as 
overlay. On the next boot the JFFS2 can't be mounted again.


It's a build from ten minutes ago for the GL-AR750.

- Patrick Vorlicek

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