From e6938cd35d0f3206663c11e02de0c50acddbe157 Mon Sep 17 00:00:00 2001 From: tackerman Date: Sat, 1 Jan 2005 19:57:23 +0000 Subject: Corrected a workaround that should only be applied to one adapter. Workaround was causing device hangs when incorrectly applied to other adapters. PR: kern/66634 --- sys/dev/em/if_em.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 6cf1a7f..2b233bb 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -3005,8 +3005,20 @@ em_enable_intr(struct adapter * adapter) static void em_disable_intr(struct adapter *adapter) { - E1000_WRITE_REG(&adapter->hw, IMC, - (0xffffffff & ~E1000_IMC_RXSEQ)); + /* + * The first version of 82542 had an errata where when link was forced it + * would stay up even up even if the cable was disconnected. Sequence errors + * were used to detect the disconnect and then the driver would unforce the link. + * This code in the in the ISR. For this to work correctly the Sequence error + * interrupt had to be enabled all the time. + */ + + if (adapter->hw.mac_type == em_82542_rev2_0) + E1000_WRITE_REG(&adapter->hw, IMC, + (0xffffffff & ~E1000_IMC_RXSEQ)); + else + E1000_WRITE_REG(&adapter->hw, IMC, + 0xffffffff); return; } -- cgit v1.1