Blame 0302-usb-core-Don-t-set-packet-state-to-complete-on-a-nak.patch

c8dfc6
From ae5b888748b713d018ca7b339262b32bf88ec1be Mon Sep 17 00:00:00 2001
c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Date: Mon, 3 Sep 2012 12:33:44 +0200
c8dfc6
Subject: [PATCH 302/366] usb-core: Don't set packet state to complete on a
c8dfc6
 nak
c8dfc6
c8dfc6
This way the hcd can re-use the same packet to retry without needing
c8dfc6
to re-init it.
c8dfc6
c8dfc6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
c8dfc6
---
c8dfc6
 hw/usb/core.c | 6 ++++--
c8dfc6
 1 file changed, 4 insertions(+), 2 deletions(-)
c8dfc6
c8dfc6
diff --git a/hw/usb/core.c b/hw/usb/core.c
c8dfc6
index 2da38e7..be6d936 100644
c8dfc6
--- a/hw/usb/core.c
c8dfc6
+++ b/hw/usb/core.c
c8dfc6
@@ -399,8 +399,10 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
c8dfc6
              * otherwise packets can complete out of order!
c8dfc6
              */
c8dfc6
             assert(!p->ep->pipeline);
c8dfc6
-            p->result = ret;
c8dfc6
-            usb_packet_set_state(p, USB_PACKET_COMPLETE);
c8dfc6
+            if (ret != USB_RET_NAK) {
c8dfc6
+                p->result = ret;
c8dfc6
+                usb_packet_set_state(p, USB_PACKET_COMPLETE);
c8dfc6
+            }
c8dfc6
         }
c8dfc6
     } else {
c8dfc6
         ret = USB_RET_ASYNC;
c8dfc6
-- 
c8dfc6
1.7.12
c8dfc6