[Spice-devel,SPICE-GTK,Win,USB] win-usb-dev: ignore devices with addr 1 for LIBUSBX_API_VERSION

Submitted by Uri Lublin on Aug. 15, 2013, 3:44 p.m.

Details

Message ID 1376581440-15900-1-git-send-email-uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin Aug. 15, 2013, 3:44 p.m.
Starting libusbx version 1.0.13 (commit 8cd30bb7066f785ee78cf6c3dccafdbc4b957b50)
windows device enumeration changed and root hubs address number is 1 intead
of 0xff.

This patch uses LIBUSBX_API_VERSION which was introduced after 1.0.13 release
(commit 9d368fc4774344d81ab02840f3a8478301bfb6fa).
---
 gtk/win-usb-dev.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/gtk/win-usb-dev.c b/gtk/win-usb-dev.c
index 9c95ac4..0f57e40 100644
--- a/gtk/win-usb-dev.c
+++ b/gtk/win-usb-dev.c
@@ -534,6 +534,9 @@  static gboolean g_udev_skip_search(GUdevDevice *udev)
     g_return_val_if_fail(udevinfo != NULL, FALSE);

     skip = ((udevinfo->addr == 0xff) ||  /* root hub (HCD) */
+#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x010000FF)
+            (udevinfo->addr == 1) || /* root hub addr for libusbx >= 1.0.13 */
+#endif
             (udevinfo->class == LIBUSB_CLASS_HUB) || /* hub*/
             (udevinfo->addr == 0)); /* bad address */
     return skip;

Comments

ACK.

On 08/15/2013 05:44 PM, Uri Lublin wrote:
> Starting libusbx version 1.0.13 (commit 8cd30bb7066f785ee78cf6c3dccafdbc4b957b50)
> windows device enumeration changed and root hubs address number is 1 intead
> of 0xff.
>
> This patch uses LIBUSBX_API_VERSION which was introduced after 1.0.13 release
> (commit 9d368fc4774344d81ab02840f3a8478301bfb6fa).
> ---
>   gtk/win-usb-dev.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/gtk/win-usb-dev.c b/gtk/win-usb-dev.c
> index 9c95ac4..0f57e40 100644
> --- a/gtk/win-usb-dev.c
> +++ b/gtk/win-usb-dev.c
> @@ -534,6 +534,9 @@ static gboolean g_udev_skip_search(GUdevDevice *udev)
>       g_return_val_if_fail(udevinfo != NULL, FALSE);
>
>       skip = ((udevinfo->addr == 0xff) ||  /* root hub (HCD) */
> +#if defined(LIBUSBX_API_VERSION) && (LIBUSBX_API_VERSION >= 0x010000FF)
> +            (udevinfo->addr == 1) || /* root hub addr for libusbx >= 1.0.13 */
> +#endif
>               (udevinfo->class == LIBUSB_CLASS_HUB) || /* hub*/
>               (udevinfo->addr == 0)); /* bad address */
>       return skip;
>