[haiku-commits] haiku: hrev51050 - src/add-ons/kernel/busses/usb

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 28 Mar 2017 22:48:13 +0200 (CEST)

hrev51050 adds 1 changeset to branch 'master'
old head: e5c95a01ff5b11a5e7d44ff34cad5c6c480318ee
new head: deb50a898c23bb62d65aee31d5ae90d5443dbc12
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=deb50a898c23+%5Ee5c95a01ff5b

----------------------------------------------------------------------------

deb50a898c23: xhci: Cleanup tracing, add trb ring dump
  
  * Cleanup trace output. Don't print hex without 0x prefix.

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev51050
Commit:      deb50a898c23bb62d65aee31d5ae90d5443dbc12
URL:         http://cgit.haiku-os.org/haiku/commit/?id=deb50a898c23
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Tue Mar 28 20:44:43 2017 UTC

----------------------------------------------------------------------------

2 files changed, 27 insertions(+), 3 deletions(-)
src/add-ons/kernel/busses/usb/xhci.cpp | 29 ++++++++++++++++++++++++++---
src/add-ons/kernel/busses/usb/xhci.h   |  1 +

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp 
b/src/add-ons/kernel/busses/usb/xhci.cpp
index dab2e22..0945907 100644
--- a/src/add-ons/kernel/busses/usb/xhci.cpp
+++ b/src/add-ons/kernel/busses/usb/xhci.cpp
@@ -165,7 +165,7 @@ XHCI::XHCI(pci_info *info, Stack *stack)
                + offset + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1);
 
        TRACE("map physical memory 0x%08" B_PRIx32 " : 0x%08" B_PRIx32 " "
-               "(base: 0x%08" B_PRIxPHYSADDR "; offset: %" B_PRIx32 ");"
+               "(base: 0x%08" B_PRIxPHYSADDR "; offset: 0x%" B_PRIx32 ");"
                "size: %" B_PRId32 "\n", fPCIInfo->u.h0.base_registers[0],
                fPCIInfo->u.h0.base_registers[1], physicalAddress, offset,
                fPCIInfo->u.h0.base_register_sizes[0]);
@@ -572,6 +572,9 @@ XHCI::Start()
        status_t noopResult = Noop();
        TRACE("No-Op %ssuccessful\n", noopResult < B_OK ? "un" : "");
 #endif
+
+       //DumpRing(fCmdRing, (XHCI_MAX_COMMANDS - 1));
+
        return BusManager::Start();
 }
 
@@ -1910,7 +1913,8 @@ XHCI::Interrupt()
        }
 
        if ((status & STS_EINT) == 0) {
-               TRACE("STS: %" B_PRIx32 " IRQ_PENDING: %" B_PRIx32 "\n", 
status, temp);
+               TRACE("STS: 0x%" B_PRIx32 " IRQ_PENDING: 0x%" B_PRIx32 "\n",
+                       status, temp);
                return B_UNHANDLED_INTERRUPT;
        }
 
@@ -1944,7 +1948,7 @@ XHCI::QueueCommand(xhci_trb* trb)
        i = fCmdIdx;
        j = fCmdCcs;
 
-       TRACE("command[%u] = %" B_PRIx32 " (0x%016" B_PRIx64 ", 0x%08" B_PRIx32
+       TRACE("command[%u] = %" B_PRId32 " (0x%016" B_PRIx64 ", 0x%08" B_PRIx32
                ", 0x%08" B_PRIx32 ")\n", i, TRB_3_TYPE_GET(trb->dwtrb3), 
trb->qwtrb0,
                trb->dwtrb2, trb->dwtrb3);
 
@@ -2041,6 +2045,25 @@ XHCI::HandleTransferComplete(xhci_trb* trb)
 }
 
 
+void
+XHCI::DumpRing(xhci_trb *trbs, uint32 size)
+{
+       if (!Lock()) {
+               TRACE("Unable to get lock!\n");
+               return;
+       }
+
+       for (uint32 i = 0; i < size; i++) {
+               TRACE("command[%" B_PRId32 "] = %" B_PRId32 " (0x%016" B_PRIx64 
","
+                       " 0x%08" B_PRIx32 ", 0x%08" B_PRIx32 ")\n", i,
+                       TRB_3_TYPE_GET(B_LENDIAN_TO_HOST_INT32(trbs[i].dwtrb3)),
+                       trbs[i].qwtrb0, trbs[i].dwtrb2, trbs[i].dwtrb3);
+       }
+
+       Unlock();
+}
+
+
 status_t
 XHCI::DoCommand(xhci_trb* trb)
 {
diff --git a/src/add-ons/kernel/busses/usb/xhci.h 
b/src/add-ons/kernel/busses/usb/xhci.h
index 1ad1e01..e77900b 100644
--- a/src/add-ons/kernel/busses/usb/xhci.h
+++ b/src/add-ons/kernel/busses/usb/xhci.h
@@ -155,6 +155,7 @@ private:
                                                                        
xhci_endpoint *endpoint);
 
                        // Command
+                       void                            DumpRing(xhci_trb *trb, 
uint32 size);
                        void                            QueueCommand(xhci_trb 
*trb);
                        void                            
HandleCmdComplete(xhci_trb *trb);
                        void                            
HandleTransferComplete(xhci_trb *trb);


Other related posts:

  • » [haiku-commits] haiku: hrev51050 - src/add-ons/kernel/busses/usb - kallisti5