OSDN Git Service

net: dsa: mv88e6xxx: Get mv88e6352 SERDES statistics
authorAndrew Lunn <andrew@lunn.ch>
Thu, 1 Mar 2018 01:02:31 +0000 (02:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 4 Mar 2018 18:34:18 +0000 (13:34 -0500)
commitcda9f4aae3dceed192442807b70a5d34a13c478b
treeaf056020b5dbecea1e4fc30f37e50a32ae747576
parenteb755c3f6b7deb22ed19e2d3cc4418d3ae510196
net: dsa: mv88e6xxx: Get mv88e6352 SERDES statistics

Add support for reading the SERDES statistics of the mv88e8352, using
the standard ethtool -S option. The SERDES interface can be mapped to
either port 4 or 5, so only return statistics on those ports, if the
SERDES interface is in use.

The counters are reset on read, so need to be accumulated. Add a per
port structure to hold the stats counters. The 6352 only has a single
SERDES interface and so only one port will using the newly added
array. However the 6390 family has as many SERDES interfaces as ports,
each with statistics counters. Also, PTP has a number of counters per
port which will also need accumulating.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/chip.h
drivers/net/dsa/mv88e6xxx/serdes.c
drivers/net/dsa/mv88e6xxx/serdes.h