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

From
Andrew Lunn <andrew@lunn.ch>
Date
2025-08-12 03:46:04
Also in
linux-devicetree, linux-riscv, lkml, spacemit
Reply to
Vivian Wang, 2025-08-12
quoted hunk ↗ jump to hunk
+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.
quoted hunk ↗ jump to hunk
+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.
quoted hunk ↗ jump to hunk
+/* 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
Thread (12 messages) 12 messages, 3 authors, last reply 2025-08-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help