From 2db10a081c5c1082d58809a1bcf1a6073f4db160 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 27 Jun 2006 09:06:28 -0700 Subject: 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 Signed-off-by: Auke Kok --- drivers/net/e1000/e1000.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/net/e1000/e1000.h') 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 @@ #ifdef NETIF_F_TSO #include #endif -#include #include #include #include @@ -255,7 +254,6 @@ struct e1000_adapter { spinlock_t tx_queue_lock; #endif atomic_t irq_sem; - struct work_struct watchdog_task; struct work_struct reset_task; uint8_t fc_autoneg; @@ -340,8 +338,13 @@ struct e1000_adapter { #ifdef NETIF_F_TSO boolean_t tso_force; #endif + unsigned long flags; }; +enum e1000_state_t { + __E1000_DRIVER_TESTING, + __E1000_RESETTING, +}; /* e1000_main.c */ extern char e1000_driver_name[]; @@ -349,6 +352,7 @@ extern char e1000_driver_version[]; int e1000_up(struct e1000_adapter *adapter); void e1000_down(struct e1000_adapter *adapter); void e1000_reset(struct e1000_adapter *adapter); +void e1000_reinit_locked(struct e1000_adapter *adapter); int e1000_setup_all_tx_resources(struct e1000_adapter *adapter); void e1000_free_all_tx_resources(struct e1000_adapter *adapter); int e1000_setup_all_rx_resources(struct e1000_adapter *adapter); -- cgit v1.2.1 From 9a53a2029885e0088e9149679215b95d04deb57b Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 27 Jun 2006 09:06:45 -0700 Subject: e1000: add smart power down code Smart Power Down is a power saving feature in newer e1000 hardware. We disable it because it causes time to link to be long, but make it a user choice. Signed-off-by: Jesse Brandeburg Signed-off-by: Auke Kok --- drivers/net/e1000/e1000.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/e1000/e1000.h') diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 2b96ad0482ef..dbdaa332cac6 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -338,6 +338,7 @@ struct e1000_adapter { #ifdef NETIF_F_TSO boolean_t tso_force; #endif + boolean_t smart_power_down; /* phy smart power down */ unsigned long flags; }; -- cgit v1.2.1 From cd94dd0b648ceb64ca5e41d9ccfa99c1e30e92ef Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 27 Jun 2006 09:08:22 -0700 Subject: e1000: integrate ich8 support into driver This hooks up the ich8 structure into the driver itself. Signed-off-by: Jesse Brandeburg Signed-off-by: Auke Kok --- drivers/net/e1000/e1000.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/e1000/e1000.h') diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index dbdaa332cac6..323a2683417f 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -143,6 +143,7 @@ struct e1000_adapter; #define AUTO_ALL_MODES 0 #define E1000_EEPROM_82544_APM 0x0004 +#define E1000_EEPROM_ICH8_APME 0x0004 #define E1000_EEPROM_APME 0x0400 #ifndef E1000_MASTER_SLAVE -- cgit v1.2.1