peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0600-usb-redir-Convert-to-new-libusbredirparser-0.5-API.patch

5544c1
From a6400ff20f4e32eecce44931e33939cdf04e2a3e Mon Sep 17 00:00:00 2001
Hans de Goede c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
Hans de Goede c8dfc6
Date: Fri, 31 Aug 2012 13:41:38 +0200
5544c1
Subject: [PATCH] usb-redir: Convert to new libusbredirparser 0.5 API
Hans de Goede c8dfc6
Hans de Goede c8dfc6
This gives us support for 64 bit ids which is needed for using XHCI with
Hans de Goede c8dfc6
the new hcd generated ids.
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
 configure         |  2 +-
Hans de Goede c8dfc6
 hw/usb/redirect.c | 62 +++++++++++++++++++++++++++----------------------------
Hans de Goede c8dfc6
 2 files changed, 32 insertions(+), 32 deletions(-)
Hans de Goede c8dfc6
Hans de Goede c8dfc6
diff --git a/configure b/configure
5544c1
index 83c478c..2c4469f 100755
Hans de Goede c8dfc6
--- a/configure
Hans de Goede c8dfc6
+++ b/configure
5544c1
@@ -2758,7 +2758,7 @@ fi
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
 # check for usbredirparser for usb network redirection support
Hans de Goede c8dfc6
 if test "$usb_redir" != "no" ; then
Hans de Goede c8dfc6
-    if $pkg_config --atleast-version=0.3.4 libusbredirparser >/dev/null 2>&1 ; then
Hans de Goede c8dfc6
+    if $pkg_config --atleast-version=0.5 libusbredirparser >/dev/null 2>&1 ; then
Hans de Goede c8dfc6
         usb_redir="yes"
Hans de Goede c8dfc6
         usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null)
Hans de Goede c8dfc6
         usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null)
Hans de Goede c8dfc6
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
5544c1
index b7c7f1e..321f5be 100644
Hans de Goede c8dfc6
--- a/hw/usb/redirect.c
Hans de Goede c8dfc6
+++ b/hw/usb/redirect.c
Hans de Goede c8dfc6
@@ -107,27 +107,27 @@ static void usbredir_interface_info(void *priv,
Hans de Goede c8dfc6
     struct usb_redir_interface_info_header *interface_info);
Hans de Goede c8dfc6
 static void usbredir_ep_info(void *priv,
Hans de Goede c8dfc6
     struct usb_redir_ep_info_header *ep_info);
Hans de Goede c8dfc6
-static void usbredir_configuration_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_configuration_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_configuration_status_header *configuration_status);
Hans de Goede c8dfc6
-static void usbredir_alt_setting_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_alt_setting_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_alt_setting_status_header *alt_setting_status);
Hans de Goede c8dfc6
-static void usbredir_iso_stream_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_iso_stream_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_iso_stream_status_header *iso_stream_status);
Hans de Goede c8dfc6
-static void usbredir_interrupt_receiving_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_interrupt_receiving_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_interrupt_receiving_status_header
Hans de Goede c8dfc6
     *interrupt_receiving_status);
Hans de Goede c8dfc6
-static void usbredir_bulk_streams_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_bulk_streams_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_bulk_streams_status_header *bulk_streams_status);
Hans de Goede c8dfc6
-static void usbredir_control_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_control_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_control_packet_header *control_packet,
Hans de Goede c8dfc6
     uint8_t *data, int data_len);
Hans de Goede c8dfc6
-static void usbredir_bulk_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_bulk_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_bulk_packet_header *bulk_packet,
Hans de Goede c8dfc6
     uint8_t *data, int data_len);
Hans de Goede c8dfc6
-static void usbredir_iso_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_iso_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_iso_packet_header *iso_packet,
Hans de Goede c8dfc6
     uint8_t *data, int data_len);
Hans de Goede c8dfc6
-static void usbredir_interrupt_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_interrupt_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_interrupt_packet_header *interrupt_header,
Hans de Goede c8dfc6
     uint8_t *data, int data_len);
Hans de Goede c8dfc6
 
5544c1
@@ -814,6 +814,7 @@ static void usbredir_chardev_open(USBRedirDevice *dev)
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     usbredirparser_caps_set_cap(caps, usb_redir_cap_connect_device_version);
Hans de Goede c8dfc6
     usbredirparser_caps_set_cap(caps, usb_redir_cap_filter);
Hans de Goede c8dfc6
+    usbredirparser_caps_set_cap(caps, usb_redir_cap_64bits_ids);
5544c1
     usbredirparser_init(dev->parser, VERSION, caps, USB_REDIR_CAPS_SIZE, 0);
Hans de Goede c8dfc6
     usbredirparser_do_write(dev->parser);
Hans de Goede c8dfc6
 }
5544c1
@@ -1204,15 +1205,15 @@ static void usbredir_ep_info(void *priv,
Hans de Goede c8dfc6
     }
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_configuration_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_configuration_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_configuration_status_header *config_status)
Hans de Goede c8dfc6
 {
Hans de Goede c8dfc6
     USBRedirDevice *dev = priv;
Hans de Goede c8dfc6
     USBPacket *p;
Hans de Goede c8dfc6
     int len = 0;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF("set config status %d config %d id %u\n", config_status->status,
Hans de Goede c8dfc6
-            config_status->configuration, id);
Hans de Goede c8dfc6
+    DPRINTF("set config status %d config %d id %"PRIu64"\n",
Hans de Goede c8dfc6
+            config_status->status, config_status->configuration, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     p = usbredir_find_packet_by_id(dev, 0, id);
Hans de Goede c8dfc6
     if (p) {
5544c1
@@ -1225,16 +1226,15 @@ static void usbredir_configuration_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
     }
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_alt_setting_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_alt_setting_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_alt_setting_status_header *alt_setting_status)
Hans de Goede c8dfc6
 {
Hans de Goede c8dfc6
     USBRedirDevice *dev = priv;
Hans de Goede c8dfc6
     USBPacket *p;
Hans de Goede c8dfc6
     int len = 0;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF("alt status %d intf %d alt %d id: %u\n",
Hans de Goede c8dfc6
-            alt_setting_status->status,
Hans de Goede c8dfc6
-            alt_setting_status->interface,
Hans de Goede c8dfc6
+    DPRINTF("alt status %d intf %d alt %d id: %"PRIu64"\n",
Hans de Goede c8dfc6
+            alt_setting_status->status, alt_setting_status->interface,
Hans de Goede c8dfc6
             alt_setting_status->alt, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     p = usbredir_find_packet_by_id(dev, 0, id);
5544c1
@@ -1249,13 +1249,13 @@ static void usbredir_alt_setting_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
     }
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_iso_stream_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_iso_stream_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_iso_stream_status_header *iso_stream_status)
Hans de Goede c8dfc6
 {
Hans de Goede c8dfc6
     USBRedirDevice *dev = priv;
Hans de Goede c8dfc6
     uint8_t ep = iso_stream_status->endpoint;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF("iso status %d ep %02X id %u\n", iso_stream_status->status,
Hans de Goede c8dfc6
+    DPRINTF("iso status %d ep %02X id %"PRIu64"\n", iso_stream_status->status,
Hans de Goede c8dfc6
             ep, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     if (!dev->dev.attached || !dev->endpoint[EP2I(ep)].iso_started) {
5544c1
@@ -1269,14 +1269,14 @@ static void usbredir_iso_stream_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
     }
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_interrupt_receiving_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_interrupt_receiving_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_interrupt_receiving_status_header
Hans de Goede c8dfc6
     *interrupt_receiving_status)
Hans de Goede c8dfc6
 {
Hans de Goede c8dfc6
     USBRedirDevice *dev = priv;
Hans de Goede c8dfc6
     uint8_t ep = interrupt_receiving_status->endpoint;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF("interrupt recv status %d ep %02X id %u\n",
Hans de Goede c8dfc6
+    DPRINTF("interrupt recv status %d ep %02X id %"PRIu64"\n",
Hans de Goede c8dfc6
             interrupt_receiving_status->status, ep, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     if (!dev->dev.attached || !dev->endpoint[EP2I(ep)].interrupt_started) {
5544c1
@@ -1291,12 +1291,12 @@ static void usbredir_interrupt_receiving_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
     }
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_bulk_streams_status(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_bulk_streams_status(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_bulk_streams_status_header *bulk_streams_status)
Hans de Goede c8dfc6
 {
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_control_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_control_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_control_packet_header *control_packet,
Hans de Goede c8dfc6
     uint8_t *data, int data_len)
Hans de Goede c8dfc6
 {
5544c1
@@ -1304,7 +1304,7 @@ static void usbredir_control_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
     USBPacket *p;
Hans de Goede c8dfc6
     int len = control_packet->length;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF("ctrl-in status %d len %d id %u\n", control_packet->status,
Hans de Goede c8dfc6
+    DPRINTF("ctrl-in status %d len %d id %"PRIu64"\n", control_packet->status,
Hans de Goede c8dfc6
             len, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     p = usbredir_find_packet_by_id(dev, 0, id);
5544c1
@@ -1326,7 +1326,7 @@ static void usbredir_control_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
     free(data);
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_bulk_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_bulk_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_bulk_packet_header *bulk_packet,
Hans de Goede c8dfc6
     uint8_t *data, int data_len)
Hans de Goede c8dfc6
 {
5544c1
@@ -1335,8 +1335,8 @@ static void usbredir_bulk_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
     int len = bulk_packet->length;
Hans de Goede c8dfc6
     USBPacket *p;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF("bulk-in status %d ep %02X len %d id %u\n", bulk_packet->status,
Hans de Goede c8dfc6
-            ep, len, id);
Hans de Goede c8dfc6
+    DPRINTF("bulk-in status %d ep %02X len %d id %"PRIu64"\n",
Hans de Goede c8dfc6
+            bulk_packet->status, ep, len, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     p = usbredir_find_packet_by_id(dev, ep, id);
Hans de Goede c8dfc6
     if (p) {
5544c1
@@ -1357,15 +1357,15 @@ static void usbredir_bulk_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
     free(data);
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_iso_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_iso_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_iso_packet_header *iso_packet,
Hans de Goede c8dfc6
     uint8_t *data, int data_len)
Hans de Goede c8dfc6
 {
Hans de Goede c8dfc6
     USBRedirDevice *dev = priv;
Hans de Goede c8dfc6
     uint8_t ep = iso_packet->endpoint;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF2("iso-in status %d ep %02X len %d id %u\n", iso_packet->status, ep,
Hans de Goede c8dfc6
-             data_len, id);
Hans de Goede c8dfc6
+    DPRINTF2("iso-in status %d ep %02X len %d id %"PRIu64"\n",
Hans de Goede c8dfc6
+             iso_packet->status, ep, data_len, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     if (dev->endpoint[EP2I(ep)].type != USB_ENDPOINT_XFER_ISOC) {
Hans de Goede c8dfc6
         ERROR("received iso packet for non iso endpoint %02X\n", ep);
5544c1
@@ -1383,14 +1383,14 @@ static void usbredir_iso_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
     bufp_alloc(dev, data, data_len, iso_packet->status, ep);
Hans de Goede c8dfc6
 }
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-static void usbredir_interrupt_packet(void *priv, uint32_t id,
Hans de Goede c8dfc6
+static void usbredir_interrupt_packet(void *priv, uint64_t id,
Hans de Goede c8dfc6
     struct usb_redir_interrupt_packet_header *interrupt_packet,
Hans de Goede c8dfc6
     uint8_t *data, int data_len)
Hans de Goede c8dfc6
 {
Hans de Goede c8dfc6
     USBRedirDevice *dev = priv;
Hans de Goede c8dfc6
     uint8_t ep = interrupt_packet->endpoint;
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
-    DPRINTF("interrupt-in status %d ep %02X len %d id %u\n",
Hans de Goede c8dfc6
+    DPRINTF("interrupt-in status %d ep %02X len %d id %"PRIu64"\n",
Hans de Goede c8dfc6
             interrupt_packet->status, ep, data_len, id);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     if (dev->endpoint[EP2I(ep)].type != USB_ENDPOINT_XFER_INT) {
Hans de Goede c8dfc6
-- 
5544c1
1.7.12.1
Hans de Goede c8dfc6