From e3a3180b9b380ce9092ee0d7b8e9d82d66b1c261 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sat, 25 Sep 2021 01:29:07 +0900 Subject: usb: Add more Apple Silicon retstore PIDs 1904 is the M1 iMac; presumably this is now a range Signed-off-by: Hector Martin --- src/usb.c | 3 ++- src/usb.h | 3 ++- udev/39-usbmuxd.rules.in | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/usb.c b/src/usb.c index 388b6f3..4ff2d07 100644 --- a/src/usb.c +++ b/src/usb.c @@ -383,7 +383,8 @@ static int usb_device_add(libusb_device* dev) if(devdesc.idVendor != VID_APPLE) return -1; if((devdesc.idProduct != PID_APPLE_T2_COPROCESSOR) && - (devdesc.idProduct != PID_APPLE_SILICON_RESTORE) && + ((devdesc.idProduct < PID_APPLE_SILICON_RESTORE_LOW) || + (devdesc.idProduct > PID_APPLE_SILICON_RESTORE_MAX)) && ((devdesc.idProduct < PID_RANGE_LOW) || (devdesc.idProduct > PID_RANGE_MAX))) return -1; diff --git a/src/usb.h b/src/usb.h index 80ec6fc..ee74685 100644 --- a/src/usb.h +++ b/src/usb.h @@ -47,7 +47,8 @@ #define PID_RANGE_LOW 0x1290 #define PID_RANGE_MAX 0x12af #define PID_APPLE_T2_COPROCESSOR 0x8600 -#define PID_APPLE_SILICON_RESTORE 0x1901 +#define PID_APPLE_SILICON_RESTORE_LOW 0x1901 +#define PID_APPLE_SILICON_RESTORE_MAX 0x1904 struct usb_device; diff --git a/udev/39-usbmuxd.rules.in b/udev/39-usbmuxd.rules.in index fdd6b91..ab20517 100644 --- a/udev/39-usbmuxd.rules.in +++ b/udev/39-usbmuxd.rules.in @@ -1,13 +1,13 @@ # usbmuxd (Apple Mobile Device Muxer listening on /var/run/usbmuxd) # systemd should receive all events relating to device -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/1901/*|5ac/8600/*", TAG+="systemd" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/190[1-4]/*|5ac/8600/*", TAG+="systemd" # Initialize iOS devices into "deactivated" USB configuration state and activate usbmuxd -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/1901/*|5ac/8600/*", ACTION=="add", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux", @udev_activation_rule@ +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/190[1-4]/*|5ac/8600/*", ACTION=="add", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux", @udev_activation_rule@ # Make sure properties don't get lost when bind action is called -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/1901/*|5ac/8600/*", ACTION=="bind", ENV{USBMUX_SUPPORTED}="1", OWNER="usbmux", @udev_activation_rule@ +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/190[1-4]/*|5ac/8600/*", ACTION=="bind", ENV{USBMUX_SUPPORTED}="1", OWNER="usbmux", @udev_activation_rule@ # Exit usbmuxd when the last device is removed -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/1901/*|5ac/8600/*", ACTION=="remove", RUN+="@sbindir@/usbmuxd -x" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/190[1-4]/*|5ac/8600/*", ACTION=="remove", RUN+="@sbindir@/usbmuxd -x" -- cgit v1.1-32-gdbae