Commit Graph

7 Commits

Author SHA1 Message Date
Jan Hoffmann 15a4d621d8 realtek: actually enable 2500Base-X
The SerDes setup function needs to be called to make 2500Base-X work.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/19517
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-25 23:52:49 +02:00
Markus Stockhausen 9533e2e574 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>
2025-07-24 00:35:00 +02:00
Markus Stockhausen 22beb4fbc4 realtek: 6.12: align internal/external mac eee function names
The DSA driver uses set_mac_eee() for the outside API while
the interal helper is called port_eee_set(). Align that.
Additionally do not call the internal helpers directly by
the function names but use the register assignments.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18935
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-11 22:27:22 +02:00
Markus Stockhausen d7f51c1917 realtek: 6.12: refactor get_mac_eee
Upstream will get rid of the get_mac_eee() function in the DSA
driver and replace it by a boolean alternative. While we fill a
lot of data here (because of EEE bugs in the Realtek phy layer)
other DSA drivers only return if EEE is available or not for a
port. To make the next kernel upgrade easier follow that design.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18935
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-11 22:27:22 +02:00
Markus Stockhausen 34a070bfe1 realtek: 6.12: add mac capabilities to rtl83xx_phylink_get_caps()
Not only the link but also the mac capabilities are needed here.
Additionally do some alphabetical sorting.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18935
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-11 22:27:22 +02:00
Markus Stockhausen a4a40ab6ea realtek: 6.12: replace ethtool_eee with ethtool_keee
EEE functions are now called with ethtool_keee instead of
ethtool_eee. Replace all occurrences. This will fix function
signature checks but still produces compilation errors due
to structure changes.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18935
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-11 22:27:22 +02:00
Markus Stockhausen ac1be95438 realtek: 6.12: create files-6.12 from files-6.6
Automatically generated commit.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18935
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-11 22:27:21 +02:00