summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2014-08-08 14:22:45 +0000
committermpi <mpi@openbsd.org>2014-08-08 14:22:45 +0000
commiteac70f6dca7daa15647a51e1920abfbc789578a0 (patch)
treeb5f1a737868259c9152cf411c08cd5db631c3c73
parentSuper Speed hub descriptor definition and routine, required for upcoming (diff)
downloadwireguard-openbsd-eac70f6dca7daa15647a51e1920abfbc789578a0.tar.xz
wireguard-openbsd-eac70f6dca7daa15647a51e1920abfbc789578a0.zip
Implement polling.
-rw-r--r--sys/dev/usb/xhci.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c
index 38e34b0f03f..7a3afac5f6f 100644
--- a/sys/dev/usb/xhci.c
+++ b/sys/dev/usb/xhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xhci.c,v 1.17 2014/08/08 14:17:52 mpi Exp $ */
+/* $OpenBSD: xhci.c,v 1.18 2014/08/08 14:22:45 mpi Exp $ */
/*
* Copyright (c) 2014 Martin Pieuchot
@@ -575,7 +575,21 @@ xhci_poll(struct usbd_bus *bus)
void
xhci_waitintr(struct xhci_softc *sc, struct usbd_xfer *xfer)
{
- DPRINTF(("%s: stub\n", __func__));
+ int timo;
+
+ for (timo = xfer->timeout; timo >= 0; timo--) {
+ usb_delay_ms(&sc->sc_bus, 1);
+ if (sc->sc_bus.dying)
+ break;
+
+ if (xfer->status != USBD_IN_PROGRESS)
+ return;
+
+ xhci_intr1(sc);
+ }
+
+ xfer->status = USBD_TIMEOUT;
+ usb_transfer_complete(xfer);
}
void