aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igbvf
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-01 07:58:24 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-05 03:10:10 -0400
commit15f0a394c6573f4cb65a13095288ab9b9f8135f9 (patch)
tree211fe96826513a68a107feb9850817b9c4b2c8d1 /drivers/net/igbvf
parent1ddee09ff0420090d5b03ef3f9eba0e4db647035 (diff)
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/igbvf')
-rw-r--r--drivers/net/igbvf/ethtool.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c
index ee17a097d1ca..bc606f8b61aa 100644
--- a/drivers/net/igbvf/ethtool.c
+++ b/drivers/net/igbvf/ethtool.c
@@ -363,16 +363,6 @@ static int igbvf_link_test(struct igbvf_adapter *adapter, u64 *data)
363 return *data; 363 return *data;
364} 364}
365 365
366static int igbvf_get_self_test_count(struct net_device *netdev)
367{
368 return IGBVF_TEST_LEN;
369}
370
371static int igbvf_get_stats_count(struct net_device *netdev)
372{
373 return IGBVF_GLOBAL_STATS_LEN;
374}
375
376static void igbvf_diag_test(struct net_device *netdev, 366static void igbvf_diag_test(struct net_device *netdev,
377 struct ethtool_test *eth_test, u64 *data) 367 struct ethtool_test *eth_test, u64 *data)
378{ 368{
@@ -480,6 +470,18 @@ static void igbvf_get_ethtool_stats(struct net_device *netdev,
480 470
481} 471}
482 472
473static int igbvf_get_sset_count(struct net_device *dev, int stringset)
474{
475 switch(stringset) {
476 case ETH_SS_TEST:
477 return IGBVF_TEST_LEN;
478 case ETH_SS_STATS:
479 return IGBVF_GLOBAL_STATS_LEN;
480 default:
481 return -EINVAL;
482 }
483}
484
483static void igbvf_get_strings(struct net_device *netdev, u32 stringset, 485static void igbvf_get_strings(struct net_device *netdev, u32 stringset,
484 u8 *data) 486 u8 *data)
485{ 487{
@@ -528,11 +530,10 @@ static const struct ethtool_ops igbvf_ethtool_ops = {
528 .get_tso = ethtool_op_get_tso, 530 .get_tso = ethtool_op_get_tso,
529 .set_tso = igbvf_set_tso, 531 .set_tso = igbvf_set_tso,
530 .self_test = igbvf_diag_test, 532 .self_test = igbvf_diag_test,
533 .get_sset_count = igbvf_get_sset_count,
531 .get_strings = igbvf_get_strings, 534 .get_strings = igbvf_get_strings,
532 .phys_id = igbvf_phys_id, 535 .phys_id = igbvf_phys_id,
533 .get_ethtool_stats = igbvf_get_ethtool_stats, 536 .get_ethtool_stats = igbvf_get_ethtool_stats,
534 .self_test_count = igbvf_get_self_test_count,
535 .get_stats_count = igbvf_get_stats_count,
536 .get_coalesce = igbvf_get_coalesce, 537 .get_coalesce = igbvf_get_coalesce,
537 .set_coalesce = igbvf_set_coalesce, 538 .set_coalesce = igbvf_set_coalesce,
538}; 539};