Convert GL-AR150 to TWO_PORT #224

Closed
fbl wants to merge 2 commits from fbl:ar150 into master
Owner

The GL-AR150 has two ethernet ports. One of them is connected directly to the CPU (labeled "WAN"), while the other one (labeled "LAN") is connected to the internal switch of the AR9330 platform.

Previously, this device had its own codepath in configurenetwork, utilizing the ETHPORT variable, so the single physical port of the switch could be connected to either the CLIENT or BATMAN vlan of the SWITCHPORT.

When adding support for TWO_PORT devices, this codepath was accidentally removed, so the LAN-Port was not configured anymore.

Configuring the internal switch is not necessary when only a single physical port ist connected to it. Instead, leave the switch unconfigured, so it behaves like an unmanaged vlan-transparent switch.

As we support TWO_PORT devices now, utilize the TWO_PORT codepath (instead of the ONE_PORT codepath, which would be equivalent to the old behaviour) to make both ports configureable. To retain the previously configured mode of the LAN-Port, migrate ETHPORT to LAN1MODE before executing configurenetwork.

Fixes: #222
Fixes: c22032e254 ("fff-network: support native two-port devices")

The GL-AR150 has two ethernet ports. One of them is connected directly to the CPU (labeled "WAN"), while the other one (labeled "LAN") is connected to the internal switch of the AR9330 platform. Previously, this device had its own codepath in configurenetwork, utilizing the ETHPORT variable, so the single physical port of the switch could be connected to either the CLIENT or BATMAN vlan of the SWITCHPORT. When adding support for TWO_PORT devices, this codepath was accidentally removed, so the LAN-Port was not configured anymore. Configuring the internal switch is not necessary when only a single physical port ist connected to it. Instead, leave the switch unconfigured, so it behaves like an unmanaged vlan-transparent switch. As we support TWO_PORT devices now, utilize the TWO_PORT codepath (instead of the ONE_PORT codepath, which would be equivalent to the old behaviour) to make both ports configureable. To retain the previously configured mode of the LAN-Port, migrate ETHPORT to LAN1MODE before executing configurenetwork. Fixes: #222 Fixes: c22032e254 ("fff-network: support native two-port devices")
fbl added this to the 20220405-beta milestone 2022-03-22 22:49:06 +01:00
fbl added 2 commits 2022-03-22 22:49:06 +01:00
37a34fb33c fff-network: convert GL-AR150 to TWOPORT
The GL-AR150 has two ethernet ports. One of them is connected directly
to the CPU (labeled "WAN"), while the other one (labeled "LAN") is
connected to the internal switch of the AR9330 platform.

Previously, this device had its own codepath in configurenetwork,
utilizing the ETHPORT variable, so the single physical port of the
switch could be connected to either the CLIENT or BATMAN vlan of the
SWITCHPORT.

When adding support for TWO_PORT devices, this codepath was accidentally
removed, so the LAN-Port was not configured anymore.

Configuring the internal switch is not necessary when only a single
physical port ist connected to it. Instead, leave the switch
unconfigured, so it behaves like an unmanaged vlan-transparent switch.

As we support TWO_PORT devices now, utilize the TWO_PORT codepath
(instead of the ONE_PORT codepath, which would be equivalent to the old
behaviour) to make both ports configureable. To retain the previously
configured mode of the LAN-Port, migrate ETHPORT to LAN1MODE before
executing configurenetwork.

Fixes: #222
Fixes: c22032e254 ("fff-network: support native two-port devices")

Signed-off-by: Fabian Bläse <fabian@blaese.de>
7c6a4f0acc treewide: remove ETHPORT leftovers
ETHPORT was used to configure devices with two physical ethernet ports,
one of them being connected directly to the CPU, while the other one is
connected to the internal switch of the platform.

As the GL-AR150 has been converted to the TWO_PORT codepath and no other
devices utilizes ETHPORT, remove all leftovers.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Author
Owner
https://fw.sgstbr.de/fff-node-20211224-29-g7c6a4f0-glinet_gl-ar150-sysupgrade.bin
Author
Owner

Da wir die "SWITCHDEV"-Variable für ONE_PORT und TWO_PORT für das CLIENT-device missbrauchen, die uci-Configblöcke für den Switch aber abhängig vom Output von swconfig list erzeugt werden, entstehen beim AR150 weiterhin beim Boot entsprechende switch und switch_vlan-Blöcke. Dies muss noch verhindert werden.

Da wir die "SWITCHDEV"-Variable für ONE_PORT und TWO_PORT für das CLIENT-device missbrauchen, die uci-Configblöcke für den Switch aber abhängig vom Output von `swconfig list` erzeugt werden, entstehen beim AR150 weiterhin beim Boot entsprechende `switch` und `switch_vlan`-Blöcke. Dies muss noch verhindert werden.
Author
Owner

Da wir die "SWITCHDEV"-Variable für ONE_PORT und TWO_PORT für das CLIENT-device missbrauchen, die uci-Configblöcke für den Switch aber abhängig vom Output von swconfig list erzeugt werden, entstehen beim AR150 weiterhin beim Boot entsprechende switch und switch_vlan-Blöcke. Dies muss noch verhindert werden.

Das betrifft im Übrigen auch die CPE210 und vielleicht auch andere Geräte. Vor der Trennung von configurenetwork in statischen und dynamischen Teil war die if-Kaskade leicht anders, daher gab es diese Unterscheidung auf ONE_PORT und TWO_PORT devices nicht.

> Da wir die "SWITCHDEV"-Variable für ONE_PORT und TWO_PORT für das CLIENT-device missbrauchen, die uci-Configblöcke für den Switch aber abhängig vom Output von swconfig list erzeugt werden, entstehen beim AR150 weiterhin beim Boot entsprechende switch und switch_vlan-Blöcke. Dies muss noch verhindert werden. Das betrifft im Übrigen auch die CPE210 und vielleicht auch andere Geräte. Vor der Trennung von configurenetwork in statischen und dynamischen Teil war die if-Kaskade leicht anders, daher gab es diese Unterscheidung auf ONE_PORT und TWO_PORT devices nicht.
First-time contributor

Tested by: Sebastian Beck <freifunk@beibecks.de>

Nach dem flashen ist der Clientport nicht erreichbar.

Erst nach einem ersten Reboot / configurenetwork funktioniert Fabians Patch wie gewünscht.
Ebenfalls funktioniert die Migration von /etc/network.config wie gewünscht.

`Tested by: Sebastian Beck <freifunk@beibecks.de>` Nach dem flashen ist der Clientport nicht erreichbar. Erst nach einem ersten Reboot / configurenetwork funktioniert Fabians Patch wie gewünscht. Ebenfalls funktioniert die Migration von /etc/network.config wie gewünscht.
Author
Owner

Nach dem flashen ist der Clientport nicht erreichbar.

Das ist die oben beschriebene Problematik. Das ganze müssen wir sowieso reparieren, unabhängig von diesem Gerät.

> Nach dem flashen ist der Clientport nicht erreichbar. Das ist die oben beschriebene Problematik. Das ganze müssen wir sowieso reparieren, unabhängig von diesem Gerät.
Author
Owner

Das betrifft im Übrigen auch die CPE210 und vielleicht auch andere Geräte. Vor der Trennung von configurenetwork in statischen und dynamischen Teil war die if-Kaskade leicht anders, daher gab es diese Unterscheidung auf ONE_PORT und TWO_PORT devices nicht.

Fix: #225

> Das betrifft im Übrigen auch die CPE210 und vielleicht auch andere Geräte. Vor der Trennung von configurenetwork in statischen und dynamischen Teil war die if-Kaskade leicht anders, daher gab es diese Unterscheidung auf ONE_PORT und TWO_PORT devices nicht. Fix: #225
Author
Owner

Plant noch jemand sich das hier anzusehen? Ansonsten werde ich es im laufe des Tage applien.

Plant noch jemand sich das hier anzusehen? Ansonsten werde ich es im laufe des Tage applien.
Author
Owner

Auf meinen staging Branch applied.

Auf meinen staging Branch applied.
fbl closed this pull request 2022-03-31 19:30:38 +02:00
fbl deleted branch ar150 2022-03-31 22:54:13 +02:00

Pull request closed

Sign in to join this conversation.
No description provided.