From 6469c75e8f2f91844513967c8c371820829c241a Mon Sep 17 00:00:00 2001 From: mpi Date: Sun, 21 Dec 2014 11:20:24 +0000 Subject: [PATCH] Use a bitmask when dumping TRB flags. No change in !XHCI_DEBUG. --- sys/dev/usb/xhci.c | 7 ++++--- sys/dev/usb/xhcireg.h | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index f247fdc49b6..25bb6f191ae 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.47 2014/12/19 22:44:59 guenther Exp $ */ +/* $OpenBSD: xhci.c,v 1.48 2014/12/21 11:20:24 mpi Exp $ */ /* * Copyright (c) 2014 Martin Pieuchot @@ -202,8 +202,9 @@ struct usbd_pipe_methods xhci_device_generic_methods = { static void xhci_dump_trb(struct xhci_trb *trb) { - printf("trb=%p (0x%016llx 0x%08x 0x%08x)\n", trb, - (long long)trb->trb_paddr, trb->trb_status, trb->trb_flags); + printf("trb=%p (0x%016llx 0x%08x 0x%b)\n", trb, + (long long)letoh64(trb->trb_paddr), letoh32(trb->trb_status), + (int)letoh32(trb->trb_flags), XHCI_TRB_FLAGS_BITMASK); } #endif diff --git a/sys/dev/usb/xhcireg.h b/sys/dev/usb/xhcireg.h index a4db01c2043..30233f56730 100644 --- a/sys/dev/usb/xhcireg.h +++ b/sys/dev/usb/xhcireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xhcireg.h,v 1.7 2014/12/15 17:10:44 mpi Exp $ */ +/* $OpenBSD: xhcireg.h,v 1.8 2014/12/21 11:20:24 mpi Exp $ */ /*- * Copyright (c) 2014 Martin Pieuchot. All rights reserved. @@ -363,6 +363,9 @@ struct xhci_trb { #define XHCI_TRB_SET_SLOT(x) (((x) & 0xff) << 24) } __packed; +#define XHCI_TRB_FLAGS_BITMASK \ + "\20\007IDT\006IOC\005CHAIN\004NOSNOOP\003ISP\002LINKSEG\001CYCLE" + #define XHCI_TRB_TYPE_MASK 0xfc00 #define XHCI_TRB_TYPE(x) (((x) & XHCI_TRB_TYPE_MASK) >> 10) -- 2.20.1