[PATCH net-next v5 2/5] net: spacemit: Add K1 Ethernet MAC

Andrew Lunn andrew at lunn.ch
Mon Aug 11 20:45:36 PDT 2025


> +static void emac_get_pause_stats(struct net_device *dev,
> +				 struct ethtool_pause_stats *pause_stats)
> +{
> +	struct emac_priv *priv = netdev_priv(dev);
> +	struct emac_hw_tx_stats *tx_stats;
> +	struct emac_hw_rx_stats *rx_stats;
> +
> +	tx_stats = &priv->tx_stats;
> +	rx_stats = &priv->rx_stats;
> +
> +	scoped_guard(spinlock_irqsave, &priv->stats_lock) {
> +		emac_stats_update(priv);
> +
> +		pause_stats->tx_pause_frames = tx_stats->tx_pause_pkts;
> +		pause_stats->rx_pause_frames = rx_stats->rx_pause_pkts;
> +	}
> +}

You have pause statistics, but not actual configuration of pause.

> +static void emac_adjust_link(struct net_device *dev)
> +{
> +	struct emac_priv *priv = netdev_priv(dev);
> +	struct phy_device *phydev = dev->phydev;
> +	u32 ctrl;

Normally the adjust_link callback you configure the hardware with the
result of pause negotiation.

> +/* Called when net interface is brought up. */
> +static int emac_open(struct net_device *ndev)
> +{
> +	struct emac_priv *priv = netdev_priv(ndev);
> +	struct device *dev = &priv->pdev->dev;
> +
> +	int ret;

Extra blank line.


    Andrew

---
pw-bot: cr



More information about the linux-riscv mailing list