xhci: add port trace points

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2012-10-26 11:49:06 +02:00
parent b62b08282d
commit 4f47f0f82e
2 changed files with 7 additions and 1 deletions

View File

@ -2391,12 +2391,14 @@ static void xhci_port_update(XHCIPort *port, int is_detach)
} }
} }
set_field(&port->portsc, pls, PORTSC_PLS); set_field(&port->portsc, pls, PORTSC_PLS);
trace_usb_xhci_port_link(port->portnr, pls);
xhci_port_notify(port, PORTSC_CSC); xhci_port_notify(port, PORTSC_CSC);
} }
static void xhci_port_reset(XHCIPort *port) static void xhci_port_reset(XHCIPort *port)
{ {
DPRINTF("xhci: port %d reset\n", port); trace_usb_xhci_port_reset(port->portnr);
if (!xhci_port_have_device(port)) { if (!xhci_port_have_device(port)) {
return; return;
} }
@ -2408,6 +2410,7 @@ static void xhci_port_reset(XHCIPort *port)
case USB_SPEED_FULL: case USB_SPEED_FULL:
case USB_SPEED_HIGH: case USB_SPEED_HIGH:
set_field(&port->portsc, PLS_U0, PORTSC_PLS); set_field(&port->portsc, PLS_U0, PORTSC_PLS);
trace_usb_xhci_port_link(port->portnr, PLS_U0);
port->portsc |= PORTSC_PED; port->portsc |= PORTSC_PED;
break; break;
} }
@ -2574,6 +2577,7 @@ static void xhci_port_write(void *ptr, hwaddr reg,
/* overwrite PLS only when LWS=1 */ /* overwrite PLS only when LWS=1 */
uint32_t pls = get_field(val, PORTSC_PLS); uint32_t pls = get_field(val, PORTSC_PLS);
set_field(&portsc, pls, PORTSC_PLS); set_field(&portsc, pls, PORTSC_PLS);
trace_usb_xhci_port_link(port->portnr, pls);
} }
/* read/write bits */ /* read/write bits */
portsc &= ~(PORTSC_PP|PORTSC_WCE|PORTSC_WDE|PORTSC_WOE); portsc &= ~(PORTSC_PP|PORTSC_WCE|PORTSC_WDE|PORTSC_WOE);

View File

@ -333,6 +333,8 @@ usb_xhci_irq_msix_use(uint32_t nr) "nr %d"
usb_xhci_irq_msix_unuse(uint32_t nr) "nr %d" usb_xhci_irq_msix_unuse(uint32_t nr) "nr %d"
usb_xhci_queue_event(uint32_t vector, uint32_t idx, const char *trb, const char *evt, uint64_t param, uint32_t status, uint32_t control) "v %d, idx %d, %s, %s, p %016" PRIx64 ", s %08x, c 0x%08x" usb_xhci_queue_event(uint32_t vector, uint32_t idx, const char *trb, const char *evt, uint64_t param, uint32_t status, uint32_t control) "v %d, idx %d, %s, %s, p %016" PRIx64 ", s %08x, c 0x%08x"
usb_xhci_fetch_trb(uint64_t addr, const char *name, uint64_t param, uint32_t status, uint32_t control) "addr %016" PRIx64 ", %s, p %016" PRIx64 ", s %08x, c 0x%08x" usb_xhci_fetch_trb(uint64_t addr, const char *name, uint64_t param, uint32_t status, uint32_t control) "addr %016" PRIx64 ", %s, p %016" PRIx64 ", s %08x, c 0x%08x"
usb_xhci_port_reset(uint32_t port) "port %d"
usb_xhci_port_link(uint32_t port, uint32_t pls) "port %d, pls %d"
usb_xhci_slot_enable(uint32_t slotid) "slotid %d" usb_xhci_slot_enable(uint32_t slotid) "slotid %d"
usb_xhci_slot_disable(uint32_t slotid) "slotid %d" usb_xhci_slot_disable(uint32_t slotid) "slotid %d"
usb_xhci_slot_address(uint32_t slotid) "slotid %d" usb_xhci_slot_address(uint32_t slotid) "slotid %d"