]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: pcs: reject SerDes modes unsupported by the instance 23608/head
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 31 May 2026 20:38:00 +0000 (20:38 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 1 Jun 2026 07:17:15 +0000 (09:17 +0200)
commit80a44d6a52ba7464b8ccc4975588a86ad4f9f73e
tree3a1a0ac5ebc4c6a34d2f8af4629d45806d2826e8
parente74d236e07a79889b813bdcd4b9b3718eb304209
realtek: pcs: reject SerDes modes unsupported by the instance

Add a per-SerDes supported_modes bitmap, filled at probe by each
variant from the SerDes id or type, and reject unsupported modes in
determine_hw_mode() via test_bit().

This replaces the rtl838x is_hw_mode_supported() switch and adds the
same gating to rtl839x/rtl93xx, which previously relied only on the
per-variant mode-value table. Unlike that table, the bitmap is per
SerDes instance, so it also rejects modes the table can encode but that
a given SerDes cannot actually use. Rejection uses the uapi -EOPNOTSUPP
instead of the internal -ENOTSUPP.

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