Re: [PATCH v4 13/14] net: phy: adin: add ethtool get_stats support

2019-08-14 Thread Andrew Lunn
> So, I have to apologize again here. > I guess I was an idiot/n00b about this. Not a problem. If it is not something you have come across before, you can easily miss the significance. So you just need to modify the ordering and you are good to go. Please add a comment in the code about this

Re: [PATCH v4 13/14] net: phy: adin: add ethtool get_stats support

2019-08-14 Thread Ardelean, Alexandru
On Tue, 2019-08-13 at 08:48 +0300, Alexandru Ardelean wrote: > On Mon, 2019-08-12 at 16:33 +0200, Andrew Lunn wrote: > > [External] > > > > > +static int adin_read_mmd_stat_regs(struct phy_device *phydev, > > > +struct adin_hw_stat *stat, > > > +

Re: [PATCH v4 13/14] net: phy: adin: add ethtool get_stats support

2019-08-13 Thread Ardelean, Alexandru
On Mon, 2019-08-12 at 16:26 +0200, Andrew Lunn wrote: > [External] > > > +/* Named just like in the datasheet */ > > +static struct adin_hw_stat adin_hw_stats[] = { > > + { "RxErrCnt", 0x0014, }, > > + { "MseA", 0x8402, 0, true }, > > + { "MseB",

Re: [PATCH v4 13/14] net: phy: adin: add ethtool get_stats support

2019-08-12 Thread Ardelean, Alexandru
On Mon, 2019-08-12 at 16:33 +0200, Andrew Lunn wrote: > [External] > > > +static int adin_read_mmd_stat_regs(struct phy_device *phydev, > > + struct adin_hw_stat *stat, > > + u32 *val) > > +{ > > + int ret; > > + > > + ret =

Re: [PATCH v4 13/14] net: phy: adin: add ethtool get_stats support

2019-08-12 Thread Andrew Lunn
> +static int adin_read_mmd_stat_regs(struct phy_device *phydev, > +struct adin_hw_stat *stat, > +u32 *val) > +{ > + int ret; > + > + ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, stat->reg1); > + if (ret < 0) > +

Re: [PATCH v4 13/14] net: phy: adin: add ethtool get_stats support

2019-08-12 Thread Andrew Lunn
> +/* Named just like in the datasheet */ > +static struct adin_hw_stat adin_hw_stats[] = { > + { "RxErrCnt", 0x0014, }, > + { "MseA", 0x8402, 0, true }, > + { "MseB", 0x8403, 0, true }, > + { "MseC", 0x8404, 0,

[PATCH v4 13/14] net: phy: adin: add ethtool get_stats support

2019-08-12 Thread Alexandru Ardelean
This change implements retrieving all the error counters from the PHY. The PHY supports several error counters/stats. The `Mean Square Errors` status values are only valie when a link is established, and shouldn't be accumulated. These values characterize the quality of a signal. The rest of the