Commit Graph

30 Commits

Author SHA1 Message Date
Adrian Schmutzler 8fe7512ae5 ramips/mt76x8: Add support for TP-Link Archer C50 v4
Add support for the TP-Link Archer C50 v4, a low-cost mt7628-based
dual-band router.

Label MAC address is on ethernet and 2.4 GHz WiFi.

The v4 uses the same hardware as the v3 variant, but v4 includes
the newer split uboot.

ATTENTION:

Initial flashing of this device requires additional steps:

As all installation methods require an U-Boot to be integrated into the
image (and we do not ship one with the image) we are not able to create
an image in our build-process.

Download a TP-Link image from their Website and a FFF/OpenWRT sysupgrade
image for the device and build yourself a factory image like following:

TP-Link image:             tpl.bin
OpenWRT sysupgrade image:  owrt.bin

 > dd if=tpl.bin of=boot.bin bs=131584 count=1
 > cat owrt.bin >> boot.bin

This image can be used for Web-UI and recovery, but not TFTP.

Additional instruction can be found in the OpenWrt commit
01dcd574a248 ("ramips: add support for Archer C50 v4")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-12-09 13:10:09 +01:00
Adrian Schmutzler 24be8ecdda fff-network: fix unintended wan=eth1 for two-port devices
For historic reasons, the wan interface is set to eth1 as default
value. When updating the config for one-port devices in
configurenetwork, the same value is put there again if the mode
is switched to something != WAN, instead of just removing the
value.

While ifname actually is a mandatory value, this has been handled
inconsistently in the past, where ethmesh ifname was deleted, and
wan ifname was just changed back to eth1, when assigning the
actually relevant eth0 to a different task.

This concept was set up with a one-port device in mind, i.e. a
device where there is no eth1. However, this very setup routine
got applied to the Nanostation M as well (which is treated as
as one-port), where we suddenly have two interfaces and the eth1
exists.
So, while the user assumes it's unconfigured, the second port
actually becomes set up as WAN if the first one is != WAN.
If connected to a second device with CLIENT (=default) to provide
PoE there, this will create a loop.

So, finally, in order to somehow fix this mess, this patch just
changes the hardcoded "eth1" to "eth2". While this is no proper
fix, it perpetuates the original idea of keeping wan set to
something, but nothing which actually exists. However, there are
no sideeffects and we keep this minimal-invasive.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-09-15 13:05:49 +02:00
Fabian Bläse b5563caa23 fff-network: Improve IPv6 WAN connectivity
Until now, IPv6 connectivity was only ensured by some custom sysctls.
OpenWrt has a proper way of enabling IPv6 client (SLAAC, as well as DHCPv6)
for an interface. Switching to OpenWrt's way of configuring client addresses
for an interface might also make configuration more reliable, as the appropriate
sysctls are now set by netifd. Especially OnePort and TwoPort devices will
benefit from this change, as IPv6 auto configuration does not have to be manually
enabled and disabled for a physical interface, but rather is set as an option for
our logical wan interface.

At the same time this change enables DHCPv6 client support for WAN.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-01 01:09:10 +02:00
Fabian Bläse 1faaec432a fff-network: Group network files by arch, not by target
OpenWrt only builds and installs a packet for each architecture.
If a package is already fully built and installed for a architecture,
it is not rebuilt.

Because we have two different BSPs building two different targets (BOARDs)
using the same architecture (ath79 and ar71xx, mips), the fff-network package
is not reinstalled when switching between those.

However, we have defined an install step, which copies the necessary network
files seperated by board. But because the package is not rebuilt when switching
targets, the wrong network files might be present in the package.

To resolve this issue, the network files are now seperated by ARCH instead of
the target (i.e. the BOARD variable).

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Robert Langhammer <rlanghammer@web.de>
[bump PKG_RELEASE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-18 12:47:05 +02:00
Adrian Schmutzler 1cf4d762ff treewide: move devices from ar71xx to ath79
This patch moves device support for ar71xx devices that are supported
in ath79. Building them with ath79 will be the new default.

The only devices remaining in ar71xx will be the following, as backporting
them to openwrt-19.07 is too complicated:
- cpe210-v1
- cpe510-v1

Accordingly, no tiny devices are left in ar71xx and we can drop the relevant
patches, and build ar71xx as generic again.

For the tl-wr741nd-v2, in ath79 the tplink_tl-wr741-v1 image is used.

The move from ar71xx to ath79 requires some adjustments on the way:
- The board names and image names on ath79 contain the vendor name,
  where the former have it separated by a comma (tplink,cpe210-v2)
  and the latter use an underscore (tplink_cpe210-v2). It is
  safe to assume that this is the only difference between board and
  image names.
  Consequently, the ath79 devices will use their full board name also
  in our firmware. A lot of renames in fff-boardname can be dropped.
  The rename for fff-sysupgrade is already present in fff-upgrade.sh
  While at it, fix that for the WDR4900 v1 as well.
- Due to a different switch driver, the startup of ethernet devices
  is altered, which leads to eth0 and eth1 being swapped for some ath79
  devices compared to ar71xx. This has been adjusted for SWITCHDEV/WANDEV
  and MAC address setup.
- Since we have direct support for the AC Mesh now, use the proper
  name instead of the AC Lite image. For Ubiquiti, different device
  variants are now available as separate images.
- Remove left-over power-m-xw entry in cpuport file

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Tested-by: Fabian Bläse <fabian@blaese.de>
2020-06-18 12:41:03 +02:00
Adrian Schmutzler d649151399 fff-network: set correct CPUPORT for new mt76x8 devices
When adding support for the TP-Link Archer C50 v3 and TL-WR841N v13,
their CPU port provided for layer-3 setup has not been set correctly.

Do it now.

Fixes: d165915178 ("ramips/mt76x8: Add support for TP-Link Archer C50 v3")
Fixes: 9343153547 ("ramips/mt76x8: Add support for TP-Link TL-WR841N v13")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-05-01 17:47:18 +02:00
Tim Niemeyer b6c7acd704 nodewatcher: split into nodewatcher.d scripts for individual task
This splits up the data extraction/assembly of the nodewatcher
script into several parts and distributes them across packages, so
that each nodewatcher.d subscript is located in the package providing
the relevant functionality. This allows to extend the nodewatcher data
by enabling/disabling packages.
This scheme is not perfectly fulfilled for fff-network vs. fff-wireless,
as data cannot uniquely assigned there and the XML syntax does not allow
separation anyway.

In general, this moves code without applying code improvements, yielding
at an easy comparison of moved fragments. However, the following changes
were done to improve experience:

- The function writing debug output has been renamed from "err" to "debug"
- Since we catch the stdout of the nodewatcher.d functions anyway,
  those scripts were adjusted to echo output directly instead of first
  writing it into a variable and then outputting it at the end.
- The uci config has been kept, but initialization for the network part
  has been moved to the fff-network package.
- Space indent has been changed to tab, which is more common in the
  firmware and requires less space.
- Remove support for nodewatcher run without uci config. Script-based
  nodewatcher on other platforms will have altered code anyway, and
  splitting it up will prevent effective use as a blueprint for those
  cases. After this change, nodewatcher in firmware is supposed to be
  used only for this firmware.

Note that since the nodewatcher.d scripts are evaluated by using their
echo output, having a function created uncaught output to stdout there
will corrupt the XML.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
[rebase and adjustments for current master, use simpler mechanism to
call nodewatcher.d scripts, use tab indent, remove debug() definition
where not needed, do not remove uci config, add commit message, use
echo -n]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[remove 'local' modifier for variable not inside a function, fix typo]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler be80e17c57 ar71xx: remove non-existant ubnt-power-m-xw
The ubnt-power-m-xw identifier was introduced in 0447d0c709
("fff-boardname: introduce new ubnt boards") assuming that the
Ubiquiti Powerbeam M2 XW had a separate model identifier in
/var/sysinfo/model (otherwise, it was derived from loco-m-xw image).

However, OpenWrt has never known about a PowerBeam device. Consequently,
on devices nothing changed, and all PowerBeam devices were still
recognized as Nanostation Loco M XW.

Thus, this patch removes all references to a ubnt-power-m-xw, as it's
never been working anyway.

Note that this also implies that any user of a PowerBeam would have
used the wrong antenna_gain values of the Loco M XW by default (and
will continue to do so).

However, actually the Loco M XW has never been tested or supported
officially for this firmware. The image was only used for the
support of the Powerbeam M2 XW in 68314ea943 ("Add support for
Powerbeam M2 XW"). However, since the firmware is expected to work
and seems to be installed on several devices already, we won't remove
the image for now.

For further reference:
The board and model names set in ar71xx are found in the OpenWrt file
target/linux/ar71xx/base-files/lib/ar71xx.sh

Fixes: 0447d0c709 ("fff-boardname: introduce new ubnt boards")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-31 23:35:40 +02:00
Adrian Schmutzler aa0d237fa9 fff-network: apply upstream swap of MAC addresses for Archer C60
The ethernet MAC addresses of the Archer C60 v1/v2 were swapped
compared to the vendor assignment. This has been fixed in OpenWrt
after 19.07.2.

Apply this to our firmware already, so we cannot forget it later
and prevent having messed-up br-mesh MAC addresses.

The OpenWrt patches can be removed again when bumping to 19.07.3.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:56 +01:00
Adrian Schmutzler aa42a39ce2 fff-network: use static MAC address location for TL-WR1043ND v4
At the moment, the ETHMESHMAC for the TL-WR1043ND v4 is loaded from
the config partition. The data there is written by the stock firmware,
and thus is dependent on the version installed before and may even
vary in position.

Instead, this patch uses the product-info partition, which is not
modified by stock firmware.

While at it, update the sourced library files and the comment for
both v4 and v5.

ref: 53839da46e

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:55 +01:00
Adrian Schmutzler 73e227cdc8 fff-network: account for MAC address change of TL-WDR3600/43x0
In OpenWrt commit 27eea249213b ("ar71xx: fix MAC address setup for
TL-WDR4300 board") the LAN/WAN MAC addresses for the TL-WDR3600,
TL-WDR4300 and TL-WDR4310 were changed.

This creates an overlap of the LAN und 5 GHz MAC addresses, where
the first will also affect the BATMAN interface eth0.3.

To keep BATMAN interfaces with separate addresses, this patch will
set the ETHMESHMAC to eth0 +1, corresponding to the virtual WAN device
(VLAN 2) OpenWrt sets up (which we aren't using anyway).

ref: https://github.com/openwrt/openwrt/commit/27eea249213b04a372491009850926f9282d13

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:54 +01:00
Adrian Schmutzler 7614dc5584 fff-network: account for MAC address change of Archer C7 v2
In OpenWrt commit 8a21bc36229d ("ar71xx: fix MAC addresses for
Archer C5 v1, C7 v1/v2, WDR4900 v2") the WiFi MAC addresses for
the Archer C7 v2 were changed.

This creates an overlap of the LAN und 2.4 GHz MAC addresses, where
the first will also affect the BATMAN interface eth1.3.

To keep BATMAN interfaces with separate addresses, this patch will
set the ETHMESHMAC from eth0, corresponding to the separate WAN
device we are not using in our firmware anyway.

ref: https://github.com/openwrt/openwrt/commit/8a21bc36229d3eabad213ae47fddb4d86d76ac

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:53 +01:00
Adrian Schmutzler 9f25f5dc35 batman-adv: Split batadv proto in meshif and hardif part
This migrates to the new configuration architecture introduced
and required in
54af5a209e

This is a side-effect of the switch to openwrt-19.07.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[fabian@blaese.de: Rebase onto fff firmware master]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-03-15 22:04:43 +01:00
Fabian Bläse 30c7541e6f fff-network: Add portorder to Archer C7v2
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2019-12-10 10:02:26 +01:00
Fabian Bläse ccfde6c655 fff-network: Remove dependency to uradvd
As odhcpd is used as router advertisement server in layer3 variant,
but configurenetwork is still necessary, the dependency to fff-uradvd has
to be removed.

This is done by first checking, if the fff-uradvd service exists, before it
is restarted.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-11-10 14:22:56 +01:00
Adrian Schmutzler fe9c5919e6 fff-network: Remove MTU 1528 from ethmesh device
This interface was using 1500 anyway and setting ethernet to
MTU > 1500 might not be a good idea.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langammer <rlanghammer@web.de>
2019-05-31 17:22:52 +02:00
Adrian Schmutzler fa2ead9306 packages/fff: Use tabs in Makefiles
Currently, Makefile use a mixture of tabs and spaces with various
indents. This harmonizes all Makefiles to use tab indentation only.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-02-05 14:29:31 +01:00
Tim Niemeyer bd5985e99e fff-network: enable forwarding; filter forwarding
Fixes #83
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
2018-03-03 21:34:36 +01:00
Christian Dresel 7b0add8c70 Add support for Unifi AC Mesh
This is the correct firmware for the Unifi AC Mesh I have only
tested at Unifi AC Mesh and not at Unifi AC lite But my information
is, that both have the same Hardware

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-12-23 13:14:06 +01:00
Fabian Bläse 078bb80a53 fff-network: Get MAC from wifi device instead of wifi network
Using wifi devices makes it possible to get mac address
without having to configure wifi networks.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Tested-By: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
- Increment package version
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 18:02:32 +01:00
Adrian Schmutzler e7e27c168c Utilize PKG_NAME in Makefiles
Since there is a PKG_NAME variable, there is no need to repeat
the individual package name five times.

This makes editing and particularly copying Makefiles much
easier, as only the PKG_NAME has to be changed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-10-16 21:20:02 +02:00
Adrian Schmutzler 4dbf136a31 fff-network: Make custom port configuration update-safe
This writes CLIENT/BATMAN/WAN port configurations for devices
with switches to a separate file. This file can be changed
based on the desired setup and is then preserved during
firmware upgrade. In case of a future bugfix concerning the
entries of a specific network.* file, this will still be
effective as only the port configurations reside in the
new file, while the other settings could be overwritten by
the upgrade.

For one- and two-port devices, adjustments have been made so
that their relevant settings also reside in the new file now.

This also adds a WebUI interface for setting the two-port
devices (CPE210 and CPE510).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
 - Changed doc in network.mode
2017-09-17 16:09:28 +02:00
Tim Niemeyer 4d4aa50ffb Add support for TP-Link C25
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2017-08-20 13:58:36 +02:00
Fabian Bläse da71f7f339 Add support for tl-wa901nd-v2
Signed-off-by: Fabian Blaese <fabian@blaese.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
2017-05-30 18:29:01 +02:00
Christian Dresel 9cd2738b36 Add support for wr1043 v4
Dieses Patch fügt den Support für den WR1043 v4 hinzu. Dieses Patch
baut auf den LEDE Patch auf und darf erst nach dem LEDE Patch
applied werden.

Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-02-18 13:55:42 +01:00
Christian Dresel 0950e58c58 Add support for Ubiquiti Unifi AP
Signed-off-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-08-20 15:48:16 +02:00
Tim Niemeyer 92dc0c647d fff-nodewatcher: self-detect client interfaces
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-06-11 14:13:13 +02:00
Tim Niemeyer d9d69f55aa fff-network: move default-bsp files to package
- mv /etc/network.* files to package
- mv /etc/config/network to package
- also removes the bsp specific root_file_system

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-06-11 14:11:37 +02:00
Tim Niemeyer cac1ef47e4 fff-boardname: mv rc.local board detect to package
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-06-11 09:42:09 +02:00
Jan Kraus 4e145b83b9 Moved network configuration script to own package
Signed-off-by: Jan Kraus <mayosemmel@gmail.com>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Changed mode of configurenetwork to 755
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2016-05-16 14:33:22 +02:00