[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/11] xhci: drop XHCITransfer->{slotid,epid}
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 07/11] xhci: drop XHCITransfer->{slotid,epid} |
Date: |
Wed, 12 Oct 2016 14:58:14 +0200 |
We can use XHCITransfer->epctx->{slotid,epid} instead.
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden
---
hw/usb/hcd-xhci.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index c82fe09..80840d3 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -352,8 +352,6 @@ typedef struct XHCITransfer {
bool complete;
bool int_req;
unsigned int iso_pkts;
- unsigned int slotid;
- unsigned int epid;
unsigned int streamid;
bool in_xfer;
bool iso_xfer;
@@ -1450,8 +1448,6 @@ static XHCITransfer *xhci_ep_alloc_xfer(XHCIEPContext
*epctx,
xfer = g_new0(XHCITransfer, 1);
xfer->epctx = epctx;
- xfer->slotid = epctx->slotid;
- xfer->epid = epctx->epid;
xfer->trbs = g_new(XHCITRB, length);
xfer->trb_count = length;
usb_packet_init(&xfer->packet);
@@ -1816,8 +1812,8 @@ static void xhci_xfer_report(XHCITransfer *xfer)
if (!reported && ((trb->control & TRB_TR_IOC) ||
(shortpkt && (trb->control & TRB_TR_ISP)) ||
(xfer->status != CC_SUCCESS && left == 0))) {
- event.slotid = xfer->slotid;
- event.epid = xfer->epid;
+ event.slotid = xfer->epctx->slotid;
+ event.epid = xfer->epctx->epid;
event.length = (trb->status & 0x1ffff) - chunk;
event.flags = 0;
event.ptr = trb->addr;
@@ -1886,7 +1882,7 @@ static int xhci_setup_packet(XHCITransfer *xfer)
if (xfer->packet.ep) {
ep = xfer->packet.ep;
} else {
- ep = xhci_epid_to_usbep(xhci, xfer->slotid, xfer->epid);
+ ep = xhci_epid_to_usbep(xhci, xfer->epctx->slotid, xfer->epctx->epid);
if (!ep) {
DPRINTF("xhci: slot %d has no device\n",
xfer->slotid);
@@ -1966,7 +1962,8 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci,
XHCITransfer *xfer)
trb_setup = &xfer->trbs[0];
trb_status = &xfer->trbs[xfer->trb_count-1];
- trace_usb_xhci_xfer_start(xfer, xfer->slotid, xfer->epid, xfer->streamid);
+ trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid,
+ xfer->epctx->epid, xfer->streamid);
/* at most one Event Data TRB allowed after STATUS */
if (TRB_TYPE(*trb_status) == TR_EVDATA && xfer->trb_count > 2) {
@@ -2120,7 +2117,8 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer
*xfer, XHCIEPContext *epctx
static int xhci_fire_transfer(XHCIState *xhci, XHCITransfer *xfer,
XHCIEPContext *epctx)
{
- trace_usb_xhci_xfer_start(xfer, xfer->slotid, xfer->epid, xfer->streamid);
+ trace_usb_xhci_xfer_start(xfer, xfer->epctx->slotid,
+ xfer->epctx->epid, xfer->streamid);
return xhci_submit(xhci, xfer, epctx);
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/11] usb patch queue, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 05/11] xhci: drop XHCITransfer->xhci, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 07/11] xhci: drop XHCITransfer->{slotid,epid},
Gerd Hoffmann <=
- [Qemu-devel] [PULL 08/11] xhci: make xhci_epid_to_usbep accept XHCIEPContext, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 10/11] usb: Fix incorrect default DMA offset., Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 02/11] xhci: decouple EV_QUEUE from TD_QUEUE, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 04/11] xhci: use linked list for transfers, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 11/11] usb-redir: allocate buffers before waking up the host adapter, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 06/11] xhci: add & use xhci_kick_epctx(), Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 03/11] xhci: drop unused comp_xfer field, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 01/11] xhci: limit the number of link trbs we are willing to process, Gerd Hoffmann, 2016/10/12
- [Qemu-devel] [PULL 09/11] usb: fix serial generator, Gerd Hoffmann, 2016/10/12
- Re: [Qemu-devel] [PULL 00/11] usb patch queue, Peter Maydell, 2016/10/12