aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ucc_geth_ethtool.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-10-03 21:07:32 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:45 -0400
commitb9f2c0440d806e01968c3ed4def930a43be248ad (patch)
treeb8e4668b0a4eab842fc33402e92b15f6c63cbc18 /drivers/net/ucc_geth_ethtool.c
parent753f492093da7a40141bfe083073400f518f4c68 (diff)
[netdrvr] Stop using legacy hooks ->self_test_count, ->get_stats_count
These have been superceded by the new ->get_sset_count() hook. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ucc_geth_ethtool.c')
-rw-r--r--drivers/net/ucc_geth_ethtool.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index 73aa677a4a3e..9a9622c13e2b 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -276,20 +276,26 @@ uec_set_ringparam(struct net_device *netdev,
276 return ret; 276 return ret;
277} 277}
278 278
279static int uec_get_stats_count(struct net_device *netdev) 279static int uec_get_sset_count(struct net_device *netdev, int sset)
280{ 280{
281 struct ucc_geth_private *ugeth = netdev_priv(netdev); 281 struct ucc_geth_private *ugeth = netdev_priv(netdev);
282 u32 stats_mode = ugeth->ug_info->statisticsMode; 282 u32 stats_mode = ugeth->ug_info->statisticsMode;
283 int len = 0; 283 int len = 0;
284 284
285 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE) 285 switch (sset) {
286 len += UEC_HW_STATS_LEN; 286 case ETH_SS_STATS:
287 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX) 287 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE)
288 len += UEC_TX_FW_STATS_LEN; 288 len += UEC_HW_STATS_LEN;
289 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX) 289 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX)
290 len += UEC_RX_FW_STATS_LEN; 290 len += UEC_TX_FW_STATS_LEN;
291 if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX)
292 len += UEC_RX_FW_STATS_LEN;
293
294 return len;
291 295
292 return len; 296 default:
297 return -EOPNOTSUPP;
298 }
293} 299}
294 300
295static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf) 301static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
@@ -353,8 +359,6 @@ uec_get_drvinfo(struct net_device *netdev,
353 strncpy(drvinfo->version, DRV_VERSION, 32); 359 strncpy(drvinfo->version, DRV_VERSION, 32);
354 strncpy(drvinfo->fw_version, "N/A", 32); 360 strncpy(drvinfo->fw_version, "N/A", 32);
355 strncpy(drvinfo->bus_info, "QUICC ENGINE", 32); 361 strncpy(drvinfo->bus_info, "QUICC ENGINE", 32);
356 drvinfo->n_stats = uec_get_stats_count(netdev);
357 drvinfo->testinfo_len = 0;
358 drvinfo->eedump_len = 0; 362 drvinfo->eedump_len = 0;
359 drvinfo->regdump_len = uec_get_regs_len(netdev); 363 drvinfo->regdump_len = uec_get_regs_len(netdev);
360} 364}
@@ -374,7 +378,7 @@ static const struct ethtool_ops uec_ethtool_ops = {
374 .get_pauseparam = uec_get_pauseparam, 378 .get_pauseparam = uec_get_pauseparam,
375 .set_pauseparam = uec_set_pauseparam, 379 .set_pauseparam = uec_set_pauseparam,
376 .set_sg = ethtool_op_set_sg, 380 .set_sg = ethtool_op_set_sg,
377 .get_stats_count = uec_get_stats_count, 381 .get_sset_count = uec_get_sset_count,
378 .get_strings = uec_get_strings, 382 .get_strings = uec_get_strings,
379 .get_ethtool_stats = uec_get_ethtool_stats, 383 .get_ethtool_stats = uec_get_ethtool_stats,
380}; 384};