|
|
9ae3a8 |
From 120f0850e08e429f7782df32412ce7cbb626a654 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Date: Fri, 11 Jul 2014 14:21:00 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 26/43] xhci: use DPRINTF() instead of fprintf(stderr, ...)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1405088470-24115-28-git-send-email-kraxel@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 59856
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.1 qemu-kvm PATCH 27/37] xhci: use DPRINTF() instead of fprintf(stderr, ...)
|
|
|
9ae3a8 |
Bugzilla: 980833
|
|
|
9ae3a8 |
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
So we don't spam stderr with (guest-triggerable) messages by default.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit d6bb65fcd24c8cb8c37ffe324c360f3b0c94b902)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/hcd-xhci.c | 90 +++++++++++++++++++++++++++----------------------------
|
|
|
9ae3a8 |
1 file changed, 45 insertions(+), 45 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/hcd-xhci.c | 90 +++++++++++++++++++++++++++----------------------------
|
|
|
9ae3a8 |
1 file changed, 45 insertions(+), 45 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
index f937b4e..2352b12 100644
|
|
|
9ae3a8 |
--- a/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
+++ b/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
@@ -810,7 +810,7 @@ static inline int xhci_running(XHCIState *xhci)
|
|
|
9ae3a8 |
static void xhci_die(XHCIState *xhci)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
xhci->usbsts |= USBSTS_HCE;
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: asserted controller error\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: asserted controller error\n");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static void xhci_write_event(XHCIState *xhci, XHCIEvent *event, int v)
|
|
|
9ae3a8 |
@@ -857,8 +857,8 @@ static void xhci_events_update(XHCIState *xhci, int v)
|
|
|
9ae3a8 |
erdp = xhci_addr64(intr->erdp_low, intr->erdp_high);
|
|
|
9ae3a8 |
if (erdp < intr->er_start ||
|
|
|
9ae3a8 |
erdp >= (intr->er_start + TRB_SIZE*intr->er_size)) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
|
|
9ae3a8 |
v, intr->er_start, intr->er_size);
|
|
|
9ae3a8 |
xhci_die(xhci);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
@@ -926,7 +926,7 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v)
|
|
|
9ae3a8 |
if (intr->er_full) {
|
|
|
9ae3a8 |
DPRINTF("xhci_event(): ER full, queueing\n");
|
|
|
9ae3a8 |
if (((intr->ev_buffer_put+1) % EV_QUEUE) == intr->ev_buffer_get) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: event queue full, dropping event!\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: event queue full, dropping event!\n");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
intr->ev_buffer[intr->ev_buffer_put++] = *event;
|
|
|
9ae3a8 |
@@ -939,8 +939,8 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v)
|
|
|
9ae3a8 |
erdp = xhci_addr64(intr->erdp_low, intr->erdp_high);
|
|
|
9ae3a8 |
if (erdp < intr->er_start ||
|
|
|
9ae3a8 |
erdp >= (intr->er_start + TRB_SIZE*intr->er_size)) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
|
|
9ae3a8 |
v, intr->er_start, intr->er_size);
|
|
|
9ae3a8 |
xhci_die(xhci);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
@@ -957,7 +957,7 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v)
|
|
|
9ae3a8 |
#endif
|
|
|
9ae3a8 |
intr->er_full = 1;
|
|
|
9ae3a8 |
if (((intr->ev_buffer_put+1) % EV_QUEUE) == intr->ev_buffer_get) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: event queue full, dropping event!\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: event queue full, dropping event!\n");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
intr->ev_buffer[intr->ev_buffer_put++] = *event;
|
|
|
9ae3a8 |
@@ -1075,7 +1075,7 @@ static void xhci_er_reset(XHCIState *xhci, int v)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
/* cache the (sole) event ring segment location */
|
|
|
9ae3a8 |
if (intr->erstsz != 1) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: invalid value for ERSTSZ: %d\n", intr->erstsz);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: invalid value for ERSTSZ: %d\n", intr->erstsz);
|
|
|
9ae3a8 |
xhci_die(xhci);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1085,7 +1085,7 @@ static void xhci_er_reset(XHCIState *xhci, int v)
|
|
|
9ae3a8 |
le32_to_cpus(&seg.addr_high);
|
|
|
9ae3a8 |
le32_to_cpus(&seg.size);
|
|
|
9ae3a8 |
if (seg.size < 16 || seg.size > 4096) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: invalid value for segment size: %d\n", seg.size);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: invalid value for segment size: %d\n", seg.size);
|
|
|
9ae3a8 |
xhci_die(xhci);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1251,7 +1251,7 @@ static TRBCCode xhci_alloc_device_streams(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
r = usb_device_alloc_streams(eps[0]->dev, eps, nr_eps, req_nr_streams);
|
|
|
9ae3a8 |
if (r != 0) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: alloc streams failed\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: alloc streams failed\n");
|
|
|
9ae3a8 |
return CC_RESOURCE_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1535,7 +1535,7 @@ static TRBCCode xhci_stop_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
assert(slotid >= 1 && slotid <= xhci->numslots);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (epid < 1 || epid > 31) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: bad ep %d\n", epid);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: bad ep %d\n", epid);
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1547,7 +1547,7 @@ static TRBCCode xhci_stop_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (xhci_ep_nuke_xfers(xhci, slotid, epid, CC_STOPPED) > 0) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: FIXME: endpoint stopped w/ xfers running, "
|
|
|
9ae3a8 |
+ DPRINTF("xhci: FIXME: endpoint stopped w/ xfers running, "
|
|
|
9ae3a8 |
"data might be lost\n");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1572,7 +1572,7 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
assert(slotid >= 1 && slotid <= xhci->numslots);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (epid < 1 || epid > 31) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: bad ep %d\n", epid);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: bad ep %d\n", epid);
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1586,13 +1586,13 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
epctx = slot->eps[epid-1];
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (epctx->state != EP_HALTED) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: reset EP while EP %d not halted (%d)\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: reset EP while EP %d not halted (%d)\n",
|
|
|
9ae3a8 |
epid, epctx->state);
|
|
|
9ae3a8 |
return CC_CONTEXT_STATE_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (xhci_ep_nuke_xfers(xhci, slotid, epid, 0) > 0) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: FIXME: endpoint reset w/ xfers running, "
|
|
|
9ae3a8 |
+ DPRINTF("xhci: FIXME: endpoint reset w/ xfers running, "
|
|
|
9ae3a8 |
"data might be lost\n");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1629,7 +1629,7 @@ static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
assert(slotid >= 1 && slotid <= xhci->numslots);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (epid < 1 || epid > 31) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: bad ep %d\n", epid);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: bad ep %d\n", epid);
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1646,7 +1646,7 @@ static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
epctx = slot->eps[epid-1];
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (epctx->state != EP_STOPPED) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: set EP dequeue pointer while EP %d not stopped\n", epid);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: set EP dequeue pointer while EP %d not stopped\n", epid);
|
|
|
9ae3a8 |
return CC_CONTEXT_STATE_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -1688,7 +1688,7 @@ static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
|
|
|
9ae3a8 |
switch (TRB_TYPE(*trb)) {
|
|
|
9ae3a8 |
case TR_DATA:
|
|
|
9ae3a8 |
if ((!(trb->control & TRB_TR_DIR)) != (!in_xfer)) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: data direction mismatch for TR_DATA\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: data direction mismatch for TR_DATA\n");
|
|
|
9ae3a8 |
goto err;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
/* fallthrough */
|
|
|
9ae3a8 |
@@ -1698,7 +1698,7 @@ static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
|
|
|
9ae3a8 |
chunk = trb->status & 0x1ffff;
|
|
|
9ae3a8 |
if (trb->control & TRB_TR_IDT) {
|
|
|
9ae3a8 |
if (chunk > 8 || in_xfer) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: invalid immediate data TRB\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: invalid immediate data TRB\n");
|
|
|
9ae3a8 |
goto err;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
qemu_sglist_add(&xfer->sgl, trb->addr, chunk);
|
|
|
9ae3a8 |
@@ -1827,7 +1827,7 @@ static int xhci_setup_packet(XHCITransfer *xfer)
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
ep = xhci_epid_to_usbep(xhci, xfer->slotid, xfer->epid);
|
|
|
9ae3a8 |
if (!ep) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: slot %d has no device\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: slot %d has no device\n",
|
|
|
9ae3a8 |
xfer->slotid);
|
|
|
9ae3a8 |
return -1;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1890,7 +1890,7 @@ static int xhci_complete_packet(XHCITransfer *xfer)
|
|
|
9ae3a8 |
xhci_stall_ep(xfer);
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
default:
|
|
|
9ae3a8 |
- fprintf(stderr, "%s: FIXME: status = %d\n", __func__,
|
|
|
9ae3a8 |
+ DPRINTF("%s: FIXME: status = %d\n", __func__,
|
|
|
9ae3a8 |
xfer->packet.status);
|
|
|
9ae3a8 |
FIXME("unhandled USB_RET_*");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -1914,21 +1914,21 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* do some sanity checks */
|
|
|
9ae3a8 |
if (TRB_TYPE(*trb_setup) != TR_SETUP) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: ep0 first TD not SETUP: %d\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: ep0 first TD not SETUP: %d\n",
|
|
|
9ae3a8 |
TRB_TYPE(*trb_setup));
|
|
|
9ae3a8 |
return -1;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (TRB_TYPE(*trb_status) != TR_STATUS) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: ep0 last TD not STATUS: %d\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: ep0 last TD not STATUS: %d\n",
|
|
|
9ae3a8 |
TRB_TYPE(*trb_status));
|
|
|
9ae3a8 |
return -1;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (!(trb_setup->control & TRB_TR_IDT)) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: Setup TRB doesn't have IDT set\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: Setup TRB doesn't have IDT set\n");
|
|
|
9ae3a8 |
return -1;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if ((trb_setup->status & 0x1ffff) != 8) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: Setup TRB has bad length (%d)\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: Setup TRB has bad length (%d)\n",
|
|
|
9ae3a8 |
(trb_setup->status & 0x1ffff));
|
|
|
9ae3a8 |
return -1;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2079,12 +2079,12 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
assert(epid >= 1 && epid <= 31);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (!xhci->slots[slotid-1].enabled) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: xhci_kick_ep for disabled slot %d\n", slotid);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: xhci_kick_ep for disabled slot %d\n", slotid);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
epctx = xhci->slots[slotid-1].eps[epid-1];
|
|
|
9ae3a8 |
if (!epctx) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: xhci_kick_ep for disabled endpoint %d,%d\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: xhci_kick_ep for disabled endpoint %d,%d\n",
|
|
|
9ae3a8 |
epid, slotid);
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2189,14 +2189,14 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE;
|
|
|
9ae3a8 |
ep = xfer->packet.ep;
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: error firing CTL transfer\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: error firing CTL transfer\n");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
if (xhci_fire_transfer(xhci, xfer, epctx) >= 0) {
|
|
|
9ae3a8 |
epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE;
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
if (!xfer->timed_xfer) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: error firing data transfer\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: error firing data transfer\n");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2299,7 +2299,7 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (ictl_ctx[0] != 0x0 || ictl_ctx[1] != 0x3) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: invalid input context control %08x %08x\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: invalid input context control %08x %08x\n",
|
|
|
9ae3a8 |
ictl_ctx[0], ictl_ctx[1]);
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2315,14 +2315,14 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
uport = xhci_lookup_uport(xhci, slot_ctx);
|
|
|
9ae3a8 |
if (uport == NULL) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: port not found\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: port not found\n");
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
trace_usb_xhci_slot_address(slotid, uport->path);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
dev = uport->dev;
|
|
|
9ae3a8 |
if (!dev || !dev->attached) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: port %s not connected\n", uport->path);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: port %s not connected\n", uport->path);
|
|
|
9ae3a8 |
return CC_USB_TRANSACTION_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -2331,7 +2331,7 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
continue;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (xhci->slots[i].uport == uport) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: port %s already assigned to slot %d\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: port %s already assigned to slot %d\n",
|
|
|
9ae3a8 |
uport->path, i+1);
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2415,7 +2415,7 @@ static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if ((ictl_ctx[0] & 0x3) != 0x0 || (ictl_ctx[1] & 0x3) != 0x1) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: invalid input context control %08x %08x\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: invalid input context control %08x %08x\n",
|
|
|
9ae3a8 |
ictl_ctx[0], ictl_ctx[1]);
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2424,7 +2424,7 @@ static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
xhci_dma_read_u32s(xhci, octx, slot_ctx, sizeof(slot_ctx));
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (SLOT_STATE(slot_ctx[3]) < SLOT_ADDRESSED) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: invalid slot state %08x\n", slot_ctx[3]);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: invalid slot state %08x\n", slot_ctx[3]);
|
|
|
9ae3a8 |
return CC_CONTEXT_STATE_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -2497,7 +2497,7 @@ static TRBCCode xhci_evaluate_slot(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (ictl_ctx[0] != 0x0 || ictl_ctx[1] & ~0x3) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: invalid input context control %08x %08x\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: invalid input context control %08x %08x\n",
|
|
|
9ae3a8 |
ictl_ctx[0], ictl_ctx[1]);
|
|
|
9ae3a8 |
return CC_TRB_ERROR;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2576,11 +2576,11 @@ static unsigned int xhci_get_slot(XHCIState *xhci, XHCIEvent *event, XHCITRB *tr
|
|
|
9ae3a8 |
unsigned int slotid;
|
|
|
9ae3a8 |
slotid = (trb->control >> TRB_CR_SLOTID_SHIFT) & TRB_CR_SLOTID_MASK;
|
|
|
9ae3a8 |
if (slotid < 1 || slotid > xhci->numslots) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: bad slot id %d\n", slotid);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: bad slot id %d\n", slotid);
|
|
|
9ae3a8 |
event->ccode = CC_TRB_ERROR;
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
} else if (!xhci->slots[slotid-1].enabled) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: slot id %d not enabled\n", slotid);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: slot id %d not enabled\n", slotid);
|
|
|
9ae3a8 |
event->ccode = CC_SLOT_NOT_ENABLED_ERROR;
|
|
|
9ae3a8 |
return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -2696,7 +2696,7 @@ static void xhci_process_commands(XHCIState *xhci)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (i >= xhci->numslots) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: no device slots available\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: no device slots available\n");
|
|
|
9ae3a8 |
event.ccode = CC_NO_SLOTS_ERROR;
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
slotid = i+1;
|
|
|
9ae3a8 |
@@ -2888,7 +2888,7 @@ static void xhci_reset(DeviceState *dev)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
trace_usb_xhci_reset();
|
|
|
9ae3a8 |
if (!(xhci->usbsts & USBSTS_HCH)) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: reset while running!\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: reset while running!\n");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
xhci->usbcmd = 0;
|
|
|
9ae3a8 |
@@ -3066,7 +3066,7 @@ static void xhci_port_write(void *ptr, hwaddr reg,
|
|
|
9ae3a8 |
/* windows does this for some reason, don't spam stderr */
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
default:
|
|
|
9ae3a8 |
- fprintf(stderr, "%s: ignore pls write (old %d, new %d)\n",
|
|
|
9ae3a8 |
+ DPRINTF("%s: ignore pls write (old %d, new %d)\n",
|
|
|
9ae3a8 |
__func__, old_pls, new_pls);
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -3317,7 +3317,7 @@ static void xhci_doorbell_write(void *ptr, hwaddr reg,
|
|
|
9ae3a8 |
trace_usb_xhci_doorbell_write(reg, val);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (!xhci_running(xhci)) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: wrote doorbell while xHC stopped or paused\n");
|
|
|
9ae3a8 |
+ DPRINTF("xhci: wrote doorbell while xHC stopped or paused\n");
|
|
|
9ae3a8 |
return;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -3327,16 +3327,16 @@ static void xhci_doorbell_write(void *ptr, hwaddr reg,
|
|
|
9ae3a8 |
if (val == 0) {
|
|
|
9ae3a8 |
xhci_process_commands(xhci);
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: bad doorbell 0 write: 0x%x\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: bad doorbell 0 write: 0x%x\n",
|
|
|
9ae3a8 |
(uint32_t)val);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
epid = val & 0xff;
|
|
|
9ae3a8 |
streamid = (val >> 16) & 0xffff;
|
|
|
9ae3a8 |
if (reg > xhci->numslots) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: bad doorbell %d\n", (int)reg);
|
|
|
9ae3a8 |
+ DPRINTF("xhci: bad doorbell %d\n", (int)reg);
|
|
|
9ae3a8 |
} else if (epid > 31) {
|
|
|
9ae3a8 |
- fprintf(stderr, "xhci: bad doorbell %d write: 0x%x\n",
|
|
|
9ae3a8 |
+ DPRINTF("xhci: bad doorbell %d write: 0x%x\n",
|
|
|
9ae3a8 |
(int)reg, (uint32_t)val);
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
xhci_kick_ep(xhci, reg, epid, streamid);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|