Add hotplug support to the Darwin backend.
authorNathan Hjelm <hjelmn@me.com>
Thu, 29 Nov 2012 23:13:00 +0000 (16:13 -0700)
committerHans de Goede <hdegoede@redhat.com>
Wed, 15 May 2013 17:54:31 +0000 (19:54 +0200)
commit9b76386f3e91dbc02a3dc7d744265cf1f370b1f1
tree4a6bba8233719185f6c1dfcf423f2d9983c6df88
parent7801ff94fa6e49fe98433eccc7f2e461590a6f7c
Add hotplug support to the Darwin backend.

Hotplug events are handled by the async event thread. This thread listens for
two events: kIOTerminatedNotification, and kIOFirstMatchNotification. If
either of these events fires the thread will iterate through the appropriate
iterator and will either enumerate or call usbi_disconnect_device depending
on the event.

While adding hotplug support it was discovered that when reading from the IO
registry we need to use kCFNumberSInt32Type for the device location. Using
kCFNumberLongType would cause locations to be sign-extended and not match
what is stored for the session id. This is now fixed.

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