diff options
author | Andrew Lunn <andrew@lunn.ch> | 2016-11-22 01:27:00 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-22 17:55:30 +0300 |
commit | 795234739105381afd813ca7a0298b9c293f2765 (patch) | |
tree | c06cea28ed5c93c8af8abb6e0441657f8ad353b3 /drivers/net/dsa/mv88e6xxx/global1.c | |
parent | 4b325d8c84a8dda1e3e59a6ddb2304e10b5d8c74 (diff) | |
download | linux-795234739105381afd813ca7a0298b9c293f2765.tar.xz |
net: dsa: mv88e6xxx: Add mv88e6390 stats snapshot operation
The MV88E6390 has a control register for what the histogram statistics
actually contain. This means the stat_snapshot method should not set
this information. So implement the 6390 stats_snapshot function without
these bits.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/global1.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/global1.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/global1.c b/drivers/net/dsa/mv88e6xxx/global1.c index 47b507d4d163..a3a441f9c458 100644 --- a/drivers/net/dsa/mv88e6xxx/global1.c +++ b/drivers/net/dsa/mv88e6xxx/global1.c @@ -59,3 +59,19 @@ int mv88e6320_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port) return mv88e6xxx_g1_stats_snapshot(chip, port); } + +int mv88e6390_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port) +{ + int err; + + port = (port + 1) << 5; + + /* Snapshot the hardware statistics counters for this port. */ + err = mv88e6xxx_g1_write(chip, GLOBAL_STATS_OP, + GLOBAL_STATS_OP_CAPTURE_PORT | port); + if (err) + return err; + + /* Wait for the snapshotting to complete. */ + return mv88e6xxx_g1_stats_wait(chip); +} |