]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
xhci: Fix remainder field for TR_SETUP completion event.
authorHans Petter Selasky <hps@selasky.org>
Tue, 23 Aug 2016 11:39:49 +0000 (13:39 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 13 Sep 2016 07:07:18 +0000 (09:07 +0200)
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 <hps@selasky.org>
[ kraxel: codestyle fixup ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-xhci.c

index 188f95416ac4bacc0b0632f92ce3b76f99288e98..37c14938a7afcac9de249f1025b8cdb78badefc0 100644 (file)
@@ -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: