Skip to content

Commit

Permalink
dpaa2-eth: add support for nway reset
Browse files Browse the repository at this point in the history
Add support for ethtool -r so that PHY negotiation can be restarted.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Russell King authored and David S. Miller committed Feb 27, 2020
1 parent 4a84182 commit 2e6af0f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ static void dpaa2_eth_get_drvinfo(struct net_device *net_dev,
sizeof(drvinfo->bus_info));
}

static int dpaa2_eth_nway_reset(struct net_device *net_dev)
{
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);

if (priv->mac)
return phylink_ethtool_nway_reset(priv->mac->phylink);

return -EOPNOTSUPP;
}

static int
dpaa2_eth_get_link_ksettings(struct net_device *net_dev,
struct ethtool_link_ksettings *link_settings)
Expand Down Expand Up @@ -761,6 +771,7 @@ static int dpaa2_eth_get_ts_info(struct net_device *dev,

const struct ethtool_ops dpaa2_ethtool_ops = {
.get_drvinfo = dpaa2_eth_get_drvinfo,
.nway_reset = dpaa2_eth_nway_reset,
.get_link = ethtool_op_get_link,
.get_link_ksettings = dpaa2_eth_get_link_ksettings,
.set_link_ksettings = dpaa2_eth_set_link_ksettings,
Expand Down

0 comments on commit 2e6af0f

Please sign in to comment.