Blame 0319-usb-redir-Get-rid-of-async-struct-get-member.patch

c8dfc6
From 5f83bc6b7bf54271bc1e3460b2e6f790407964e0 Mon Sep 17 00:00:00 2001
c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Date: Mon, 27 Aug 2012 16:33:08 +0200
c8dfc6
Subject: [PATCH 319/366] usb-redir: Get rid of async-struct get member
c8dfc6
c8dfc6
This is a preparation patch for completely getting rid of the async-packet
c8dfc6
struct in usb-redir, instead relying on the (new) per ep queues in the
c8dfc6
qemu usb core.
c8dfc6
c8dfc6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
c8dfc6
---
c8dfc6
 hw/usb/redirect.c | 9 +++------
c8dfc6
 1 file changed, 3 insertions(+), 6 deletions(-)
c8dfc6
c8dfc6
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
c8dfc6
index 8ac8637..4121983 100644
c8dfc6
--- a/hw/usb/redirect.c
c8dfc6
+++ b/hw/usb/redirect.c
c8dfc6
@@ -1,7 +1,7 @@
c8dfc6
 /*
c8dfc6
  * USB redirector usb-guest
c8dfc6
  *
c8dfc6
- * Copyright (c) 2011 Red Hat, Inc.
c8dfc6
+ * Copyright (c) 2011-2012 Red Hat, Inc.
c8dfc6
  *
c8dfc6
  * Red Hat Authors:
c8dfc6
  * Hans de Goede <hdegoede@redhat.com>
c8dfc6
@@ -99,7 +99,6 @@ struct AsyncURB {
c8dfc6
     USBRedirDevice *dev;
c8dfc6
     USBPacket *packet;
c8dfc6
     uint32_t packet_id;
c8dfc6
-    int get;
c8dfc6
     union {
c8dfc6
         struct usb_redir_control_packet_header control_packet;
c8dfc6
         struct usb_redir_bulk_packet_header bulk_packet;
c8dfc6
@@ -682,7 +681,6 @@ static int usbredir_get_config(USBRedirDevice *dev, USBPacket *p)
c8dfc6
 
c8dfc6
     DPRINTF("get config id %u\n", aurb->packet_id);
c8dfc6
 
c8dfc6
-    aurb->get = 1;
c8dfc6
     usbredirparser_send_get_configuration(dev->parser, aurb->packet_id);
c8dfc6
     usbredirparser_do_write(dev->parser);
c8dfc6
     return USB_RET_ASYNC;
c8dfc6
@@ -731,7 +729,6 @@ static int usbredir_get_interface(USBRedirDevice *dev, USBPacket *p,
c8dfc6
     DPRINTF("get interface %d id %u\n", interface, aurb->packet_id);
c8dfc6
 
c8dfc6
     get_alt.interface = interface;
c8dfc6
-    aurb->get = 1;
c8dfc6
     usbredirparser_send_get_alt_setting(dev->parser, aurb->packet_id,
c8dfc6
                                         &get_alt);
c8dfc6
     usbredirparser_do_write(dev->parser);
c8dfc6
@@ -1253,7 +1250,7 @@ static void usbredir_configuration_status(void *priv, uint32_t id,
c8dfc6
         return;
c8dfc6
     }
c8dfc6
     if (aurb->packet) {
c8dfc6
-        if (aurb->get) {
c8dfc6
+        if (dev->dev.setup_buf[0] & USB_DIR_IN) {
c8dfc6
             dev->dev.data_buf[0] = config_status->configuration;
c8dfc6
             len = 1;
c8dfc6
         }
c8dfc6
@@ -1281,7 +1278,7 @@ static void usbredir_alt_setting_status(void *priv, uint32_t id,
c8dfc6
         return;
c8dfc6
     }
c8dfc6
     if (aurb->packet) {
c8dfc6
-        if (aurb->get) {
c8dfc6
+        if (dev->dev.setup_buf[0] & USB_DIR_IN) {
c8dfc6
             dev->dev.data_buf[0] = alt_setting_status->alt;
c8dfc6
             len = 1;
c8dfc6
         }
c8dfc6
-- 
c8dfc6
1.7.12
c8dfc6