diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-09-03 12:33:44 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-09-11 07:42:58 +0200 |
commit | cc40997489260f405aecccd30d4626ceee862502 (patch) | |
tree | 8704189d4872cd33f15ae7abc7cbfbe0aace4e54 /hw | |
parent | 45b339b18c660eb85af2ba25bfcaed5469660d77 (diff) | |
download | qemu-cc40997489260f405aecccd30d4626ceee862502.tar.gz qemu-cc40997489260f405aecccd30d4626ceee862502.tar.bz2 qemu-cc40997489260f405aecccd30d4626ceee862502.zip |
usb-core: Don't set packet state to complete on a nak
This way the hcd can re-use the same packet to retry without needing
to re-init it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/usb/core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/usb/core.c b/hw/usb/core.c index 2da38e7fd0..be6d936881 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -399,8 +399,10 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p) * otherwise packets can complete out of order! */ assert(!p->ep->pipeline); - p->result = ret; - usb_packet_set_state(p, USB_PACKET_COMPLETE); + if (ret != USB_RET_NAK) { + p->result = ret; + usb_packet_set_state(p, USB_PACKET_COMPLETE); + } } } else { ret = USB_RET_ASYNC; |