From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrTRP-0003mT-NL for qemu-devel@nongnu.org; Mon, 02 Jun 2014 10:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrTRG-0002KY-Rt for qemu-devel@nongnu.org; Mon, 02 Jun 2014 10:42:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrTRG-0002K0-KY for qemu-devel@nongnu.org; Mon, 02 Jun 2014 10:42:14 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s52EgEKK002240 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 2 Jun 2014 10:42:14 -0400 From: Gerd Hoffmann Date: Mon, 2 Jun 2014 16:42:03 +0200 Message-Id: <1401720127-32546-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1401720127-32546-1-git-send-email-kraxel@redhat.com> References: <1401720127-32546-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 07/10] usb-host: add HAVE_STREAMS define List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann --- hw/usb/host-libusb.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index e465028..afbf156 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -147,6 +147,10 @@ static void usb_host_attach_kernel(USBHostDevice *s); #define BULK_TIMEOUT 0 /* unlimited */ #define INTR_TIMEOUT 0 /* unlimited */ +#if LIBUSBX_API_VERSION >= 0x01000103 +# define HAVE_STREAMS 1 +#endif + static const char *speed_name[] = { [LIBUSB_SPEED_UNKNOWN] = "?", [LIBUSB_SPEED_LOW] = "1.5", @@ -686,7 +690,7 @@ static void usb_host_speed_compat(USBHostDevice *s) struct libusb_config_descriptor *conf; const struct libusb_interface_descriptor *intf; const struct libusb_endpoint_descriptor *endp; -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifdef HAVE_STREAMS struct libusb_ss_endpoint_companion_descriptor *endp_ss_comp; #endif bool compat_high = true; @@ -711,7 +715,7 @@ static void usb_host_speed_compat(USBHostDevice *s) compat_high = false; break; case 0x02: /* BULK */ -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifdef HAVE_STREAMS rc = libusb_get_ss_endpoint_companion_descriptor (ctx, endp, &endp_ss_comp); if (rc == LIBUSB_SUCCESS) { @@ -761,7 +765,7 @@ static void usb_host_ep_update(USBHostDevice *s) struct libusb_config_descriptor *conf; const struct libusb_interface_descriptor *intf; const struct libusb_endpoint_descriptor *endp; -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifdef HAVE_STREAMS struct libusb_ss_endpoint_companion_descriptor *endp_ss_comp; #endif uint8_t devep, type; @@ -809,7 +813,7 @@ static void usb_host_ep_update(USBHostDevice *s) usb_ep_set_type(udev, pid, ep, type); usb_ep_set_ifnum(udev, pid, ep, i); usb_ep_set_halted(udev, pid, ep, 0); -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifdef HAVE_STREAMS if (type == LIBUSB_TRANSFER_TYPE_BULK && libusb_get_ss_endpoint_companion_descriptor(ctx, endp, &endp_ss_comp) == LIBUSB_SUCCESS) { @@ -1261,7 +1265,7 @@ static void usb_host_handle_data(USBDevice *udev, USBPacket *p) } ep = p->ep->nr | (r->in ? USB_DIR_IN : 0); if (p->stream) { -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifdef HAVE_STREAMS libusb_fill_bulk_stream_transfer(r->xfer, s->dh, ep, p->stream, r->buffer, size, usb_host_req_complete_data, r, @@ -1342,7 +1346,7 @@ static void usb_host_handle_reset(USBDevice *udev) static int usb_host_alloc_streams(USBDevice *udev, USBEndpoint **eps, int nr_eps, int streams) { -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifdef HAVE_STREAMS USBHostDevice *s = USB_HOST_DEVICE(udev); unsigned char endpoints[30]; int i, rc; @@ -1372,7 +1376,7 @@ static int usb_host_alloc_streams(USBDevice *udev, USBEndpoint **eps, static void usb_host_free_streams(USBDevice *udev, USBEndpoint **eps, int nr_eps) { -#if LIBUSBX_API_VERSION >= 0x01000103 +#ifdef HAVE_STREAMS USBHostDevice *s = USB_HOST_DEVICE(udev); unsigned char endpoints[30]; int i; -- 1.8.3.1