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