summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Paul Sladen2009-03-29 20:14:20 +0200
committerGravatar Nikias Bassen2009-03-29 20:14:20 +0200
commite652af13edb7e47e1a0770c40448b93e93d0daa5 (patch)
treeb68e1ba0c78de8daa96b7cdf80fde0f491fd648a
parent1a8b5bb89af79bb08ccede29a36aecb3c2ca839d (diff)
downloadusbmuxd-e652af13edb7e47e1a0770c40448b93e93d0daa5.tar.gz
usbmuxd-e652af13edb7e47e1a0770c40448b93e93d0daa5.tar.bz2
Added file 85-usbmuxd.rules
Signed-off-by: Nikias Bassen <nikias@gmx.li>
-rw-r--r--85-usbmuxd.rules37
1 files changed, 37 insertions, 0 deletions
diff --git a/85-usbmuxd.rules b/85-usbmuxd.rules
new file mode 100644
index 0000000..90d49ea
--- /dev/null
+++ b/85-usbmuxd.rules
@@ -0,0 +1,37 @@
+# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd)
+#if
+#SUBSYSTEMS=="usb_interface", SYMLINK+="usbmux/interface"
+
+#SUBSYSTEMS!="usb", GOTO="usbmuxd_rules_end" # stops the whole script working
+ATTR{idVendor}!="05ac", GOTO="usbmuxd_rules_end"
+
+# If it's plug insertion, flip it into dual "PTP + Apple Mobile Device" configuration
+# This allows another application to switch it later without it getting switched back (hopefully)
+# TODO: check iPod Touch/3G
+SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="iPhone", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end"
+
+# SYMLINK the usbmux endpoints, if we get them
+# TODO: Multiple devices
+# TODO: work out how to make nice, incrementing usbmux/{0,1,2,3}-in for
+LABEL="usbmuxd_rules_usbmux"
+
+# ff/fe/02 == usbmux
+#
+#ACTION=="add",
+
+# Try to symlink the interface, containing the endpoints.
+# ...But it doesn't work
+#KERNELS=="7-3:3.1", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="01", ATTRS{bAlternateSetting}==" 0", ATTRS{bNumEndpoints}=="02", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/prettyplease", RUN+="/bin/ls -l /dev/usbmux/prettyplease"
+
+#ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/interface"
+
+# Cute names, really they should have nice numerically increasing names.
+ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/in"
+ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/out"
+
+# Start and stop 'usbmuxd' as required.
+ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --start --oknodo --background --make-pidfile --pidfile /var/run/usbmuxd.pid --exec /usr/local/sbin/usbmuxd"
+ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --stop --signal 2 --pidfile /var/run/usbmuxd.pid --exec /usr/local/sbin/usbmuxd"
+
+# skip
+LABEL="usbmuxd_rules_end"