From f8f0945b0957e77ab770416f001e012926a9cdff Mon Sep 17 00:00:00 2001 From: jfv Date: Thu, 31 May 2007 23:36:21 +0000 Subject: Couple of the fixes needed revising. The ICH8 autoneg was still broken, this change both simplifies the code and plugs a hole where the devise was reset without keeping the management controller at bay :) Second, the 82571 LAA reset problem was incomplete, this addition is necessary. Just one of those days :) --- sys/dev/em/if_em.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'sys/dev/em/if_em.c') diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 3db569d..73d16d2 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -719,13 +719,6 @@ em_attach(device_t dev) else adapter->pcix_82544 = FALSE; - /* Get control from any management/hw control */ - if (((adapter->hw.mac.type == e1000_82573) || - (adapter->hw.mac.type == e1000_ich8lan) || - (adapter->hw.mac.type == e1000_ich9lan)) && - e1000_check_mng_mode(&adapter->hw)) - em_get_hw_control(adapter); - /* Tell the stack that the interface is not active */ adapter->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -873,13 +866,6 @@ em_resume(device_t dev) EM_LOCK(adapter); em_init_locked(adapter); - - /* Get control from any management/hw control */ - if (((adapter->hw.mac.type == e1000_82573) || - (adapter->hw.mac.type == e1000_ich8lan) || - (adapter->hw.mac.type == e1000_ich9lan)) && - e1000_check_mng_mode(&adapter->hw)) - em_get_hw_control(adapter); em_init_manageability(adapter); if ((ifp->if_flags & IFF_UP) && @@ -2358,9 +2344,16 @@ em_local_timer(void *arg) e1000_check_for_link(&adapter->hw); em_update_link_status(adapter); em_update_stats_counters(adapter); + + /* Check for 82571 LAA reset by other port */ + if (e1000_get_laa_state_82571(&adapter->hw) == TRUE) + e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); + if (em_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) em_print_hw_stats(adapter); + em_smartspeed(adapter); + /* * Each second we check the watchdog to * protect against hardware hangs. @@ -2368,7 +2361,6 @@ em_local_timer(void *arg) em_watchdog(adapter); callout_reset(&adapter->timer, hz, em_local_timer, adapter); - } static void @@ -2701,6 +2693,13 @@ em_hardware_init(struct adapter *adapter) /* Issue a global reset */ e1000_reset_hw(&adapter->hw); + /* Get control from any management/hw control */ + if (((adapter->hw.mac.type == e1000_82573) || + (adapter->hw.mac.type == e1000_ich8lan) || + (adapter->hw.mac.type == e1000_ich9lan)) && + e1000_check_mng_mode(&adapter->hw)) + em_get_hw_control(adapter); + /* When hardware is reset, fifo_head is also reset */ adapter->tx_fifo_head = 0; -- cgit v1.1