From patchwork Tue Sep 27 08:32:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9351599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 952EA600CB for ; Tue, 27 Sep 2016 08:38:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8251C29099 for ; Tue, 27 Sep 2016 08:38:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72B2B29119; Tue, 27 Sep 2016 08:38:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E620B29099 for ; Tue, 27 Sep 2016 08:38:01 +0000 (UTC) Received: from localhost ([::1]:48763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bonto-0003lb-Ms for patchwork-qemu-devel@patchwork.kernel.org; Tue, 27 Sep 2016 04:38:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bonp5-0007Z0-IF for qemu-devel@nongnu.org; Tue, 27 Sep 2016 04:33:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bonp0-00080C-ED for qemu-devel@nongnu.org; Tue, 27 Sep 2016 04:33:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bonp0-0007zm-5m for qemu-devel@nongnu.org; Tue, 27 Sep 2016 04:33:02 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B056D693F2 for ; Tue, 27 Sep 2016 08:33:01 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8R8X0mm026176; Tue, 27 Sep 2016 04:33:01 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id F19CD80BD2; Tue, 27 Sep 2016 10:32:58 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 27 Sep 2016 10:32:51 +0200 Message-Id: <1474965172-30321-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1474965172-30321-1-git-send-email-kraxel@redhat.com> References: <1474965172-30321-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 27 Sep 2016 08:33:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 7/8] xhci: drop XHCITransfer->{slotid,epid} X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We can use XHCITransfer->epctx->{slotid,epid} instead. Signed-off-by: Gerd Hoffmann --- 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 4e557c2..108d185 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -350,8 +350,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; @@ -1440,8 +1438,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); @@ -1806,8 +1802,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; @@ -1876,7 +1872,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); @@ -1956,7 +1952,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) { @@ -2110,7 +2107,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); }