diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-04-25 12:12:50 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-27 11:53:03 -0400 |
commit | 89f09048348936a9a8c5131c8538cc6ed26fd44c (patch) | |
tree | 8b44dd664df9b03217bc751a9319e129dbe2c47a /drivers/net/dsa/b53 | |
parent | 1d1e79f1c6a57dc3750d328ea38a4c385d4edee8 (diff) | |
download | blackbird-obmc-linux-89f09048348936a9a8c5131c8538cc6ed26fd44c.tar.gz blackbird-obmc-linux-89f09048348936a9a8c5131c8538cc6ed26fd44c.zip |
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/b53')
-rw-r--r-- | drivers/net/dsa/b53/b53_common.c | 11 | ||||
-rw-r--r-- | drivers/net/dsa/b53/b53_priv.h | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 78616787f2a3..726b2d8c6fe9 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -806,13 +806,17 @@ static unsigned int b53_get_mib_size(struct b53_device *dev) return B53_MIBS_SIZE; } -void b53_get_strings(struct dsa_switch *ds, int port, uint8_t *data) +void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset, + uint8_t *data) { struct b53_device *dev = ds->priv; const struct b53_mib_desc *mibs = b53_get_mib(dev); unsigned int mib_size = b53_get_mib_size(dev); unsigned int i; + if (stringset != ETH_SS_STATS) + return; + for (i = 0; i < mib_size; i++) strlcpy(data + i * ETH_GSTRING_LEN, mibs[i].name, ETH_GSTRING_LEN); @@ -852,10 +856,13 @@ void b53_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data) } EXPORT_SYMBOL(b53_get_ethtool_stats); -int b53_get_sset_count(struct dsa_switch *ds, int port) +int b53_get_sset_count(struct dsa_switch *ds, int port, int sset) { struct b53_device *dev = ds->priv; + if (sset != ETH_SS_STATS) + return 0; + return b53_get_mib_size(dev); } EXPORT_SYMBOL(b53_get_sset_count); diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index 1187ebd79287..b933d5cb5c2d 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h @@ -286,9 +286,10 @@ static inline int b53_switch_get_reset_gpio(struct b53_device *dev) /* Exported functions towards other drivers */ void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port); int b53_configure_vlan(struct dsa_switch *ds); -void b53_get_strings(struct dsa_switch *ds, int port, uint8_t *data); +void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset, + uint8_t *data); void b53_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data); -int b53_get_sset_count(struct dsa_switch *ds, int port); +int b53_get_sset_count(struct dsa_switch *ds, int port, int sset); int b53_br_join(struct dsa_switch *ds, int port, struct net_device *bridge); void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *bridge); void b53_br_set_stp_state(struct dsa_switch *ds, int port, u8 state); |