dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

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

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