summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormglocker <mglocker@openbsd.org>2007-09-17 20:43:18 +0000
committermglocker <mglocker@openbsd.org>2007-09-17 20:43:18 +0000
commitf29eb7fc37e06fa0509dd6b043591cf4085dcdc0 (patch)
tree6be9cb80331d77aa03fa375fac7237c78a219586
parentinstead of inspecting the vnode op's to figure out if (diff)
downloadwireguard-openbsd-f29eb7fc37e06fa0509dd6b043591cf4085dcdc0.tar.xz
wireguard-openbsd-f29eb7fc37e06fa0509dd6b043591cf4085dcdc0.zip
If device is down, don't handle any interrupts. Even don't read the
interrupt status register instead return directly. This fixes the machine freeze on amd64 and let me receive proper interrupts if device is up. This bit was originaly in the DragonFly code, and must have sneaked out while porting ...
-rw-r--r--sys/dev/ic/bwi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/ic/bwi.c b/sys/dev/ic/bwi.c
index be2bfa14e9f..ac95dea2feb 100644
--- a/sys/dev/ic/bwi.c
+++ b/sys/dev/ic/bwi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwi.c,v 1.37 2007/09/17 14:26:51 mglocker Exp $ */
+/* $OpenBSD: bwi.c,v 1.38 2007/09/17 20:43:18 mglocker Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
@@ -506,12 +506,16 @@ int
bwi_intr(void *xsc)
{
struct bwi_softc *sc = xsc;
+ struct ifnet *ifp = &sc->sc_ic.ic_if;
uint32_t intr_status;
uint32_t txrx_intr_status[BWI_TXRX_NRING];
int i, txrx_error;
DPRINTF(2, "%s\n", __func__);
+ if ((ifp->if_flags & IFF_RUNNING) == 0)
+ return (0);
+
/*
* Get interrupt status
*/