Skip to content

usb: Register the hotplug callback for any USB device class - #284

Open
niconistal wants to merge 1 commit into
libimobiledevice:masterfrom
niconistal:hotplug-any-device-class
Open

niconistal wants to merge 1 commit into
libimobiledevice:masterfrom
niconistal:hotplug-any-device-class

Conversation

@niconistal

Copy link
Copy Markdown

usb_init() registers the libusb hotplug callback with dev_class 0, so only devices whose descriptor announces device class 0 produce arrival and departure events. An Apple device that reports another class is never seen by the hotplug path.

One such device is the Apple T1 coprocessor (iBridge1,1, 05ac:8600, or 05ac:1281 in recovery) in the 2016 and 2017 Touch Bar MacBook Pros. It re-enumerates several times during an EmbeddedOS restore driven through usbmuxd and idevicerestore, and each re-enumeration was missed.

This matches LIBUSB_HOTPLUG_MATCH_ANY for the device class, as is already done for the product id. The callback itself still filters on the Apple vendor id, so nothing outside 05ac is affected.

Testing. Used in a Linux-only T1 EmbeddedOS restore on a MacBookPro14,3 (t1-revive, which carries this as its only usbmuxd change): with it, usbmuxd follows the T1 through every reset of the restore; without it the daemon never sees the device come back. Normal iPhone operation unchanged in my use.

One line, offered under the project's existing GPL-2.0-only OR GPL-3.0-only terms.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant