diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-06-23 01:56:11 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-06-23 01:56:11 +0000 |
commit | a14ed84c665d191f15c65ce64c08174dff2c3ea5 (patch) | |
tree | c8502533ed5fcc16bfe1c79d3961fa18c7c380a6 /sys | |
parent | 0806416b3cfb32ec50db20cd48f6ecb9e9a6dff9 (diff) |
Disable interupts *before* establishing them to avoid a race.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pcmcia/if_wi_pcmcia.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/pcmcia/if_wi_pcmcia.c b/sys/dev/pcmcia/if_wi_pcmcia.c index 18451a14503..99447659473 100644 --- a/sys/dev/pcmcia/if_wi_pcmcia.c +++ b/sys/dev/pcmcia/if_wi_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_pcmcia.c,v 1.6 2001/06/11 00:50:38 millert Exp $ */ +/* $OpenBSD: if_wi_pcmcia.c,v 1.7 2001/06/23 01:56:10 millert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -57,6 +57,8 @@ #include <netinet/if_ether.h> #endif +#include <net/if_ieee80211.h> + #include <machine/bus.h> #include <dev/pcmcia/pcmciareg.h> @@ -273,6 +275,10 @@ wi_pcmcia_attach(parent, self, aux) sc->wi_btag = psc->sc_pcioh.iot; sc->wi_bhandle = psc->sc_pcioh.ioh; + /* Make sure interrupts are disabled. */ + CSR_WRITE_2(sc, WI_INT_EN, 0); + CSR_WRITE_2(sc, WI_EVENT_ACK, 0xffff); + /* Establish the interrupt. */ sc->sc_ih = pcmcia_intr_establish(pa->pf, IPL_NET, wi_intr, psc); if (sc->sc_ih == NULL) { @@ -281,10 +287,6 @@ wi_pcmcia_attach(parent, self, aux) goto bad; } - /* Make sure interrupts are disabled. */ - CSR_WRITE_2(sc, WI_INT_EN, 0); - CSR_WRITE_2(sc, WI_EVENT_ACK, 0xffff); - wi_attach(sc, 0); return; |