]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: pcs: replace various SerDes range checks 22941/head
authorJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 15 Apr 2026 09:05:16 +0000 (09:05 +0000)
committerRobert Marko <robimarko@gmail.com>
Mon, 20 Apr 2026 09:10:54 +0000 (11:10 +0200)
commitf95dbe3575bc844c79c226c0a9d6ece808522ff1
tree57676fd6a0f5329bbf2b62316677e27c56c36cdc
parentc32e90a39699afda4ecd76bd3dc9c406e9963b6c
realtek: pcs: replace various SerDes range checks

The whole driver often does some range checks of the SerDes ID to
restrict some functionality to a group of SerDes. However, having these
open-coded checks everywhere is rather confusing because it's not
obvious what it actually means.

Luckily, those checks give a good picture of what SerDes types we have:
- 5G: RTL838x, RTL839x (0-7, 10, 11), RTL930x (0, 1)
- 10G: RTL839x (8, 9, 12, 13), RTL930x (2-9), RTL931x (2-13)
- unknown: RTL930x (10, 11), RTL931x (0, 1)

Add a new enum and field in rtpcs_serdes for the type of a SerDes we
have. This is filled during SerDes probe, making use of the stub
implementations for that hook.. All SerDes ID range checks related to
this are replaced with corresponding checks of the SerDes type.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22941
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c