aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
diff options
context:
space:
mode:
authorBirger Koblitz <git@birger-koblitz.de>2021-05-01 16:36:32 +0200
committerPetr Štetiar <ynezz@true.cz>2021-05-07 07:05:16 +0200
commit4342d27ec90cd0988fd3e62ccefbe66f2e691372 (patch)
tree0c1488225ffd01cd63e4cdbd62177d22ab212ab7 /target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
parentd4649942ad72a1b1db2595ace3620c1059fa3464 (diff)
downloadupstream-4342d27ec90cd0988fd3e62ccefbe66f2e691372.tar.gz
upstream-4342d27ec90cd0988fd3e62ccefbe66f2e691372.tar.bz2
upstream-4342d27ec90cd0988fd3e62ccefbe66f2e691372.zip
realtek: Setup all VLANs with default configurations
This sets up all VLANs with a default configuration on reset: - forward based on VLAN-ID and not the FID/MSTI - forward based on the inner VLAN-ID (not outer) Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Diffstat (limited to 'target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c')
-rw-r--r--target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
index b31b1ae6ba..9ecd189d91 100644
--- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
+++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl838x.c
@@ -92,6 +92,16 @@ static void rtl838x_vlan_set_untagged(u32 vlan, u64 portmask)
rtl_table_release(r);
}
+/* Sets the L2 forwarding to be based on either the inner VLAN tag or the outer
+ */
+static void rtl838x_vlan_fwd_on_inner(int port, bool is_set)
+{
+ if (is_set)
+ sw_w32_mask(BIT(port), 0, RTL838X_VLAN_PORT_FWD);
+ else
+ sw_w32_mask(0, BIT(port), RTL838X_VLAN_PORT_FWD);
+}
+
static inline int rtl838x_mac_force_mode_ctrl(int p)
{
return RTL838X_MAC_FORCE_MODE_CTRL + (p << 2);
@@ -406,6 +416,7 @@ const struct rtl838x_reg rtl838x_reg = {
.mac_force_mode_ctrl = rtl838x_mac_force_mode_ctrl,
.vlan_profile_dump = rtl838x_vlan_profile_dump,
.vlan_profile_setup = rtl838x_vlan_profile_setup,
+ .vlan_fwd_on_inner = rtl838x_vlan_fwd_on_inner,
.stp_get = rtl838x_stp_get,
.stp_set = rtl838x_stp_set,
.mac_port_ctrl = rtl838x_mac_port_ctrl,