From 7741349485f0741e8b2dbccd936faf487c3bdee4 Mon Sep 17 00:00:00 2001 From: Nicolás Nistal Date: Tue, 15 Sep 2026 14:16:41 -0400 Subject: usb: Register the hotplug callback for any USB device class usb_init() registered the libusb hotplug callback with dev_class 0, so only devices whose device descriptor announces class 0 produced arrival and departure events. Apple devices that report another device class were never seen by the hotplug path and only picked up by polling, if at all. One such device is the Apple T1 coprocessor (iBridge1,1, 05ac:8600 / 05ac:1281 in recovery) in the 2016 and 2017 Touch Bar MacBook Pros, which re-enumerates several times during an EmbeddedOS restore driven through usbmuxd and idevicerestore. Match LIBUSB_HOTPLUG_MATCH_ANY for the device class, as is already done for the product id; the callback itself still filters by the Apple vendor id. Co-Authored-By: Claude Fable 5.1 --- src/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb.c b/src/usb.c index 389520e..85d3854 100644 --- a/src/usb.c +++ b/src/usb.c @@ -1110,7 +1110,7 @@ int usb_init(void) #ifdef HAVE_LIBUSB_HOTPLUG_API if (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) { usbmuxd_log(LL_INFO, "Registering for libusb hotplug events"); - res = libusb_hotplug_register_callback(NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, LIBUSB_HOTPLUG_ENUMERATE, VID_APPLE, LIBUSB_HOTPLUG_MATCH_ANY, 0, usb_hotplug_cb, NULL, &usb_hotplug_cb_handle); + res = libusb_hotplug_register_callback(NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, LIBUSB_HOTPLUG_ENUMERATE, VID_APPLE, LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY, usb_hotplug_cb, NULL, &usb_hotplug_cb_handle); if (res == LIBUSB_SUCCESS) { device_polling = 0; } else { -- cgit v1.1-32-gdbae