diff options
Diffstat (limited to 'drivers/net/ucc_geth_ethtool.c')
-rw-r--r-- | drivers/net/ucc_geth_ethtool.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c index 73aa677a4a3..9a9622c13e2 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 | ||
279 | static int uec_get_stats_count(struct net_device *netdev) | 279 | static 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 | ||
295 | static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf) | 301 | static 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 | }; |