diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-04-28 08:20:24 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2018-04-28 08:20:24 +0000 |
commit | 9c6f4e8c6d9eaa7eade37c07a4d78c8e23771b4a (patch) | |
tree | cc631611a283c542008fedb279a50566c4f9afc4 /sys/dev/usb | |
parent | ac785c3feb3f9595d6f9768d5a10ed1739553d6f (diff) |
Print more debug informations in the event xfer handler.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/xhci.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 715e89a0b1d..801609df49a 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.82 2018/04/27 13:25:08 mpi Exp $ */ +/* $OpenBSD: xhci.c,v 1.83 2018/04/28 08:20:23 mpi Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -712,19 +712,21 @@ xhci_event_xfer(struct xhci_softc *sc, uint64_t paddr, uint32_t status, } xp = sc->sc_sdevs[slot].pipes[dci - 1]; - if (xp == NULL) + if (xp == NULL) { + DPRINTF(("%s: incorrect dci (%u)\n", DEVNAME(sc), dci)); return; + } code = XHCI_TRB_GET_CODE(status); remain = XHCI_TRB_REMAIN(status); switch (code) { case XHCI_CODE_RING_UNDERRUN: - DPRINTFN(4, ("%s: slot %u underrun wih %zu TRB\n", DEVNAME(sc), + DPRINTF(("%s: slot %u underrun wih %zu TRB\n", DEVNAME(sc), slot, xp->ring.ntrb - xp->free_trbs)); return; case XHCI_CODE_RING_OVERRUN: - DPRINTFN(4, ("%s: slot %u overrun wih %zu TRB\n", DEVNAME(sc), + DPRINTF(("%s: slot %u overrun wih %zu TRB\n", DEVNAME(sc), slot, xp->ring.ntrb - xp->free_trbs)); return; default: @@ -768,8 +770,11 @@ xhci_event_xfer(struct xhci_softc *sc, uint64_t paddr, uint32_t status, * had a change to schedule the softinterrupt. */ xx = (struct xhci_xfer *)xfer; - if (xx->index != trb_idx) + if (xx->index != trb_idx) { + DPRINTF(("%s: short xfer %p for %u\n", DEVNAME(sc), + xfer, xx->index)); return; + } xfer->status = USBD_NORMAL_COMPLETION; break; |