mirror of https://github.com/xemu-project/xemu.git
xhci: use DPRINTF() instead of fprintf(stderr, ...)
So we don't spam stderr with (guest-triggerable) messages by default. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
4f9cc73422
commit
d6bb65fcd2
|
@ -807,7 +807,7 @@ static inline int xhci_running(XHCIState *xhci)
|
||||||
static void xhci_die(XHCIState *xhci)
|
static void xhci_die(XHCIState *xhci)
|
||||||
{
|
{
|
||||||
xhci->usbsts |= USBSTS_HCE;
|
xhci->usbsts |= USBSTS_HCE;
|
||||||
fprintf(stderr, "xhci: asserted controller error\n");
|
DPRINTF("xhci: asserted controller error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xhci_write_event(XHCIState *xhci, XHCIEvent *event, int v)
|
static void xhci_write_event(XHCIState *xhci, XHCIEvent *event, int v)
|
||||||
|
@ -854,8 +854,8 @@ static void xhci_events_update(XHCIState *xhci, int v)
|
||||||
erdp = xhci_addr64(intr->erdp_low, intr->erdp_high);
|
erdp = xhci_addr64(intr->erdp_low, intr->erdp_high);
|
||||||
if (erdp < intr->er_start ||
|
if (erdp < intr->er_start ||
|
||||||
erdp >= (intr->er_start + TRB_SIZE*intr->er_size)) {
|
erdp >= (intr->er_start + TRB_SIZE*intr->er_size)) {
|
||||||
fprintf(stderr, "xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
DPRINTF("xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
||||||
fprintf(stderr, "xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
DPRINTF("xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
||||||
v, intr->er_start, intr->er_size);
|
v, intr->er_start, intr->er_size);
|
||||||
xhci_die(xhci);
|
xhci_die(xhci);
|
||||||
return;
|
return;
|
||||||
|
@ -923,7 +923,7 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v)
|
||||||
if (intr->er_full) {
|
if (intr->er_full) {
|
||||||
DPRINTF("xhci_event(): ER full, queueing\n");
|
DPRINTF("xhci_event(): ER full, queueing\n");
|
||||||
if (((intr->ev_buffer_put+1) % EV_QUEUE) == intr->ev_buffer_get) {
|
if (((intr->ev_buffer_put+1) % EV_QUEUE) == intr->ev_buffer_get) {
|
||||||
fprintf(stderr, "xhci: event queue full, dropping event!\n");
|
DPRINTF("xhci: event queue full, dropping event!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
intr->ev_buffer[intr->ev_buffer_put++] = *event;
|
intr->ev_buffer[intr->ev_buffer_put++] = *event;
|
||||||
|
@ -936,8 +936,8 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v)
|
||||||
erdp = xhci_addr64(intr->erdp_low, intr->erdp_high);
|
erdp = xhci_addr64(intr->erdp_low, intr->erdp_high);
|
||||||
if (erdp < intr->er_start ||
|
if (erdp < intr->er_start ||
|
||||||
erdp >= (intr->er_start + TRB_SIZE*intr->er_size)) {
|
erdp >= (intr->er_start + TRB_SIZE*intr->er_size)) {
|
||||||
fprintf(stderr, "xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
DPRINTF("xhci: ERDP out of bounds: "DMA_ADDR_FMT"\n", erdp);
|
||||||
fprintf(stderr, "xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
DPRINTF("xhci: ER[%d] at "DMA_ADDR_FMT" len %d\n",
|
||||||
v, intr->er_start, intr->er_size);
|
v, intr->er_start, intr->er_size);
|
||||||
xhci_die(xhci);
|
xhci_die(xhci);
|
||||||
return;
|
return;
|
||||||
|
@ -954,7 +954,7 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v)
|
||||||
#endif
|
#endif
|
||||||
intr->er_full = 1;
|
intr->er_full = 1;
|
||||||
if (((intr->ev_buffer_put+1) % EV_QUEUE) == intr->ev_buffer_get) {
|
if (((intr->ev_buffer_put+1) % EV_QUEUE) == intr->ev_buffer_get) {
|
||||||
fprintf(stderr, "xhci: event queue full, dropping event!\n");
|
DPRINTF("xhci: event queue full, dropping event!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
intr->ev_buffer[intr->ev_buffer_put++] = *event;
|
intr->ev_buffer[intr->ev_buffer_put++] = *event;
|
||||||
|
@ -1072,7 +1072,7 @@ static void xhci_er_reset(XHCIState *xhci, int v)
|
||||||
}
|
}
|
||||||
/* cache the (sole) event ring segment location */
|
/* cache the (sole) event ring segment location */
|
||||||
if (intr->erstsz != 1) {
|
if (intr->erstsz != 1) {
|
||||||
fprintf(stderr, "xhci: invalid value for ERSTSZ: %d\n", intr->erstsz);
|
DPRINTF("xhci: invalid value for ERSTSZ: %d\n", intr->erstsz);
|
||||||
xhci_die(xhci);
|
xhci_die(xhci);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1082,7 +1082,7 @@ static void xhci_er_reset(XHCIState *xhci, int v)
|
||||||
le32_to_cpus(&seg.addr_high);
|
le32_to_cpus(&seg.addr_high);
|
||||||
le32_to_cpus(&seg.size);
|
le32_to_cpus(&seg.size);
|
||||||
if (seg.size < 16 || seg.size > 4096) {
|
if (seg.size < 16 || seg.size > 4096) {
|
||||||
fprintf(stderr, "xhci: invalid value for segment size: %d\n", seg.size);
|
DPRINTF("xhci: invalid value for segment size: %d\n", seg.size);
|
||||||
xhci_die(xhci);
|
xhci_die(xhci);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1248,7 +1248,7 @@ static TRBCCode xhci_alloc_device_streams(XHCIState *xhci, unsigned int slotid,
|
||||||
|
|
||||||
r = usb_device_alloc_streams(eps[0]->dev, eps, nr_eps, req_nr_streams);
|
r = usb_device_alloc_streams(eps[0]->dev, eps, nr_eps, req_nr_streams);
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
fprintf(stderr, "xhci: alloc streams failed\n");
|
DPRINTF("xhci: alloc streams failed\n");
|
||||||
return CC_RESOURCE_ERROR;
|
return CC_RESOURCE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1532,7 +1532,7 @@ static TRBCCode xhci_stop_ep(XHCIState *xhci, unsigned int slotid,
|
||||||
assert(slotid >= 1 && slotid <= xhci->numslots);
|
assert(slotid >= 1 && slotid <= xhci->numslots);
|
||||||
|
|
||||||
if (epid < 1 || epid > 31) {
|
if (epid < 1 || epid > 31) {
|
||||||
fprintf(stderr, "xhci: bad ep %d\n", epid);
|
DPRINTF("xhci: bad ep %d\n", epid);
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1544,7 +1544,7 @@ static TRBCCode xhci_stop_ep(XHCIState *xhci, unsigned int slotid,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xhci_ep_nuke_xfers(xhci, slotid, epid, CC_STOPPED) > 0) {
|
if (xhci_ep_nuke_xfers(xhci, slotid, epid, CC_STOPPED) > 0) {
|
||||||
fprintf(stderr, "xhci: FIXME: endpoint stopped w/ xfers running, "
|
DPRINTF("xhci: FIXME: endpoint stopped w/ xfers running, "
|
||||||
"data might be lost\n");
|
"data might be lost\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1569,7 +1569,7 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid,
|
||||||
assert(slotid >= 1 && slotid <= xhci->numslots);
|
assert(slotid >= 1 && slotid <= xhci->numslots);
|
||||||
|
|
||||||
if (epid < 1 || epid > 31) {
|
if (epid < 1 || epid > 31) {
|
||||||
fprintf(stderr, "xhci: bad ep %d\n", epid);
|
DPRINTF("xhci: bad ep %d\n", epid);
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1583,13 +1583,13 @@ static TRBCCode xhci_reset_ep(XHCIState *xhci, unsigned int slotid,
|
||||||
epctx = slot->eps[epid-1];
|
epctx = slot->eps[epid-1];
|
||||||
|
|
||||||
if (epctx->state != EP_HALTED) {
|
if (epctx->state != EP_HALTED) {
|
||||||
fprintf(stderr, "xhci: reset EP while EP %d not halted (%d)\n",
|
DPRINTF("xhci: reset EP while EP %d not halted (%d)\n",
|
||||||
epid, epctx->state);
|
epid, epctx->state);
|
||||||
return CC_CONTEXT_STATE_ERROR;
|
return CC_CONTEXT_STATE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xhci_ep_nuke_xfers(xhci, slotid, epid, 0) > 0) {
|
if (xhci_ep_nuke_xfers(xhci, slotid, epid, 0) > 0) {
|
||||||
fprintf(stderr, "xhci: FIXME: endpoint reset w/ xfers running, "
|
DPRINTF("xhci: FIXME: endpoint reset w/ xfers running, "
|
||||||
"data might be lost\n");
|
"data might be lost\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1626,7 +1626,7 @@ static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid,
|
||||||
assert(slotid >= 1 && slotid <= xhci->numslots);
|
assert(slotid >= 1 && slotid <= xhci->numslots);
|
||||||
|
|
||||||
if (epid < 1 || epid > 31) {
|
if (epid < 1 || epid > 31) {
|
||||||
fprintf(stderr, "xhci: bad ep %d\n", epid);
|
DPRINTF("xhci: bad ep %d\n", epid);
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1643,7 +1643,7 @@ static TRBCCode xhci_set_ep_dequeue(XHCIState *xhci, unsigned int slotid,
|
||||||
epctx = slot->eps[epid-1];
|
epctx = slot->eps[epid-1];
|
||||||
|
|
||||||
if (epctx->state != EP_STOPPED) {
|
if (epctx->state != EP_STOPPED) {
|
||||||
fprintf(stderr, "xhci: set EP dequeue pointer while EP %d not stopped\n", epid);
|
DPRINTF("xhci: set EP dequeue pointer while EP %d not stopped\n", epid);
|
||||||
return CC_CONTEXT_STATE_ERROR;
|
return CC_CONTEXT_STATE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1685,7 +1685,7 @@ static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
|
||||||
switch (TRB_TYPE(*trb)) {
|
switch (TRB_TYPE(*trb)) {
|
||||||
case TR_DATA:
|
case TR_DATA:
|
||||||
if ((!(trb->control & TRB_TR_DIR)) != (!in_xfer)) {
|
if ((!(trb->control & TRB_TR_DIR)) != (!in_xfer)) {
|
||||||
fprintf(stderr, "xhci: data direction mismatch for TR_DATA\n");
|
DPRINTF("xhci: data direction mismatch for TR_DATA\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
@ -1695,7 +1695,7 @@ static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
|
||||||
chunk = trb->status & 0x1ffff;
|
chunk = trb->status & 0x1ffff;
|
||||||
if (trb->control & TRB_TR_IDT) {
|
if (trb->control & TRB_TR_IDT) {
|
||||||
if (chunk > 8 || in_xfer) {
|
if (chunk > 8 || in_xfer) {
|
||||||
fprintf(stderr, "xhci: invalid immediate data TRB\n");
|
DPRINTF("xhci: invalid immediate data TRB\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
qemu_sglist_add(&xfer->sgl, trb->addr, chunk);
|
qemu_sglist_add(&xfer->sgl, trb->addr, chunk);
|
||||||
|
@ -1824,7 +1824,7 @@ static int xhci_setup_packet(XHCITransfer *xfer)
|
||||||
} else {
|
} else {
|
||||||
ep = xhci_epid_to_usbep(xhci, xfer->slotid, xfer->epid);
|
ep = xhci_epid_to_usbep(xhci, xfer->slotid, xfer->epid);
|
||||||
if (!ep) {
|
if (!ep) {
|
||||||
fprintf(stderr, "xhci: slot %d has no device\n",
|
DPRINTF("xhci: slot %d has no device\n",
|
||||||
xfer->slotid);
|
xfer->slotid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1887,7 +1887,7 @@ static int xhci_complete_packet(XHCITransfer *xfer)
|
||||||
xhci_stall_ep(xfer);
|
xhci_stall_ep(xfer);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%s: FIXME: status = %d\n", __func__,
|
DPRINTF("%s: FIXME: status = %d\n", __func__,
|
||||||
xfer->packet.status);
|
xfer->packet.status);
|
||||||
FIXME("unhandled USB_RET_*");
|
FIXME("unhandled USB_RET_*");
|
||||||
}
|
}
|
||||||
|
@ -1911,21 +1911,21 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer)
|
||||||
|
|
||||||
/* do some sanity checks */
|
/* do some sanity checks */
|
||||||
if (TRB_TYPE(*trb_setup) != TR_SETUP) {
|
if (TRB_TYPE(*trb_setup) != TR_SETUP) {
|
||||||
fprintf(stderr, "xhci: ep0 first TD not SETUP: %d\n",
|
DPRINTF("xhci: ep0 first TD not SETUP: %d\n",
|
||||||
TRB_TYPE(*trb_setup));
|
TRB_TYPE(*trb_setup));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (TRB_TYPE(*trb_status) != TR_STATUS) {
|
if (TRB_TYPE(*trb_status) != TR_STATUS) {
|
||||||
fprintf(stderr, "xhci: ep0 last TD not STATUS: %d\n",
|
DPRINTF("xhci: ep0 last TD not STATUS: %d\n",
|
||||||
TRB_TYPE(*trb_status));
|
TRB_TYPE(*trb_status));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!(trb_setup->control & TRB_TR_IDT)) {
|
if (!(trb_setup->control & TRB_TR_IDT)) {
|
||||||
fprintf(stderr, "xhci: Setup TRB doesn't have IDT set\n");
|
DPRINTF("xhci: Setup TRB doesn't have IDT set\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((trb_setup->status & 0x1ffff) != 8) {
|
if ((trb_setup->status & 0x1ffff) != 8) {
|
||||||
fprintf(stderr, "xhci: Setup TRB has bad length (%d)\n",
|
DPRINTF("xhci: Setup TRB has bad length (%d)\n",
|
||||||
(trb_setup->status & 0x1ffff));
|
(trb_setup->status & 0x1ffff));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -2076,12 +2076,12 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
|
||||||
assert(epid >= 1 && epid <= 31);
|
assert(epid >= 1 && epid <= 31);
|
||||||
|
|
||||||
if (!xhci->slots[slotid-1].enabled) {
|
if (!xhci->slots[slotid-1].enabled) {
|
||||||
fprintf(stderr, "xhci: xhci_kick_ep for disabled slot %d\n", slotid);
|
DPRINTF("xhci: xhci_kick_ep for disabled slot %d\n", slotid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
epctx = xhci->slots[slotid-1].eps[epid-1];
|
epctx = xhci->slots[slotid-1].eps[epid-1];
|
||||||
if (!epctx) {
|
if (!epctx) {
|
||||||
fprintf(stderr, "xhci: xhci_kick_ep for disabled endpoint %d,%d\n",
|
DPRINTF("xhci: xhci_kick_ep for disabled endpoint %d,%d\n",
|
||||||
epid, slotid);
|
epid, slotid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2186,14 +2186,14 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
|
||||||
epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE;
|
epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE;
|
||||||
ep = xfer->packet.ep;
|
ep = xfer->packet.ep;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "xhci: error firing CTL transfer\n");
|
DPRINTF("xhci: error firing CTL transfer\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (xhci_fire_transfer(xhci, xfer, epctx) >= 0) {
|
if (xhci_fire_transfer(xhci, xfer, epctx) >= 0) {
|
||||||
epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE;
|
epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE;
|
||||||
} else {
|
} else {
|
||||||
if (!xfer->timed_xfer) {
|
if (!xfer->timed_xfer) {
|
||||||
fprintf(stderr, "xhci: error firing data transfer\n");
|
DPRINTF("xhci: error firing data transfer\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2296,7 +2296,7 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
|
||||||
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
||||||
|
|
||||||
if (ictl_ctx[0] != 0x0 || ictl_ctx[1] != 0x3) {
|
if (ictl_ctx[0] != 0x0 || ictl_ctx[1] != 0x3) {
|
||||||
fprintf(stderr, "xhci: invalid input context control %08x %08x\n",
|
DPRINTF("xhci: invalid input context control %08x %08x\n",
|
||||||
ictl_ctx[0], ictl_ctx[1]);
|
ictl_ctx[0], ictl_ctx[1]);
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -2312,14 +2312,14 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
|
||||||
|
|
||||||
uport = xhci_lookup_uport(xhci, slot_ctx);
|
uport = xhci_lookup_uport(xhci, slot_ctx);
|
||||||
if (uport == NULL) {
|
if (uport == NULL) {
|
||||||
fprintf(stderr, "xhci: port not found\n");
|
DPRINTF("xhci: port not found\n");
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
trace_usb_xhci_slot_address(slotid, uport->path);
|
trace_usb_xhci_slot_address(slotid, uport->path);
|
||||||
|
|
||||||
dev = uport->dev;
|
dev = uport->dev;
|
||||||
if (!dev || !dev->attached) {
|
if (!dev || !dev->attached) {
|
||||||
fprintf(stderr, "xhci: port %s not connected\n", uport->path);
|
DPRINTF("xhci: port %s not connected\n", uport->path);
|
||||||
return CC_USB_TRANSACTION_ERROR;
|
return CC_USB_TRANSACTION_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2328,7 +2328,7 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (xhci->slots[i].uport == uport) {
|
if (xhci->slots[i].uport == uport) {
|
||||||
fprintf(stderr, "xhci: port %s already assigned to slot %d\n",
|
DPRINTF("xhci: port %s already assigned to slot %d\n",
|
||||||
uport->path, i+1);
|
uport->path, i+1);
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -2412,7 +2412,7 @@ static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid,
|
||||||
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
||||||
|
|
||||||
if ((ictl_ctx[0] & 0x3) != 0x0 || (ictl_ctx[1] & 0x3) != 0x1) {
|
if ((ictl_ctx[0] & 0x3) != 0x0 || (ictl_ctx[1] & 0x3) != 0x1) {
|
||||||
fprintf(stderr, "xhci: invalid input context control %08x %08x\n",
|
DPRINTF("xhci: invalid input context control %08x %08x\n",
|
||||||
ictl_ctx[0], ictl_ctx[1]);
|
ictl_ctx[0], ictl_ctx[1]);
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -2421,7 +2421,7 @@ static TRBCCode xhci_configure_slot(XHCIState *xhci, unsigned int slotid,
|
||||||
xhci_dma_read_u32s(xhci, octx, slot_ctx, sizeof(slot_ctx));
|
xhci_dma_read_u32s(xhci, octx, slot_ctx, sizeof(slot_ctx));
|
||||||
|
|
||||||
if (SLOT_STATE(slot_ctx[3]) < SLOT_ADDRESSED) {
|
if (SLOT_STATE(slot_ctx[3]) < SLOT_ADDRESSED) {
|
||||||
fprintf(stderr, "xhci: invalid slot state %08x\n", slot_ctx[3]);
|
DPRINTF("xhci: invalid slot state %08x\n", slot_ctx[3]);
|
||||||
return CC_CONTEXT_STATE_ERROR;
|
return CC_CONTEXT_STATE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2494,7 +2494,7 @@ static TRBCCode xhci_evaluate_slot(XHCIState *xhci, unsigned int slotid,
|
||||||
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
xhci_dma_read_u32s(xhci, ictx, ictl_ctx, sizeof(ictl_ctx));
|
||||||
|
|
||||||
if (ictl_ctx[0] != 0x0 || ictl_ctx[1] & ~0x3) {
|
if (ictl_ctx[0] != 0x0 || ictl_ctx[1] & ~0x3) {
|
||||||
fprintf(stderr, "xhci: invalid input context control %08x %08x\n",
|
DPRINTF("xhci: invalid input context control %08x %08x\n",
|
||||||
ictl_ctx[0], ictl_ctx[1]);
|
ictl_ctx[0], ictl_ctx[1]);
|
||||||
return CC_TRB_ERROR;
|
return CC_TRB_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -2573,11 +2573,11 @@ static unsigned int xhci_get_slot(XHCIState *xhci, XHCIEvent *event, XHCITRB *tr
|
||||||
unsigned int slotid;
|
unsigned int slotid;
|
||||||
slotid = (trb->control >> TRB_CR_SLOTID_SHIFT) & TRB_CR_SLOTID_MASK;
|
slotid = (trb->control >> TRB_CR_SLOTID_SHIFT) & TRB_CR_SLOTID_MASK;
|
||||||
if (slotid < 1 || slotid > xhci->numslots) {
|
if (slotid < 1 || slotid > xhci->numslots) {
|
||||||
fprintf(stderr, "xhci: bad slot id %d\n", slotid);
|
DPRINTF("xhci: bad slot id %d\n", slotid);
|
||||||
event->ccode = CC_TRB_ERROR;
|
event->ccode = CC_TRB_ERROR;
|
||||||
return 0;
|
return 0;
|
||||||
} else if (!xhci->slots[slotid-1].enabled) {
|
} else if (!xhci->slots[slotid-1].enabled) {
|
||||||
fprintf(stderr, "xhci: slot id %d not enabled\n", slotid);
|
DPRINTF("xhci: slot id %d not enabled\n", slotid);
|
||||||
event->ccode = CC_SLOT_NOT_ENABLED_ERROR;
|
event->ccode = CC_SLOT_NOT_ENABLED_ERROR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2693,7 +2693,7 @@ static void xhci_process_commands(XHCIState *xhci)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i >= xhci->numslots) {
|
if (i >= xhci->numslots) {
|
||||||
fprintf(stderr, "xhci: no device slots available\n");
|
DPRINTF("xhci: no device slots available\n");
|
||||||
event.ccode = CC_NO_SLOTS_ERROR;
|
event.ccode = CC_NO_SLOTS_ERROR;
|
||||||
} else {
|
} else {
|
||||||
slotid = i+1;
|
slotid = i+1;
|
||||||
|
@ -2885,7 +2885,7 @@ static void xhci_reset(DeviceState *dev)
|
||||||
|
|
||||||
trace_usb_xhci_reset();
|
trace_usb_xhci_reset();
|
||||||
if (!(xhci->usbsts & USBSTS_HCH)) {
|
if (!(xhci->usbsts & USBSTS_HCH)) {
|
||||||
fprintf(stderr, "xhci: reset while running!\n");
|
DPRINTF("xhci: reset while running!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
xhci->usbcmd = 0;
|
xhci->usbcmd = 0;
|
||||||
|
@ -3063,7 +3063,7 @@ static void xhci_port_write(void *ptr, hwaddr reg,
|
||||||
/* windows does this for some reason, don't spam stderr */
|
/* windows does this for some reason, don't spam stderr */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "%s: ignore pls write (old %d, new %d)\n",
|
DPRINTF("%s: ignore pls write (old %d, new %d)\n",
|
||||||
__func__, old_pls, new_pls);
|
__func__, old_pls, new_pls);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3314,7 +3314,7 @@ static void xhci_doorbell_write(void *ptr, hwaddr reg,
|
||||||
trace_usb_xhci_doorbell_write(reg, val);
|
trace_usb_xhci_doorbell_write(reg, val);
|
||||||
|
|
||||||
if (!xhci_running(xhci)) {
|
if (!xhci_running(xhci)) {
|
||||||
fprintf(stderr, "xhci: wrote doorbell while xHC stopped or paused\n");
|
DPRINTF("xhci: wrote doorbell while xHC stopped or paused\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3324,16 +3324,16 @@ static void xhci_doorbell_write(void *ptr, hwaddr reg,
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
xhci_process_commands(xhci);
|
xhci_process_commands(xhci);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "xhci: bad doorbell 0 write: 0x%x\n",
|
DPRINTF("xhci: bad doorbell 0 write: 0x%x\n",
|
||||||
(uint32_t)val);
|
(uint32_t)val);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
epid = val & 0xff;
|
epid = val & 0xff;
|
||||||
streamid = (val >> 16) & 0xffff;
|
streamid = (val >> 16) & 0xffff;
|
||||||
if (reg > xhci->numslots) {
|
if (reg > xhci->numslots) {
|
||||||
fprintf(stderr, "xhci: bad doorbell %d\n", (int)reg);
|
DPRINTF("xhci: bad doorbell %d\n", (int)reg);
|
||||||
} else if (epid > 31) {
|
} else if (epid > 31) {
|
||||||
fprintf(stderr, "xhci: bad doorbell %d write: 0x%x\n",
|
DPRINTF("xhci: bad doorbell %d write: 0x%x\n",
|
||||||
(int)reg, (uint32_t)val);
|
(int)reg, (uint32_t)val);
|
||||||
} else {
|
} else {
|
||||||
xhci_kick_ep(xhci, reg, epid, streamid);
|
xhci_kick_ep(xhci, reg, epid, streamid);
|
||||||
|
|
Loading…
Reference in New Issue