diff options
| author | augustss <augustss@NetBSD.org> | 1999-09-15 14:17:14 +0000 |
|---|---|---|
| committer | augustss <augustss@NetBSD.org> | 1999-09-15 14:17:14 +0000 |
| commit | e54df1b10c4e9beac1d6467c5b0e4ea552ab665e (patch) | |
| tree | e8f8d5955fcab80a75ebf98519e608ece858d583 | |
| parent | 60199e09b69107e945adb4acc4792ce79ae604bb (diff) | |
Handle the use_polling flag with a lttle more care and only set it if
we are cold booting.
| -rw-r--r-- | sys/dev/usb/uhci.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/usb.c | 11 | ||||
| -rw-r--r-- | sys/dev/usb/usbdi.c | 7 |
3 files changed, 16 insertions, 8 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 44bf6d8ab94..8b453e71cea 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.53 1999/09/15 10:25:31 augustss Exp $ */ +/* $NetBSD: uhci.c,v 1.54 1999/09/15 14:17:14 augustss Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -507,7 +507,7 @@ uhci_power(why, v) if (sc->sc_has_timo) usb_untimeout(uhci_timo, sc->sc_has_timo, sc->sc_has_timo->timo_handle); - sc->sc_bus.use_polling = 1; + sc->sc_bus.use_polling++; uhci_run(sc, 0); /* stop the controller */ UHCICMD(sc, cmd | UHCI_CMD_EGSM); /* enter global suspend */ usb_delay_ms(&sc->sc_bus, USB_RESUME_WAIT); @@ -529,7 +529,7 @@ uhci_power(why, v) UHCI_INTR_IOCE | UHCI_INTR_SPIE); /* re-enable intrs */ uhci_run(sc, 1); /* and start traffic again */ usb_delay_ms(&sc->sc_bus, USB_RESUME_RECOVERY); - sc->sc_bus.use_polling = 0; + sc->sc_bus.use_polling--; if (sc->sc_has_timo) usb_timeout(uhci_timo, sc->sc_has_timo, sc->sc_ival, sc->sc_has_timo->timo_handle); diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index f3312048a10..0fdb3b75cf6 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: usb.c,v 1.22 1999/09/15 10:25:31 augustss Exp $ */ +/* $NetBSD: usb.c,v 1.23 1999/09/15 14:17:15 augustss Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -125,6 +125,9 @@ usbd_status usb_discover __P((struct usb_softc *)); void usb_create_event_thread __P((void *)); void usb_event_thread __P((void *)); +/* Flag to see if we are in the cold boot process. */ +extern int cold; + USB_DECLARE_DRIVER_INIT(usb, DEVMETHOD(bus_print_child, usbd_print_child)); USB_MATCH(usb) @@ -154,7 +157,8 @@ USB_ATTACH(usb) usbd_init(); sc->sc_bus = aux; sc->sc_bus->usbctl = sc; - sc->sc_bus->use_polling = 1; + if (cold) + sc->sc_bus->use_polling++; sc->sc_port.power = USB_MAX_POWER; r = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0,0,0, &sc->sc_port); @@ -174,7 +178,8 @@ USB_ATTACH(usb) USBDEVNAME(sc->sc_dev), r); sc->sc_dying = 1; } - sc->sc_bus->use_polling = 0; + if (cold) + sc->sc_bus->use_polling--; kthread_create(usb_create_event_thread, sc); diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index a6e32ee1672..7a16652e524 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.41 1999/09/15 10:25:32 augustss Exp $ */ +/* $NetBSD: usbdi.c,v 1.42 1999/09/15 14:17:15 augustss Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -1009,7 +1009,10 @@ usbd_set_polling(iface, on) usbd_interface_handle iface; int on; { - iface->device->bus->use_polling = on; + if (on) + iface->device->bus->use_polling++; + else + iface->device->bus->use_polling--; } |
