Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Handle the use_polling flag with a lttle more ca...



details:   https://anonhg.NetBSD.org/src/rev/c765a84118fe
branches:  trunk
changeset: 476388:c765a84118fe
user:      augustss <augustss%NetBSD.org@localhost>
date:      Wed Sep 15 14:17:14 1999 +0000

description:
Handle the use_polling flag with a lttle more care and only set it if
we are cold booting.

diffstat:

 sys/dev/usb/uhci.c  |   6 +++---
 sys/dev/usb/usb.c   |  11 ++++++++---
 sys/dev/usb/usbdi.c |   7 +++++--
 3 files changed, 16 insertions(+), 8 deletions(-)

diffs (87 lines):

diff -r cd4b74578cf9 -r c765a84118fe sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Wed Sep 15 13:57:26 1999 +0000
+++ b/sys/dev/usb/uhci.c        Wed Sep 15 14:17:14 1999 +0000
@@ -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 @@
                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_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 -r cd4b74578cf9 -r c765a84118fe sys/dev/usb/usb.c
--- a/sys/dev/usb/usb.c Wed Sep 15 13:57:26 1999 +0000
+++ b/sys/dev/usb/usb.c Wed Sep 15 14:17:14 1999 +0000
@@ -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 @@
 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 @@
        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 @@
                       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 -r cd4b74578cf9 -r c765a84118fe sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Wed Sep 15 13:57:26 1999 +0000
+++ b/sys/dev/usb/usbdi.c       Wed Sep 15 14:17:14 1999 +0000
@@ -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_interface_handle iface;
        int on;
 {
-       iface->device->bus->use_polling = on;
+       if (on)
+               iface->device->bus->use_polling++;
+       else
+               iface->device->bus->use_polling--;
 }
 
 



Home | Main Index | Thread Index | Old Index