]> git.proxmox.com Git - qemu.git/commitdiff
usb-host: fix splitted transfers
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 15 Nov 2012 15:11:49 +0000 (16:11 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 16 Nov 2012 10:27:32 +0000 (11:27 +0100)
USBPacket->actual_length wasn't updated correctly for USBPackets
splitted into multiple urbs.  Fix it.

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

index e3d394fcef899d9d4a0b89e69a27fad4f0bba9d4..aa77b7704da29630da8ad6f082d67b22daf03262 100644 (file)
@@ -366,8 +366,11 @@ static void async_complete(void *opaque)
         if (p) {
             switch (aurb->urb.status) {
             case 0:
-                p->actual_length = aurb->urb.actual_length;
-                p->status = USB_RET_SUCCESS; /* Clear previous ASYNC status */
+                p->actual_length += aurb->urb.actual_length;
+                if (!aurb->more) {
+                    /* Clear previous ASYNC status */
+                    p->status = USB_RET_SUCCESS;
+                }
                 break;
 
             case -EPIPE: