summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hector Martin2021-09-25 01:29:07 +0900
committerGravatar Hector Martin2021-09-25 01:29:07 +0900
commite3a3180b9b380ce9092ee0d7b8e9d82d66b1c261 (patch)
tree58c51db870cadca3c43b4844d57b3fd56c0cff36
parentf0ca69d9b1f488e4eca7e1095190ededc76f3507 (diff)
downloadusbmuxd-e3a3180b9b380ce9092ee0d7b8e9d82d66b1c261.tar.gz
usbmuxd-e3a3180b9b380ce9092ee0d7b8e9d82d66b1c261.tar.bz2
usb: Add more Apple Silicon retstore PIDs
1904 is the M1 iMac; presumably this is now a range Signed-off-by: Hector Martin <marcan@marcan.st>
-rw-r--r--src/usb.c3
-rw-r--r--src/usb.h3
-rw-r--r--udev/39-usbmuxd.rules.in8
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)
383 if(devdesc.idVendor != VID_APPLE) 383 if(devdesc.idVendor != VID_APPLE)
384 return -1; 384 return -1;
385 if((devdesc.idProduct != PID_APPLE_T2_COPROCESSOR) && 385 if((devdesc.idProduct != PID_APPLE_T2_COPROCESSOR) &&
386 (devdesc.idProduct != PID_APPLE_SILICON_RESTORE) && 386 ((devdesc.idProduct < PID_APPLE_SILICON_RESTORE_LOW) ||
387 (devdesc.idProduct > PID_APPLE_SILICON_RESTORE_MAX)) &&
387 ((devdesc.idProduct < PID_RANGE_LOW) || 388 ((devdesc.idProduct < PID_RANGE_LOW) ||
388 (devdesc.idProduct > PID_RANGE_MAX))) 389 (devdesc.idProduct > PID_RANGE_MAX)))
389 return -1; 390 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 @@
47#define PID_RANGE_LOW 0x1290 47#define PID_RANGE_LOW 0x1290
48#define PID_RANGE_MAX 0x12af 48#define PID_RANGE_MAX 0x12af
49#define PID_APPLE_T2_COPROCESSOR 0x8600 49#define PID_APPLE_T2_COPROCESSOR 0x8600
50#define PID_APPLE_SILICON_RESTORE 0x1901 50#define PID_APPLE_SILICON_RESTORE_LOW 0x1901
51#define PID_APPLE_SILICON_RESTORE_MAX 0x1904
51 52
52struct usb_device; 53struct usb_device;
53 54
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 @@
1# usbmuxd (Apple Mobile Device Muxer listening on /var/run/usbmuxd) 1# usbmuxd (Apple Mobile Device Muxer listening on /var/run/usbmuxd)
2 2
3# systemd should receive all events relating to device 3# systemd should receive all events relating to device
4SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/1901/*|5ac/8600/*", TAG+="systemd" 4SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/190[1-4]/*|5ac/8600/*", TAG+="systemd"
5 5
6# Initialize iOS devices into "deactivated" USB configuration state and activate usbmuxd 6# Initialize iOS devices into "deactivated" USB configuration state and activate usbmuxd
7SUBSYSTEM=="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@ 7SUBSYSTEM=="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@
8 8
9# Make sure properties don't get lost when bind action is called 9# Make sure properties don't get lost when bind action is called
10SUBSYSTEM=="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@ 10SUBSYSTEM=="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@
11 11
12# Exit usbmuxd when the last device is removed 12# Exit usbmuxd when the last device is removed
13SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*|5ac/1901/*|5ac/8600/*", ACTION=="remove", RUN+="@sbindir@/usbmuxd -x" 13SUBSYSTEM=="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"