realtek: dsa: Add MSTI to HW MST ID mapping
authorSven Eckelmann <se@simonwunderlich.de>
Mon, 27 Oct 2025 16:19:24 +0000 (17:19 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 15 Nov 2025 15:21:16 +0000 (16:21 +0100)
commit44976dcac4687bfec84a5317c53d9b14ffc78735
treeda80c4b9fa94ef959cd0ab4164ec48edb55dd448
parent6c15c5d5eb7c3c58107573c6341581559acb812f
realtek: dsa: Add MSTI to HW MST ID mapping

The MSTI range is 0..4095 but the HW range is only supporting a lower
range - for example 0..63 for RTL930x. But the HW doesn't really need to
know the actual MSTI. It is therefore possible to use a mapping from MSTI
to HW slot to allow a larger range of MSTIs.

Since the CIST (MSTI 0) is always needed, the mapping data structure is
skipping this entry and is always keeping the HW slot 0 for CIST.

This doesn't increase the total number of MSTIs a HW supports.

Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h