Thread (10 messages) flat view 10 messages, 2 authors, 2018-10-04

Re: [PATCH net-next v2 2/6] net: phy: mscc: add ethtool statistics counters

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-10-04 15:22:44
Also in: lkml

On Thu, Oct 04, 2018 at 02:47:24PM +0200, Quentin Schulz wrote:

Hi Quentin
+static u64 vsc85xx_get_stat(struct phy_device *phydev, int i)
+{
+	struct vsc8531_private *priv = phydev->priv;
+	int val, oldpage;
+	u64 ret;
+
+	oldpage = phy_select_page(phydev, priv->hw_stats[i].page);
+
+	val = __phy_read(phydev, priv->hw_stats[i].reg);
+	if (val < 0) {
+		ret = U64_MAX;
+		goto out;
+	}
phy_read_paged() should work here as well.
+
+	val = val & priv->hw_stats[i].mask;
+	priv->stats[i] += val;
+	ret = priv->stats[i];
Otherwise this looks good.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help