Received: from eggs.gnu.org ([2001:4830:134:3::10]:53846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk6Zh-0000ec-63 for qemu-devel@nongnu.org; Wed, 14 Sep 2016 05:33:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bk6Zb-0001u3-7M for qemu-devel@nongnu.org; Wed, 14 Sep 2016 05:33:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk6Zb-0001th-1T for qemu-devel@nongnu.org; Wed, 14 Sep 2016 05:33:43 -0400 From: Gerd Hoffmann Date: Wed, 14 Sep 2016 11:33:31 +0200 Message-Id: <1473845615-16982-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1473845615-16982-1-git-send-email-kraxel@redhat.com> References: <1473845615-16982-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 1/5] xhci: Fix remainder field for TR_SETUP completion event. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans Petter Selasky , Gerd Hoffmann From: Hans Petter Selasky Previously the code would incorrectly report the remainder as 8 bytes. A remainder of 0 bytes should be reported when the SETUP packet is successfully transferred. Found using FreeBSD's XHCI driver. Signed-off-by: Hans Petter Selasky [ kraxel: codestyle fixup ] Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 188f954..37c1493 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1753,6 +1753,12 @@ static void xhci_xfer_report(XHCITransfer *xfer) unsigned int chunk = 0; switch (TRB_TYPE(*trb)) { + case TR_SETUP: + chunk = trb->status & 0x1ffff; + if (chunk > 8) { + chunk = 8; + } + break; case TR_DATA: case TR_NORMAL: case TR_ISOCH: -- 1.8.3.1