diff options
author | 2001-08-15 16:50:26 +0000 | |
---|---|---|
committer | 2001-08-15 16:50:26 +0000 | |
commit | fcd3f758b71264b3e8b1ea230d22d5bff93be2f0 (patch) | |
tree | 53c3c1c4cb7ebb2e49b36a961eb36d3b3d5a2542 | |
parent | Use INFTIM. (diff) | |
download | wireguard-openbsd-fcd3f758b71264b3e8b1ea230d22d5bff93be2f0.tar.xz wireguard-openbsd-fcd3f758b71264b3e8b1ea230d22d5bff93be2f0.zip |
Add some stuff missed in a previous FreeBSD merge... Fixes the problem where
sk busy loops when carrier is lost until it returns; based on patch from
david langhorst <dirt@monkey.org> and tested by John Ladwig <jladwig@mango.lioness.net>
-rw-r--r-- | sys/dev/pci/if_sk.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 5db1428ba32..7a5a437eec4 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.14 2001/08/12 20:03:49 mickey Exp $ */ +/* $OpenBSD: if_sk.c,v 1.15 2001/08/15 16:50:26 jason Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1543,14 +1543,16 @@ void sk_intr_xmac(sc_if) sc = sc_if->sk_softc; status = SK_XM_READ_2(sc_if, XM_ISR); - if (status & XM_ISR_LINKEVENT) { - SK_XM_SETBIT_2(sc_if, XM_IMR, XM_IMR_LINKEVENT); - if (sc_if->sk_link == 1) - sc_if->sk_link = 0; - } + if (sc_if->sk_phytype == SK_PHYTYPE_XMAC) { + if (status & XM_ISR_GP0_SET) { + SK_XM_SETBIT_2(sc_if, XM_IMR, XM_IMR_GP0_SET); + timeout_add(&sc_if->sk_tick_ch, hz); + } - if (status & XM_ISR_AUTONEG_DONE) - timeout_add(&sc_if->sk_tick_ch, hz); + if (status & XM_ISR_AUTONEG_DONE) { + timeout_add(&sc_if->sk_tick_ch, hz); + } + } if (status & XM_IMR_TX_UNDERRUN) SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_FLUSH_TXFIFO); |