summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-27 04:44:21 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-27 04:44:21 +0000
commit3c7b4c90f16918cee171cdce87a4fd2caba5078b (patch)
treeaee48b36ad2d39e890057f7aace6d026a182bff4
parent2793071e8cf9cfd86f01f167108102d1a4e50825 (diff)
introduce and use a flag indicating that interrupts are
enabled for this cbb. essentially this means that cbb driver has completed it's initialization and is ready to treat interrupts. this was exposed by ccb's sharing their interrupt and pccbbintr() being called for cbb which has not completed attachment due to interrupt sharing.
-rw-r--r--sys/dev/pci/pccbb.c7
-rw-r--r--sys/dev/pci/pccbbvar.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index c1ab80640d0..de05bbe2de4 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.15 2001/01/22 18:53:57 deraadt Exp $ */
+/* $OpenBSD: pccbb.c,v 1.16 2001/01/27 04:44:20 mickey Exp $ */
/* $NetBSD: pccbb.c,v 1.42 2000/06/16 23:41:35 cgd Exp $ */
/*
@@ -665,6 +665,8 @@ pccbb_pci_callback(self)
sc->sc_csc = csc;
}
+ sc->sc_ints_on = 1;
+
/* CSC Interrupt: Card detect interrupt on */
maskreg = bus_space_read_4(base_memt, base_memh, CB_SOCKET_MASK);
maskreg |= CB_SOCKET_MASK_CD; /* Card detect intr is turned on. */
@@ -899,6 +901,9 @@ pccbbintr(arg)
bus_space_handle_t memh = sc->sc_base_memh;
struct pcic_handle *ph = &sc->sc_pcmcia_h;
+ if (!sc->sc_ints_on)
+ return 0;
+
sockevent = bus_space_read_4(memt, memh, CB_SOCKET_EVENT);
bus_space_write_4(memt, memh, CB_SOCKET_EVENT, sockevent);
Pcic_read(ph, PCIC_CSC);
diff --git a/sys/dev/pci/pccbbvar.h b/sys/dev/pci/pccbbvar.h
index f3d1f72e68d..243be204c27 100644
--- a/sys/dev/pci/pccbbvar.h
+++ b/sys/dev/pci/pccbbvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbbvar.h,v 1.3 2000/07/25 00:04:59 mickey Exp $ */
+/* $OpenBSD: pccbbvar.h,v 1.4 2001/01/27 04:44:20 mickey Exp $ */
/* $NetBSD: pccbbvar.h,v 1.13 2000/06/08 10:28:29 haya Exp $ */
/*
* Copyright (c) 1999 HAYAKAWA Koichi. All rights reserved.
@@ -135,6 +135,7 @@ struct pccbb_softc {
pci_chipset_tag_t sc_pc;
pcitag_t sc_tag;
int sc_chipset; /* chipset id */
+ int sc_ints_on;
bus_addr_t sc_mem_start; /* CardBus/PCMCIA memory start */
bus_addr_t sc_mem_end; /* CardBus/PCMCIA memory end */