darwin/libusb_reset: reenumerate device if the device descriptor or any configuration...
authorNathan Hjelm <hjelmn@cs.unm.edu>
Fri, 8 Feb 2013 04:56:30 +0000 (21:56 -0700)
committerHans de Goede <hdegoede@redhat.com>
Wed, 15 May 2013 18:43:35 +0000 (20:43 +0200)
commit7598cc176c844d50dac6287b919fafca02cf5d08
treeb52f4b75af1f278cd9174d08e511be0df522812c
parentb08592edd803988b87a9079aff406e3ee637beb5
darwin/libusb_reset: reenumerate device if the device descriptor or any configuration descriptor has changed

Some background: the Linux kernel causes a device to be reenumeration when
reset if the device's descriptors have changed. Darwin does not provide
this feature but instead provides a call to force the reenumeration of
a device. This behavior is required to support the firmware update
protocol used by some devices.

This patch updates darwin_reset to check if either the device or
configuration descriptors have changed. If they have darwin_reset will
ask the OS to reenumerate the device and return LIBUSB_ERROR_NOT_FOUND
or LIBUSB_SUCCESS accordingly.

Fixes #169

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
libusb/os/darwin_usb.c
libusb/version_nano.h