aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6131.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2015-04-01 22:06:38 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-01 22:55:41 -0400
commite413e7e1f7493910274c552d7f70ae396c93199a (patch)
treecc658c267c3efd5c11fc15873c2255863c7e1e81 /drivers/net/dsa/mv88e6131.c
parent2f40c6981ac0adcaa2b3fc64e6ae81f80809aec8 (diff)
net: dsa: Consolidate getting the statistics
Reading the statistics from the hardware is the same for all chips. What differs is the number of available statistics. Have just one copy of the code in the shared mv88e6xxx. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6131.c')
-rw-r--r--drivers/net/dsa/mv88e6131.c59
1 files changed, 3 insertions, 56 deletions
diff --git a/drivers/net/dsa/mv88e6131.c b/drivers/net/dsa/mv88e6131.c
index 534a8f0b1c28..5bec7a60b476 100644
--- a/drivers/net/dsa/mv88e6131.c
+++ b/drivers/net/dsa/mv88e6131.c
@@ -299,59 +299,6 @@ mv88e6131_phy_write(struct dsa_switch *ds,
299 return mv88e6xxx_phy_write_ppu(ds, addr, regnum, val); 299 return mv88e6xxx_phy_write_ppu(ds, addr, regnum, val);
300} 300}
301 301
302static struct mv88e6xxx_hw_stat mv88e6131_hw_stats[] = {
303 { "in_good_octets", 8, 0x00, },
304 { "in_bad_octets", 4, 0x02, },
305 { "in_unicast", 4, 0x04, },
306 { "in_broadcasts", 4, 0x06, },
307 { "in_multicasts", 4, 0x07, },
308 { "in_pause", 4, 0x16, },
309 { "in_undersize", 4, 0x18, },
310 { "in_fragments", 4, 0x19, },
311 { "in_oversize", 4, 0x1a, },
312 { "in_jabber", 4, 0x1b, },
313 { "in_rx_error", 4, 0x1c, },
314 { "in_fcs_error", 4, 0x1d, },
315 { "out_octets", 8, 0x0e, },
316 { "out_unicast", 4, 0x10, },
317 { "out_broadcasts", 4, 0x13, },
318 { "out_multicasts", 4, 0x12, },
319 { "out_pause", 4, 0x15, },
320 { "excessive", 4, 0x11, },
321 { "collisions", 4, 0x1e, },
322 { "deferred", 4, 0x05, },
323 { "single", 4, 0x14, },
324 { "multiple", 4, 0x17, },
325 { "out_fcs_error", 4, 0x03, },
326 { "late", 4, 0x1f, },
327 { "hist_64bytes", 4, 0x08, },
328 { "hist_65_127bytes", 4, 0x09, },
329 { "hist_128_255bytes", 4, 0x0a, },
330 { "hist_256_511bytes", 4, 0x0b, },
331 { "hist_512_1023bytes", 4, 0x0c, },
332 { "hist_1024_max_bytes", 4, 0x0d, },
333};
334
335static void
336mv88e6131_get_strings(struct dsa_switch *ds, int port, uint8_t *data)
337{
338 mv88e6xxx_get_strings(ds, ARRAY_SIZE(mv88e6131_hw_stats),
339 mv88e6131_hw_stats, port, data);
340}
341
342static void
343mv88e6131_get_ethtool_stats(struct dsa_switch *ds,
344 int port, uint64_t *data)
345{
346 mv88e6xxx_get_ethtool_stats(ds, ARRAY_SIZE(mv88e6131_hw_stats),
347 mv88e6131_hw_stats, port, data);
348}
349
350static int mv88e6131_get_sset_count(struct dsa_switch *ds)
351{
352 return ARRAY_SIZE(mv88e6131_hw_stats);
353}
354
355struct dsa_switch_driver mv88e6131_switch_driver = { 302struct dsa_switch_driver mv88e6131_switch_driver = {
356 .tag_protocol = DSA_TAG_PROTO_DSA, 303 .tag_protocol = DSA_TAG_PROTO_DSA,
357 .priv_size = sizeof(struct mv88e6xxx_priv_state), 304 .priv_size = sizeof(struct mv88e6xxx_priv_state),
@@ -361,9 +308,9 @@ struct dsa_switch_driver mv88e6131_switch_driver = {
361 .phy_read = mv88e6131_phy_read, 308 .phy_read = mv88e6131_phy_read,
362 .phy_write = mv88e6131_phy_write, 309 .phy_write = mv88e6131_phy_write,
363 .poll_link = mv88e6xxx_poll_link, 310 .poll_link = mv88e6xxx_poll_link,
364 .get_strings = mv88e6131_get_strings, 311 .get_strings = mv88e6xxx_get_strings,
365 .get_ethtool_stats = mv88e6131_get_ethtool_stats, 312 .get_ethtool_stats = mv88e6xxx_get_ethtool_stats,
366 .get_sset_count = mv88e6131_get_sset_count, 313 .get_sset_count = mv88e6xxx_get_sset_count,
367}; 314};
368 315
369MODULE_ALIAS("platform:mv88e6085"); 316MODULE_ALIAS("platform:mv88e6085");