Skip to content

Commit 1ddee09

Browse files
Ben Hutchingsdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent df8b4ec commit 1ddee09

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

drivers/net/tehuti.c

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,12 +2105,6 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
21052105
}
21062106

21072107
/****************** Ethtool interface *********************/
2108-
/* get strings for tests */
2109-
static const char
2110-
bdx_test_names[][ETH_GSTRING_LEN] = {
2111-
"No tests defined"
2112-
};
2113-
21142108
/* get strings for statistics counters */
21152109
static const char
21162110
bdx_stat_names[][ETH_GSTRING_LEN] = {
@@ -2380,25 +2374,28 @@ bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
23802374
static void bdx_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
23812375
{
23822376
switch (stringset) {
2383-
case ETH_SS_TEST:
2384-
memcpy(data, *bdx_test_names, sizeof(bdx_test_names));
2385-
break;
23862377
case ETH_SS_STATS:
23872378
memcpy(data, *bdx_stat_names, sizeof(bdx_stat_names));
23882379
break;
23892380
}
23902381
}
23912382

23922383
/*
2393-
* bdx_get_stats_count - return number of 64bit statistics counters
2384+
* bdx_get_sset_count - return number of statistics or tests
23942385
* @netdev
23952386
*/
2396-
static int bdx_get_stats_count(struct net_device *netdev)
2387+
static int bdx_get_sset_count(struct net_device *netdev, int stringset)
23972388
{
23982389
struct bdx_priv *priv = netdev_priv(netdev);
2399-
BDX_ASSERT(ARRAY_SIZE(bdx_stat_names)
2400-
!= sizeof(struct bdx_stats) / sizeof(u64));
2401-
return ((priv->stats_flag) ? ARRAY_SIZE(bdx_stat_names) : 0);
2390+
2391+
switch (stringset) {
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+
}
24022399
}
24032400

24042401
/*
@@ -2441,7 +2438,7 @@ static void bdx_ethtool_ops(struct net_device *netdev)
24412438
.get_sg = ethtool_op_get_sg,
24422439
.get_tso = ethtool_op_get_tso,
24432440
.get_strings = bdx_get_strings,
2444-
.get_stats_count = bdx_get_stats_count,
2441+
.get_sset_count = bdx_get_sset_count,
24452442
.get_ethtool_stats = bdx_get_ethtool_stats,
24462443
};
24472444

0 commit comments

Comments
 (0)