aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000.h
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2006-06-27 12:06:28 -0400
committerAuke Kok <juke-jan.h.kok@intel.com>2006-06-27 12:06:28 -0400
commit2db10a081c5c1082d58809a1bcf1a6073f4db160 (patch)
treef54772ef60f2c5bf5f8d602a83d6dc508158a0e0 /drivers/net/e1000/e1000.h
parentacfbc9fde2ec7f304398f6ad7644002e07bf84bc (diff)
e1000: rework driver hardware reset locking
After studying the driver mac reset code it was found that there were multiple race conditions possible to reset the unit twice or bring it e1000_up() double. This fixes all occurences where the driver needs to reset the mac. We also remove irq requesting/releasing into _open and _close so that while the device is _up we will never touch the irq's. This fixes the double free irq bug that people saw. To make sure that the watchdog task doesn't cause another race we let it run as a non-scheduled task. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000.h')
-rw-r--r--drivers/net/e1000/e1000.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 2bc34fbfa69c..2b96ad0482ef 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -69,7 +69,6 @@
69#ifdef NETIF_F_TSO 69#ifdef NETIF_F_TSO
70#include <net/checksum.h> 70#include <net/checksum.h>
71#endif 71#endif
72#include <linux/workqueue.h>
73#include <linux/mii.h> 72#include <linux/mii.h>
74#include <linux/ethtool.h> 73#include <linux/ethtool.h>
75#include <linux/if_vlan.h> 74#include <linux/if_vlan.h>
@@ -255,7 +254,6 @@ struct e1000_adapter {
255 spinlock_t tx_queue_lock; 254 spinlock_t tx_queue_lock;
256#endif 255#endif
257 atomic_t irq_sem; 256 atomic_t irq_sem;
258 struct work_struct watchdog_task;
259 struct work_struct reset_task; 257 struct work_struct reset_task;
260 uint8_t fc_autoneg; 258 uint8_t fc_autoneg;
261 259
@@ -340,8 +338,13 @@ struct e1000_adapter {
340#ifdef NETIF_F_TSO 338#ifdef NETIF_F_TSO
341 boolean_t tso_force; 339 boolean_t tso_force;
342#endif 340#endif
341 unsigned long flags;
343}; 342};
344 343
344enum e1000_state_t {
345 __E1000_DRIVER_TESTING,
346 __E1000_RESETTING,
347};
345 348
346/* e1000_main.c */ 349/* e1000_main.c */
347extern char e1000_driver_name[]; 350extern char e1000_driver_name[];
@@ -349,6 +352,7 @@ extern char e1000_driver_version[];
349int e1000_up(struct e1000_adapter *adapter); 352int e1000_up(struct e1000_adapter *adapter);
350void e1000_down(struct e1000_adapter *adapter); 353void e1000_down(struct e1000_adapter *adapter);
351void e1000_reset(struct e1000_adapter *adapter); 354void e1000_reset(struct e1000_adapter *adapter);
355void e1000_reinit_locked(struct e1000_adapter *adapter);
352int e1000_setup_all_tx_resources(struct e1000_adapter *adapter); 356int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
353void e1000_free_all_tx_resources(struct e1000_adapter *adapter); 357void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
354int e1000_setup_all_rx_resources(struct e1000_adapter *adapter); 358int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);