Backport phylink patches for PCS/PHY caps OPs. This makes it easier to align future generic PCS patch and permit supporting special PHY that needs specific tune if "in-band" mode is enabled (for example Aeonsemi PHYs) This is also mainly using the upstream version of the Mediatek patch 739-net-add-negotiation-of-in-band-capabilities. All affected patch automatically refreshed. Link: https://github.com/openwrt/openwrt/pull/20461 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
58 lines
1.6 KiB
Diff
58 lines
1.6 KiB
Diff
From 484d0170d6c6bbb5213d037664e9a551f793bacd Mon Sep 17 00:00:00 2001
|
|
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
|
|
Date: Thu, 5 Dec 2024 09:42:34 +0000
|
|
Subject: [PATCH 3/3] net: pcs: xpcs: implement pcs_inband_caps() method
|
|
|
|
Report the PCS inband capabilities to phylink for XPCS.
|
|
|
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Link: https://patch.msgid.link/E1tJ8NW-006L5V-I9@rmk-PC.armlinux.org.uk
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
drivers/net/pcs/pcs-xpcs.c | 28 ++++++++++++++++++++++++++++
|
|
1 file changed, 28 insertions(+)
|
|
|
|
--- a/drivers/net/pcs/pcs-xpcs.c
|
|
+++ b/drivers/net/pcs/pcs-xpcs.c
|
|
@@ -608,6 +608,33 @@ static int xpcs_validate(struct phylink_
|
|
return 0;
|
|
}
|
|
|
|
+static unsigned int xpcs_inband_caps(struct phylink_pcs *pcs,
|
|
+ phy_interface_t interface)
|
|
+{
|
|
+ struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
|
|
+ const struct dw_xpcs_compat *compat;
|
|
+
|
|
+ compat = xpcs_find_compat(xpcs->desc, interface);
|
|
+ if (!compat)
|
|
+ return 0;
|
|
+
|
|
+ switch (compat->an_mode) {
|
|
+ case DW_AN_C73:
|
|
+ return LINK_INBAND_ENABLE;
|
|
+
|
|
+ case DW_AN_C37_SGMII:
|
|
+ case DW_AN_C37_1000BASEX:
|
|
+ return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE;
|
|
+
|
|
+ case DW_10GBASER:
|
|
+ case DW_2500BASEX:
|
|
+ return LINK_INBAND_DISABLE;
|
|
+
|
|
+ default:
|
|
+ return 0;
|
|
+ }
|
|
+}
|
|
+
|
|
void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces)
|
|
{
|
|
int i, j;
|
|
@@ -1365,6 +1392,7 @@ static const struct dw_xpcs_desc xpcs_de
|
|
|
|
static const struct phylink_pcs_ops xpcs_phylink_ops = {
|
|
.pcs_validate = xpcs_validate,
|
|
+ .pcs_inband_caps = xpcs_inband_caps,
|
|
.pcs_config = xpcs_config,
|
|
.pcs_get_state = xpcs_get_state,
|
|
.pcs_an_restart = xpcs_an_restart,
|