diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-03 21:07:32 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:45 -0400 |
commit | b9f2c0440d806e01968c3ed4def930a43be248ad (patch) | |
tree | b8e4668b0a4eab842fc33402e92b15f6c63cbc18 /drivers/net/forcedeth.c | |
parent | 753f492093da7a40141bfe083073400f518f4c68 (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/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index f7354bc9b009..666de42e5a76 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -4333,16 +4333,26 @@ static int nv_set_sg(struct net_device *dev, u32 data) | |||
4333 | return -EOPNOTSUPP; | 4333 | return -EOPNOTSUPP; |
4334 | } | 4334 | } |
4335 | 4335 | ||
4336 | static int nv_get_stats_count(struct net_device *dev) | 4336 | static int nv_get_sset_count(struct net_device *dev, int sset) |
4337 | { | 4337 | { |
4338 | struct fe_priv *np = netdev_priv(dev); | 4338 | struct fe_priv *np = netdev_priv(dev); |
4339 | 4339 | ||
4340 | if (np->driver_data & DEV_HAS_STATISTICS_V1) | 4340 | switch (sset) { |
4341 | return NV_DEV_STATISTICS_V1_COUNT; | 4341 | case ETH_SS_TEST: |
4342 | else if (np->driver_data & DEV_HAS_STATISTICS_V2) | 4342 | if (np->driver_data & DEV_HAS_TEST_EXTENDED) |
4343 | return NV_DEV_STATISTICS_V2_COUNT; | 4343 | return NV_TEST_COUNT_EXTENDED; |
4344 | else | 4344 | else |
4345 | return 0; | 4345 | return NV_TEST_COUNT_BASE; |
4346 | case ETH_SS_STATS: | ||
4347 | if (np->driver_data & DEV_HAS_STATISTICS_V1) | ||
4348 | return NV_DEV_STATISTICS_V1_COUNT; | ||
4349 | else if (np->driver_data & DEV_HAS_STATISTICS_V2) | ||
4350 | return NV_DEV_STATISTICS_V2_COUNT; | ||
4351 | else | ||
4352 | return 0; | ||
4353 | default: | ||
4354 | return -EOPNOTSUPP; | ||
4355 | } | ||
4346 | } | 4356 | } |
4347 | 4357 | ||
4348 | static void nv_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *buffer) | 4358 | static void nv_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *buffer) |
@@ -4352,17 +4362,7 @@ static void nv_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *e | |||
4352 | /* update stats */ | 4362 | /* update stats */ |
4353 | nv_do_stats_poll((unsigned long)dev); | 4363 | nv_do_stats_poll((unsigned long)dev); |
4354 | 4364 | ||
4355 | memcpy(buffer, &np->estats, nv_get_stats_count(dev)*sizeof(u64)); | 4365 | memcpy(buffer, &np->estats, nv_get_sset_count(dev, ETH_SS_STATS)*sizeof(u64)); |
4356 | } | ||
4357 | |||
4358 | static int nv_self_test_count(struct net_device *dev) | ||
4359 | { | ||
4360 | struct fe_priv *np = netdev_priv(dev); | ||
4361 | |||
4362 | if (np->driver_data & DEV_HAS_TEST_EXTENDED) | ||
4363 | return NV_TEST_COUNT_EXTENDED; | ||
4364 | else | ||
4365 | return NV_TEST_COUNT_BASE; | ||
4366 | } | 4366 | } |
4367 | 4367 | ||
4368 | static int nv_link_test(struct net_device *dev) | 4368 | static int nv_link_test(struct net_device *dev) |
@@ -4609,7 +4609,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64 | |||
4609 | struct fe_priv *np = netdev_priv(dev); | 4609 | struct fe_priv *np = netdev_priv(dev); |
4610 | u8 __iomem *base = get_hwbase(dev); | 4610 | u8 __iomem *base = get_hwbase(dev); |
4611 | int result; | 4611 | int result; |
4612 | memset(buffer, 0, nv_self_test_count(dev)*sizeof(u64)); | 4612 | memset(buffer, 0, nv_get_sset_count(dev, ETH_SS_TEST)*sizeof(u64)); |
4613 | 4613 | ||
4614 | if (!nv_link_test(dev)) { | 4614 | if (!nv_link_test(dev)) { |
4615 | test->flags |= ETH_TEST_FL_FAILED; | 4615 | test->flags |= ETH_TEST_FL_FAILED; |
@@ -4692,10 +4692,10 @@ static void nv_get_strings(struct net_device *dev, u32 stringset, u8 *buffer) | |||
4692 | { | 4692 | { |
4693 | switch (stringset) { | 4693 | switch (stringset) { |
4694 | case ETH_SS_STATS: | 4694 | case ETH_SS_STATS: |
4695 | memcpy(buffer, &nv_estats_str, nv_get_stats_count(dev)*sizeof(struct nv_ethtool_str)); | 4695 | memcpy(buffer, &nv_estats_str, nv_get_sset_count(dev, ETH_SS_STATS)*sizeof(struct nv_ethtool_str)); |
4696 | break; | 4696 | break; |
4697 | case ETH_SS_TEST: | 4697 | case ETH_SS_TEST: |
4698 | memcpy(buffer, &nv_etests_str, nv_self_test_count(dev)*sizeof(struct nv_ethtool_str)); | 4698 | memcpy(buffer, &nv_etests_str, nv_get_sset_count(dev, ETH_SS_TEST)*sizeof(struct nv_ethtool_str)); |
4699 | break; | 4699 | break; |
4700 | } | 4700 | } |
4701 | } | 4701 | } |
@@ -4720,9 +4720,8 @@ static const struct ethtool_ops ops = { | |||
4720 | .set_tx_csum = nv_set_tx_csum, | 4720 | .set_tx_csum = nv_set_tx_csum, |
4721 | .set_sg = nv_set_sg, | 4721 | .set_sg = nv_set_sg, |
4722 | .get_strings = nv_get_strings, | 4722 | .get_strings = nv_get_strings, |
4723 | .get_stats_count = nv_get_stats_count, | ||
4724 | .get_ethtool_stats = nv_get_ethtool_stats, | 4723 | .get_ethtool_stats = nv_get_ethtool_stats, |
4725 | .self_test_count = nv_self_test_count, | 4724 | .get_sset_count = nv_get_sset_count, |
4726 | .self_test = nv_self_test, | 4725 | .self_test = nv_self_test, |
4727 | }; | 4726 | }; |
4728 | 4727 | ||