diff options
author | Thomas Nixon <tom@tomn.co.uk> | 2021-06-26 12:50:12 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2021-07-25 13:52:38 +0200 |
commit | ad712c71cea3b26d8a7c53200c742181d1d040e7 (patch) | |
tree | 7372c5d94ca6a7b1a9fe364eeea011d8effb2e59 /target | |
parent | d996b47be02dd6e9cef9987c4b26e3fe907bd324 (diff) | |
download | upstream-ad712c71cea3b26d8a7c53200c742181d1d040e7.tar.gz upstream-ad712c71cea3b26d8a7c53200c742181d1d040e7.tar.bz2 upstream-ad712c71cea3b26d8a7c53200c742181d1d040e7.zip |
realtek: remove rtl83xx vlan 1 special cases
On reset, the PVID of all ports is set to 1; if this is reset to 0,
the special cases for VLAN 1 are no longer required.
port_vlan_add is called with vid=0 when the DSA port interfaces are
enabled with no VLAN; previously the VLAN was not configured in this
case, relying on VLAN 1 being present, but with the PVID set to 0,
configuring VLAN 0 as normal works as expected.
Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c index c5f243c55a..c2a230c4cb 100644 --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c @@ -134,6 +134,10 @@ static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv) for (i = 0; i < MAX_VLANS; i ++) priv->r->vlan_set_tagged(i, &info); + // reset PVIDs; defaults to 1 on reset + for (i = 0; i <= priv->ds->num_ports; i++) + sw_w32(0, priv->r->vlan_port_pb + (i << 2)); + // Set forwarding action based on inner VLAN tag for (i = 0; i < priv->cpu_port; i++) priv->r->vlan_fwd_on_inner(i, true); @@ -909,9 +913,6 @@ static void rtl83xx_vlan_add(struct dsa_switch *ds, int port, } for (v = vlan->vid_begin; v <= vlan->vid_end; v++) { - if (!v) - continue; - /* Get port memberships of this vlan */ priv->r->vlan_tables_read(v, &info); @@ -971,9 +972,7 @@ static int rtl83xx_vlan_del(struct dsa_switch *ds, int port, /* remove port from both tables */ info.untagged_ports &= (~BIT_ULL(port)); - /* always leave vid 1 */ - if (v != 1) - info.tagged_ports &= (~BIT_ULL(port)); + info.tagged_ports &= (~BIT_ULL(port)); priv->r->vlan_set_untagged(v, info.untagged_ports); pr_debug("Untagged ports, VLAN %d: %llx\n", v, info.untagged_ports); |