Subject: [PATCH 2.6.12-rc5 8/9] tg3: Add interrupt test

From: "Michael Chan" <[email-masked]>
Date: Thu, 26 May 2005 10:59:29 -0700

This test uses the previously added tg3_test_interrupt() to perform the
test.

Signed-off-by: Michael Chan <[email-masked]>
diff -Nru d7/drivers/net/tg3.c d8/drivers/net/tg3.c
--- d7/drivers/net/tg3.c	2005-05-25 12:59:38.000000000 -0700
+++ d8/drivers/net/tg3.c	2005-05-25 12:59:46.000000000 -0700
@@ -5894,6 +5894,9 @@
 	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 @@
 			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;