summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-09-13 08:26:55 +0000
committerimp <imp@FreeBSD.org>2001-09-13 08:26:55 +0000
commitcd3f175e88a8787dc72b6a169a8cd1a9bc7546c9 (patch)
treefe41baa0bce9c3a433c31fdec1b8afe45e41efa9 /sys/pccard/pccard.c
parent214349ee3a8fd079e8ada36c86698d61a7706aa5 (diff)
downloadFreeBSD-src-cd3f175e88a8787dc72b6a169a8cd1a9bc7546c9.zip
FreeBSD-src-cd3f175e88a8787dc72b6a169a8cd1a9bc7546c9.tar.gz
<jkh> "Hey Rocky, watch me eject this pccard outta my laptop!" "What,
again? That NEVER works!" "This time for sure!" Minor overhaul of how we do interrupts for the pci interrupt routing case to cope with card ejection better (read: make it not hand on so many cards): o Reintroduce func_intr and func_arg and use the to store the interrupt handler to call. o Create a pcic_pci_func_intr to call the real interrupt handler iff the card hasn't been ejected. o Remove some checks in pcic_setup_intr now that it is used exclusively for isa routed interrupts. o Defer the eject event until later too, but make sure we can't do any client driver ISR calling in the interrum. o Add some simple code to make sure that we don't attach more than one child. This should fix pccardd starting twice problem (ala single user -> multi-user when you started pccardd by hand in SU). MFC: after jkh thinks I've put the crack pipe away.
Diffstat (limited to 'sys/pccard/pccard.c')
-rw-r--r--sys/pccard/pccard.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index a7650de..dfd12fe 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -44,6 +44,7 @@
#include <sys/uio.h>
#include <sys/poll.h>
#include <sys/bus.h>
+#include <sys/proc.h>
#include <machine/bus.h>
#include <pccard/cardinfo.h>
@@ -216,8 +217,19 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
device_t pccarddev;
int err, irq = 0;
device_t child;
+ device_t *devs;
+ int count;
pccarddev = slt->dev;
+ err = device_get_children(pccarddev, &devs, &count);
+ if (err != 0)
+ return (err);
+ free(devs, M_TEMP);
+ if (count) {
+ device_printf(pccarddev,
+ "Can not attach more than one child.\n");
+ return (EIO);
+ }
irq = ffs(desc->irqmask) - 1;
MALLOC(devi, struct pccard_devinfo *, sizeof(*devi), M_DEVBUF,
M_WAITOK | M_ZERO);
OpenPOWER on IntegriCloud