summaryrefslogtreecommitdiff
path: root/sys/dev/ic/rt2560.c
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2006-07-18 16:40:31 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2006-07-18 16:40:31 +0000
commitee89b6dd44105f4b5edefd527dde2e41ddd84f95 (patch)
tree2a2b747037aa7e5cfafec53d8aa4e8e63c1f5908 /sys/dev/ic/rt2560.c
parentf9014f87878027e3d21e68f677fe9112a1966f50 (diff)
modify interrupt handlers to exit early and return 0 on shared interrupts.
pointed out by deraadt@
Diffstat (limited to 'sys/dev/ic/rt2560.c')
-rw-r--r--sys/dev/ic/rt2560.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index 50ea6735500..c66475263dc 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.21 2006/06/18 18:44:04 damien Exp $ */
+/* $OpenBSD: rt2560.c,v 1.22 2006/07/18 16:40:30 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -1377,16 +1377,19 @@ rt2560_intr(void *arg)
struct ifnet *ifp = &sc->sc_ic.ic_if;
uint32_t r;
+ if ((r = RAL_READ(sc, RT2560_CSR7)) == 0)
+ return 0; /* not for us */
+
/* disable interrupts */
RAL_WRITE(sc, RT2560_CSR8, 0xffffffff);
+ /* acknowledge interrupts */
+ RAL_WRITE(sc, RT2560_CSR7, r);
+
/* don't re-enable interrupts if we're shutting down */
if (!(ifp->if_flags & IFF_RUNNING))
return 0;
- r = RAL_READ(sc, RT2560_CSR7);
- RAL_WRITE(sc, RT2560_CSR7, r);
-
if (r & RT2560_BEACON_EXPIRE)
rt2560_beacon_expire(sc);