mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-12-10 06:24:40 +01:00
Add a new microchipsw target aimed add supporting Microchip switch SoC-s. Start by supporting LAN969x SoC-s as the first subtarget. Signed-off-by: Robert Marko <robert.marko@sartura.hr>
62 lines
2.3 KiB
Diff
62 lines
2.3 KiB
Diff
From b3461fb971b0db9158653bdbcb99d1327f7eeff0 Mon Sep 17 00:00:00 2001
|
|
From: Daniel Machon <daniel.machon@microchip.com>
|
|
Date: Wed, 17 Sep 2025 13:49:43 +0200
|
|
Subject: [PATCH 82/82] net: sparx5/lan969x: Add support for ethtool pause
|
|
parameters
|
|
|
|
Implement get_pauseparam() and set_pauseparam() ethtool operations for
|
|
Sparx5 ports. This allows users to query and configure IEEE 802.3x
|
|
pause frame settings via:
|
|
|
|
ethtool -a ethX
|
|
ethtool -A ethX rx on|off tx on|off autoneg on|off
|
|
|
|
The driver delegates pause parameter handling to phylink through
|
|
phylink_ethtool_get_pauseparam() and phylink_ethtool_set_pauseparam().
|
|
|
|
The underlying configuration of pause frame generation and reception is
|
|
already implemented in the driver; this patch only wires it up to the
|
|
standard ethtool interface, making the feature accessible to userspace.
|
|
|
|
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
|
|
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Link: https://patch.msgid.link/20250917-802-3x-pause-v1-1-3d1565a68a96@microchip.com
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
.../ethernet/microchip/sparx5/sparx5_ethtool.c | 18 ++++++++++++++++++
|
|
1 file changed, 18 insertions(+)
|
|
|
|
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
|
|
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
|
|
@@ -1212,6 +1212,22 @@ static int sparx5_get_ts_info(struct net
|
|
return 0;
|
|
}
|
|
|
|
+static void sparx5_get_pauseparam(struct net_device *dev,
|
|
+ struct ethtool_pauseparam *pause)
|
|
+{
|
|
+ struct sparx5_port *port = netdev_priv(dev);
|
|
+
|
|
+ phylink_ethtool_get_pauseparam(port->phylink, pause);
|
|
+}
|
|
+
|
|
+static int sparx5_set_pauseparam(struct net_device *dev,
|
|
+ struct ethtool_pauseparam *pause)
|
|
+{
|
|
+ struct sparx5_port *port = netdev_priv(dev);
|
|
+
|
|
+ return phylink_ethtool_set_pauseparam(port->phylink, pause);
|
|
+}
|
|
+
|
|
const struct ethtool_ops sparx5_ethtool_ops = {
|
|
.get_sset_count = sparx5_get_sset_count,
|
|
.get_strings = sparx5_get_sset_strings,
|
|
@@ -1224,6 +1240,8 @@ const struct ethtool_ops sparx5_ethtool_
|
|
.get_eth_ctrl_stats = sparx5_get_eth_mac_ctrl_stats,
|
|
.get_rmon_stats = sparx5_get_eth_rmon_stats,
|
|
.get_ts_info = sparx5_get_ts_info,
|
|
+ .get_pauseparam = sparx5_get_pauseparam,
|
|
+ .set_pauseparam = sparx5_set_pauseparam,
|
|
};
|
|
|
|
int sparx_stats_init(struct sparx5 *sparx5)
|