summaryrefslogtreecommitdiffstats
path: root/sys/dev/pcic
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-12-20 06:47:38 +0000
committerimp <imp@FreeBSD.org>1999-12-20 06:47:38 +0000
commita4f9c84aaa8a78673b58b3d6dce217ff6ecb9656 (patch)
treeb4dde308b74805e12c7e4452e4ec211434b1af57 /sys/dev/pcic
parent2778635d506c02b20db03b9f113d52ea2c30c651 (diff)
downloadFreeBSD-src-a4f9c84aaa8a78673b58b3d6dce217ff6ecb9656.zip
FreeBSD-src-a4f9c84aaa8a78673b58b3d6dce217ff6ecb9656.tar.gz
Make attach work, almost. Calling kthread_create from a
config_intrhook_establish doesn't work. Children aren't yet attached properly, but that's ok because pccard would likely panic in its current shape. o Save dev of pcic early in attach process o save dev in pcic_handle for use in pcic_create_event_thread. o Remove direct attachments of pccard children for now o move establishment of pcic kthread to config_intrhook.
Diffstat (limited to 'sys/dev/pcic')
-rw-r--r--sys/dev/pcic/i82365.c23
-rw-r--r--sys/dev/pcic/i82365var.h1
2 files changed, 21 insertions, 3 deletions
diff --git a/sys/dev/pcic/i82365.c b/sys/dev/pcic/i82365.c
index dc99466..8c0ed3a 100644
--- a/sys/dev/pcic/i82365.c
+++ b/sys/dev/pcic/i82365.c
@@ -177,6 +177,8 @@ pcic_attach(device_t dev)
struct pcic_handle *h;
int vendor, count, i, reg;
+ sc->dev = dev;
+
/* now check for each controller/socket */
/*
@@ -339,6 +341,7 @@ pcic_attach(device_t dev)
h->memalloc = 0;
h->ioalloc = 0;
h->ih_irq = 0;
+ h->sc = sc;
h->dev = device_add_child(dev, "pccard", -1);
device_set_ivars(h->dev, h);
pcic_init_socket(h);
@@ -374,6 +377,9 @@ pcic_create_event_thread(void *arg)
"cannot create event thread for sock 0x%02x\n", h->sock);
panic("pcic_create_event_thread");
}
+ config_intrhook_disestablish(h->hook);
+ free(h->hook, M_TEMP);
+ h->hook = 0;
}
void
@@ -468,6 +474,7 @@ pcic_init_socket(struct pcic_handle *h)
{
int reg;
struct pcic_softc *sc = (struct pcic_softc *)(h->ph_parent);
+ struct intr_config_hook *hook;
/*
* queue creation of a kernel thread to handle insert/removal events.
@@ -476,7 +483,17 @@ pcic_init_socket(struct pcic_handle *h)
if (h->event_thread != NULL)
panic("pcic_init_socket: event thread");
#endif
- pcic_create_event_thread(h);
+ hook =
+ (struct intr_config_hook *)malloc(sizeof(struct intr_config_hook),
+ M_TEMP, M_NOWAIT);
+ if (!hook) {
+ printf("ini socket failed\n");
+ return;
+ }
+ hook->ich_func = pcic_create_event_thread;
+ hook->ich_arg = h;
+ h->hook = hook;
+ config_intrhook_establish(hook);
/* set up the card to interrupt on card detect */
@@ -605,7 +622,7 @@ pcic_attach_card(struct pcic_handle *h)
if (!(h->flags & PCIC_FLAG_CARDP)) {
/* call the MI attach function */
- pccard_card_attach(h->pccard);
+ /* XXX pccard_card_attach(h->pccard); */
h->flags |= PCIC_FLAG_CARDP;
} else {
@@ -621,7 +638,7 @@ pcic_detach_card(struct pcic_handle *h, int flags)
h->flags &= ~PCIC_FLAG_CARDP;
/* call the MI detach function */
- pccard_card_detach(h->pccard, flags);
+ /* XXX pccard_card_detach(h->pccard, flags); */
} else {
DPRINTF(("pcic_detach_card: already detached"));
}
diff --git a/sys/dev/pcic/i82365var.h b/sys/dev/pcic/i82365var.h
index 7c769f3..ed01494 100644
--- a/sys/dev/pcic/i82365var.h
+++ b/sys/dev/pcic/i82365var.h
@@ -50,6 +50,7 @@ struct pcic_handle {
struct pcic_softc *sc;
struct device *ph_parent;
device_t *dev;
+ struct intr_config_hook *hook;
bus_space_tag_t ph_bus_t; /* I/O or MEM? I don't mind */
bus_space_handle_t ph_bus_h;
u_int8_t (* ph_read)(struct pcic_handle*, int);
OpenPOWER on IntegriCloud