Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Use config_pending and let the kernel thread to a...
details: https://anonhg.NetBSD.org/src/rev/28ca12e721f0
branches: trunk
changeset: 481260:28ca12e721f0
user: enami <enami%NetBSD.org@localhost>
date: Tue Jan 25 09:14:27 2000 +0000
description:
Use config_pending and let the kernel thread to attach a card even on boot.
diffstat:
sys/dev/ic/i82365.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (45 lines):
diff -r 28652b32b8e3 -r 28ca12e721f0 sys/dev/ic/i82365.c
--- a/sys/dev/ic/i82365.c Tue Jan 25 09:06:50 2000 +0000
+++ b/sys/dev/ic/i82365.c Tue Jan 25 09:14:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i82365.c,v 1.28 2000/01/13 09:00:30 joda Exp $ */
+/* $NetBSD: i82365.c,v 1.29 2000/01/25 09:14:27 enami Exp $ */
#define PCICDEBUG
@@ -437,13 +437,17 @@
{
struct pcic_handle *h = arg;
struct pcic_event *pe;
- int s;
+ int s, first = 1;
struct pcic_softc *sc = (struct pcic_softc *)(h->ph_parent);
while (h->shutdown == 0) {
s = splhigh();
if ((pe = SIMPLEQ_FIRST(&h->events)) == NULL) {
splx(s);
+ if (first) {
+ first = 0;
+ config_pending_decr();
+ }
(void) tsleep(&h->events, PWAIT, "pcicev", 0);
continue;
} else {
@@ -533,6 +537,7 @@
if (h->event_thread != NULL)
panic("pcic_attach_socket: event thread");
#endif
+ config_pending_incr();
kthread_create(pcic_create_event_thread, h);
/* set up the card to interrupt on card detect */
@@ -568,7 +573,7 @@
if ((reg & PCIC_IF_STATUS_CARDDETECT_MASK) ==
PCIC_IF_STATUS_CARDDETECT_PRESENT) {
- pcic_attach_card(h);
+ pcic_queue_event(h, PCIC_EVENT_INSERTION);
h->laststate = PCIC_LASTSTATE_PRESENT;
} else {
h->laststate = PCIC_LASTSTATE_EMPTY;
Home |
Main Index |
Thread Index |
Old Index