Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Put some #ifdefs around power and shutdown hooks.



details:   https://anonhg.NetBSD.org/src/rev/5839a7d8152e
branches:  trunk
changeset: 481517:5839a7d8152e
user:      augustss <augustss%NetBSD.org@localhost>
date:      Tue Feb 01 05:42:52 2000 +0000

description:
Put some #ifdefs around power and shutdown hooks.

diffstat:

 sys/dev/usb/ohci.c    |  15 +++++++++++++--
 sys/dev/usb/ohcivar.h |   6 ++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diffs (75 lines):

diff -r 81a9f6e9880b -r 5839a7d8152e sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Tue Feb 01 05:28:01 2000 +0000
+++ b/sys/dev/usb/ohci.c        Tue Feb 01 05:42:52 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.70 2000/01/31 22:35:13 augustss Exp $       */
+/*     $NetBSD: ohci.c,v 1.71 2000/02/01 05:42:52 augustss Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
 /*
@@ -359,8 +359,10 @@
        if (rv != 0)
                return (rv);
 
+#if defined(__NetBSD__) || defined(__OpenBSD__)
        powerhook_disestablish(sc->sc_powerhook);
        shutdownhook_disestablish(sc->sc_shutdownhook);
+#endif
 
        /* free data structures XXX */
 
@@ -802,8 +804,10 @@
        sc->sc_bus.methods = &ohci_bus_methods;
        sc->sc_bus.pipe_size = sizeof(struct ohci_pipe);
 
+#if defined(__NetBSD__) || defined(__OpenBSD__)
        sc->sc_powerhook = powerhook_establish(ohci_power, sc);
        sc->sc_shutdownhook = shutdownhook_establish(ohci_shutdown, sc);
+#endif
 
        return (USBD_NORMAL_COMPLETION);
 
@@ -1114,6 +1118,13 @@
                stdnext = std->dnext;
                DPRINTFN(10, ("ohci_process_done: std=%p xfer=%p hcpriv=%p\n",
                                std, xfer, xfer ? xfer->hcpriv : 0));
+               if (xfer == NULL) {
+                       /* xfer == NULL: There seems to be no xfer associated
+                        * with this TD. It is tailp that happened to end up on
+                        * the done queue.
+                        */
+                       continue;
+               }
                cc = OHCI_TD_GET_CC(LE(std->td.td_flags));
                usb_untimeout(ohci_timeout, xfer, xfer->timo_handle);
                if (xfer->status == USBD_CANCELLED ||
@@ -1143,7 +1154,7 @@
                        struct ohci_pipe *opipe = 
                                (struct ohci_pipe *)xfer->pipe;
 
-                       DPRINTF(("ohci_process_done: error cc=%d (%s)\n",
+                       DPRINTFN(15,("ohci_process_done: error cc=%d (%s)\n",
                          OHCI_TD_GET_CC(LE(std->td.td_flags)),
                          ohci_cc_strs[OHCI_TD_GET_CC(LE(std->td.td_flags))]));
 
diff -r 81a9f6e9880b -r 5839a7d8152e sys/dev/usb/ohcivar.h
--- a/sys/dev/usb/ohcivar.h     Tue Feb 01 05:28:01 2000 +0000
+++ b/sys/dev/usb/ohcivar.h     Tue Feb 01 05:42:52 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohcivar.h,v 1.18 2000/01/18 20:11:00 augustss Exp $    */
+/*     $NetBSD: ohcivar.h,v 1.19 2000/02/01 05:42:53 augustss Exp $    */
 /*     $FreeBSD: src/sys/dev/usb/ohcivar.h,v 1.13 1999/11/17 22:33:41 n_hibma Exp $    */
 
 /*
@@ -105,8 +105,10 @@
        char sc_vendor[16];
        int sc_id_vendor;
 
-       void *sc_powerhook;
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+       void *sc_powerhook;             /* cookie from power hook */
        void *sc_shutdownhook;          /* cookie from shutdown hook */
+#endif
 
        device_ptr_t sc_child;
 } ohci_softc_t;



Home | Main Index | Thread Index | Old Index