aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/lan9303-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dsa/lan9303-core.c')
-rw-r--r--drivers/net/dsa/lan9303-core.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index fefa454f3e56..b4f6e1a67dd9 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -977,10 +977,14 @@ static const struct lan9303_mib_desc lan9303_mib[] = {
977 { .offset = LAN9303_MAC_TX_LATECOL_0, .name = "TxLateCol", }, 977 { .offset = LAN9303_MAC_TX_LATECOL_0, .name = "TxLateCol", },
978}; 978};
979 979
980static void lan9303_get_strings(struct dsa_switch *ds, int port, uint8_t *data) 980static void lan9303_get_strings(struct dsa_switch *ds, int port,
981 u32 stringset, uint8_t *data)
981{ 982{
982 unsigned int u; 983 unsigned int u;
983 984
985 if (stringset != ETH_SS_STATS)
986 return;
987
984 for (u = 0; u < ARRAY_SIZE(lan9303_mib); u++) { 988 for (u = 0; u < ARRAY_SIZE(lan9303_mib); u++) {
985 strncpy(data + u * ETH_GSTRING_LEN, lan9303_mib[u].name, 989 strncpy(data + u * ETH_GSTRING_LEN, lan9303_mib[u].name,
986 ETH_GSTRING_LEN); 990 ETH_GSTRING_LEN);
@@ -1007,8 +1011,11 @@ static void lan9303_get_ethtool_stats(struct dsa_switch *ds, int port,
1007 } 1011 }
1008} 1012}
1009 1013
1010static int lan9303_get_sset_count(struct dsa_switch *ds, int port) 1014static int lan9303_get_sset_count(struct dsa_switch *ds, int port, int sset)
1011{ 1015{
1016 if (sset != ETH_SS_STATS)
1017 return 0;
1018
1012 return ARRAY_SIZE(lan9303_mib); 1019 return ARRAY_SIZE(lan9303_mib);
1013} 1020}
1014 1021