aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-01 07:27:59 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-05 03:10:10 -0400
commit1ddee09ff0420090d5b03ef3f9eba0e4db647035 (patch)
tree925407cea6c1bd96441027ab61dc0126e1c7504e /drivers
parentdf8b4ec8b15a5db84706548149add3131c3af8ba (diff)
tehuti: Convert ethtool get_stats_count() ops to get_sset_count()
This string query operation was supposed to be replaced by the generic get_sset_count() starting in 2007. Convert tehuti's implementation. Also remove the dummy self-test name which was not used since tehuti does not advertise any self-tests. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/tehuti.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index ec9dfb251f3..79d4868e75a 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -2105,12 +2105,6 @@ err_pci:
2105} 2105}
2106 2106
2107/****************** Ethtool interface *********************/ 2107/****************** Ethtool interface *********************/
2108/* get strings for tests */
2109static const char
2110 bdx_test_names[][ETH_GSTRING_LEN] = {
2111 "No tests defined"
2112};
2113
2114/* get strings for statistics counters */ 2108/* get strings for statistics counters */
2115static const char 2109static const char
2116 bdx_stat_names[][ETH_GSTRING_LEN] = { 2110 bdx_stat_names[][ETH_GSTRING_LEN] = {
@@ -2380,9 +2374,6 @@ bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
2380static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data) 2374static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
2381{ 2375{
2382 switch (stringset) { 2376 switch (stringset) {
2383 case ETH_SS_TEST:
2384 memcpy(data, *bdx_test_names, sizeof(bdx_test_names));
2385 break;
2386 case ETH_SS_STATS: 2377 case ETH_SS_STATS:
2387 memcpy(data, *bdx_stat_names, sizeof(bdx_stat_names)); 2378 memcpy(data, *bdx_stat_names, sizeof(bdx_stat_names));
2388 break; 2379 break;
@@ -2390,15 +2381,21 @@ static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
2390} 2381}
2391 2382
2392/* 2383/*
2393 * bdx_get_stats_count - return number of 64bit statistics counters 2384 * bdx_get_sset_count - return number of statistics or tests
2394 * @netdev 2385 * @netdev
2395 */ 2386 */
2396static int bdx_get_stats_count(struct net_device *netdev) 2387static int bdx_get_sset_count(struct net_device *netdev, int stringset)
2397{ 2388{
2398 struct bdx_priv *priv = netdev_priv(netdev); 2389 struct bdx_priv *priv = netdev_priv(netdev);
2399 BDX_ASSERT(ARRAY_SIZE(bdx_stat_names) 2390
2400 != sizeof(struct bdx_stats) / sizeof(u64)); 2391 switch (stringset) {
2401 return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0); 2392 case ETH_SS_STATS:
2393 BDX_ASSERT(ARRAY_SIZE(bdx_stat_names)
2394 != sizeof(struct bdx_stats) / sizeof(u64));
2395 return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0);
2396 default:
2397 return -EINVAL;
2398 }
2402} 2399}
2403 2400
2404/* 2401/*
@@ -2441,7 +2438,7 @@ static void bdx_ethtool_ops(struct net_device *netdev)
2441 .get_sg = ethtool_op_get_sg, 2438 .get_sg = ethtool_op_get_sg,
2442 .get_tso = ethtool_op_get_tso, 2439 .get_tso = ethtool_op_get_tso,
2443 .get_strings = bdx_get_strings, 2440 .get_strings = bdx_get_strings,
2444 .get_stats_count = bdx_get_stats_count, 2441 .get_sset_count = bdx_get_sset_count,
2445 .get_ethtool_stats = bdx_get_ethtool_stats, 2442 .get_ethtool_stats = bdx_get_ethtool_stats,
2446 }; 2443 };
2447 2444