diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-09-17 21:44:49 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-09-19 11:28:40 +0200 |
commit | 4c5d82ecf1e8fd0720137f7d09fc77d65b51b4d0 (patch) | |
tree | b152a9493f7e9102b077a88997956b2e3f6c2ec0 /hw/usb | |
parent | d063c3112c4cd23a479ee18720c2bd119da2d315 (diff) | |
download | qemu-4c5d82ecf1e8fd0720137f7d09fc77d65b51b4d0.zip qemu-4c5d82ecf1e8fd0720137f7d09fc77d65b51b4d0.tar.gz qemu-4c5d82ecf1e8fd0720137f7d09fc77d65b51b4d0.tar.bz2 |
xhci: Init a transfers xhci, slotid and epid member on epctx alloc
Transfers are part of an epctx, which is part of a slot, which is part of
a xhci. Transfers cannot dynamically be moved from one epctx to another,
so once created their xhci, slotid and epid are constant, so lets set these
up at creation time, rather then re-initializing them with the same
value each time a transfer gets submitted.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r-- | hw/usb/hcd-xhci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 69d9144..7c0c0c4 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1245,6 +1245,9 @@ static XHCIEPContext *xhci_alloc_epctx(XHCIState *xhci, epctx->epid = epid; for (i = 0; i < ARRAY_SIZE(epctx->transfers); i++) { + epctx->transfers[i].xhci = xhci; + epctx->transfers[i].slotid = slotid; + epctx->transfers[i].epid = epid; usb_packet_init(&epctx->transfers[i].packet); } epctx->kick_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, xhci_ep_kick_timer, epctx); @@ -2060,9 +2063,6 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, for (i = 0; i < length; i++) { assert(xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL)); } - xfer->xhci = xhci; - xfer->epid = epid; - xfer->slotid = slotid; xfer->streamid = streamid; if (epid == 1) { |