Received: from eggs.gnu.org ([2001:4830:134:3::10]:41139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMadv-0006kS-6F for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:35:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMadj-0002ZN-03 for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:35:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMadi-0002Z0-Ns for qemu-devel@nongnu.org; Thu, 19 Sep 2013 05:35:10 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8J9Z9hw003107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Sep 2013 05:35:09 -0400 From: Gerd Hoffmann Date: Thu, 19 Sep 2013 11:34:54 +0200 Message-Id: <1379583298-7524-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1379583298-7524-1-git-send-email-kraxel@redhat.com> References: <1379583298-7524-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 3/7] xhci: Init a transfers xhci, slotid and epid member on epctx alloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede 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 Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 6 +++--- 1 file 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) { -- 1.8.3.1