summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
diff options
context:
space:
mode:
authorHarshal Gohel <hg@simonwunderlich.de>2024-01-03 16:15:12 +0100
committerSander Vanheule <sander@svanheule.net>2024-01-09 21:20:37 +0100
commite691e2b302d98d4239ffbfced0759384592ea995 (patch)
tree87a3b32cae9a4ae14200aa8697bc772ffd7da7d0 /target/linux/realtek
parentda495c477d9018d59b1f6deb128cc8372d16df16 (diff)
downloadopenwrt-e691e2b302d98d4239ffbfced0759384592ea995.tar.gz
openwrt-e691e2b302d98d4239ffbfced0759384592ea995.tar.bz2
openwrt-e691e2b302d98d4239ffbfced0759384592ea995.zip
rtl83xx: dsa: reset PVID to 1 instead of 0
Before, PVID is reset for all ports and goes out of bounds. Also, PVID is later changed by dsa configuration by `ip link` and `bridge vlan` commands, this does not change the CPU port PVID and CPU PVID stays 0. It does not allow sending packets from OpenWrt to any connected devices unless default configuration is changed This change iterates up to and including cpu_port and sets default PVID to 1. For lan* ports PVID can be configured with `ip link` and `bridge vlan` commands Acked-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Diffstat (limited to 'target/linux/realtek')
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
index 0e1d64ae69..a5b8ccea1c 100644
--- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c
@@ -137,9 +137,9 @@ static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv)
priv->r->vlan_set_tagged(i, &info);
/* reset PVIDs; defaults to 1 on reset */
- for (int i = 0; i <= priv->ds->num_ports; i++) {
- priv->r->vlan_port_pvid_set(i, PBVLAN_TYPE_INNER, 0);
- priv->r->vlan_port_pvid_set(i, PBVLAN_TYPE_OUTER, 0);
+ for (int i = 0; i <= priv->cpu_port; i++) {
+ priv->r->vlan_port_pvid_set(i, PBVLAN_TYPE_INNER, 1);
+ priv->r->vlan_port_pvid_set(i, PBVLAN_TYPE_OUTER, 1);
priv->r->vlan_port_pvidmode_set(i, PBVLAN_TYPE_INNER, PBVLAN_MODE_UNTAG_AND_PRITAG);
priv->r->vlan_port_pvidmode_set(i, PBVLAN_TYPE_OUTER, PBVLAN_MODE_UNTAG_AND_PRITAG);
}