net: dsa: microchip: add MIB counter reading support
authorTristram Ha <Tristram.Ha@microchip.com>
Sat, 23 Feb 2019 00:36:48 +0000 (16:36 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Feb 2019 01:49:59 +0000 (17:49 -0800)
commit7c6ff470aa867f53b8522a3a5c84c36ac7a20090
tree84c02ceed3dc03618f080a027f2418c4a14f52ae
parent42fc6a4c613019666f2fd11bc0b542cf2f4dae24
net: dsa: microchip: add MIB counter reading support

Add background MIB counter reading support.

Port MIB counters should only be read when there is link.  Otherwise it is
a waste of time as hardware never increases those counters.  There are
exceptions as some switches keep track of dropped counts no matter what.

Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz9477.c
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h
drivers/net/dsa/microchip/ksz_priv.h