]> git.proxmox.com Git - qemu.git/commitdiff
xhci: Add support for packets with both data and an error status
authorHans de Goede <hdegoede@redhat.com>
Thu, 1 Nov 2012 16:15:05 +0000 (17:15 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 8 Nov 2012 17:41:47 +0000 (18:41 +0100)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-xhci.c

index d4a2e0c3ec358de067223c9775e1d809aae0caa7..a181d459100bdf7a0641a2f578ef9781670f5de0 100644 (file)
@@ -1388,7 +1388,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];
@@ -1416,7 +1416,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;