Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Simplify and fixup roothub interrupt transfers to...



details:   https://anonhg.NetBSD.org/src/rev/84c36ffe9f09
branches:  trunk
changeset: 345279:84c36ffe9f09
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon May 16 15:09:29 2016 +0000

description:
Simplify and fixup roothub interrupt transfers to work as well as before
nick-nhusb.

diffstat:

 sys/dev/ic/sl811hs.c |  47 ++++++++++++++++-------------------------------
 1 files changed, 16 insertions(+), 31 deletions(-)

diffs (82 lines):

diff -r c561e71f86f3 -r 84c36ffe9f09 sys/dev/ic/sl811hs.c
--- a/sys/dev/ic/sl811hs.c      Mon May 16 09:53:59 2016 +0000
+++ b/sys/dev/ic/sl811hs.c      Mon May 16 15:09:29 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sl811hs.c,v 1.74 2016/05/16 08:00:25 skrll Exp $       */
+/*     $NetBSD: sl811hs.c,v 1.75 2016/05/16 15:09:29 skrll Exp $       */
 
 /*
  * Not (c) 2007 Matthew Orgass
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.74 2016/05/16 08:00:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.75 2016/05/16 15:09:29 skrll Exp $");
 
 #include "opt_slhci.h"
 
@@ -524,8 +524,6 @@
 static usbd_status slhci_clear_feature(struct slhci_softc *, unsigned int);
 static usbd_status slhci_set_feature(struct slhci_softc *, unsigned int);
 static void slhci_get_status(struct slhci_softc *, usb_port_status_t *);
-static usbd_status slhci_root(struct slhci_softc *, struct slhci_pipe *,
-    struct usbd_xfer *);
 
 #define        SLHCIHIST_FUNC()        USBHIST_FUNC()
 #define        SLHCIHIST_CALLED()      USBHIST_CALLED(slhcidebug)
@@ -993,7 +991,20 @@
        spipe = SLHCI_PIPE2SPIPE(xfer->ux_pipe);
        sc = SLHCI_XFER2SC(xfer);
 
-       return slhci_lock_call(sc, &slhci_root, spipe, xfer);
+       struct slhci_transfers *t = &sc->sc_transfers;
+
+       LK_SLASSERT(spipe != NULL && xfer != NULL, sc, spipe, xfer, return
+           USBD_CANCELLED);
+
+       DLOG(D_TRACE, "%s start", pnames(SLHCI_XFER_TYPE(xfer)), 0,0,0);
+
+       KASSERT(spipe->ptype == PT_ROOT_INTR);
+
+       mutex_enter(&sc->sc_intr_lock);
+       t->rootintr = xfer;
+       mutex_exit(&sc->sc_intr_lock);
+
+       return USBD_IN_PROGRESS;
 }
 
 usbd_status
@@ -3080,32 +3091,6 @@
        DLOG(D_ROOT, "status=%#.4x, change=%#.4x", status, change, 0,0);
 }
 
-static usbd_status
-slhci_root(struct slhci_softc *sc, struct slhci_pipe *spipe,
-    struct usbd_xfer *xfer)
-{
-       SLHCIHIST_FUNC(); SLHCIHIST_CALLED();
-       struct slhci_transfers *t;
-
-       t = &sc->sc_transfers;
-
-       LK_SLASSERT(spipe != NULL && xfer != NULL, sc, spipe, xfer, return
-           USBD_CANCELLED);
-
-       DLOG(D_TRACE, "%s start", pnames(SLHCI_XFER_TYPE(xfer)), 0,0,0);
-       KASSERT(mutex_owned(&sc->sc_intr_lock));
-
-       KASSERT(spipe->ptype == PT_ROOT_INTR);
-#if 0
-       LK_SLASSERT(t->rootintr == NULL, sc, spipe, xfer, return
-           USBD_CANCELLED);
-#endif
-       t->rootintr = xfer;
-       if (t->flags & F_CHANGE)
-               t->flags |= F_ROOTINTR;
-       return USBD_IN_PROGRESS;
-}
-
 static int
 slhci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req,
     void *buf, int buflen)



Home | Main Index | Thread Index | Old Index