Fixed e1000_open() in e1000e drivers. stable-1.5
authorFlorian Pose <fp@igh-essen.com>
Wed, 05 Dec 2012 12:15:49 +0100
branchstable-1.5
changeset 2473 f62b64fdbc23
parent 2472 50b861e981f7
child 2474 fb2fe8fae501
Fixed e1000_open() in e1000e drivers.
devices/e1000e/netdev-2.6.32-ethercat.c
devices/e1000e/netdev-2.6.33-ethercat.c
devices/e1000e/netdev-2.6.34-ethercat.c
devices/e1000e/netdev-2.6.35-ethercat.c
devices/e1000e/netdev-2.6.37-ethercat.c
devices/e1000e/netdev-3.2-ethercat.c
--- a/devices/e1000e/netdev-2.6.32-ethercat.c	Wed Dec 05 12:02:44 2012 +0100
+++ b/devices/e1000e/netdev-2.6.32-ethercat.c	Wed Dec 05 12:15:49 2012 +0100
@@ -1190,10 +1190,10 @@
 	struct e1000_hw *hw = &adapter->hw;
 	u32 icr = er32(ICR);
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 	/*
@@ -1294,10 +1294,10 @@
 			mod_timer(&adapter->watchdog_timer, jiffies + 1);
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 
@@ -1377,9 +1377,9 @@
 		adapter->rx_ring->set_itr = 0;
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
 	} else {
 		if (napi_schedule_prep(&adapter->napi)) {
 			adapter->total_rx_bytes = 0;
@@ -3249,11 +3249,13 @@
 	/* From here on the code is the same as e1000e_up() */
 	clear_bit(__E1000_DOWN, &adapter->state);
 
-	napi_enable(&adapter->napi);
-
-	e1000_irq_enable(adapter);
-
-	netif_start_queue(netdev);
+	if (!adapter->ecdev) {
+		napi_enable(&adapter->napi);
+
+		e1000_irq_enable(adapter);
+
+		netif_start_queue(netdev);
+	}
 
 	/* fire a link status change interrupt to start the watchdog */
 	ew32(ICS, E1000_ICS_LSC);
--- a/devices/e1000e/netdev-2.6.33-ethercat.c	Wed Dec 05 12:02:44 2012 +0100
+++ b/devices/e1000e/netdev-2.6.33-ethercat.c	Wed Dec 05 12:15:49 2012 +0100
@@ -3237,11 +3237,13 @@
 	/* From here on the code is the same as e1000e_up() */
 	clear_bit(__E1000_DOWN, &adapter->state);
 
-	napi_enable(&adapter->napi);
-
-	e1000_irq_enable(adapter);
-
-	netif_start_queue(netdev);
+	if (!adapter->ecdev) {
+		napi_enable(&adapter->napi);
+
+		e1000_irq_enable(adapter);
+
+		netif_start_queue(netdev);
+	}
 
 	/* fire a link status change interrupt to start the watchdog */
 	ew32(ICS, E1000_ICS_LSC);
--- a/devices/e1000e/netdev-2.6.34-ethercat.c	Wed Dec 05 12:02:44 2012 +0100
+++ b/devices/e1000e/netdev-2.6.34-ethercat.c	Wed Dec 05 12:15:49 2012 +0100
@@ -24,6 +24,8 @@
   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 
+  vim: noexpandtab
+
 *******************************************************************************/
 
 #include <linux/module.h>
@@ -1187,10 +1189,10 @@
 	struct e1000_hw *hw = &adapter->hw;
 	u32 icr = er32(ICR);
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 	/*
@@ -1291,10 +1293,10 @@
 			mod_timer(&adapter->watchdog_timer, jiffies + 1);
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 
@@ -1374,9 +1376,9 @@
 		adapter->rx_ring->set_itr = 0;
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
 	} else {
 		if (napi_schedule_prep(&adapter->napi)) {
 			adapter->total_rx_bytes = 0;
@@ -3217,11 +3219,13 @@
 	/* From here on the code is the same as e1000e_up() */
 	clear_bit(__E1000_DOWN, &adapter->state);
 
-	napi_enable(&adapter->napi);
-
-	e1000_irq_enable(adapter);
-
-	netif_start_queue(netdev);
+	if (!adapter->ecdev) {
+		napi_enable(&adapter->napi);
+
+		e1000_irq_enable(adapter);
+
+		netif_start_queue(netdev);
+	}
 
 	/* fire a link status change interrupt to start the watchdog */
 	ew32(ICS, E1000_ICS_LSC);
--- a/devices/e1000e/netdev-2.6.35-ethercat.c	Wed Dec 05 12:02:44 2012 +0100
+++ b/devices/e1000e/netdev-2.6.35-ethercat.c	Wed Dec 05 12:15:49 2012 +0100
@@ -24,6 +24,8 @@
   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 
+  vim: noexpandtab
+
 *******************************************************************************/
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -1532,10 +1534,10 @@
 	struct e1000_hw *hw = &adapter->hw;
 	u32 icr = er32(ICR);
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 	/*
@@ -1636,10 +1638,10 @@
 			mod_timer(&adapter->watchdog_timer, jiffies + 1);
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 
@@ -1719,9 +1721,9 @@
 		adapter->rx_ring->set_itr = 0;
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
 	} else {
 		if (napi_schedule_prep(&adapter->napi)) {
 			adapter->total_rx_bytes = 0;
@@ -3270,20 +3272,20 @@
 
 	if (!adapter->ecdev) {
 		napi_enable(&adapter->napi);
-    }
+	}
 
 	if (adapter->msix_entries)
 		e1000_configure_msix(adapter);
 	if (!adapter->ecdev) {
-        e1000_irq_enable(adapter);
-
-        netif_wake_queue(adapter->netdev);
-
-        /* fire a link change interrupt to start the watchdog */
-        if (adapter->msix_entries)
-            ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
-        else
-            ew32(ICS, E1000_ICS_LSC);
+		e1000_irq_enable(adapter);
+
+		netif_wake_queue(adapter->netdev);
+
+		/* fire a link change interrupt to start the watchdog */
+		if (adapter->msix_entries)
+			ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
+		else
+			ew32(ICS, E1000_ICS_LSC);
 	}
 
 	return 0;
@@ -3609,11 +3611,13 @@
 	/* From here on the code is the same as e1000e_up() */
 	clear_bit(__E1000_DOWN, &adapter->state);
 
-	napi_enable(&adapter->napi);
-
-	e1000_irq_enable(adapter);
-
-	netif_start_queue(netdev);
+	if (!adapter->ecdev) {
+		napi_enable(&adapter->napi);
+
+		e1000_irq_enable(adapter);
+
+		netif_start_queue(netdev);
+	}
 
 	adapter->idle_check = true;
 	pm_runtime_put(&pdev->dev);
@@ -4031,7 +4035,7 @@
 
 	link = e1000e_has_link(adapter);
 	if ((adapter->ecdev && (ecdev_get_link(adapter->ecdev)) && link)
-            || (!adapter->ecdev && (netif_carrier_ok(netdev)) && link)) {
+			|| (!adapter->ecdev && (netif_carrier_ok(netdev)) && link)) {
 		/* Cancel scheduled suspend requests. */
 		pm_runtime_resume(netdev->dev.parent);
 
@@ -5281,9 +5285,9 @@
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
-    if (adapter->ecdev) {
-        return -EBUSY;
-    }
+	if (adapter->ecdev) {
+		return -EBUSY;
+	}
 
 	retval = __e1000_shutdown(pdev, &wake, false);
 	if (!retval)
@@ -5298,9 +5302,9 @@
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
-    if (adapter->ecdev) {
-        return -EBUSY;
-    }
+	if (adapter->ecdev) {
+		return -EBUSY;
+	}
 
 	if (e1000e_pm_ready(adapter))
 		adapter->idle_check = true;
--- a/devices/e1000e/netdev-2.6.37-ethercat.c	Wed Dec 05 12:02:44 2012 +0100
+++ b/devices/e1000e/netdev-2.6.37-ethercat.c	Wed Dec 05 12:15:49 2012 +0100
@@ -24,6 +24,8 @@
   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 
+  vim: noexpandtab
+
 *******************************************************************************/
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -1537,10 +1539,10 @@
 	struct e1000_hw *hw = &adapter->hw;
 	u32 icr = er32(ICR);
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 	/*
@@ -1641,10 +1643,10 @@
 			mod_timer(&adapter->watchdog_timer, jiffies + 1);
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 
@@ -1724,9 +1726,9 @@
 		adapter->rx_ring->set_itr = 0;
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
 	} else {
 		if (napi_schedule_prep(&adapter->napi)) {
 			adapter->total_rx_bytes = 0;
@@ -3703,16 +3705,16 @@
 		e1000_irq_enable(adapter);
 
 		netif_start_queue(netdev);
-
-		adapter->idle_check = true;
-		pm_runtime_put(&pdev->dev);
-
-		/* fire a link status change interrupt to start the watchdog */
-		if (adapter->msix_entries)
-			ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
-		else
-			ew32(ICS, E1000_ICS_LSC);
-	}
+	}
+
+	adapter->idle_check = true;
+	pm_runtime_put(&pdev->dev);
+
+	/* fire a link status change interrupt to start the watchdog */
+	if (adapter->msix_entries)
+		ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
+	else
+		ew32(ICS, E1000_ICS_LSC);
 
 	return 0;
 
--- a/devices/e1000e/netdev-3.2-ethercat.c	Wed Dec 05 12:02:44 2012 +0100
+++ b/devices/e1000e/netdev-3.2-ethercat.c	Wed Dec 05 12:15:49 2012 +0100
@@ -24,6 +24,8 @@
   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 
+  vim: noexpandtab
+
 *******************************************************************************/
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -984,7 +986,7 @@
 		} else {
 		    e1000_receive_skb(adapter, netdev, skb, staterr,
 				      rx_desc->wb.upper.vlan);
-        }
+		}
 
 next_desc:
 		rx_desc->wb.upper.status_error &= cpu_to_le32(~0xFF);
@@ -1065,7 +1067,9 @@
 	}
 	/* Real hang detected */
 	adapter->tx_hang_recheck = false;
-	netif_stop_queue(netdev);
+	if (!adapter->ecdev) {
+		netif_stop_queue(netdev);
+	}
 
 	e1e_rphy(hw, PHY_STATUS, &phy_status);
 	e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
@@ -1664,10 +1668,10 @@
 	struct e1000_hw *hw = &adapter->hw;
 	u32 icr = er32(ICR);
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 	/*
@@ -1768,10 +1772,10 @@
 			mod_timer(&adapter->watchdog_timer, jiffies + 1);
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
- 		e1000_clean_tx_irq(adapter);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
+		e1000_clean_tx_irq(adapter);
 		return IRQ_HANDLED;
 	}
 
@@ -1851,9 +1855,9 @@
 		adapter->rx_ring->set_itr = 0;
 	}
 
- 	if (adapter->ecdev) {
- 		int ec_work_done = 0;
- 		adapter->clean_rx(adapter, &ec_work_done, 100);
+	if (adapter->ecdev) {
+		int ec_work_done = 0;
+		adapter->clean_rx(adapter, &ec_work_done, 100);
 	} else {
 		if (napi_schedule_prep(&adapter->napi)) {
 			adapter->total_rx_bytes = 0;
@@ -3871,19 +3875,22 @@
 		napi_enable(&adapter->napi);
 
 		e1000_irq_enable(adapter);
+	}
 
 	adapter->tx_hang_recheck = false;
+
+	if (!adapter->ecdev) {
 		netif_start_queue(netdev);
-
-		adapter->idle_check = true;
-		pm_runtime_put(&pdev->dev);
-
-		/* fire a link status change interrupt to start the watchdog */
-		if (adapter->msix_entries)
-			ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
-		else
-			ew32(ICS, E1000_ICS_LSC);
-	}
+	}
+
+	adapter->idle_check = true;
+	pm_runtime_put(&pdev->dev);
+
+	/* fire a link status change interrupt to start the watchdog */
+	if (adapter->msix_entries)
+		ew32(ICS, E1000_ICS_LSC | E1000_ICR_OTHER);
+	else
+		ew32(ICS, E1000_ICS_LSC);
 
 	return 0;