summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorskrll <skrll@NetBSD.org>2016-05-16 15:09:29 +0000
committerskrll <skrll@NetBSD.org>2016-05-16 15:09:29 +0000
commit01f12d754f38bd3432cced772af82d2facf4dec5 (patch)
tree2bbf12a54e61a392cd23124b5559ae190a4f2c2a /sys/dev
parent2b842ed0d2d397fcfea8b108a15717457b568a4d (diff)
Simplify and fixup roothub interrupt transfers to work as well as before
nick-nhusb.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/sl811hs.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/sys/dev/ic/sl811hs.c b/sys/dev/ic/sl811hs.c
index f24c0610ec4..18e6bf8329b 100644
--- a/sys/dev/ic/sl811hs.c
+++ b/sys/dev/ic/sl811hs.c
@@ -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 void slhci_insert(struct slhci_softc *);
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 @@ slhci_root_start(struct usbd_xfer *xfer)
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 @@ slhci_get_status(struct slhci_softc *sc, usb_port_status_t *ps)
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)