diff options
author | Birger Koblitz <git@birger-koblitz.de> | 2021-05-01 16:36:32 +0200 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2021-05-07 07:05:16 +0200 |
commit | 4342d27ec90cd0988fd3e62ccefbe66f2e691372 (patch) | |
tree | 0c1488225ffd01cd63e4cdbd62177d22ab212ab7 /target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c | |
parent | d4649942ad72a1b1db2595ace3620c1059fa3464 (diff) | |
download | upstream-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/rtl930x.c')
-rw-r--r-- | target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c index a6e5cb763f..a80a6d89b2 100644 --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl930x.c @@ -132,6 +132,17 @@ static void rtl930x_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 rtl930x_vlan_fwd_on_inner(int port, bool is_set) +{ + // Always set all tag modes to fwd based on either inner or outer tag + if (is_set) + sw_w32_mask(0, 0xf, RTL930X_VLAN_PORT_FWD + (port << 2)); + else + sw_w32_mask(0xf, 0, RTL930X_VLAN_PORT_FWD + (port << 2)); +} + static void rtl930x_vlan_profile_setup(int profile) { u32 p[5]; @@ -727,6 +738,7 @@ const struct rtl838x_reg rtl930x_reg = { .vlan_set_untagged = rtl930x_vlan_set_untagged, .vlan_profile_dump = rtl930x_vlan_profile_dump, .vlan_profile_setup = rtl930x_vlan_profile_setup, + .vlan_fwd_on_inner = rtl930x_vlan_fwd_on_inner, .stp_get = rtl930x_stp_get, .stp_set = rtl930x_stp_set, .mac_force_mode_ctrl = rtl930x_mac_force_mode_ctrl, |