]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: adin: add ethtool get_stats support
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Fri, 16 Aug 2019 13:10:10 +0000 (16:10 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Aug 2019 18:56:26 +0000 (11:56 -0700)
commite15055a4dd52ca4f4ee70b2e521b23ca29d38aa0
treee7dafe58ce57d163cd881b4dbbf917ec492d9337
parentb708817e4aba2245cd143717395e7118de4721fd
net: phy: adin: add ethtool get_stats support

This change implements retrieving all the error counters from the PHY.

The counters require that the RxErrCnt register (0x0014) be read first,
after which copies of the counters are latched into the registers. This
ensures that all registers read after RxErrCnt are synchronized at the
moment that they are read.

The counter values need to be accumulated by the driver, as each time that
RxErrCnt is read, the values that are latched are the ones that have
incremented from the last read.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/adin.c