aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/gemini
diff options
context:
space:
mode:
authorLuiz Angelo Daros de Luca <luizluca@gmail.com>2022-11-07 20:10:08 -0300
committerSander Vanheule <sander@svanheule.net>2022-12-01 22:15:55 +0100
commited9bd9824a477b2cca0887867155a73b38775d80 (patch)
tree7a3a6265e54bea4b11e64fb918bb54b38962d5bd /target/linux/gemini
parent59542c9ac9acd470c4fa3182792de91b4c2f6421 (diff)
downloadupstream-ed9bd9824a477b2cca0887867155a73b38775d80.tar.gz
upstream-ed9bd9824a477b2cca0887867155a73b38775d80.tar.bz2
upstream-ed9bd9824a477b2cca0887867155a73b38775d80.zip
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>
Diffstat (limited to 'target/linux/gemini')
0 files changed, 0 insertions, 0 deletions