Re: [PATCH net-next v10 10/13] net:ethernet:realtek:rtase: Implement ethtool function

From: Andrew Lunn
Date: Sat Nov 04 2023 - 15:52:37 EST


> +static int rtase_get_settings(struct net_device *dev,
> + struct ethtool_link_ksettings *cmd)
> +{
> + u32 supported = SUPPORTED_MII | SUPPORTED_Pause;
> +
> + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
> + supported);
> + cmd->base.speed = SPEED_5000;
> + cmd->base.duplex = DUPLEX_FULL;
> + cmd->base.port = PORT_MII;
> + cmd->base.autoneg = AUTONEG_DISABLE;
> +
> + return 0;
> +}
> +

> +static int rtase_set_pauseparam(struct net_device *dev,
> + struct ethtool_pauseparam *pause)
> +{
> + const struct rtase_private *tp = netdev_priv(dev);
> + u16 value = rtase_r16(tp, RTASE_CPLUS_CMD);
> +
> + if (pause->autoneg)
> + return -EOPNOTSUPP;
> +
> + value &= ~(FORCE_TXFLOW_EN | FORCE_RXFLOW_EN);
> +
> + if (pause->tx_pause)
> + value |= FORCE_TXFLOW_EN;
> +
> + if (pause->rx_pause)
> + value |= FORCE_RXFLOW_EN;

It appears the hardware supports asymmetric pause? So i think your
rtase_get_settings() is wrong.

Andrew