From 51edda751fb881cdbdbacf8e54de0c8b5a3760c1 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 12 Sep 2012 13:10:26 -0300 Subject: [RHEL6 qemu-kvm PATCH 07/14] usb-redir: Get rid of async-struct get member RH-Author: Hans de Goede Message-id: <1347455431-11260-8-git-send-email-hdegoede@redhat.com> Patchwork-id: 41859 O-Subject: [RHEL-6.4 qemu-kvm PATCH 07/12] usb-redir: Get rid of async-struct get member Bugzilla: RH-Acked-by: Alon Levy RH-Acked-by: Gerd Hoffmann RH-Acked-by: Christophe Fergeau Bugzilla-related: 805172 This is a preparation patch for completely getting rid of the async-packet struct in usb-redir, instead relying on the (new) per ep queues in the qemu usb core. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann Upstream-commit: cb897117cdedd488f19985c8ec5ea05971103a27 --- usb-redir.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) Signed-off-by: Eduardo Habkost --- usb-redir.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index d0e5e6d..5e3d132 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -1,7 +1,7 @@ /* * USB redirector usb-guest * - * Copyright (c) 2011 Red Hat, Inc. + * Copyright (c) 2011-2012 Red Hat, Inc. * * Red Hat Authors: * Hans de Goede @@ -98,7 +98,6 @@ struct AsyncURB { USBRedirDevice *dev; USBPacket *packet; uint32_t packet_id; - int get; union { struct usb_redir_control_packet_header control_packet; struct usb_redir_bulk_packet_header bulk_packet; @@ -676,7 +675,6 @@ static int usbredir_get_config(USBRedirDevice *dev, USBPacket *p) DPRINTF("get config id %u\n", aurb->packet_id); - aurb->get = 1; usbredirparser_send_get_configuration(dev->parser, aurb->packet_id); usbredirparser_do_write(dev->parser); return USB_RET_ASYNC; @@ -725,7 +723,6 @@ static int usbredir_get_interface(USBRedirDevice *dev, USBPacket *p, DPRINTF("get interface %d id %u\n", interface, aurb->packet_id); get_alt.interface = interface; - aurb->get = 1; usbredirparser_send_get_alt_setting(dev->parser, aurb->packet_id, &get_alt); usbredirparser_do_write(dev->parser); @@ -1237,7 +1234,7 @@ static void usbredir_configuration_status(void *priv, uint32_t id, return; } if (aurb->packet) { - if (aurb->get) { + if (dev->dev.setup_buf[0] & USB_DIR_IN) { dev->dev.data_buf[0] = config_status->configuration; len = 1; } @@ -1265,7 +1262,7 @@ static void usbredir_alt_setting_status(void *priv, uint32_t id, return; } if (aurb->packet) { - if (aurb->get) { + if (dev->dev.setup_buf[0] & USB_DIR_IN) { dev->dev.data_buf[0] = alt_setting_status->alt; len = 1; } -- 1.7.11.4