summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--daemon/usb-linux.c7
-rw-r--r--daemon/usb.h7
-rw-r--r--udev/85-usbmuxd.rules.in4
3 files changed, 6 insertions, 12 deletions
diff --git a/daemon/usb-linux.c b/daemon/usb-linux.c
index 6f25ed4..f1be612 100644
--- a/daemon/usb-linux.c
+++ b/daemon/usb-linux.c
@@ -274,11 +274,8 @@ static int usb_discover(void)
}
if(devdesc.idVendor != VID_APPLE)
continue;
- if( (devdesc.idProduct != PID_IPHONE2G) &&
- (devdesc.idProduct != PID_ITOUCH1G) &&
- (devdesc.idProduct != PID_IPHONE3G) &&
- (devdesc.idProduct != PID_ITOUCH2G) &&
- (devdesc.idProduct != PID_IPHONE3GS))
+ if((devdesc.idProduct < PID_RANGE_LOW) &&
+ (devdesc.idProduct > PID_RANGE_MAX))
continue;
libusb_device_handle *handle;
usbmuxd_log(LL_INFO, "Found new device with v/p %04x:%04x at %d-%d", devdesc.idVendor, devdesc.idProduct, bus, address);
diff --git a/daemon/usb.h b/daemon/usb.h
index 621ccb2..7e20dce 100644
--- a/daemon/usb.h
+++ b/daemon/usb.h
@@ -42,11 +42,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define USB_PACKET_SIZE 512
#define VID_APPLE 0x5ac
-#define PID_IPHONE2G 0x1290
-#define PID_ITOUCH1G 0x1291
-#define PID_IPHONE3G 0x1292
-#define PID_ITOUCH2G 0x1293
-#define PID_IPHONE3GS 0x1294
+#define PID_RANGE_LOW 0x1290
+#define PID_RANGE_MAX 0x1299
#define USB_INTERFACE 1
diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in
index 3521ccb..f68a5fa 100644
--- a/udev/85-usbmuxd.rules.in
+++ b/udev/85-usbmuxd.rules.in
@@ -1,7 +1,7 @@
# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd)
# Forces iPhone 1.0, 3G, 3GS and iPodTouch 1 and 2 to USB configuration 3 and run usbmuxd
-ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-4]", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -u -U"
+ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9]", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -u -U"
# Exit usbmuxd when the last phone is removed
-ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[0-4]/*", ENV{INTERFACE}=="255/*", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -x"
+ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[0-9]/*", ENV{INTERFACE}=="255/*", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -x"