[OpenWrt-Devel] [PATCH] uhttpd: serve precompressed files

2020-06-08 Thread Sergey Ponomarev

Follow up on this patch:

1. The patch it was tested and accepted into ArednMesh.org 
 because they works with distant networks 
https://github.com/aredn/aredn_ar71xx/pull/276.


The same problem is actual for a regular WiFi networks e.g. trying to 
login into Luci when something wrong with wifi and you want to check 
connectivity.


So speaking about space vs network tradeoff then network may be more 
important.


The patch looks fine but we can add support of other browser supported 
encoders: DEFLATE, LZ4 and Brotli. Also if we requested the compressed 
file itself e.g. /backup.tar.gz then user wants to download the archive 
as is so no need to add Content-Encoding header.


2. There is a patch "uhttpd: add support for gzipped content encoding" 
Message ID 1443738134-5929-2-git-send-email-a...@tnode.com 
https://patchwork.ozlabs.org/project/openwrt/patch/1443738134-5929-2-git-send-email-a...@tnode.com/ 
which makes on the fly encoding. But the patch looks like forgotten but 
I added it's author to CC.


I reviewed it's code and the patch looks good and it can be even 
slightly improved by switching from gzip to raw DEFLATE i.e. gzip 
without header and checksum so more lightweight.


To switch to deflate just need to just negate windowBits param of 
deflateInit2 i.e. instead of `16 | MAX_WBITS` use `-(16 | MAX_WBITS)`.



Anyway precompressing makes sense if use Brotli instead of gzip and this 
may solve the space/network/cpu tradeoff. I checked on my homepage:


 204800 www_homepage.tar      i.e. uncompressed size
   68114 www_homepage.tar.br      assets precompressed with brotli
  70220 www_homepage.tar.xz   as it will be compressed in openwrt image
  68180 www_homepage.tar.br.xz   so precompressed with brotli asset 
takes the same place in openwrt image


Off course sizes still may be better in xz but anyway it looks like we 
can safely precompress the Luci assets.




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


Re: [OpenWrt-Devel] [PATCH] build, imagebuilder: Do not require libncurses-dev

2020-06-08 Thread Sven Roederer
Am Dienstag, 14. April 2020, 23:14:47 CEST schrieb Paul Spooren:
> The buildroot and SDK both require `libncurses-dev` to be installed on
> the system, however the ImageBuilder uses precompiled binaries.
> 
> This patch changes the prerequirements checks to skip the
> `libncurses-dev` part if running as ImageBuilder.
> 

Hi Paul,

I gave this today a test on my spare computer, but it still complained about 
the missing libncurses.
I tested with snapshot imagebuilder (r13519-8a858363b0) with just calling 
"make image"

Any ideas?

Sven

> Signed-off-by: Paul Spooren 
> ---
>  include/prereq-build.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/prereq-build.mk b/include/prereq-build.mk
> index 830a9eff9a..72fb6ad97a 100644
> --- a/include/prereq-build.mk
> +++ b/include/prereq-build.mk
> @@ -51,10 +51,12 @@ $(eval $(call TestHostCommand,working-g++, \
>   g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
>   $(TMP_DIR)/a.out))
> 
> +ifndef IB
>  $(eval $(call TestHostCommand,ncurses, \
>   Please install ncurses. (Missing libncurses.so or ncurses.h), \
>   echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
>   gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
> +endif
> 
>  ifeq ($(HOST_OS),Linux)
>zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic





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


[OpenWrt-Devel] [PATCH] hostapd: hostapd_set_psk_file: fix defaut value for mac

2020-06-08 Thread Johann Neuhauser via openwrt-devel
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 ---
Bringing up of station vlan fails if the optional mac entry isn't set.
The default mac "00:00:00:00:00:00", which should match all stations,
is mistakenly set to the non used variable "isolate". This results in
a wrong formatted .psk file which has to be "vlan_id mac key".

fixes: 5aa2ddd0: hostapd: add support for wifi-station and wifi-vlan sections

Signed-off-by: Johann Neuhauser 
---
 package/network/services/hostapd/files/hostapd.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index c9c0507120..f4e2aa559c 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -283,7 +283,7 @@ hostapd_set_psk_file() {
local vlan_id=""
 
json_get_vars mac vid key
-   set_default isolate "00:00:00:00:00:00"
+   set_default mac "00:00:00:00:00:00"
[ -n "$vid" ] && vlan_id="vlanid=$vid "
echo "${vlan_id} ${mac} ${key}" >> /var/run/hostapd-${ifname}.psk
 }
-- 
2.25.1


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


[OpenWrt-Devel] [PATCH v2][umdns] Fix advertised IPv6 addresses

2020-06-08 Thread David Woodhouse
The dns_reply_a() function appears to filter out IPv6 addresses other
than link-local. This means that advertised services are unreachable
over IPv6 (since on the client side, we drop the interface identifier
so link-local addresses aren't usable anyway).

Fix it to include all addresses, in accordance with RFC6762 §6.2:

   When a Multicast DNS responder sends a Multicast DNS response message
   containing its own address records, it MUST include all addresses
   that are valid on the interface on which it is sending the message,
   and MUST NOT include addresses that are not valid on that interface
   (such as addresses that may be configured on the host's other
   interfaces).  For example, if an interface has both an IPv6 link-
   local and an IPv6 routable address, both should be included in the
   response message so that queriers receive both and can make their own
   choice about which to use.  This allows a querier that only has an
   IPv6 link-local address to connect to the link-local address, and a
   different querier that has an IPv6 routable address to connect to the
   IPv6 routable address instead.


---
v2: Include all addresses; don't exclude LL

diff --git a/dns.c b/dns.c
index 1d3362f..3e902d0 100644
--- a/dns.c
+++ b/dns.c
@@ -200,10 +200,8 @@ dns_reply_a(struct interface *iface, struct sockaddr *to, 
int ttl)
dns_add_answer(TYPE_A, (uint8_t *) &sa->sin_addr, 4, 
ttl);
}
if (ifa->ifa_addr->sa_family == AF_INET6) {
-   uint8_t ll_prefix[] = {0xfe, 0x80 };
sa6 = (struct sockaddr_in6 *) ifa->ifa_addr;
-   if (!memcmp(&sa6->sin6_addr, &ll_prefix, 2))
-   dns_add_answer(TYPE_, (uint8_t *) 
&sa6->sin6_addr, 16, ttl);
+   dns_add_answer(TYPE_, (uint8_t *) &sa6->sin6_addr, 
16, ttl);
}
}
dns_send_answer(iface, to, mdns_hostname_local);


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Google Season of Docs projects for OpenWrt

2020-06-08 Thread Baptiste Jonglez
Hi,

On 08-06-20, Stan Grishin wrote:
> I've had a look at the project ideas posted, and I'd like to put my
> name forward for a few areas where I'd like to contribute:
> 
> 1. There is a great documentation for creating lua-based luci
> applications and model/cbi which allowed me to start creating WebUI
> applications without knowing much about Lua. I believe it would be
> beneficial to have similar documentation for the new javascript UI. I
> don't have much experience with javascript, but I can read and with
> some supervision I hope I can document things.

I think what you're looking for already exists? 
https://openwrt.github.io/luci/jsapi/

The links on https://github.com/openwrt/luci/wiki/Documentation were
broken, I have just fixed them.

LuCI is quite different from the other components (and as you said already
has extensive documentation).  Project 1 is mostly about the other core
components at https://git.openwrt.org/?a=project_list;pf=project

> 2. The showcase project -- as someone who pushed for the "why use
> LEDE" page when the site was redesigned, I'm glad the importance of
> this is recognized by core developers. In addition or instead of #1, I
> can help out with some DNS or VPN-related articles.
> 
> I have contributed to some wiki pages (sadly changes since
> overwritten), LEDE showcase and READMEs on my own packages
> (simple-adblock and vpn-policy-routing).

I guess you are referring to https://openwrt.org/#why_use_openwrt and
https://openwrt.org/reasons_to_use_openwrt ?

This is a good start: while these pages are mostly general, I'm thinking
of Project 4 as a way to showcase specific setups and use-cases.  In other
words, it's complementary.

Most of the project is about producing content, but there is a first part
about thinking how to organize/publish things.  Do you have ideas about
this?  Wiki pages, blog posts, videos, something else?

> Let me know if/how I should proceed.

For details on the process if you want to apply, please see 
https://developers.google.com/season-of-docs/docs/tech-writer-guide

The deadline to apply is in one month, so you still have time.

> PS. I'm glad you brought up the LineageOS wiki, I wish we could
> supplement the ToH with something like the search at
> https://wiki.lineageos.org/, where when you start typing some letters
> from your devices it lists supported ones matching what you typed.
> With a variety of platforms/devices supported by OpenWrt it may be a
> daunting task for a new user just trying to figure out how to find the
> OpenWrt binaries for a specific device.

I'll let Paul answer, as I think he was the one proposing this.

Thanks,
Baptiste

PS: please keep discussion in the same email thread.

> On Mon, Jun 8, 2020 at 3:32 AM  
> wrote:
> >
> > -- Forwarded message --
> > From: Baptiste Jonglez 
> > To: openwrt-devel@lists.openwrt.org
> > Cc:
> > Bcc:
> > Date: Mon, 8 Jun 2020 12:14:05 +0200
> > Subject: [OpenWrt-Devel] Google Season of Docs projects for OpenWrt
> > Hi,
> >
> > As discussed previously, OpenWrt has applied and been accepted for the
> > Season of Docs.  We have three mentors (me, Jow, Thomas Hühn), while Hauke
> > and Paul are "project administrators".
> >
> > We started proposing projects here: 
> > https://openwrt.org/google-season-of-docs
> >
> > Feel free to discuss the proposed projects here, especially if you plan to
> > apply as a technical writer.  The goal is to clarify the projects if
> > needed, and make sure that we provide a good match between projects and
> > technical writer applications.
> >
> > The deadline for applying as a technical writer is July 9, see
> > https://developers.google.com/season-of-docs/docs/timeline
> >
> > More information about being a technical writer (requirements, stipend
> > amount, etc) is here: 
> > https://developers.google.com/season-of-docs/docs/tech-writer-guide
> >
> > Baptiste
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] openwrt-devel Digest, Vol 50, Issue 39

2020-06-08 Thread Stan Grishin
Baptiste,

Thanks for taking a lead on this, it's a fantastic idea!

I've had a look at the project ideas posted, and I'd like to put my
name forward for a few areas where I'd like to contribute:

1. There is a great documentation for creating lua-based luci
applications and model/cbi which allowed me to start creating WebUI
applications without knowing much about Lua. I believe it would be
beneficial to have similar documentation for the new javascript UI. I
don't have much experience with javascript, but I can read and with
some supervision I hope I can document things.

2. The showcase project -- as someone who pushed for the "why use
LEDE" page when the site was redesigned, I'm glad the importance of
this is recognized by core developers. In addition or instead of #1, I
can help out with some DNS or VPN-related articles.

I have contributed to some wiki pages (sadly changes since
overwritten), LEDE showcase and READMEs on my own packages
(simple-adblock and vpn-policy-routing).

Let me know if/how I should proceed.

PS. I'm glad you brought up the LineageOS wiki, I wish we could
supplement the ToH with something like the search at
https://wiki.lineageos.org/, where when you start typing some letters
from your devices it lists supported ones matching what you typed.
With a variety of platforms/devices supported by OpenWrt it may be a
daunting task for a new user just trying to figure out how to find the
OpenWrt binaries for a specific device.


On Mon, Jun 8, 2020 at 3:32 AM  wrote:
>
> -- Forwarded message --
> From: Baptiste Jonglez 
> To: openwrt-devel@lists.openwrt.org
> Cc:
> Bcc:
> Date: Mon, 8 Jun 2020 12:14:05 +0200
> Subject: [OpenWrt-Devel] Google Season of Docs projects for OpenWrt
> Hi,
>
> As discussed previously, OpenWrt has applied and been accepted for the
> Season of Docs.  We have three mentors (me, Jow, Thomas Hühn), while Hauke
> and Paul are "project administrators".
>
> We started proposing projects here: https://openwrt.org/google-season-of-docs
>
> Feel free to discuss the proposed projects here, especially if you plan to
> apply as a technical writer.  The goal is to clarify the projects if
> needed, and make sure that we provide a good match between projects and
> technical writer applications.
>
> The deadline for applying as a technical writer is July 9, see
> https://developers.google.com/season-of-docs/docs/timeline
>
> More information about being a technical writer (requirements, stipend
> amount, etc) is here: 
> https://developers.google.com/season-of-docs/docs/tech-writer-guide
>
> Baptiste

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


[OpenWrt-Devel] Fwd: [PATCH] hostapd: wpad init script renamed

2020-06-08 Thread Michael T Farnworth

When hostapd is launched as /etc/init.d/wpad it appears in a different
location under "ubus call service list" presenting problems with scripts
/lib/netifd/hostapd.sh and /lib/netifd/wireless/mac80211.sh.  Either
these scripts need to be patched to recognise the move, or the
init.d script needs to be renamed to hostapd.  This patch renames the
init.d script as unidentified things may also depend upon the placement
of entries within ubus output.  This ubus change only came about on the
8 April 2020 and it is unlikely that very much code has been written or
re-written to support the renaming.  Problem is manifested in log files
as "/usr/sbin/wpad does not match process  path (/proc/exe)"

Signed-off-by: Michael T Farnworth 

diff --git a/package/network/services/hostapd/Makefile 
b/package/network/services/hostapd/Makefile

index 66560d5d41..b8b7c2b315 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -533,7 +533,7 @@ endef
 define Package/hostapd-common/install
$(INSTALL_DIR) $(1)/lib/netifd $(1)/etc/rc.button 
$(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d

$(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh
-   $(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad
+   $(INSTALL_BIN) ./files/hostapd.init $(1)/etc/init.d/hostapd
$(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
 endef

diff --git a/package/network/services/hostapd/files/wpad.init 
b/package/network/services/hostapd/files/hostapd.init

similarity index 97%
rename from package/network/services/hostapd/files/wpad.init
rename to package/network/services/hostapd/files/hostapd.init
index 3198e9801f..b9494b6bf5 100644
--- a/package/network/services/hostapd/files/wpad.init
+++ b/package/network/services/hostapd/files/hostapd.init
@@ -4,7 +4,7 @@ START=19
 STOP=21

 USE_PROCD=1
-NAME=wpad
+NAME=hostapd

 start_service() {
if [ -x "/usr/sbin/hostapd" ]; then

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


[OpenWrt-Devel] [PATCH][umdns] Fix advertised IPv6 addresses

2020-06-08 Thread David Woodhouse
The dns_reply_a() function appears to include *only* link-local IPv6
addresses. This seems wrong, and ends up publishing addresses which
can't be used to reach the host in question.

I believe the logic should be the other way around and we should be
*eliding* the link-local addresses but including the global ones.

With this fixed, I can run 'ubus call umdns hosts' on another AP in my
network and I see the correct global IPv6 address. Likewise, running
'ubus call umdns browse' shows the right address and I can set about
fixing https://github.com/berlin-open-wireless-lab/DAWN/issues/95

Fixes: https://bugs.openwrt.org/index.php?do=details&task_id=3167

diff --git a/dns.c b/dns.c
index 1d3362f..47c75ad 100644
--- a/dns.c
+++ b/dns.c
@@ -202,7 +202,7 @@ dns_reply_a(struct interface *iface, struct sockaddr *to, 
int ttl)
if (ifa->ifa_addr->sa_family == AF_INET6) {
uint8_t ll_prefix[] = {0xfe, 0x80 };
sa6 = (struct sockaddr_in6 *) ifa->ifa_addr;
-   if (!memcmp(&sa6->sin6_addr, &ll_prefix, 2))
+   if (memcmp(&sa6->sin6_addr, &ll_prefix, 2))
dns_add_answer(TYPE_, (uint8_t *) 
&sa6->sin6_addr, 16, ttl);
}
}


smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] hostapd: update to latest Git hostap_2_9-1331-g5a8b366233f5

2020-06-08 Thread Petr Štetiar
Bump to latest Git and refresh all patches in order to get fix for "UPnP
SUBSCRIBE misbehavior in hostapd WPS AP" (CVE-2020-12695).

 General security vulnerability in the way the callback URLs in the UPnP
 SUBSCRIBE command are used were reported (VU#339275, CVE-2020-12695).
 Some of the described issues may be applicable to the use of UPnP in WPS
 AP mode functionality for supporting external registrars.

Ref: https://w1.fi/security/2020-1/
Signed-off-by: Petr Štetiar 
---

Just compile tested, Tested-by: welcome!

 package/network/services/hostapd/Makefile |  6 +--
 ...ompletion-callback-to-complete-mesh-.patch |  4 +-
 ...rnel-driver-DFS-handler-in-userspace.patch |  2 +-
 ...hannels-to-be-selected-if-dfs-is-ena.patch | 10 ++--
 ...sh-do-not-use-offchan-mgmt-tx-on-DFS.patch |  4 +-
 ...18-mesh-make-forwarding-configurable.patch | 14 +++---
 .../hostapd/patches/200-multicall.patch   | 46 +--
 .../services/hostapd/patches/300-noscan.patch |  4 +-
 .../hostapd/patches/301-mesh-noscan.patch |  6 +--
 .../patches/310-rescan_immediately.patch  |  2 +-
 .../patches/330-nl80211_fix_set_freq.patch|  2 +-
 .../patches/350-nl80211_del_beacon_bss.patch  | 10 ++--
 .../patches/360-ctrl_iface_reload.patch   |  2 +-
 .../hostapd/patches/370-ap_sta_support.patch  | 16 +++
 .../patches/380-disable_ctrl_iface_mib.patch  | 26 +--
 .../patches/390-wpa_ie_cap_workaround.patch   |  4 +-
 ...dd-new-config-params-to-be-used-with.patch |  4 +-
 ...-use-new-parameters-during-ibss-join.patch |  4 +-
 .../patches/463-add-mcast_rate-to-11s.patch   |  4 +-
 .../patches/464-fix-mesh-obss-check.patch |  2 +-
 .../patches/500-lto-jobserver-support.patch   |  4 +-
 .../hostapd/patches/600-ubus_support.patch| 34 +++---
 .../hostapd/patches/700-wifi-reload.patch | 16 +++
 23 files changed, 113 insertions(+), 113 deletions(-)

diff --git a/package/network/services/hostapd/Makefile 
b/package/network/services/hostapd/Makefile
index 66560d5d4181..ea90e01c1d63 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -11,9 +11,9 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2020-05-20
-PKG_SOURCE_VERSION:=dd2daf0848ed8854065cc5cfca07a0538cd380af
-PKG_MIRROR_HASH:=5f198ba4f9098e8bddb32e41f82a24d0510c6e25317a86dcfafc70fb8db260e2
+PKG_SOURCE_DATE:=2020-06-08
+PKG_SOURCE_VERSION:=5a8b366233f5585e68a4ffbb604fbb4a848eb325
+PKG_MIRROR_HASH:=1b2a4947034142587a3f81eac2ea27dd64650e77f8943d973623b47533be2393
 
 PKG_MAINTAINER:=Felix Fietkau 
 PKG_LICENSE:=BSD-3-Clause
diff --git 
a/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch
 
b/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch
index 844437f74a8c..54dea274faed 100644
--- 
a/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch
+++ 
b/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch
@@ -34,7 +34,7 @@ Signed-off-by: Peter Oh 
  #endif /* CONFIG_MESH */
  
hostapd_clean_rrm(hapd);
-@@ -2145,6 +2147,13 @@ dfs_offload:
+@@ -2156,6 +2158,13 @@ dfs_offload:
if (hapd->setup_complete_cb)
hapd->setup_complete_cb(hapd->setup_complete_cb_ctx);
  
@@ -48,7 +48,7 @@ Signed-off-by: Peter Oh 
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
   iface->bss[0]->conf->iface);
if (iface->interfaces && iface->interfaces->terminate_on_error > 0)
-@@ -2288,7 +2297,7 @@ int hostapd_setup_interface(struct hosta
+@@ -2299,7 +2308,7 @@ int hostapd_setup_interface(struct hosta
ret = setup_interface(iface);
if (ret) {
wpa_printf(MSG_ERROR, "%s: Unable to setup interface.",
diff --git 
a/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch
 
b/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch
index 8b1ce88864e2..2ca15e5d1eb5 100644
--- 
a/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch
+++ 
b/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch
@@ -26,7 +26,7 @@ Signed-off-by: Peter Oh 
  struct wpa_driver_set_key_params {
 --- a/src/drivers/driver_nl80211.c
 +++ b/src/drivers/driver_nl80211.c
-@@ -10038,6 +10038,9 @@ static int nl80211_join_mesh(struct i802
+@@ -10051,6 +10051,9 @@ static int nl80211_join_mesh(struct i802
  
wpa_printf(MSG_DEBUG, "  * flags=%08X", params->flags);
  
diff --git 
a/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
 
b/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch
index cc6357688355..3a9b84717

[OpenWrt-Devel] [PATCH] hostapd: wpad init script renamed

2020-06-08 Thread Michael T Farnworth
When hostapd is launched as /etc/init.d/wpad it appears in a different 
location under "ubus call service list" presenting problems with scripts 
/lib/netifd/hostapd.sh and /lib/netifd/wireless/mac80211.sh

Either these scripts need to be patched to recognise the move, or the
init.d script needs to be renamed to hostapd.  This patch renames the 
init.d script as unidentified things may also depend upon the placement 
of entries within ubus output.  This ubus change only came about on the 
8 April 2020 and it is unlikely that very much code has been written or 
re-written to support the renaming.  Problem is manifested in log files 
as "/usr/sbin/wpad does not match process  path (/proc/exe)"


Signed-off-by: Michael T Farnworth 

diff --git a/package/network/services/hostapd/Makefile 
b/package/network/services/hostapd/Makefile

index 66560d5d41..b8b7c2b315 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -533,7 +533,7 @@ endef
 define Package/hostapd-common/install
$(INSTALL_DIR) $(1)/lib/netifd $(1)/etc/rc.button 
$(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d

$(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh
-   $(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad
+   $(INSTALL_BIN) ./files/hostapd.init $(1)/etc/init.d/hostapd
$(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
 endef

diff --git a/package/network/services/hostapd/files/wpad.init 
b/package/network/services/hostapd/files/hostapd.init

similarity index 97%
rename from package/network/services/hostapd/files/wpad.init
rename to package/network/services/hostapd/files/hostapd.init
index 3198e9801f..b9494b6bf5 100644
--- a/package/network/services/hostapd/files/wpad.init
+++ b/package/network/services/hostapd/files/hostapd.init
@@ -4,7 +4,7 @@ START=19
 STOP=21

 USE_PROCD=1
-NAME=wpad
+NAME=hostapd

 start_service() {
if [ -x "/usr/sbin/hostapd" ]; then

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


[OpenWrt-Devel] [PATCH 3/3] vxlan: add capability for multiple fdb entries

2020-06-08 Thread Johannes Kimmel
Similar to wireguard, vxlan can configure multiple peers or add specific
entries to the fdb for a single mac address.

While you can still use peeraddr/peer6addr option within the proto
vxlan/vxlan6 section to not break existing configurations, this patch
allows to add multiple sections that conigure fdb entries via the bridge
command. As such, the bridge command is now a dependency of the vxlan
package. (To be honest without the bridge command available, vxlan isn't
very much fun to use or debug at all)

Field names are taken direclty from the bridge command.

Example with all supported parameters, since this hasn't been documented so
far:

  config interface 'vx0'
  option proto 'vxlan6'  # use vxlan over ipv6

  # main options
  option ip6addr   '2001:db8::1' # listen address
  option tunlink   'wan6'# optional if listen address given
  option peer6addr '2001:db8::2' # now optional
  option port  '8472'# this is the standard port under linux
  option vid   '42'  # VXLAN Network Identifier to use
  option mtu   '1430'# vxlan6 has 70 bytes overhead

  # extra options
  option rxcsum  '0'  # allow receiving packets without checksum
  option txcsum  '0'  # send packets without checksum
  option ttl '16' # specifies the TTL value for outgoing packets
  option tos '0'  # specifies the TOS value for outgoing packets
  option macaddr '11:22:33:44:55:66' # optional, manually specify mac
 # default is a random address

Single peer with head-end replication. Corresponds to the following call
to bridge:

  $ bridge fdb append 00:00:00:00:00:00 dev vx0 dst 2001:db8::3

  config vxlan_vx0
  option dst '2001:db8::3' # always required

It's possible to specify a multicast address as destination. Useful when
multicast routing is available or within one lan segment:

  config vxlan_vx0
  option dst 'ff02::1337' # multicast group to join.
  # all bum traffic will be send there
  option via 'eth1'   # for multicast, an outgoing interface needs
  # to be specified

All available peer options for completeness:

  config vxlan_vx0
  option lladdr  'aa:bb:cc:dd:ee:ff' # specific mac,
  option dst '2001:db8::4'   # connected to this peer
  option via 'eth0.1'# use this interface only
  option port'4789'  # use different port for this peer
  option vni '23'# override vni for this peer
  option src_vni '123'   # see man 3 bridge

Signed-off-by: Johannes Kimmel 
---
 package/network/config/vxlan/Makefile   |  2 +-
 package/network/config/vxlan/files/vxlan.sh | 36 -
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/package/network/config/vxlan/Makefile 
b/package/network/config/vxlan/Makefile
index 5850c44..46970d9 100644
--- a/package/network/config/vxlan/Makefile
+++ b/package/network/config/vxlan/Makefile
@@ -11,7 +11,7 @@ define Package/vxlan
   CATEGORY:=Network
   MAINTAINER:=Matthias Schiffer 
   TITLE:=Virtual eXtensible LAN config support
-  DEPENDS:=+kmod-vxlan
+  DEPENDS:=+kmod-vxlan +ip-bridge
   PKGARCH:=all
 endef
 
diff --git a/package/network/config/vxlan/files/vxlan.sh 
b/package/network/config/vxlan/files/vxlan.sh
index bdcaa62..319d95c 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -7,6 +7,38 @@
init_proto "$@"
 }
 
+proto_vxlan_setup_peer() {
+   local peer_config="$1"
+
+   local lladdr
+   local dst
+   local src_vni
+   local vni
+   local port
+   local via
+
+   config_get lladdr  "${peer_config}" "lladdr"
+   config_get dst "${peer_config}" "dst"
+   config_get src_vni "${peer_config}" "src_vni"
+   config_get vni "${peer_config}" "vni"
+   config_get port"${peer_config}" "port"
+   config_get via "${peer_config}" "via"
+
+   [ -z "${dst}" ] && {
+   proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
+   exit
+   }
+
+   bridge fdb append \
+   ${lladdr:-00:00:00:00:00:00} \
+   dev ${cfg}   \
+   ${dst:+dst $dst} \
+   ${src_vni:+src_vni $src_vni} \
+   ${vni:+vni $vni} \
+   ${port:+port $port}  \
+   ${via:+via $via}
+}
+
 vxlan_generic_setup() {
local cfg="$1"
local mode="$2"
@@ -18,7 +50,6 @@ vxlan_generic_setup() {
local port vid ttl tos mtu macaddr zone rxcsum txcsum
json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum
 
-
proto_init_update "$link" 1
 
proto_add_tunnel
@@ -47,6 +78,9 @@ vxlan_generic_setup() {
proto_close_data
 
proto_send_update "$cfg"
+
+   config_lo

[OpenWrt-Devel] [PATCH 2/3] vxlan: remove mandatory peeraddr

2020-06-08 Thread Johannes Kimmel
vxlan can be configured without a peer address. This is used to prepare
an interface and add peers later.

Signed-off-by: Johannes Kimmel 
---
 package/network/config/vxlan/files/vxlan.sh | 12 
 1 file changed, 12 deletions(-)

diff --git a/package/network/config/vxlan/files/vxlan.sh 
b/package/network/config/vxlan/files/vxlan.sh
index 7b1c703..bdcaa62 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -55,12 +55,6 @@ proto_vxlan_setup() {
local ipaddr peeraddr
json_get_vars ipaddr peeraddr tunlink
 
-   [ -z "$peeraddr" ] && {
-   proto_notify_error "$cfg" "MISSING_ADDRESS"
-   proto_block_restart "$cfg"
-   exit
-   }
-
( proto_add_host_dependency "$cfg" '' "$tunlink" )
 
[ -z "$ipaddr" ] && {
@@ -85,12 +79,6 @@ proto_vxlan6_setup() {
local ip6addr peer6addr
json_get_vars ip6addr peer6addr tunlink
 
-   [ -z "$peer6addr" ] && {
-   proto_notify_error "$cfg" "MISSING_ADDRESS"
-   proto_block_restart "$cfg"
-   exit
-   }
-
( proto_add_host_dependency "$cfg" '' "$tunlink" )
 
[ -z "$ip6addr" ] && {
-- 
2.27.0


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


[OpenWrt-Devel] [PATCH 1/3] vxlan: fix udp checksum control

2020-06-08 Thread Johannes Kimmel
So far, passing "rxcsum" and "txcsum" had no effect.

Signed-off-by: Johannes Kimmel 
---
 package/network/config/vxlan/files/vxlan.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/network/config/vxlan/files/vxlan.sh 
b/package/network/config/vxlan/files/vxlan.sh
index d055d41..7b1c703 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -129,6 +129,8 @@ vxlan_generic_init_config() {
proto_config_add_int "ttl"
proto_config_add_int "tos"
proto_config_add_int "mtu"
+   proto_config_add_boolean "rxcsum"
+   proto_config_add_boolean "txcsum"
proto_config_add_string "macaddr"
 }
 
-- 
2.27.0


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


[OpenWrt-Devel] [PATCH 0/3] vxlan: add capability for multiple fdb entries

2020-06-08 Thread Johannes Kimmel
This is a small series of patches to add multiple fdb entries for vxlan
interfaces.

First patch fixes an issue where the options for controlling checksums
wasn't working.

Second patch removes the requirement to specify a peeraddr, because
vxlan interfaces can be created without them.

Third patch introduces new config sections for vxlan peers similar to
wireguard peers. See patches for more info.

Johannes Kimmel (3):
  vxlan: fix udp checksum control
  vxlan: remove mandatory peeraddr
  vxlan: add capability for multiple fdb entries

 package/network/config/vxlan/Makefile   |  2 +-
 package/network/config/vxlan/files/vxlan.sh | 50 +++--
 2 files changed, 38 insertions(+), 14 deletions(-)

-- 
2.27.0


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


Re: [OpenWrt-Devel] [PATCH 4/4] ath79: add support for D-Link DAP-2695-A1

2020-06-08 Thread mail
Hi Stijn,

find my comments inline.

> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> On Behalf Of Stijn Tintel
> Sent: Montag, 8. Juni 2020 11:37
> To: openwrt-devel@lists.openwrt.org
> Subject: [OpenWrt-Devel] [PATCH 4/4] ath79: add support for D-Link DAP-
> 2695-A1
> 
> Hardware:
> * SoC: Qualcomm Atheros QCA9558
> * RAM: 256MB
> * Flash: 16MB SPI NOR
> * Ethernet: 2x 10/100/1000 (1x 802.3at PoE-PD)
> * WiFi 2.4GHz: Qualcomm Atheros QCA9558
> * WiFi 5GHz: Qualcomm Ahteros QCA9880-2R4E
> * LEDS: 1x 5GHz, 1x 2.4GHz, 1x LAN1(POE), 1x LAN2, 1x POWER
> * Buttons: 1x RESET
> * UART: 1x RJ45 RS-232 Console port
> 
> Installation via stock firmware:
> * Install the factory image via the stock firmware web interface
> 
> Installation via bootloader Emergency Web Server:
> * Connect your PC to the LAN1(PoE) port
> * Configure your PC with IP address 192.168.0.90
> * Open a serial console to the Console port (115200,8n1)
> * Press "q" within 2s when "press 'q' to stop autoboot" appears
> * Open http://192.168.0.50 in a browser
> * Upload either the factory or the sysupgrade image
> * Once you see "write image into flash...OK,dest addr=0x9f07" you
>   can power-cycle the device. Ignore "checksum bad" messages.
> 
> Setting the MAC addresses for the ethernet interfaces via
> /etc/board.d/02_network adds the following snippets to
> /etc/config/network:
> 
> config device 'lan_eth0_1_dev'
> option name 'eth0.1'
> option macaddr 'xx:xx:xx:xx:xx:xx'
> 
> config device 'wan_eth1_2_dev'
> option name 'eth1.2'
> option macaddr 'xx:xx:xx:xx:xx:xx'
> 
> This would result in the proper MAC addresses being set for the VLAN
> subinterfaces, but the parent interfaces would still have a random MAC
> address. Using untagged VLANs could solve this, but would still leave those
> extra snippets in /etc/config/network, and then the device VLAN setup
> would differ from the one used in ar71xx. Therefore, the MAC addresses of
> the ethernet interfaces are being set via preinit instead.
> 
> The bdcfg partition contains 4 MAC address labels:
> - lanmac
> - wanmac
> - wlanmac
> - wlanmac_a
> 
> The first 3 all contain the same MAC address, which is also the one on the
> label. This MAC address is used for the 2.4GHz interface, eth0 uses this
> MAC+1, eth1 uses this MAC+2, as is done in ar71xx.
> 
> Signed-off-by: Stijn Tintel 
> ---
>  .../ath79/dts/qca9558_dlink_dap-2695-a1.dts   | 172 ++
>  .../generic/base-files/etc/board.d/01_leds|   5 +
>  .../generic/base-files/etc/board.d/02_network |   6 +
>  .../etc/hotplug.d/firmware/10-ath9k-eeprom|   4 +
>  .../etc/hotplug.d/firmware/11-ath10k-caldata  |   4 +
>  .../etc/uci-defaults/09_fix-checksum  |   8 +
>  .../base-files/lib/preinit/10_fix_eth_mac.sh  |   5 +
>  target/linux/ath79/image/generic-dlink.mk |  33 
>  8 files changed, 237 insertions(+)
>  create mode 100644 target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> 
> diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> new file mode 100644
> index 00..fdabbcb84a
> --- /dev/null
> +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
> @@ -0,0 +1,172 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/;
> +
> +#include 
> +#include 
> +
> +#include "qca955x.dtsi"
> +
> +/ {
> + compatible = "dlink,dap-2695-a1", "qca,qca9557";
> + model = "D-link DAP-2695-A1";
> +
> + chosen {
> + bootargs = "console=ttyS0,115200n8";
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + power_green {
> + label = "d-link:green:power";
> + gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
> + default-state = "off";

default-state = "off" is default and can be dropped for all leds.

Consider using default-state = "on" for power_green and adding an aliases 
section with power_green and/or power_red for indicating boot/failsafe etc.

> + };
> +
> + power_red {
> + label = "d-link:red:power";
> + gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
> + default-state = "off";
> + };
> +
> + wifi_2g {

I'd be consistent with the label here and use wifi2g for the node name.

> + label = "d-link:green:wifi2g";
> + gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
> + default-state = "off";
> + };
> + };
> +
> + keys {
> + compatible = "gpio-keys-polled";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + poll-interval = <20>;

Can you try with gpio-keys for the compatible, and drop the poll-interval?
Despite, I think the two cells lines are not needed and can be dropped as well.

> +
> + button@0 {

I'd use "reset

Re: [OpenWrt-Devel] [PATCH 3/4] ath79: use separate file for generic D-Link images

2020-06-08 Thread mail
Hi Stijn,

> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> On Behalf Of Stijn Tintel
> Sent: Montag, 8. Juni 2020 11:37
> To: openwrt-devel@lists.openwrt.org
> Subject: [OpenWrt-Devel] [PATCH 3/4] ath79: use separate file for generic D-
> Link images
> 
> Move the generic D-Link image definitions to a separate file, as is done for
> several other vendors.
> 
> Signed-off-by: Stijn Tintel 
> ---
>  target/linux/ath79/image/Makefile |   1 +
>  target/linux/ath79/image/generic-dlink.mk | 114
> +
>  target/linux/ath79/image/generic.mk   | 115 --
>  3 files changed, 115 insertions(+), 115 deletions(-)  create mode 100644
> target/linux/ath79/image/generic-dlink.mk
> 
> diff --git a/target/linux/ath79/image/Makefile
> b/target/linux/ath79/image/Makefile
> index 529baf8f57..6a286d3f1f 100644
> --- a/target/linux/ath79/image/Makefile
> +++ b/target/linux/ath79/image/Makefile
> @@ -70,6 +70,7 @@ endef
> 
>  ifeq ($(SUBTARGET),generic)
>  include ./generic.mk
> +include ./generic-dlink.mk

I'd have used generic-d-link.mk here, to match the style of the other file for 
tp-link ...

>  include ./generic-tp-link.mk
>  include ./generic-ubnt.mk
>  endif
> diff --git a/target/linux/ath79/image/generic-dlink.mk
> b/target/linux/ath79/image/generic-dlink.mk
> new file mode 100644
> index 00..96cb015a09
> --- /dev/null
> +++ b/target/linux/ath79/image/generic-dlink.mk

Though it's not precisely necessary since all files get included anywhere, it 
would be more tidy to also move the Build recipes.
E.g. Device/seama is used in both generic.mk and dlink.mk now, so it should be 
moved to parent Makefile as both .mk files "depend" on it.
Same might apply to other actual build recipes and DEVICE_VARS, which should be 
moved to either dlink.mk if they are only needed there or to Makefile if they 
are required in multiple places.

Again, this is not literally required, but it would be much easier to find 
stuff then.

Best

Adrian

> @@ -0,0 +1,114 @@
> +define Device/dlink_dir-505
> +  SOC := ar9330
> +  DEVICE_VENDOR := D-Link
> +  DEVICE_MODEL := DIR-505
> +  IMAGE_SIZE := 7680k
> +  DEVICE_PACKAGES := kmod-usb2
> +  SUPPORTED_DEVICES += dir-505-a1
> +endef
> +TARGET_DEVICES += dlink_dir-505
> +
> +define Device/dlink_dir-825-b1
> +  SOC := ar7161
> +  DEVICE_VENDOR := D-Link
> +  DEVICE_MODEL := DIR-825
> +  DEVICE_VARIANT := B1
> +  IMAGE_SIZE := 6208k
> +  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
> + append-metadata | check-size
> +  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-
> usbport \
> + kmod-leds-reset kmod-owl-loader
> +  SUPPORTED_DEVICES += dir-825-b1
> +endef
> +TARGET_DEVICES += dlink_dir-825-b1
> +
> +define Device/dlink_dir-825-c1
> +  SOC := ar9344
> +  DEVICE_VENDOR := D-Link
> +  DEVICE_MODEL := DIR-825
> +  DEVICE_VARIANT := C1
> +  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-
> reset \
> + kmod-owl-loader
> +  SUPPORTED_DEVICES += dir-825-c1
> +  IMAGE_SIZE := 15936k
> +  IMAGES := factory.bin sysupgrade.bin
> +  IMAGE/default := append-kernel | pad-to (BLOCKSIZE) | append-
> rootfs | \
> + pad-rootfs
> +  IMAGE/factory.bin := $$(IMAGE/default) | pad-offset (IMAGE_SIZE)
> 26 | \
> + append-string 00DB120AR9344-RT-101214-00 | check-size
> +  IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
> + check-size
> +endef
> +TARGET_DEVICES += dlink_dir-825-c1
> +
> +define Device/dlink_dir-835-a1
> +  SOC := ar9344
> +  DEVICE_VENDOR := D-Link
> +  DEVICE_MODEL := DIR-835
> +  DEVICE_VARIANT := A1
> +  DEVICE_PACKAGES := kmod-usb2 kmod-leds-reset kmod-owl-loader
> +  SUPPORTED_DEVICES += dir-835-a1
> +  IMAGE_SIZE := 15936k
> +  IMAGES := factory.bin sysupgrade.bin
> +  IMAGE/default := append-kernel | pad-to (BLOCKSIZE) | append-
> rootfs | \
> + pad-rootfs
> +  IMAGE/factory.bin := $$(IMAGE/default) | pad-offset (IMAGE_SIZE)
> 26 | \
> + append-string 00DB120AR9344-RT-101214-00 | check-size
> +  IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
> + check-size
> +endef
> +TARGET_DEVICES += dlink_dir-835-a1
> +
> +define Device/dlink_dir-842-c
> +  SOC := qca9563
> +  DEVICE_VENDOR := D-Link
> +  DEVICE_MODEL := DIR-842
> +  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma
> +  KERNEL_INITRAMFS := $$(KERNEL) | seama
> +  IMAGES += factory.bin
> +  SEAMA_MTDBLOCK := 5
> +  SEAMA_SIGNATURE := wrgac65_dlink.2015_dir842
> +  # 64 bytes offset:
> +  # - 28 bytes seama_header
> +  # - 36 bytes of META data (4-bytes aligned)
> +  IMAGE/default := append-kernel | uImage lzma | \
> + pad-offset (BLOCKSIZE) 64 | append-rootfs
> +  IMAGE/sysupgrade.bin := $$(IMAGE/default) | seama | pad-rootfs | \
> + append-metadata | check-size
> +  IMAGE/factory.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \
> + seama-seal | check-size
> +  IMAGE_SIZE

[OpenWrt-Devel] [PATCH 4/4] ath79: add support for D-Link DAP-2695-A1

2020-06-08 Thread Stijn Tintel
Hardware:
* SoC: Qualcomm Atheros QCA9558
* RAM: 256MB
* Flash: 16MB SPI NOR
* Ethernet: 2x 10/100/1000 (1x 802.3at PoE-PD)
* WiFi 2.4GHz: Qualcomm Atheros QCA9558
* WiFi 5GHz: Qualcomm Ahteros QCA9880-2R4E
* LEDS: 1x 5GHz, 1x 2.4GHz, 1x LAN1(POE), 1x LAN2, 1x POWER
* Buttons: 1x RESET
* UART: 1x RJ45 RS-232 Console port

Installation via stock firmware:
* Install the factory image via the stock firmware web interface

Installation via bootloader Emergency Web Server:
* Connect your PC to the LAN1(PoE) port
* Configure your PC with IP address 192.168.0.90
* Open a serial console to the Console port (115200,8n1)
* Press "q" within 2s when "press 'q' to stop autoboot" appears
* Open http://192.168.0.50 in a browser
* Upload either the factory or the sysupgrade image
* Once you see "write image into flash...OK,dest addr=0x9f07" you
  can power-cycle the device. Ignore "checksum bad" messages.

Setting the MAC addresses for the ethernet interfaces via
/etc/board.d/02_network adds the following snippets to
/etc/config/network:

config device 'lan_eth0_1_dev'
option name 'eth0.1'
option macaddr 'xx:xx:xx:xx:xx:xx'

config device 'wan_eth1_2_dev'
option name 'eth1.2'
option macaddr 'xx:xx:xx:xx:xx:xx'

This would result in the proper MAC addresses being set for the VLAN
subinterfaces, but the parent interfaces would still have a random MAC
address. Using untagged VLANs could solve this, but would still leave
those extra snippets in /etc/config/network, and then the device VLAN
setup would differ from the one used in ar71xx. Therefore, the MAC
addresses of the ethernet interfaces are being set via preinit instead.

The bdcfg partition contains 4 MAC address labels:
- lanmac
- wanmac
- wlanmac
- wlanmac_a

The first 3 all contain the same MAC address, which is also the one on
the label. This MAC address is used for the 2.4GHz interface, eth0 uses
this MAC+1, eth1 uses this MAC+2, as is done in ar71xx.

Signed-off-by: Stijn Tintel 
---
 .../ath79/dts/qca9558_dlink_dap-2695-a1.dts   | 172 ++
 .../generic/base-files/etc/board.d/01_leds|   5 +
 .../generic/base-files/etc/board.d/02_network |   6 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom|   4 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   4 +
 .../etc/uci-defaults/09_fix-checksum  |   8 +
 .../base-files/lib/preinit/10_fix_eth_mac.sh  |   5 +
 target/linux/ath79/image/generic-dlink.mk |  33 
 8 files changed, 237 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts

diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts 
b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
new file mode 100644
index 00..fdabbcb84a
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
@@ -0,0 +1,172 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca955x.dtsi"
+
+/ {
+   compatible = "dlink,dap-2695-a1", "qca,qca9557";
+   model = "D-link DAP-2695-A1";
+
+   chosen {
+   bootargs = "console=ttyS0,115200n8";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power_green {
+   label = "d-link:green:power";
+   gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+   default-state = "off";
+   };
+
+   power_red {
+   label = "d-link:red:power";
+   gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+   default-state = "off";
+   };
+
+   wifi_2g {
+   label = "d-link:green:wifi2g";
+   gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+   default-state = "off";
+   };
+   };
+
+   keys {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+
+   button@0 {
+   label = "reset";
+   linux,code = ;
+   gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+   };
+   };
+};
+
+&spi {
+   status = "okay";
+   num-cs = <1>;
+
+   flash@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "mx25l12805d";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   uboot:  partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "bdcfg";
+  

[OpenWrt-Devel] [PATCH 1/4] mtd: enable wrgg support for ath79

2020-06-08 Thread Stijn Tintel
This is required for the D-Link DAP-2695-A1.

Signed-off-by: Stijn Tintel 
---
 package/system/mtd/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile
index e504a04478..6da31a04a4 100644
--- a/package/system/mtd/src/Makefile
+++ b/package/system/mtd/src/Makefile
@@ -8,7 +8,7 @@ obj.wrg = wrg.o md5.o
 obj.wrgg = wrgg.o md5.o
 obj.tpl = tpl_ramips_recoveryflag.o
 obj.ar71xx = trx.o $(obj.seama) $(obj.wrgg)
-obj.ath79 = $(obj.seama)
+obj.ath79 = $(obj.seama) $(obj.wrgg)
 obj.gemini = $(obj.wrgg)
 obj.brcm = trx.o
 obj.bcm47xx = $(obj.brcm)
-- 
2.26.2


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


[OpenWrt-Devel] [PATCH 3/4] ath79: use separate file for generic D-Link images

2020-06-08 Thread Stijn Tintel
Move the generic D-Link image definitions to a separate file, as is done
for several other vendors.

Signed-off-by: Stijn Tintel 
---
 target/linux/ath79/image/Makefile |   1 +
 target/linux/ath79/image/generic-dlink.mk | 114 +
 target/linux/ath79/image/generic.mk   | 115 --
 3 files changed, 115 insertions(+), 115 deletions(-)
 create mode 100644 target/linux/ath79/image/generic-dlink.mk

diff --git a/target/linux/ath79/image/Makefile 
b/target/linux/ath79/image/Makefile
index 529baf8f57..6a286d3f1f 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -70,6 +70,7 @@ endef
 
 ifeq ($(SUBTARGET),generic)
 include ./generic.mk
+include ./generic-dlink.mk
 include ./generic-tp-link.mk
 include ./generic-ubnt.mk
 endif
diff --git a/target/linux/ath79/image/generic-dlink.mk 
b/target/linux/ath79/image/generic-dlink.mk
new file mode 100644
index 00..96cb015a09
--- /dev/null
+++ b/target/linux/ath79/image/generic-dlink.mk
@@ -0,0 +1,114 @@
+define Device/dlink_dir-505
+  SOC := ar9330
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-505
+  IMAGE_SIZE := 7680k
+  DEVICE_PACKAGES := kmod-usb2
+  SUPPORTED_DEVICES += dir-505-a1
+endef
+TARGET_DEVICES += dlink_dir-505
+
+define Device/dlink_dir-825-b1
+  SOC := ar7161
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-825
+  DEVICE_VARIANT := B1
+  IMAGE_SIZE := 6208k
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
+   append-metadata | check-size
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
+   kmod-leds-reset kmod-owl-loader
+  SUPPORTED_DEVICES += dir-825-b1
+endef
+TARGET_DEVICES += dlink_dir-825-b1
+
+define Device/dlink_dir-825-c1
+  SOC := ar9344
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-825
+  DEVICE_VARIANT := C1
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset \
+   kmod-owl-loader
+  SUPPORTED_DEVICES += dir-825-c1
+  IMAGE_SIZE := 15936k
+  IMAGES := factory.bin sysupgrade.bin
+  IMAGE/default := append-kernel | pad-to (BLOCKSIZE) | append-rootfs | \
+   pad-rootfs
+  IMAGE/factory.bin := $$(IMAGE/default) | pad-offset (IMAGE_SIZE) 26 | \
+   append-string 00DB120AR9344-RT-101214-00 | check-size
+  IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
+   check-size
+endef
+TARGET_DEVICES += dlink_dir-825-c1
+
+define Device/dlink_dir-835-a1
+  SOC := ar9344
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-835
+  DEVICE_VARIANT := A1
+  DEVICE_PACKAGES := kmod-usb2 kmod-leds-reset kmod-owl-loader
+  SUPPORTED_DEVICES += dir-835-a1
+  IMAGE_SIZE := 15936k
+  IMAGES := factory.bin sysupgrade.bin
+  IMAGE/default := append-kernel | pad-to (BLOCKSIZE) | append-rootfs | \
+   pad-rootfs
+  IMAGE/factory.bin := $$(IMAGE/default) | pad-offset (IMAGE_SIZE) 26 | \
+   append-string 00DB120AR9344-RT-101214-00 | check-size
+  IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
+   check-size
+endef
+TARGET_DEVICES += dlink_dir-835-a1
+
+define Device/dlink_dir-842-c
+  SOC := qca9563
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-842
+  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma
+  KERNEL_INITRAMFS := $$(KERNEL) | seama
+  IMAGES += factory.bin
+  SEAMA_MTDBLOCK := 5
+  SEAMA_SIGNATURE := wrgac65_dlink.2015_dir842
+  # 64 bytes offset:
+  # - 28 bytes seama_header
+  # - 36 bytes of META data (4-bytes aligned)
+  IMAGE/default := append-kernel | uImage lzma | \
+   pad-offset (BLOCKSIZE) 64 | append-rootfs
+  IMAGE/sysupgrade.bin := $$(IMAGE/default) | seama | pad-rootfs | \
+   append-metadata | check-size
+  IMAGE/factory.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \
+   seama-seal | check-size
+  IMAGE_SIZE := 15680k
+endef
+
+define Device/dlink_dir-842-c1
+  $(Device/dlink_dir-842-c)
+  DEVICE_VARIANT := C1
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
+endef
+TARGET_DEVICES += dlink_dir-842-c1
+
+define Device/dlink_dir-842-c2
+  $(Device/dlink_dir-842-c)
+  DEVICE_VARIANT := C2
+  DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9888-ct
+endef
+TARGET_DEVICES += dlink_dir-842-c2
+
+define Device/dlink_dir-842-c3
+  $(Device/dlink_dir-842-c)
+  DEVICE_VARIANT := C3
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
+endef
+TARGET_DEVICES += dlink_dir-842-c3
+
+define Device/dlink_dir-859-a1
+  $(Device/seama)
+  SOC := qca9563
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DIR-859
+  DEVICE_VARIANT := A1
+  IMAGE_SIZE := 15872k
+  DEVICE_PACKAGES :=  kmod-usb2 kmod-ath10k-ct-smallbuffers 
ath10k-firmware-qca988x-ct
+  SEAMA_SIGNATURE := wrgac37_dlink.2013gui_dir859
+endef
+TARGET_DEVICES += dlink_dir-859-a1
diff --git a/target/linux/ath79/image/generic.mk 
b/target/linux/ath79/image/generic.mk
index 45dfc6bdad..cba2f51697 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -458,

[OpenWrt-Devel] [PATCH 0/4] ath79: add support for D-Link DAP-2695-A1

2020-06-08 Thread Stijn Tintel
This series adds support for the D-Link DAP-2695-A1 to the ath79 target.
Also available in my staging tree at [0].

Successfully tested sysupgrade from ar71xx to ath79.

[0] https://git.openwrt.org/?p=openwrt/staging/stintel.git;a=summary


Stijn Tintel (4):
  mtd: enable wrgg support for ath79
  ath79: enable wrgg MTD splitter
  ath79: use separate file for generic D-Link images
  ath79: add support for D-Link DAP-2695-A1

 package/system/mtd/src/Makefile   |   2 +-
 target/linux/ath79/config-4.19|   1 +
 target/linux/ath79/config-5.4 |   1 +
 .../ath79/dts/qca9558_dlink_dap-2695-a1.dts   | 172 ++
 .../generic/base-files/etc/board.d/01_leds|   5 +
 .../generic/base-files/etc/board.d/02_network |   6 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom|   4 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   4 +
 .../etc/uci-defaults/09_fix-checksum  |   8 +
 .../base-files/lib/preinit/10_fix_eth_mac.sh  |   5 +
 target/linux/ath79/image/Makefile |   1 +
 target/linux/ath79/image/generic-dlink.mk | 147 +++
 target/linux/ath79/image/generic.mk   | 115 
 13 files changed, 355 insertions(+), 116 deletions(-)
 create mode 100644 target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts
 create mode 100644 target/linux/ath79/image/generic-dlink.mk

-- 
2.26.2


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


[OpenWrt-Devel] [PATCH 2/4] ath79: enable wrgg MTD splitter

2020-06-08 Thread Stijn Tintel
This is required for the D-Link DAP-2695.

Signed-off-by: Stijn Tintel 
---
 target/linux/ath79/config-4.19 | 1 +
 target/linux/ath79/config-5.4  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ath79/config-4.19 b/target/linux/ath79/config-4.19
index cfa0ebd759..81fd017aba 100644
--- a/target/linux/ath79/config-4.19
+++ b/target/linux/ath79/config-4.19
@@ -171,6 +171,7 @@ CONFIG_MTD_SPLIT_LZMA_FW=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_TPLINK_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
+CONFIG_MTD_SPLIT_WRGG_FW=y
 CONFIG_MTD_VIRT_CONCAT=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_PER_CPU_KM=y
diff --git a/target/linux/ath79/config-5.4 b/target/linux/ath79/config-5.4
index 80f7209b5b..b458edce1e 100644
--- a/target/linux/ath79/config-5.4
+++ b/target/linux/ath79/config-5.4
@@ -178,6 +178,7 @@ CONFIG_MTD_SPLIT_LZMA_FW=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_TPLINK_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
+CONFIG_MTD_SPLIT_WRGG_FW=y
 CONFIG_MTD_VIRT_CONCAT=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_PER_CPU_KM=y
-- 
2.26.2


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


[OpenWrt-Devel] Google Season of Docs projects for OpenWrt

2020-06-08 Thread Baptiste Jonglez
Hi,

As discussed previously, OpenWrt has applied and been accepted for the
Season of Docs.  We have three mentors (me, Jow, Thomas Hühn), while Hauke
and Paul are "project administrators".

We started proposing projects here: https://openwrt.org/google-season-of-docs

Feel free to discuss the proposed projects here, especially if you plan to
apply as a technical writer.  The goal is to clarify the projects if
needed, and make sure that we provide a good match between projects and
technical writer applications.

The deadline for applying as a technical writer is July 9, see
https://developers.google.com/season-of-docs/docs/timeline

More information about being a technical writer (requirements, stipend
amount, etc) is here: 
https://developers.google.com/season-of-docs/docs/tech-writer-guide

Baptiste


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel