peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

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

5544c1
From bcd7c845fbfbafe03e320fbffcaa32417cfd5267 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
5544c1
Subject: [PATCH] usb-core: Don't set packet state to complete on a 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>
5544c1
(cherry picked from commit cc40997489260f405aecccd30d4626ceee862502)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.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
-- 
5544c1
1.7.12.1
c8dfc6