diff options
author | joe <joe@FreeBSD.org> | 2002-01-24 20:21:17 +0000 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2002-01-24 20:21:17 +0000 |
commit | 7b05c48325a61a7e2cb2ef23502790d6e6ea0947 (patch) | |
tree | 0b077d02ee9aeeb719297d2ce3249afe629deee6 /sys/dev | |
parent | 8ef3bbdbabd08a64d4c7e57101df476a06b87fce (diff) | |
download | FreeBSD-src-7b05c48325a61a7e2cb2ef23502790d6e6ea0947.zip FreeBSD-src-7b05c48325a61a7e2cb2ef23502790d6e6ea0947.tar.gz |
Merge from NetBSD:
usb.c: -r1.35 - 1.37
usb_port.h: tiny bit of -r1.26 + an extra bit in the FreeBSD config section.
revision 1.37
date: 2000/01/24 18:35:51; author: thorpej; state: Exp; lines: +7 -1
Use config_pending.
----------------------------
revision 1.36
date: 1999/12/22 23:54:09; author: augustss; state: Exp; lines: +2 -2
Use the flags `locator' to govern if devices are detected early or
late during cold boot.
----------------------------
revision 1.35
date: 1999/12/20 02:12:23; author: augustss; state: Exp; lines: +8 -5
Make sure tsleep() is not called during cold boot.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/usb.c | 23 | ||||
-rw-r--r-- | sys/dev/usb/usb_port.h | 6 |
2 files changed, 24 insertions, 5 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index c35d679..6c915e7 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: usb.c,v 1.33 1999/11/22 21:57:09 augustss Exp $ */ +/* $NetBSD: usb.c,v 1.37 2000/01/24 18:35:51 thorpej Exp $ */ /* $FreeBSD$ */ /* @@ -222,6 +222,10 @@ USB_ATTACH(usb) } printf("\n"); + /* Make sure not to use tsleep() if we are cold booting. */ + if (cold) + sc->sc_bus->use_polling++; + err = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, 0, 0, &sc->sc_port); if (!err) { @@ -239,18 +243,22 @@ USB_ATTACH(usb) * until the USB event thread is running, which means that * the keyboard will not work until after cold boot. */ - if (cold) { - sc->sc_bus->use_polling++; +#if defined(__FreeBSD__) + if (cold) +#else + if (cold && (sc->sc_dev.dv_cfdata->cf_flags & 1)) +#endif dev->hub->explore(sc->sc_bus->root_hub); - sc->sc_bus->use_polling--; - } #endif } else { printf("%s: root hub problem, error=%d\n", USBDEVNAME(sc->sc_dev), err); sc->sc_dying = 1; } + if (cold) + sc->sc_bus->use_polling--; + config_pending_incr(); #if defined(__NetBSD__) || defined(__OpenBSD__) kthread_create(usb_create_event_thread, sc); #endif @@ -290,6 +298,7 @@ usb_event_thread(void *arg) { struct usb_softc *sc = arg; int to; + int first = 1; #ifdef __FreeBSD__ mtx_lock(&Giant); @@ -302,6 +311,10 @@ usb_event_thread(void *arg) if (usb_noexplore < 2) #endif usb_discover(sc); + if (first) { + config_pending_decr(); + first = 0; + } to = hz * 60; #ifdef USB_DEBUG if (usb_noexplore) diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 21cb986..3f78422 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -177,6 +177,9 @@ typedef struct proc *usb_proc_ptr; #define kthread_create1 kthread_create #define kthread_create kthread_create_deferred +#define config_pending_incr() +#define config_pending_decr() + #define usbpoll usbselect #define uhidpoll uhidselect #define ugenpoll ugenselect @@ -303,6 +306,9 @@ typedef struct thread *usb_proc_ptr; #define kthread_create1(f, s, p, a0, a1) \ kthread_create((f), (s), (p), RFHIGHPID, (a0), (a1)) +#define config_pending_incr() +#define config_pending_decr() + #define usb_timeout(f, d, t, h) ((h) = timeout((f), (d), (t))) #define usb_untimeout(f, d, h) untimeout((f), (d), (h)) |