diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-08-08 14:22:46 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-08-08 14:22:46 +0000 |
commit | 990d4544fec482e6083c372b99b24d900e61a16c (patch) | |
tree | 9ce71e7a13ac7a3af549e7196b404d2157862faa /sys/dev/usb/xhci.c | |
parent | 3c6d2496b55a0ec92eb4e479e74ea9a77cd2a420 (diff) |
Implement polling.
Diffstat (limited to 'sys/dev/usb/xhci.c')
-rw-r--r-- | sys/dev/usb/xhci.c | 18 |
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 |