Allow disabling interrupts on e100, because they are enabled after hardware reset.
authorFlorian Pose <fp@igh-essen.com>
Thu, 20 Nov 2008 12:36:19 +0000
changeset 1317 09173a2de40c
parent 1316 d01d9cce8b59
child 1318 76b4014391bd
Allow disabling interrupts on e100, because they are enabled after hardware reset.
devices/e100-2.6.20-ethercat.c
devices/e100-2.6.24-ethercat.c
devices/e100-2.6.26-ethercat.c
--- a/devices/e100-2.6.20-ethercat.c	Wed Nov 19 17:10:04 2008 +0000
+++ b/devices/e100-2.6.20-ethercat.c	Thu Nov 20 12:36:19 2008 +0000
@@ -659,15 +659,14 @@
 
 static void e100_disable_irq(struct nic *nic)
 {
-	unsigned long flags;
-
-    if (nic->ecdev)
-        return;
-
-	spin_lock_irqsave(&nic->cmd_lock, flags);
+	unsigned long flags = 0;
+
+	if (!nic->ecdev)
+		spin_lock_irqsave(&nic->cmd_lock, flags);
 	writeb(irq_mask_all, &nic->csr->scb.cmd_hi);
 	e100_write_flush(nic);
-	spin_unlock_irqrestore(&nic->cmd_lock, flags);
+	if (!nic->ecdev)
+		spin_unlock_irqrestore(&nic->cmd_lock, flags);
 }
 
 static void e100_hw_reset(struct nic *nic)
@@ -2095,7 +2094,7 @@
 {
 	struct nic *nic = netdev_priv(netdev);
 
-	e100_rx_clean(nic, NULL, 100); // FIXME
+	e100_rx_clean(nic, NULL, 100);
 	e100_tx_clean(nic);
 
     if (jiffies - nic->ec_watchdog_jiffies >= 2 * HZ) {
@@ -2132,9 +2131,6 @@
 {
 	struct nic *nic = netdev_priv(netdev);
 
-    if (nic->ecdev)
-        return;
-
 	e100_disable_irq(nic);
 	e100_intr(nic->pdev->irq, netdev);
 	e100_tx_clean(nic);
--- a/devices/e100-2.6.24-ethercat.c	Wed Nov 19 17:10:04 2008 +0000
+++ b/devices/e100-2.6.24-ethercat.c	Thu Nov 20 12:36:19 2008 +0000
@@ -669,15 +669,14 @@
 
 static void e100_disable_irq(struct nic *nic)
 {
-	unsigned long flags;
-
-	if (nic->ecdev)
-		return;
-
-	spin_lock_irqsave(&nic->cmd_lock, flags);
+	unsigned long flags = 0;
+
+	if (!nic->ecdev)
+		spin_lock_irqsave(&nic->cmd_lock, flags);
 	iowrite8(irq_mask_all, &nic->csr->scb.cmd_hi);
 	e100_write_flush(nic);
-	spin_unlock_irqrestore(&nic->cmd_lock, flags);
+	if (!nic->ecdev)
+		spin_unlock_irqrestore(&nic->cmd_lock, flags);
 }
 
 static void e100_hw_reset(struct nic *nic)
@@ -2114,7 +2113,7 @@
 {
 	struct nic *nic = netdev_priv(netdev);
 
-	e100_rx_clean(nic, NULL, 100); // FIXME
+	e100_rx_clean(nic, NULL, 100);
 	e100_tx_clean(nic);
 
     if (jiffies - nic->ec_watchdog_jiffies >= 2 * HZ) {
@@ -2147,9 +2146,6 @@
 {
 	struct nic *nic = netdev_priv(netdev);
 
-	if (nic->ecdev)
-		return;
-
 	e100_disable_irq(nic);
 	e100_intr(nic->pdev->irq, netdev);
 	e100_tx_clean(nic);
--- a/devices/e100-2.6.26-ethercat.c	Wed Nov 19 17:10:04 2008 +0000
+++ b/devices/e100-2.6.26-ethercat.c	Thu Nov 20 12:36:19 2008 +0000
@@ -677,15 +677,14 @@
 
 static void e100_disable_irq(struct nic *nic)
 {
-	unsigned long flags;
-
-	if (nic->ecdev)
-		return;
-
-	spin_lock_irqsave(&nic->cmd_lock, flags);
+	unsigned long flags = 0;
+
+	if (!nic->ecdev)
+		spin_lock_irqsave(&nic->cmd_lock, flags);
 	iowrite8(irq_mask_all, &nic->csr->scb.cmd_hi);
 	e100_write_flush(nic);
-	spin_unlock_irqrestore(&nic->cmd_lock, flags);
+	if (!nic->ecdev)
+		spin_unlock_irqrestore(&nic->cmd_lock, flags);
 }
 
 static void e100_hw_reset(struct nic *nic)
@@ -2185,7 +2184,7 @@
 {
 	struct nic *nic = netdev_priv(netdev);
 
-	e100_rx_clean(nic, NULL, 100); // FIXME
+	e100_rx_clean(nic, NULL, 100);
 	e100_tx_clean(nic);
 
     if (jiffies - nic->ec_watchdog_jiffies >= 2 * HZ) {
@@ -2218,9 +2217,6 @@
 {
 	struct nic *nic = netdev_priv(netdev);
 
-	if (nic->ecdev)
-		return;
-
 	e100_disable_irq(nic);
 	e100_intr(nic->pdev->irq, netdev);
 	e100_tx_clean(nic);