[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230217034230.1249661-15-andrew@lunn.ch>
Date: Fri, 17 Feb 2023 04:42:26 +0100
From: Andrew Lunn <andrew@...n.ch>
To: netdev <netdev@...r.kernel.org>
Cc: Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Doug Berger <opendmb@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Wei Fang <wei.fang@....com>,
Shenwei Wang <shenwei.wang@....com>,
Clark Wang <xiaoning.wang@....com>,
NXP Linux Team <linux-imx@....com>,
UNGLinuxDriver@...rochip.com, Byungho An <bh74.an@...sung.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <rmk+kernel@...linux.org.uk>,
Woojung Huh <woojung.huh@...rochip.com>,
Oleksij Rempel <linux@...pel-privat.de>,
Andrew Lunn <andrew@...n.ch>
Subject: [PATCH RFC 14/18] net: dsa: b53: Call phylib for set_eee and get_eee
phylib should be called in order to manage the EEE settings in the
PHY, and to return EEE status such are supported link modes, and what
the link peer supports.
Signed-off-by: Andrew Lunn <andrew@...n.ch>
---
drivers/net/dsa/b53/b53_common.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 1e8eaf143b65..f782a08a9bc9 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2179,6 +2179,7 @@ EXPORT_SYMBOL(b53_eee_init);
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
{
+ struct dsa_port *dp = dsa_to_port(ds, port);
struct b53_device *dev = ds->priv;
struct ethtool_eee *p = &dev->ports[port].eee;
u16 reg;
@@ -2190,12 +2191,15 @@ int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
e->eee_enabled = p->eee_enabled;
e->eee_active = !!(reg & BIT(port));
+ if (dp->slave->phydev)
+ return phy_ethtool_get_eee(dp->slave->phydev, e);
return 0;
}
EXPORT_SYMBOL(b53_get_mac_eee);
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
{
+ struct dsa_port *dp = dsa_to_port(ds, port);
struct b53_device *dev = ds->priv;
struct ethtool_eee *p = &dev->ports[port].eee;
@@ -2205,6 +2209,8 @@ int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
p->eee_enabled = e->eee_enabled;
b53_eee_enable_set(ds, port, e->eee_enabled);
+ if (dp->slave->phydev)
+ return phy_ethtool_set_eee(dp->slave->phydev, e);
return 0;
}
EXPORT_SYMBOL(b53_set_mac_eee);
--
2.39.1
Powered by blists - more mailing lists