summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-06-23 01:54:49 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-06-23 01:54:49 +0000
commitaec3d3381d0ecae86fd45d741abfe6895beb8bb5 (patch)
treec7b22f0923b49fc0616c5ff33a23cab2600ca63c /sys
parent5953e59885320ca99cfc825ae9400c760d68295f (diff)
Disable interupts on the card before mapping and establishing the
interupt. Fixes as race as noted by mickey@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_wi_pci.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/pci/if_wi_pci.c b/sys/dev/pci/if_wi_pci.c
index 92ecbd9623e..12a9f23c260 100644
--- a/sys/dev/pci/if_wi_pci.c
+++ b/sys/dev/pci/if_wi_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_pci.c,v 1.4 2001/06/12 15:40:31 niklas Exp $ */
+/* $OpenBSD: if_wi_pci.c,v 1.5 2001/06/23 01:54:48 millert Exp $ */
/*
* Copyright (c) 2001 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -95,6 +95,8 @@
#include <netinet/if_ether.h>
#endif
+#include <net/if_ieee80211.h>
+
#include <machine/bus.h>
#include <dev/pci/pcireg.h>
@@ -182,6 +184,10 @@ wi_pci_attach(parent, self, aux)
pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
csr | PCI_COMMAND_MASTER_ENABLE);
+ /* Make sure interrupts are disabled. */
+ CSR_WRITE_2(sc, WI_INT_EN, 0);
+ CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF);
+
/* Map and establish the interrupt. */
if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,
pa->pa_intrline, &ih)) {
@@ -200,10 +206,6 @@ wi_pci_attach(parent, self, aux)
}
printf(": %s", intrstr);
- /* Make sure interrupts are disabled. */
- CSR_WRITE_2(sc, WI_INT_EN, 0);
- CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF);
-
/*
* Setup the PLX chip for level interrupts and config index 1
* XXX - should really reset the PLX chip too.