Commit dbdb0918 authored by Linus Walleij's avatar Linus Walleij Committed by Jakub Kicinski

net: ethernet: cortina: Implement .set_pauseparam()

The Cortina Gemini ethernet can very well set up TX or RX
pausing, so add this functionality to the driver in a
.set_pauseparam() callback. Essentially just call down to
phylib and let phylib deal with this, .adjust_link()
will respect the setting from phylib.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240529-gemini-phylib-fixes-v4-3-16487ca4c2fe@linaro.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 15c22101
...@@ -2126,6 +2126,19 @@ static void gmac_get_pauseparam(struct net_device *netdev, ...@@ -2126,6 +2126,19 @@ static void gmac_get_pauseparam(struct net_device *netdev,
pparam->autoneg = true; pparam->autoneg = true;
} }
static int gmac_set_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pparam)
{
struct phy_device *phydev = netdev->phydev;
if (!pparam->autoneg)
return -EOPNOTSUPP;
phy_set_asym_pause(phydev, pparam->rx_pause, pparam->tx_pause);
return 0;
}
static void gmac_get_ringparam(struct net_device *netdev, static void gmac_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *rp, struct ethtool_ringparam *rp,
struct kernel_ethtool_ringparam *kernel_rp, struct kernel_ethtool_ringparam *kernel_rp,
...@@ -2246,6 +2259,7 @@ static const struct ethtool_ops gmac_351x_ethtool_ops = { ...@@ -2246,6 +2259,7 @@ static const struct ethtool_ops gmac_351x_ethtool_ops = {
.set_link_ksettings = gmac_set_ksettings, .set_link_ksettings = gmac_set_ksettings,
.nway_reset = gmac_nway_reset, .nway_reset = gmac_nway_reset,
.get_pauseparam = gmac_get_pauseparam, .get_pauseparam = gmac_get_pauseparam,
.set_pauseparam = gmac_set_pauseparam,
.get_ringparam = gmac_get_ringparam, .get_ringparam = gmac_get_ringparam,
.set_ringparam = gmac_set_ringparam, .set_ringparam = gmac_set_ringparam,
.get_coalesce = gmac_get_coalesce, .get_coalesce = gmac_get_coalesce,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment