aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2025-02-10 10:53:55 +0000
committerJakub Kicinski <kuba@kernel.org>2025-02-14 13:42:51 -0800
commit5a12b2cf29c12d9d1467ec3e03746cd43dbb6251 (patch)
tree3e3cce567e4dd9145d172df0c6eb6c50987a2102
parentnet: stmmac: call xpcs_config_eee_mult_fact() (diff)
downloadwireguard-linux-5a12b2cf29c12d9d1467ec3e03746cd43dbb6251.tar.xz
wireguard-linux-5a12b2cf29c12d9d1467ec3e03746cd43dbb6251.zip
net: xpcs: convert to phylink managed EEE
Convert XPCS to use the new pcs_disable_eee() and pcs_enable_eee() methods. Since stmmac is the only user of xpcs_config_eee(), we can make this a no-op along with this change. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1thRQJ-003w7C-6v@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/pcs/pcs-xpcs.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 91ce4b13df32..1f312b5589a3 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -602,7 +602,8 @@ static void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces)
__set_bit(compat->interface, interfaces);
}
-int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable)
+static int __xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
+ int enable)
{
u16 mask, val;
int ret;
@@ -630,6 +631,11 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable)
DW_VR_MII_EEE_TRN_LPI,
enable ? DW_VR_MII_EEE_TRN_LPI : 0);
}
+
+int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable)
+{
+ return 0;
+}
EXPORT_SYMBOL_GPL(xpcs_config_eee);
static void xpcs_pre_config(struct phylink_pcs *pcs, phy_interface_t interface)
@@ -1193,6 +1199,20 @@ static void xpcs_an_restart(struct phylink_pcs *pcs)
BMCR_ANRESTART);
}
+static void xpcs_disable_eee(struct phylink_pcs *pcs)
+{
+ struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
+
+ __xpcs_config_eee(xpcs, 0, false);
+}
+
+static void xpcs_enable_eee(struct phylink_pcs *pcs)
+{
+ struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs);
+
+ __xpcs_config_eee(xpcs, xpcs->eee_mult_fact, true);
+}
+
/**
* xpcs_config_eee_mult_fact() - set the EEE clock multiplying factor
* @xpcs: pointer to a &struct dw_xpcs instance
@@ -1355,6 +1375,8 @@ static const struct phylink_pcs_ops xpcs_phylink_ops = {
.pcs_get_state = xpcs_get_state,
.pcs_an_restart = xpcs_an_restart,
.pcs_link_up = xpcs_link_up,
+ .pcs_disable_eee = xpcs_disable_eee,
+ .pcs_enable_eee = xpcs_enable_eee,
};
static int xpcs_identify(struct dw_xpcs *xpcs)