]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: microchip: lan743x: add ethtool nway_reset support
authorNicolai Buchwitz <nb@tipi-net.de>
Mon, 23 Feb 2026 08:54:42 +0000 (09:54 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 24 Feb 2026 14:10:56 +0000 (15:10 +0100)
Wire phylink_ethtool_nway_reset() as the .nway_reset ethtool operation,
allowing userspace to restart PHY autonegotiation via 'ethtool -r'.

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Russel King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260223085442.42852-1-nb@tipi-net.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/microchip/lan743x_ethtool.c

index 8a3c1ecc7866cfda2d3d33882d22d75a8ea62cfc..9195419ecee027a38407a2a1146b1ceaad457c5a 100644 (file)
@@ -1079,6 +1079,13 @@ static int lan743x_ethtool_set_eee(struct net_device *netdev,
        return phylink_ethtool_set_eee(adapter->phylink, eee);
 }
 
+static int lan743x_ethtool_nway_reset(struct net_device *netdev)
+{
+       struct lan743x_adapter *adapter = netdev_priv(netdev);
+
+       return phylink_ethtool_nway_reset(adapter->phylink);
+}
+
 static int
 lan743x_ethtool_set_link_ksettings(struct net_device *netdev,
                                   const struct ethtool_link_ksettings *cmd)
@@ -1369,6 +1376,7 @@ const struct ethtool_ops lan743x_ethtool_ops = {
        .set_rxfh = lan743x_ethtool_set_rxfh,
        .get_rxfh_fields = lan743x_ethtool_get_rxfh_fields,
        .get_ts_info = lan743x_ethtool_get_ts_info,
+       .nway_reset = lan743x_ethtool_nway_reset,
        .get_eee = lan743x_ethtool_get_eee,
        .set_eee = lan743x_ethtool_set_eee,
        .get_link_ksettings = lan743x_ethtool_get_link_ksettings,