1 From bcd7c845fbfbafe03e320fbffcaa32417cfd5267 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Mon, 3 Sep 2012 12:33:44 +0200
4 Subject: [PATCH] usb-core: Don't set packet state to complete on a nak
6 This way the hcd can re-use the same packet to retry without needing
9 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 (cherry picked from commit cc40997489260f405aecccd30d4626ceee862502)
13 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
15 hw/usb/core.c | 6 ++++--
16 1 file changed, 4 insertions(+), 2 deletions(-)
18 diff --git a/hw/usb/core.c b/hw/usb/core.c
19 index 2da38e7..be6d936 100644
22 @@ -399,8 +399,10 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
23 * otherwise packets can complete out of order!
25 assert(!p->ep->pipeline);
27 - usb_packet_set_state(p, USB_PACKET_COMPLETE);
28 + if (ret != USB_RET_NAK) {
30 + usb_packet_set_state(p, USB_PACKET_COMPLETE);