Fixed link detection in older e1000e drivers. stable-1.5
authorFlorian Pose <fp@igh-essen.com>
Fri, 11 Jan 2013 15:07:11 +0100
branchstable-1.5
changeset 2499 c350fc89afd7
parent 2498 9cdd7669dc0b
child 2500 97fd83907c7c
Fixed link detection in older e1000e drivers.
devices/e1000e/netdev-2.6.37-ethercat.c
devices/e1000e/netdev-3.2-ethercat.c
--- a/devices/e1000e/netdev-2.6.37-ethercat.c	Thu Jan 10 17:36:41 2013 +0100
+++ b/devices/e1000e/netdev-2.6.37-ethercat.c	Fri Jan 11 15:07:11 2013 +0100
@@ -5768,14 +5768,16 @@
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
 	if (jiffies - adapter->ec_watchdog_jiffies >= 2 * HZ) {
-		e1000_watchdog((unsigned long) adapter);
+		struct e1000_hw *hw = &adapter->hw;
+		hw->mac.get_link_status = true;
+		e1000_watchdog_task(&adapter->watchdog_task);
 		adapter->ec_watchdog_jiffies = jiffies;
 	}
 
 #ifdef CONFIG_PCI_MSI
-	e1000_intr_msi(0,netdev);
+	e1000_intr_msi(0, netdev);
 #else
-	e1000_intr(0,netdev);
+	e1000_intr(0, netdev);
 #endif
 }
 
@@ -6068,6 +6070,7 @@
 
 	adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE);
 	if (adapter->ecdev) {
+		adapter->ec_watchdog_jiffies = jiffies;
 		if (ecdev_open(adapter->ecdev)) {
 			ecdev_withdraw(adapter->ecdev);
 			goto err_register;
--- a/devices/e1000e/netdev-3.2-ethercat.c	Thu Jan 10 17:36:41 2013 +0100
+++ b/devices/e1000e/netdev-3.2-ethercat.c	Fri Jan 11 15:07:11 2013 +0100
@@ -6050,14 +6050,16 @@
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
 	if (jiffies - adapter->ec_watchdog_jiffies >= 2 * HZ) {
-		e1000_watchdog((unsigned long) adapter);
+		struct e1000_hw *hw = &adapter->hw;
+		hw->mac.get_link_status = true;
+		e1000_watchdog_task(&adapter->watchdog_task);
 		adapter->ec_watchdog_jiffies = jiffies;
 	}
 
 #ifdef CONFIG_PCI_MSI
-	e1000_intr_msi(0,netdev);
+	e1000_intr_msi(0, netdev);
 #else
-	e1000_intr(0,netdev);
+	e1000_intr(0, netdev);
 #endif
 }
 
@@ -6359,6 +6361,7 @@
 
 	adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE);
 	if (adapter->ecdev) {
+		adapter->ec_watchdog_jiffies = jiffies;
 		if (ecdev_open(adapter->ecdev)) {
 			ecdev_withdraw(adapter->ecdev);
 			goto err_register;