]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: dsa: relax capability checks for 2.5G modes 19429/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Wed, 16 Jul 2025 06:03:54 +0000 (02:03 -0400)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 23 Jul 2025 22:35:00 +0000 (00:35 +0200)
commit9533e2e574c73320f0410c763b2ec658b8b91639
treefadfecce5e0b5477809a91df39edd95a14ea8c3e
parent69f8f17f007cef09bcadd0c7c43b5118e3d0d436
realtek: dsa: relax capability checks for 2.5G modes

The driver currently uses two checks to verify the capabilities. These
are ..._phylink_get_caps() and ..._pcs_validate(). For RTL930x these
must allow 2.5G modes. Enhance that as follows:

Add 2500BASEX to phylink_get_caps(). Sort the interfaces alphabetically
and rename the function to the new prefix. IMPORTANT REMARK! Until now
this function allowed the XGMII mode (10G only parallel interface) that
was somehow mixed with the Realtek proprietary mode XSGMII (10G SGMII).
Remove it to avoid further confusion.

Looking upstream pcs_validate() is used less and less. There are only
2 consumers left in 6.16 and the calling location reads:

/* Validate the link parameters with the PCS */
if (pcs->ops->pcs_validate) {
ret = pcs->ops->pcs_validate(pcs, supported, state);
if (ret < 0 || phylink_is_empty_linkmode(supported))
return -EINVAL;

/* Ensure the advertising mask is a subset of the
 * supported mask.
 */
linkmode_and(state->advertising, state->advertising,
     supported);
}

There is no need for this additional check. Drop the functions.

Tested-by: Jan Hoffmann <jan@3e8.eu>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19429
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c