openwrt/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx
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
..
common.c realtek: ignore disabled switch ports 2022-08-29 08:32:42 +02:00
debugfs.c realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
dsa.c realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
Kconfig realtek: Create 4 different Realtek Platforms 2022-02-17 15:21:47 +00:00
Makefile realtek: Add driver support for TC offloading 2021-10-09 08:25:05 +02:00
qos.c
rtl83xx.h realtek: do not reset SerDes on link change 2022-05-11 22:23:50 +02:00
rtl838x.c realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
rtl838x.h realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
rtl839x.c realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
rtl930x.c realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
rtl931x.c realtek: refactor keep vlan tag setup, fix tagged forwarding 2022-12-01 22:15:55 +01:00
tc.c realtek: Add driver support for TC offloading 2021-10-09 08:25:05 +02:00