[OpenWrt-Devel] [PATCH] ar71xx: add support for GL.iNet GL-X1200

2019-04-10 Thread wellnw
This patch adds supports for GL-X1200.

Specification:
- SOC: QCA9563 (775MHz)
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR2
- Ethernet: 4x 1Gbps LAN + 1x 1Gbps WAN
- Wireless: QCA9563(2.4GHz) and QCA9886(5GHz)
- SIM: 2x SIM card slots
- MicroSD: 1x microSD slot
- Antenna: 2x external 5dBi antennas
- USB: 1x USB 2.0 port
- Button: 1x reset button
- LED: 16x LEDs (3x GPIO controllable)
- UART: 1x UART on PCB (JP1: 3.3V, RX, TX, GND)

Signed-off-by: wellnw 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   4 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   5 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.14|   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-gl-x1200.c   | 153 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/generic/config-default |   1 +
 target/linux/ar71xx/image/generic.mk   |  13 ++
 12 files changed, 198 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-x1200.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 41dd8c5..eb455ce 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -448,6 +448,10 @@ gl-inet)
ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
;;
+gl-x1200)
+   ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+   ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+   ;;
 hiwifi-hc6361)
ucidef_set_led_netdev "inet" "INET" "hiwifi:blue:internet" "eth1"
ucidef_set_led_wlan "wlan" "WLAN" "hiwifi:blue:wlan-2p4" "phy0tpt"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 68874e0..6fd4c25 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -456,6 +456,10 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:2" "3:lan:1" "1:wan"
;;
+   gl-x1200)
+   ucidef_add_switch "switch0" \
+   "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
+   ;;
jwap230)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
ucidef_add_switch "switch0" \
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 2ded261..fd6f213 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -187,6 +187,11 @@ case "$FIRMWARE" in
cf-e385ac)
ath10kcal_extract "art" 20480 12064
;;
+   gl-x1200)
+   ath10kcal_extract "art" 20480 12064
+   ln -sf /lib/firmware/ath10k/pre-cal-pci-\:00\:00.0.bin \
+   /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
+   ;;
esac
;;
 *)
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 990683a..42902d0 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -794,6 +794,9 @@ ar71xx_board_detect() {
*"GL-USB150")
name="gl-usb150"
;;
+   *"GL-X1200")
+   name="gl-x1200"
+   ;;
*"HiveAP-121")
name="hiveap-121"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8173501..55be0a3 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -273,6 +273,7 @@ platform_check_image() {
gl-domino|\
gl-mifi|\
gl-usb150|\
+   gl-x1200|\
hiwifi-hc6361|\
hornet-ub-x2|\
jwap230|\
diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14
index 9a524fa..8f8d8ce 100644
--- a/target/linux/ar71xx/config-4.14
+++ b/target/linux/ar71xx/config-4.14
@@ -130,6 +130,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_GL_INET is not set
 # CONFIG_ATH79_MACH_GL_MIFI is not set
 # CONFIG_ATH79_MACH_GL_USB150 is not set
+# CONFIG_ATH79_MACH_GL_X1200 is not set
 # 

Re: [OpenWrt-Devel] [PATCH] x86: disable kmod-drm-radeon and kmod-drm-amdgpu for geode

2019-04-10 Thread Lucian Cristian

On 09.04.2019 01:28, Tomasz Maciej Nowak wrote:

W dniu 08.04.2019 o 23:56, Lucian Cristian pisze:

On 08.04.2019 20:19, Tomasz Maciej Nowak wrote:

Hi Petr, Alberto,

W dniu 08.04.2019 o 14:34, Alberto Bursi pisze:

On 08/04/19 11:42, Petr Štetiar wrote:

Tomasz Maciej Nowak  [2019-04-07 18:35:01]:

Hi,

thanks for trying to unbreak currently failing Geode builds.


Building images for geode has been failing because of missing
dependencies:
backlight.ko
drm_kms_helper.ko
fb.ko
ttm.ko
Being geode a speciffic hardware, where drm-radeon and drm-amdgpu modules
will probably never be used, disable both.

Fixing the kernel module dependencies is PITA, I know, but this simply doesn't
look like a proper fix to me, rather just like a workaround.

Yes, adding those modules to dependencies would solve the issue, but for how 
long? If AMD people would decide to add another module to dependencies, we 
would need to fix it again and fix something not one would ever use on this 
target, only for the sake of it?

Sorry, I may have sounded harsh and triggered here, that was not my intention. 
I'm fine with either, but please do consider that with other solution that may 
not be the final one for the future.


-- ynezz



It is indeed a workaround, but is it worth to spend time troubleshooting
something that is never going to be used?

I don't see why these modules were built at all. It's pretty hard or even 
impossible
to run any addon graphics card on a Geode system.

At most they have PCI slots, many (the networking alix boards from PCEngines) 
only have mini PCI slots.

drm-amdgpu will 100% never be used as it runs modern PCIe cards.

I don't find any good reason to mount an ancient AMD card over a
PCI slot (or mini pci slot + adapter) as they have their own integrated
graphics with a VGA port already.

-Alberto

Thanks, this is more or less what I had in mind deciding how to approach this, 
and form this POV calling it workaround is debatable. I'll leave patch in this 
form, if anyone wants to take different approach, please do.

Regards


Because I crashed that, if your approach is not accepted I'll add the module 
dependencies, I didn't put them in the generic config because I also thought it 
will only be used on modern hardware

Thanks, please do.


Regards

Lucian

Regards


FYI

https://github.com/openwrt/openwrt/pull/1981


Regards


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


Re: [OpenWrt-Devel] [PATCH] instance: add support for customizable syslog facilities

2019-04-10 Thread Hans Dedecker
On Wed, Apr 10, 2019 at 7:48 PM Michael Heimpold  wrote:
>
> Hi,
>
> Am Mittwoch, 10. April 2019, 15:47:21 CEST schrieb Hans Dedecker:
> > Hi,
> >
> > On Sun, Mar 31, 2019 at 10:11 PM Michael Heimpold  wrote:
> > > This allow using a different (read: user-defined) syslog facility
> > > other than LOG_DAEMON when an instance's stdout/stderr is forwarded
> > > to syslog.
> > > It might be used to handle such messages different, e.g.
> > > filter/forward them etc.
> >
> > Did you also submit a patch which allows to set the syslog facility
> > via procd_set_param as I could not find it ?
>
> no, not yet. After I realized that this patch would modify same lines in
> procd.sh like my other patch for group support, I decided to just wait for
> some feedback first.
> I could also bundle all changes into a combined series, please advice.
I favor a combined series of patches with the syslog facility as the
first series of patches.

Hans
>
> mhei
> >
> > Hans
> >
> > > Signed-off-by: Michael Heimpold 
> > > ---
> > >
> > >  service/instance.c | 34 +-
> > >  service/instance.h |  1 +
> > >  2 files changed, 34 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/service/instance.c b/service/instance.c
> > > index 3b92536..983494b 100644
> > > --- a/service/instance.c
> > > +++ b/service/instance.c
> > > @@ -26,6 +26,8 @@
> > >
> > >  #include 
> > >  #include 
> > >  #include 
> > >
> > > +#define SYSLOG_NAMES
> > > +#include 
> > >
> > >  #include 
> > >
> > > @@ -58,6 +60,7 @@ enum {
> > >
> > > INSTANCE_ATTR_PIDFILE,
> > > INSTANCE_ATTR_RELOADSIG,
> > > INSTANCE_ATTR_TERMTIMEOUT,
> > >
> > > +   INSTANCE_ATTR_FACILITY,
> > >
> > > __INSTANCE_ATTR_MAX
> > >
> > >  };
> > >
> > > @@ -84,6 +87,7 @@ static const struct blobmsg_policy
> > > instance_attr[__INSTANCE_ATTR_MAX] = {>
> > > [INSTANCE_ATTR_PIDFILE] = { "pidfile", BLOBMSG_TYPE_STRING },
> > > [INSTANCE_ATTR_RELOADSIG] = { "reload_signal", BLOBMSG_TYPE_INT32
> > > },
> > > [INSTANCE_ATTR_TERMTIMEOUT] = { "term_timeout", BLOBMSG_TYPE_INT32
> > > },
> > >
> > > +   [INSTANCE_ATTR_FACILITY] = { "facility", BLOBMSG_TYPE_STRING },
> > >
> > >  };
> > >
> > >  enum {
> > >
> > > @@ -150,6 +154,18 @@ static void closefd(int fd)
> > >
> > > close(fd);
> > >
> > >  }
> > >
> > > +/* convert a string into numeric syslog facility or return -1 if no match
> > > found */ +static int
> > > +syslog_facility_str_to_int(const char *facility)
> > > +{
> > > +   CODE *p = facilitynames;
> > > +
> > > +   while (p->c_name && strcasecmp(p->c_name, facility))
> > > +   p++;
> > > +
> > > +   return p->c_val;
> > > +}
> > > +
> > >
> > >  static void
> > >  instance_limits(const char *limit, const char *value)
> > >  {
> > >
> > > @@ -468,7 +484,7 @@ instance_stdio(struct ustream *s, int prio, struct
> > > service_instance *in)>
> > > arg0 = basename(blobmsg_data(blobmsg_data(in->command)));
> > > snprintf(ident, sizeof(ident), "%s[%d]", arg0, in->proc.pid);
> > >
> > > -   ulog_open(ULOG_SYSLOG, LOG_DAEMON, ident);
> > > +   ulog_open(ULOG_SYSLOG, in->syslog_facility, ident);
> > >
> > > do {
> > >
> > > str = ustream_get_read_buf(s, );
> > >
> > > @@ -622,6 +638,9 @@ instance_config_changed(struct service_instance *in,
> > > struct service_instance *in>
> > > if (in->nice != in_new->nice)
> > >
> > > return true;
> > >
> > > +   if (in->syslog_facility != in_new->syslog_facility)
> > > +   return true;
> > > +
> > >
> > > if (string_changed(in->user, in_new->user))
> > >
> > > return true;
> > >
> > > @@ -944,6 +963,17 @@ instance_config_parse(struct service_instance *in)
> > >
> > > if (!instance_fill_array(>errors, tb[INSTANCE_ATTR_ERROR],
> > > NULL, true))
> > >
> > > return false;
> > >
> > > +   if (tb[INSTANCE_ATTR_FACILITY]) {
> > > +   int facility =
> > > syslog_facility_str_to_int(blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY])
> > > ); +   if (facility != -1) {
> > > +   DEBUG(3, "setting facility '%s'\n",
> > > blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY])); +
> > > in->syslog_facility = facility;
> > > +   } else {
> > > +   DEBUG(3, "unknown syslog facility '%s' given,
> > > using default (LOG_DAEMON)\n",
> > > blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY])); +
> > > in->syslog_facility = LOG_DAEMON;
> > > +   }
> > > +   }
> > > +
> > >
> > > return true;
> > >
> > >  }
> > >
> > > @@ -980,6 +1010,7 @@ instance_config_move(struct service_instance *in,
> > > struct service_instance *in_sr>
> > > in->trace = in_src->trace;
> > > in->seccomp = in_src->seccomp;
> > > in->node.avl.key = in_src->node.avl.key;
> > >
> > > +   in->syslog_facility = 

Re: [OpenWrt-Devel] [PATCH] instance: add support for customizable syslog facilities

2019-04-10 Thread Michael Heimpold
Hi,

Am Mittwoch, 10. April 2019, 15:47:21 CEST schrieb Hans Dedecker:
> Hi,
> 
> On Sun, Mar 31, 2019 at 10:11 PM Michael Heimpold  wrote:
> > This allow using a different (read: user-defined) syslog facility
> > other than LOG_DAEMON when an instance's stdout/stderr is forwarded
> > to syslog.
> > It might be used to handle such messages different, e.g.
> > filter/forward them etc.
> 
> Did you also submit a patch which allows to set the syslog facility
> via procd_set_param as I could not find it ?

no, not yet. After I realized that this patch would modify same lines in 
procd.sh like my other patch for group support, I decided to just wait for 
some feedback first.
I could also bundle all changes into a combined series, please advice.

mhei
> 
> Hans
> 
> > Signed-off-by: Michael Heimpold 
> > ---
> > 
> >  service/instance.c | 34 +-
> >  service/instance.h |  1 +
> >  2 files changed, 34 insertions(+), 1 deletion(-)
> > 
> > diff --git a/service/instance.c b/service/instance.c
> > index 3b92536..983494b 100644
> > --- a/service/instance.c
> > +++ b/service/instance.c
> > @@ -26,6 +26,8 @@
> > 
> >  #include 
> >  #include 
> >  #include 
> > 
> > +#define SYSLOG_NAMES
> > +#include 
> > 
> >  #include 
> > 
> > @@ -58,6 +60,7 @@ enum {
> > 
> > INSTANCE_ATTR_PIDFILE,
> > INSTANCE_ATTR_RELOADSIG,
> > INSTANCE_ATTR_TERMTIMEOUT,
> > 
> > +   INSTANCE_ATTR_FACILITY,
> > 
> > __INSTANCE_ATTR_MAX
> >  
> >  };
> > 
> > @@ -84,6 +87,7 @@ static const struct blobmsg_policy
> > instance_attr[__INSTANCE_ATTR_MAX] = {> 
> > [INSTANCE_ATTR_PIDFILE] = { "pidfile", BLOBMSG_TYPE_STRING },
> > [INSTANCE_ATTR_RELOADSIG] = { "reload_signal", BLOBMSG_TYPE_INT32
> > },
> > [INSTANCE_ATTR_TERMTIMEOUT] = { "term_timeout", BLOBMSG_TYPE_INT32
> > },
> > 
> > +   [INSTANCE_ATTR_FACILITY] = { "facility", BLOBMSG_TYPE_STRING },
> > 
> >  };
> >  
> >  enum {
> > 
> > @@ -150,6 +154,18 @@ static void closefd(int fd)
> > 
> > close(fd);
> >  
> >  }
> > 
> > +/* convert a string into numeric syslog facility or return -1 if no match
> > found */ +static int
> > +syslog_facility_str_to_int(const char *facility)
> > +{
> > +   CODE *p = facilitynames;
> > +
> > +   while (p->c_name && strcasecmp(p->c_name, facility))
> > +   p++;
> > +
> > +   return p->c_val;
> > +}
> > +
> > 
> >  static void
> >  instance_limits(const char *limit, const char *value)
> >  {
> > 
> > @@ -468,7 +484,7 @@ instance_stdio(struct ustream *s, int prio, struct
> > service_instance *in)> 
> > arg0 = basename(blobmsg_data(blobmsg_data(in->command)));
> > snprintf(ident, sizeof(ident), "%s[%d]", arg0, in->proc.pid);
> > 
> > -   ulog_open(ULOG_SYSLOG, LOG_DAEMON, ident);
> > +   ulog_open(ULOG_SYSLOG, in->syslog_facility, ident);
> > 
> > do {
> > 
> > str = ustream_get_read_buf(s, );
> > 
> > @@ -622,6 +638,9 @@ instance_config_changed(struct service_instance *in,
> > struct service_instance *in> 
> > if (in->nice != in_new->nice)
> > 
> > return true;
> > 
> > +   if (in->syslog_facility != in_new->syslog_facility)
> > +   return true;
> > +
> > 
> > if (string_changed(in->user, in_new->user))
> > 
> > return true;
> > 
> > @@ -944,6 +963,17 @@ instance_config_parse(struct service_instance *in)
> > 
> > if (!instance_fill_array(>errors, tb[INSTANCE_ATTR_ERROR],
> > NULL, true))
> > 
> > return false;
> > 
> > +   if (tb[INSTANCE_ATTR_FACILITY]) {
> > +   int facility =
> > syslog_facility_str_to_int(blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY])
> > ); +   if (facility != -1) {
> > +   DEBUG(3, "setting facility '%s'\n",
> > blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY])); +  
> > in->syslog_facility = facility;
> > +   } else {
> > +   DEBUG(3, "unknown syslog facility '%s' given,
> > using default (LOG_DAEMON)\n",
> > blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY])); +  
> > in->syslog_facility = LOG_DAEMON;
> > +   }
> > +   }
> > +
> > 
> > return true;
> >  
> >  }
> > 
> > @@ -980,6 +1010,7 @@ instance_config_move(struct service_instance *in,
> > struct service_instance *in_sr> 
> > in->trace = in_src->trace;
> > in->seccomp = in_src->seccomp;
> > in->node.avl.key = in_src->node.avl.key;
> > 
> > +   in->syslog_facility = in_src->syslog_facility;
> > 
> > free(in->config);
> > in->config = in_src->config;
> > 
> > @@ -1029,6 +1060,7 @@ instance_init(struct service_instance *in, struct
> > service *s, struct blob_attr *> 
> > in->timeout.cb = instance_timeout;
> > in->proc.cb = instance_exit;
> > in->term_timeout = 5;
> 

Re: [OpenWrt-Devel] [RFC/RFT] mtd resetbc: Unify "Linksys" NOR/NAND variants; Add Logging and Error Return

2019-04-10 Thread Jeff

Overtaken by https://github.com/openwrt/openwrt/pull/1980

Can close this patch in favor of the PR


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


Re: [OpenWrt-Devel] [PATCH] mac80211: Select better ch/VHT for sub-band radios

2019-04-10 Thread Jeff

Overtaken by https://github.com/openwrt/openwrt/pull/1980

Can close this patch in favor of the PR


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


Re: [OpenWrt-Devel] umbim: registration set support

2019-04-10 Thread Bjørn Mork
Petr Štetiar  writes:

>> But is there any chance someone else can push a few patches to umbim.git?
>
> Actually I've missed this patch while going through the patchwork list this
> week, so thank you for the reminder.
>
> I've merged this and the other mbim proxy patch in my staging repo[1] and
> added two more on the top (adding -Wextra compiler check), which I've sent to
> the list for the review just a few moments ago. 
>
> So it would be nice if you could take a look and review them before I'm going
> to bother blogic for his ACK (not strictly necessary, but nice to have) in
> order to push it.

Thanks!

And good luck with the tools discussion.  It's good to know that these
things are on the radar.



Bjørn

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


Re: [OpenWrt-Devel] [PATCH] instance: add support for customizable syslog facilities

2019-04-10 Thread Hans Dedecker
Hi,

On Sun, Mar 31, 2019 at 10:11 PM Michael Heimpold  wrote:
>
> This allow using a different (read: user-defined) syslog facility
> other than LOG_DAEMON when an instance's stdout/stderr is forwarded
> to syslog.
> It might be used to handle such messages different, e.g.
> filter/forward them etc.
Did you also submit a patch which allows to set the syslog facility
via procd_set_param as I could not find it ?

Hans
>
> Signed-off-by: Michael Heimpold 
> ---
>  service/instance.c | 34 +-
>  service/instance.h |  1 +
>  2 files changed, 34 insertions(+), 1 deletion(-)
>
> diff --git a/service/instance.c b/service/instance.c
> index 3b92536..983494b 100644
> --- a/service/instance.c
> +++ b/service/instance.c
> @@ -26,6 +26,8 @@
>  #include 
>  #include 
>  #include 
> +#define SYSLOG_NAMES
> +#include 
>
>  #include 
>
> @@ -58,6 +60,7 @@ enum {
> INSTANCE_ATTR_PIDFILE,
> INSTANCE_ATTR_RELOADSIG,
> INSTANCE_ATTR_TERMTIMEOUT,
> +   INSTANCE_ATTR_FACILITY,
> __INSTANCE_ATTR_MAX
>  };
>
> @@ -84,6 +87,7 @@ static const struct blobmsg_policy 
> instance_attr[__INSTANCE_ATTR_MAX] = {
> [INSTANCE_ATTR_PIDFILE] = { "pidfile", BLOBMSG_TYPE_STRING },
> [INSTANCE_ATTR_RELOADSIG] = { "reload_signal", BLOBMSG_TYPE_INT32 },
> [INSTANCE_ATTR_TERMTIMEOUT] = { "term_timeout", BLOBMSG_TYPE_INT32 },
> +   [INSTANCE_ATTR_FACILITY] = { "facility", BLOBMSG_TYPE_STRING },
>  };
>
>  enum {
> @@ -150,6 +154,18 @@ static void closefd(int fd)
> close(fd);
>  }
>
> +/* convert a string into numeric syslog facility or return -1 if no match 
> found */
> +static int
> +syslog_facility_str_to_int(const char *facility)
> +{
> +   CODE *p = facilitynames;
> +
> +   while (p->c_name && strcasecmp(p->c_name, facility))
> +   p++;
> +
> +   return p->c_val;
> +}
> +
>  static void
>  instance_limits(const char *limit, const char *value)
>  {
> @@ -468,7 +484,7 @@ instance_stdio(struct ustream *s, int prio, struct 
> service_instance *in)
>
> arg0 = basename(blobmsg_data(blobmsg_data(in->command)));
> snprintf(ident, sizeof(ident), "%s[%d]", arg0, in->proc.pid);
> -   ulog_open(ULOG_SYSLOG, LOG_DAEMON, ident);
> +   ulog_open(ULOG_SYSLOG, in->syslog_facility, ident);
>
> do {
> str = ustream_get_read_buf(s, );
> @@ -622,6 +638,9 @@ instance_config_changed(struct service_instance *in, 
> struct service_instance *in
> if (in->nice != in_new->nice)
> return true;
>
> +   if (in->syslog_facility != in_new->syslog_facility)
> +   return true;
> +
> if (string_changed(in->user, in_new->user))
> return true;
>
> @@ -944,6 +963,17 @@ instance_config_parse(struct service_instance *in)
> if (!instance_fill_array(>errors, tb[INSTANCE_ATTR_ERROR], NULL, 
> true))
> return false;
>
> +   if (tb[INSTANCE_ATTR_FACILITY]) {
> +   int facility = 
> syslog_facility_str_to_int(blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY]));
> +   if (facility != -1) {
> +   DEBUG(3, "setting facility '%s'\n", 
> blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY]));
> +   in->syslog_facility = facility;
> +   } else {
> +   DEBUG(3, "unknown syslog facility '%s' given, using 
> default (LOG_DAEMON)\n", blobmsg_get_string(tb[INSTANCE_ATTR_FACILITY]));
> +   in->syslog_facility = LOG_DAEMON;
> +   }
> +   }
> +
> return true;
>  }
>
> @@ -980,6 +1010,7 @@ instance_config_move(struct service_instance *in, struct 
> service_instance *in_sr
> in->trace = in_src->trace;
> in->seccomp = in_src->seccomp;
> in->node.avl.key = in_src->node.avl.key;
> +   in->syslog_facility = in_src->syslog_facility;
>
> free(in->config);
> in->config = in_src->config;
> @@ -1029,6 +1060,7 @@ instance_init(struct service_instance *in, struct 
> service *s, struct blob_attr *
> in->timeout.cb = instance_timeout;
> in->proc.cb = instance_exit;
> in->term_timeout = 5;
> +   in->syslog_facility = LOG_DAEMON;
>
> in->_stdout.fd.fd = -2;
> in->_stdout.stream.string_data = true;
> diff --git a/service/instance.h b/service/instance.h
> index 84ce002..42cc4be 100644
> --- a/service/instance.h
> +++ b/service/instance.h
> @@ -61,6 +61,7 @@ struct service_instance {
> struct jail jail;
> char *seccomp;
> char *pidfile;
> +   int syslog_facility;
>
> uint32_t term_timeout;
> uint32_t respawn_timeout;
> --
> 2.17.1
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list

Re: [OpenWrt-Devel] [PATCH 0/2 umbim] Enable extra compiler checks

2019-04-10 Thread Bjørn Mork
Petr Štetiar  writes:

> Hi,
>
> I would like to enforce extra compiler checks in order to have better feedback
> during compile testing of the patches before merging them. I'm not sure if
> it's going to play out well in the long term (false positives), but I simply
> prefer to have another pairs of review eyes (even if it's machine) for free
> and I usually try to enable those checks in my projects as well.
>
> Cc: Bjørn Mork 

This looks very good to me. For completeness, I did a basic runtime
test against a Sierra Wireless EM7455 on x86_64

Reviewed-by: Bjørn Mork 

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


Re: [OpenWrt-Devel] umbim: registration set support

2019-04-10 Thread Petr Štetiar
Bjørn Mork  [2019-04-09 23:03:56]:


Hi Bjørn,

> Is there anything I or anyone else can do to help here?

sure, for me it's very helpful to have at least some Reviewed-by/Tested-by
tags. In case of Tested-by it's also good to know some details about the test
setup as well (device, settings etc.). This tags helps to prioritize as well.

> There are far too many patches like this one just sitting in patchwork.

It's about 108 patches, some of them already delegated, some of them RFCs,
which makes it down to roughly about 50 patches. There is about 101 PRs on
GitHub and roughly 810 open tasks/issues in Flyspray as well. So yeah, a lot
of work.

> Pull requests on github works really well for the repos there. 

Well, although I'm personally not such big fan of this platform for open
source projects (yeah, we should promote usage of other FS/OSS), it makes
handling of the huge amount of patches much more convenient, so I can live
with that.  Patchwork is nice till you can keep with the pace of new patches,
once there's some backlog it gets awkward.

> That is a problem for a volunteer project. You can't depend on people having
> infinite spare time.  Very few have...

Good tooling could help with missing human resources a lot. I wish the day had
64 hours and we could've something like kernelci.org, i.e. have more automagic
testing and so on.

> But stuff like umbim here, and the other repos only avilable on
> git.openwrt.org, seems to depend on single maintainers.

It might look like that, but from my point of view it's just because
umbim/mbim/uqmi are projects which are domain specific, so probably not so
easy candidates for review, testing and merging. BTW anybody with commit
access can push this patches.

Anyway, I've to admit, that it's really PITA to work in this fragmented
environment (Patchwork, GitHub, Flyspray) and I'm going to bring this topic on
the developer meeting in June.

> But is there any chance someone else can push a few patches to umbim.git?

Actually I've missed this patch while going through the patchwork list this
week, so thank you for the reminder.

I've merged this and the other mbim proxy patch in my staging repo[1] and
added two more on the top (adding -Wextra compiler check), which I've sent to
the list for the review just a few moments ago. 

So it would be nice if you could take a look and review them before I'm going
to bother blogic for his ACK (not strictly necessary, but nice to have) in
order to push it.

Thanks.

1. https://github.com/ynezz/umbim/tree/staging

-- ynezz

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


[OpenWrt-Devel] [PATCH 0/2 umbim] Enable extra compiler checks

2019-04-10 Thread Petr Štetiar
Hi,

I would like to enforce extra compiler checks in order to have better feedback
during compile testing of the patches before merging them. I'm not sure if
it's going to play out well in the long term (false positives), but I simply
prefer to have another pairs of review eyes (even if it's machine) for free
and I usually try to enable those checks in my projects as well.

Cc: Bjørn Mork 

Petr Štetiar (2):
  Enable extra compiler checks
  Iron out all extra compiler warnings

 CMakeLists.txt |  2 +-
 cli.c  | 23 ---
 mbim-dev.c |  4 ++--
 mbim-msg.c |  2 +-
 mbim-msg.h |  2 +-
 5 files changed, 17 insertions(+), 16 deletions(-)

-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 1/2 umbim] Enable extra compiler checks

2019-04-10 Thread Petr Štetiar
Let's enforce additional automatic checks enforced by the compiler in
order to catch possible errors during compilation.

Cc: Bjørn Mork 
Signed-off-by: Petr Štetiar 
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc18c1f..f30ca80 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ PROJECT(umbim C)
 
 OPTION(PROXY OFF)
 
-ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
+ADD_DEFINITIONS(-Os -ggdb -Wextra -Wall -Werror --std=gnu99 
-Wmissing-declarations -Wno-unused-parameter)
 
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
-- 
1.9.1


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


[OpenWrt-Devel] [PATCH 2/2 umbim] Iron out all extra compiler warnings

2019-04-10 Thread Petr Štetiar
mbim-msg.c:83:17: error: comparison between signed and unsigned integer 
expressions
cli.c:50:10: error: comparison between signed and unsigned integer expressions
cli.c:81:10: error: comparison between signed and unsigned integer expressions
cli.c:104:10: error: comparison between signed and unsigned integer expressions
cli.c:140:10: error: comparison between signed and unsigned integer expressions
cli.c:154:18: error: comparison between signed and unsigned integer expressions
cli.c:171:10: error: comparison between signed and unsigned integer expressions
cli.c:194:10: error: comparison between signed and unsigned integer expressions
cli.c:223:10: error: comparison between signed and unsigned integer expressions
cli.c:229:17: error: comparison between signed and unsigned integer expressions
cli.c:241:17: error: comparison between signed and unsigned integer expressions
cli.c:247:17: error: comparison between signed and unsigned integer expressions
cli.c:259:17: error: comparison between signed and unsigned integer expressions
cli.c:272:10: error: comparison between signed and unsigned integer expressions
cli.c:549:16: error: comparison between signed and unsigned integer expressions
mbim-dev.c:68:21: error: comparison between signed and unsigned integer 
expressions
mbim-dev.c:97:10: error: comparison between signed and unsigned integer 
expressions

Cc: Bjørn Mork 
Signed-off-by: Petr Štetiar 
---
 cli.c  | 23 ---
 mbim-dev.c |  4 ++--
 mbim-msg.c |  2 +-
 mbim-msg.h |  2 +-
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/cli.c b/cli.c
index 3089d16..19f36f4 100644
--- a/cli.c
+++ b/cli.c
@@ -42,7 +42,7 @@ static int _argc;
 static char **_argv;
 
 static int
-mbim_device_caps_response(void *buffer, int len)
+mbim_device_caps_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_device_caps_r *caps = (struct 
mbim_basic_connect_device_caps_r *) buffer;
char *deviceid, *firmwareinfo, *hardwareinfo;
@@ -74,7 +74,7 @@ mbim_device_caps_response(void *buffer, int len)
 }
 
 static int
-mbim_pin_state_response(void *buffer, int len)
+mbim_pin_state_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_pin_r *pin = (struct mbim_basic_connect_pin_r 
*) buffer;
 
@@ -96,7 +96,7 @@ mbim_pin_state_response(void *buffer, int len)
 }
 
 static int
-mbim_registration_response(void *buffer, int len)
+mbim_registration_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_register_state_r *state = (struct 
mbim_basic_connect_register_state_r *) buffer;
char *provider_id, *provider_name, *roamingtext;
@@ -131,11 +131,11 @@ mbim_registration_response(void *buffer, int len)
 }
 
 static int
-mbim_subscriber_response(void *buffer, int len)
+mbim_subscriber_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_subscriber_ready_status_r *state = (struct 
mbim_basic_connect_subscriber_ready_status_r *) buffer;
char *subscriberid, *simiccid;
-   int nr;
+   unsigned int nr;
 
if (len < sizeof(struct mbim_basic_connect_subscriber_ready_status_r)) {
fprintf(stderr, "message not long enough\n");
@@ -164,7 +164,7 @@ mbim_subscriber_response(void *buffer, int len)
 }
 
 static int
-mbim_attach_response(void *buffer, int len)
+mbim_attach_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_packet_service_r *ps = (struct 
mbim_basic_connect_packet_service_r *) buffer;
 
@@ -187,7 +187,7 @@ mbim_attach_response(void *buffer, int len)
 }
 
 static int
-mbim_connect_response(void *buffer, int len)
+mbim_connect_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_connect_r *c = (struct 
mbim_basic_connect_connect_r *) buffer;
 
@@ -213,11 +213,11 @@ mbim_connect_response(void *buffer, int len)
 }
 
 static int
-mbim_config_response(void *buffer, int len)
+mbim_config_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_ip_configuration_r *ip = (struct 
mbim_basic_connect_ip_configuration_r *) buffer;
char out[40];
-   int i;
+   unsigned int i;
uint32_t offset;
 
if (len < sizeof(struct mbim_basic_connect_ip_configuration_r)) {
@@ -265,7 +265,7 @@ mbim_config_response(void *buffer, int len)
 }
 
 static int
-mbim_radio_response(void *buffer, int len)
+mbim_radio_response(void *buffer, size_t len)
 {
struct mbim_basic_connect_radio_state_r *r = (struct 
mbim_basic_connect_radio_state_r *) buffer;
 
@@ -507,7 +507,8 @@ int
 main(int argc, char **argv)
 {
char *cmd, *device = NULL;
-   int no_open = 0, ch, i;
+   int no_open = 0, ch;
+   unsigned int i;
 #ifdef LIBQMI_MBIM_PROXY
int proxy = 0;
 #endif
diff --git a/mbim-dev.c b/mbim-dev.c
index 170de2d..2a94d49 100644
--- a/mbim-dev.c
+++ b/mbim-dev.c
@@ -56,7 +56,7 @@ int
 mbim_send(void)
 {
struct mbim_message_header *hdr = (struct mbim_message_header *) 
mbim_buffer;
-   int ret = 0;
+ 

Re: [OpenWrt-Devel] DTS Style: Referring to "Upstream" Nodes

2019-04-10 Thread Petr Štetiar
Jeff Kletsky  [2019-04-09 07:31:46]:

Hi,

> In general, within an OpenWrt DTS that `#include "some_linux_supplied.dtsi"`
> is it preferred to refer to a node defined in upstream code by label, or by
> path?

well, it has nothing to do with OpenWrt, this looks more like a general DTS
question and could be answered by either consulting the DTS specs or just by
grepping the Linux kernel/OpenWrt DTSes and look for acceptable examples.

> For example, with `blsp1_spi2: spi@78b6000` in the upstream-controlled DTS,
> prefer
> 
>     _spi2
> 
> or (taking into account scope or path, as needed)
> 
>     spi@78b6000

I would say, that whatever works for you and makes the dtc compiler happy,
i.e.  doesn't spill out any warnings.

-- ynezz

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


Re: [OpenWrt-Devel] OpenWrt 19.03 plans

2019-04-10 Thread Vincent Wiemann
Hi Bjørn, Jo-Philipp, Eric,

all of you are right, I think. I didn't make clear what I'd like to see
OpenWrt achieve. Cuts need to be done when they delay a release too long
or when the reasons are not under the OpenWrt developer's control,
but when there is the chance that someone is getting motivated to do it,
delay it. After a due date, cut it and release the rest with a lack for
a specific feature and other people might get motivated, but that is the
last resort.

Personally I think one release a year is enough, except when there are
critical security issues which deserve an own release, but that is another
topic.

Regards,

Vincent

On 10.04.2019 06:04, Eric Luehrsen wrote:
> Or that is $0.023647, anyway. :-)
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 

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