diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-04-25 15:12:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-27 11:53:03 -0400 |
commit | 89f09048348936a9a8c5131c8538cc6ed26fd44c (patch) | |
tree | 8b44dd664df9b03217bc751a9319e129dbe2c47a /drivers/net/dsa/qca8k.c | |
parent | 1d1e79f1c6a57dc3750d328ea38a4c385d4edee8 (diff) |
net: dsa: Pass stringset to ethtool operations
Up until now we largely assumed that we were interested in ETH_SS_STATS
type of strings for all ethtool operations, this is about to change with
the introduction of additional string sets, e.g: ETH_SS_PHY_STATS.
Update all functions to take an appropriate stringset argument and act
on it when it is different than ETH_SS_STATS for now.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/qca8k.c')
-rw-r--r-- | drivers/net/dsa/qca8k.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 600d5ad1fbde..757b6d90ea36 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c | |||
@@ -600,10 +600,13 @@ qca8k_phy_write(struct dsa_switch *ds, int phy, int regnum, u16 val) | |||
600 | } | 600 | } |
601 | 601 | ||
602 | static void | 602 | static void |
603 | qca8k_get_strings(struct dsa_switch *ds, int port, uint8_t *data) | 603 | qca8k_get_strings(struct dsa_switch *ds, int port, u32 stringset, uint8_t *data) |
604 | { | 604 | { |
605 | int i; | 605 | int i; |
606 | 606 | ||
607 | if (stringset != ETH_SS_STATS) | ||
608 | return; | ||
609 | |||
607 | for (i = 0; i < ARRAY_SIZE(ar8327_mib); i++) | 610 | for (i = 0; i < ARRAY_SIZE(ar8327_mib); i++) |
608 | strncpy(data + i * ETH_GSTRING_LEN, ar8327_mib[i].name, | 611 | strncpy(data + i * ETH_GSTRING_LEN, ar8327_mib[i].name, |
609 | ETH_GSTRING_LEN); | 612 | ETH_GSTRING_LEN); |
@@ -631,8 +634,11 @@ qca8k_get_ethtool_stats(struct dsa_switch *ds, int port, | |||
631 | } | 634 | } |
632 | 635 | ||
633 | static int | 636 | static int |
634 | qca8k_get_sset_count(struct dsa_switch *ds, int port) | 637 | qca8k_get_sset_count(struct dsa_switch *ds, int port, int sset) |
635 | { | 638 | { |
639 | if (sset != ETH_SS_STATS) | ||
640 | return 0; | ||
641 | |||
636 | return ARRAY_SIZE(ar8327_mib); | 642 | return ARRAY_SIZE(ar8327_mib); |
637 | } | 643 | } |
638 | 644 | ||