Add support for Ubiquiti EdgeRouter 4 #154

Closed
fbl wants to merge 1 commits from fbl:er4 into master
Owner

This device requires DSA configuration, so this patch is based on #144.

This device requires DSA configuration, so this patch is based on #144.
fbl added 6 commits 2021-07-09 17:51:46 +02:00
bf2d220838 fff-network: fix code flow for one-port devices in configurenetwork
So far, all one-port devices also triggered the switch-based setup
in configurenetwork, as the one-port condition was not checked
there. While the relevant parts are overwritten by the one-port
config which comes later in the script, it still creates a lot
of useless/broken switch/vlan setup entries in /etc/config/network.

Properly check for one-port vs. non-one-port in the file, without
touching anything else.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Fabian Bläse <fabian@blaese.de>
07581af86a fff-network: support native two-port devices
Support native two-port devices by adding TWO_PORT variable and
exploiting the LAN0PORT and LAN1PORT variables designed for the
TP-Link CPE devices. Since the latter have been converted to
real two-port devices, we can now repurpose these variable for
the new setup.

This exploits the existing WANDEV and SWITCHDEV variables to
define the primary and secondary interfaces.

Note that by default this takes the initial values from network.mode,
so if initial WAN/CLIENT should swapped, this has to be added to
the relevant network.* file of the devices.

No device-specific changes are done in this patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3f229c1a56 fff-network: improve "-n" vs. "-z" test in configurenetwork
Simplify a single test.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
8fe37b4dbd fff-network: adapt support for TP-Link CPE210/510 v1
This migrates the support for the TP-Link CPE210 v1 and CPE510 v1
so they are recognized by the new two-port setup code.

Assignment of ports should be consistent to the ar71xx implementation,
i.e. primary port (PoE in) assigned to WAN and secondary port (PoE out)
assigned to CLIENT by default.
Note that this is the exact opposite of the default configuration of
what OpenWrt does (but both have been consistent in behavior).

Since they work again, also re-enable image transfer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
fb44b19e0e fff-network: Add support for DSA switch configuration
Starting with OpenWrt 21.02 some devices now use upstream kernel drivers
for the built-in switch instead of relying on OpenWrt's swconfig driver.

The upstream kernel drivers use the Distributed Switch Architecture
(DSA) for configuration of the switch. Instead of explicitly configuring
the hardware switch, all ports appear as distinct interfaces and linux
bridges are offloaded to the hardware switch if possible.

To keep changes small, this patch adds support for DSA devices by
setting up a linux bridge, which is then treatet just like the
cpuport-interface of the swconfig driver.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
f078c9f495 fff-network: Use DSA network configuration for devices with DSA drivers
Some devices had to be disabled starting with OpenWrt 21.02 due to their
new DSA switch drivers.

As support for DSA configuration has since been added to fff-network,
this makes use of this configuration for devices with DSA drivers.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Author
Owner

Fürs Verständnis: Der EdgeRouter 4 verwendet eigentlich gar kein DSA. Unsere DSA Konfiguration konfiguriert in OpenWrt aber eine VLAN-aware Bridge, die daher ebenso für alle anderen Geräte verwendet werden kann, um mehrere Ports zu bridgen. Nur dass dies dann eben nicht in Hardware passiert.

Dadurch kann außerdem die Konfiguration von allen anderen Single, Dual und Triple-Port Geräten deutlich vereinfacht werden.

Fürs Verständnis: Der EdgeRouter 4 verwendet eigentlich gar kein DSA. Unsere DSA Konfiguration konfiguriert in OpenWrt aber eine VLAN-aware Bridge, die daher ebenso für alle anderen Geräte verwendet werden kann, um mehrere Ports zu bridgen. Nur dass dies dann eben nicht in Hardware passiert. Dadurch kann außerdem die Konfiguration von allen anderen Single, Dual und Triple-Port Geräten deutlich vereinfacht werden.
fbl force-pushed er4 from 9cd80a1b41 to 3cb10f8154 2021-08-05 18:08:18 +02:00 Compare
Author
Owner

Changes:

  • rebase onto current master
Changes: - rebase onto current master
Member

schaut plausibel aus, ich fände ein tested-by noch hübsch da du das Gerät ja bestimmt getestet hast?

Reviewed-by: Christian Dresel <freifunk@dresel.systems>

schaut plausibel aus, ich fände ein tested-by noch hübsch da du das Gerät ja bestimmt getestet hast? `Reviewed-by: Christian Dresel <freifunk@dresel.systems>`
Author
Owner

merged.

merged.
fbl closed this pull request 2021-09-02 18:29:27 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.