From patchwork Wed Oct 31 13:01:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 195873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 918DD2C00C8 for ; Thu, 1 Nov 2012 00:31:47 +1100 (EST) Received: from localhost ([::1]:42899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXuY-0005xA-AR for incoming@patchwork.ozlabs.org; Wed, 31 Oct 2012 09:00:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXtc-0003zk-Vd for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:59:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTXtV-0002D8-8D for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:59:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTXtV-0002Cq-0I for qemu-devel@nongnu.org; Wed, 31 Oct 2012 08:59:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9VCxe24023441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Oct 2012 08:59:40 -0400 Received: from shalem.localdomain.com (vpn1-6-145.ams2.redhat.com [10.36.6.145]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9VCxUJD003076; Wed, 31 Oct 2012 08:59:39 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Wed, 31 Oct 2012 14:01:18 +0100 Message-Id: <1351688478-14541-6-git-send-email-hdegoede@redhat.com> In-Reply-To: <1351688478-14541-1-git-send-email-hdegoede@redhat.com> References: <1351688478-14541-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 5/5] xhci: Add support for packets with both data and an error status X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Hans de Goede --- hw/usb/hcd-xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 16c2a86..f670c29 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1363,7 +1363,7 @@ static void xhci_xfer_report(XHCITransfer *xfer) XHCIState *xhci = xfer->xhci; int i; - left = xfer->packet.status ? 0 : xfer->packet.actual_length; + left = xfer->packet.actual_length; for (i = 0; i < xfer->trb_count; i++) { XHCITRB *trb = &xfer->trbs[i]; @@ -1391,7 +1391,7 @@ static void xhci_xfer_report(XHCITransfer *xfer) if (!reported && ((trb->control & TRB_TR_IOC) || (shortpkt && (trb->control & TRB_TR_ISP)) || - (xfer->status != CC_SUCCESS))) { + (xfer->status != CC_SUCCESS && left == 0))) { event.slotid = xfer->slotid; event.epid = xfer->epid; event.length = (trb->status & 0x1ffff) - chunk;