aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/nvidia
diff options
context:
space:
mode:
authorIvan Vecera <ivecera@redhat.com>2013-12-04 12:06:51 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-05 20:59:22 -0500
commit86d9be263a7ad6f17214d7f112b4c8739137485d (patch)
tree3f15092b48bcdb275957cc801c7370629002aee1 /drivers/net/ethernet/nvidia
parent89015c18ff34a39e4679ddd9b058e74d7dde28e7 (diff)
forcedeth: run loopback test only on chipsets that support it
The driver incorrectly run loopback test on chips that don't support it. Loopback test is only supported by chips that has DEV_HAS_TEST_EXTENDED flag and returns 4 (NV_TEST_COUNT_EXTENDED) as test count. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/nvidia')
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 2d045be4b5cf..1e8b9514718b 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -5150,8 +5150,10 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
5150{ 5150{
5151 struct fe_priv *np = netdev_priv(dev); 5151 struct fe_priv *np = netdev_priv(dev);
5152 u8 __iomem *base = get_hwbase(dev); 5152 u8 __iomem *base = get_hwbase(dev);
5153 int result; 5153 int result, count;
5154 memset(buffer, 0, nv_get_sset_count(dev, ETH_SS_TEST)*sizeof(u64)); 5154
5155 count = nv_get_sset_count(dev, ETH_SS_TEST);
5156 memset(buffer, 0, count * sizeof(u64));
5155 5157
5156 if (!nv_link_test(dev)) { 5158 if (!nv_link_test(dev)) {
5157 test->flags |= ETH_TEST_FL_FAILED; 5159 test->flags |= ETH_TEST_FL_FAILED;
@@ -5195,7 +5197,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
5195 return; 5197 return;
5196 } 5198 }
5197 5199
5198 if (!nv_loopback_test(dev)) { 5200 if (count > NV_TEST_COUNT_BASE && !nv_loopback_test(dev)) {
5199 test->flags |= ETH_TEST_FL_FAILED; 5201 test->flags |= ETH_TEST_FL_FAILED;
5200 buffer[3] = 1; 5202 buffer[3] = 1;
5201 } 5203 }