summaryrefslogtreecommitdiffstats
path: root/include/libirecovery.h
diff options
context:
space:
mode:
authorGravatar Nicolás Nistal2026-09-15 14:16:59 -0400
committerGravatar Nikias Bassen2026-11-06 22:42:35 +0800
commit3301fe7d834a485b368cd7edf20f7535d6d598b4 (patch)
treee2cf641b2051b20d74368bc76acb1e9128c793be /include/libirecovery.h
parent42f2c26463da466f42d207b9c0094df0d351d47a (diff)
downloadlibirecovery-3301fe7d834a485b368cd7edf20f7535d6d598b4.tar.gz
libirecovery-3301fe7d834a485b368cd7edf20f7535d6d598b4.tar.bz2
Make the iSerialNumber string read robust to slow or failing devicesHEADmaster
libusb_get_string_descriptor_ascii() uses a fixed 1 s timeout for the control transfer. The Apple T1 (iBridge1,1) in recovery mode answers the iSerialNumber read only intermittently and often later than that, so the read returns LIBUSB_ERROR_TIMEOUT. Losing it costs the device identity and the AP and SEP nonces, and in the hotplug add handler it meant giving up on the device: IRECV_DEVICE_ADD was never emitted and callers concluded that nothing was attached. - When the libusb helper fails, retry the descriptor read a few times with libirecovery's own USB_TIMEOUT. - On Linux, when the read still yields no iBoot string, fall back to the serial string the kernel already cached for the same bus and device number under /sys/bus/usb/devices. Used both when opening a device and in the hotplug add handler; never fatal, and a no-op on other platforms. - Only assume the legacy CPID 0x8900 when the iBoot string is non-empty but carries no CPID field. An empty string means the read failed, and claiming 0x8900 there mis-identifies every modern part. Behaviour for devices that answer the first read promptly is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'include/libirecovery.h')
0 files changed, 0 insertions, 0 deletions