diff options
author | Michael Chan <mchan@broadcom.com> | 2005-05-29 23:59:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-05-29 23:59:20 +0200 |
commit | d4bc3927d284784b3f0bff05b4eed2242cc3e226 (patch) | |
tree | acf2ae55152e4ec68abf108e978e6e8b6d719a32 /drivers | |
parent | [TG3]: Add loopback test (diff) | |
download | linux-d4bc3927d284784b3f0bff05b4eed2242cc3e226.tar.xz linux-d4bc3927d284784b3f0bff05b4eed2242cc3e226.zip |
[TG3]: Add interrupt test
This test uses the previously added tg3_test_interrupt() to perform the
test.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tg3.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 2a771fd4c7cd..82afd26a829f 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -5894,6 +5894,9 @@ static int tg3_test_interrupt(struct tg3 *tp) int err, i; u32 int_mbox = 0; + if (!netif_running(dev)) + return -ENODEV; + tg3_disable_ints(tp); free_irq(tp->pdev->irq, dev); @@ -7729,6 +7732,15 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest, data[4] = 1; } + spin_unlock(&tp->tx_lock); + spin_unlock_irq(&tp->lock); + if (tg3_test_interrupt(tp) != 0) { + etest->flags |= ETH_TEST_FL_FAILED; + data[5] = 1; + } + spin_lock_irq(&tp->lock); + spin_lock(&tp->tx_lock); + tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); if (netif_running(dev)) { tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; |