openwrt/target/linux/realtek
Luiz Angelo Daros de Luca ed9bd9824a realtek: refactor keep vlan tag setup, fix tagged forwarding
The code in dsa.c:rtl83xx_port_enable() was trying to set
vlan_port_tag_sts_ctrl while dealing with differences between SoCs.
However, not only that register has a different address, the register
structure and even the 2-bit value semantic changes for each SoC.

The vlan_port_tag_sts_ctrl field was dropped and converted into a
vlan_port_keep_incoming_tag_set() function that abstracts the different
between SoCs. The macro referencing that register migrated to the SoC
specific c file as it will be privately used by each file.

All magic numbers were converted into macros using BITMASK and
FIELD_PREP.

The vlan_port_tag_sts_ctrl debugfs was dropped for now as it is already
broken for rtl93xx. The best place for SoC specific code might be in each
respective c file and not in if/else clauses.

The final result is:

rtl838x: set ITAG_STS=TAGGED, same as before
rtl839x: set ITAG_STS=TAGGED instead of IGR_P_ITAG_KEEP=0x1, fixing
	 forwarding of tagged packets
rtl930x: set EGR_ITAG_STS=TAGGED instead of IGR_P_ITAG=0x1, possibly
	 fixing forwarding of tagged packets
rtl931x: set EGR_ITAG_STS=TAGGED instead of OTPID_KEEP=0x1, possibly
         fixing forwarding of tagged packets

Without (EGR_)ITAG_STS=TAGGED, at least for rtl839x, forwarded packets
will drop the vlan tag while packets from the CPU will still have the
correct tag.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2022-12-01 22:15:55 +01:00
..
base-files realtek: add support for TP-Link SG2210P 2022-09-13 09:22:26 +02:00
dts-5.10 realtek: timer driver: activate for RTL839X devices 2022-10-23 22:33:08 +02:00
files/firmware/rtl838x_phy realtek: update the tree to the latest refactored version 2020-11-26 13:29:27 +01:00
files-5.10 realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
image realtek: use Device prefix for common recipes 2022-09-18 10:12:19 +02:00
patches-5.10 realtek: 5.10: refresh kernel patches 2022-10-25 04:56:16 +02:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x realtek: timer driver: activate for RTL838X devices 2022-10-23 22:33:08 +02:00
rtl839x realtek: timer driver: activate for RTL839X devices 2022-10-23 22:33:08 +02:00
rtl930x realtek: disable otto timer for RTL93xx targets 2022-10-23 22:33:08 +02:00
rtl931x realtek: disable otto timer for RTL93xx targets 2022-10-23 22:33:08 +02:00
Makefile realtek: Fix tc default package 2022-03-29 13:43:01 +02:00