summaryrefslogtreecommitdiff
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-01 11:58:24 +0000
committerDavid S. Miller <davem@davemloft.net>2009-10-05 00:10:10 -0700
commit15f0a394c6573f4cb65a13095288ab9b9f8135f9 (patch)
tree211fe96826513a68a107feb9850817b9c4b2c8d1 /drivers/net/benet
parent1ddee09ff0420090d5b03ef3f9eba0e4db647035 (diff)
downloadlinux-15f0a394c6573f4cb65a13095288ab9b9f8135f9.tar.gz
linux-15f0a394c6573f4cb65a13095288ab9b9f8135f9.tar.xz
net: Convert ethtool {get_stats, self_test}_count() ops to get_sset_count()
These string query operations were supposed to be replaced by the generic get_sset_count() starting in 2007. Convert the remaining implementations. Also remove calls to these operations to initialise drvinfo->n_stats. The ethtool core code already does that. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_ethtool.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 11445df3dbc0..851543a040cb 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -281,9 +281,14 @@ be_get_stat_strings(struct net_device *netdev, uint32_t stringset,
}
}
-static int be_get_stats_count(struct net_device *netdev)
+static int be_get_sset_count(struct net_device *netdev, int stringset)
{
- return ETHTOOL_STATS_NUM;
+ switch (stringset) {
+ case ETH_SS_STATS:
+ return ETHTOOL_STATS_NUM;
+ default:
+ return -EINVAL;
+ }
}
static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
@@ -364,7 +369,7 @@ const struct ethtool_ops be_ethtool_ops = {
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso,
.get_strings = be_get_stat_strings,
- .get_stats_count = be_get_stats_count,
+ .get_sset_count = be_get_sset_count,
.get_ethtool_stats = be_get_ethtool_stats,
.flash_device = be_do_flash,
};