--- scripts/bluetooth-hid2hci.rules	2009-05-19 10:04:10.000000000 +0100
+++ scripts/bluetooth-hid2hci.rules	2009-05-19 10:04:10.000000000 +0100
@@ -1,3 +1,6 @@
+ACTION!="add", GOTO="hid2hci_end"
+SUBSYSTEM!="usb", GOTO="hid2hci_end"
+
 # Variety of Dell Bluetooth devices
 #
 # it looks like a bit of an odd rule, because it is matching
@@ -8,29 +11,36 @@
 #   413c:8154
 #   413c:8158
 #   413c:8162
-ACTION=="add", ENV{ID_VENDOR}=="413c", ENV{ID_CLASS}=="mouse", ATTRS{bmAttributes}=="e0", KERNEL=="mouse*", RUN+="/usr/sbin/hid2hci --method dell -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
+ATTR{idVendor}=="413c", ATTR{ID_CLASS}=="mouse", ATTR{bmAttributes}=="e0", KERNEL=="mouse*", RUN+="/lib/udev/bluez --method dell -v $attr{idVendor} -p $attr{idProduct} --mode hci"
 
 # Logitech devices
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c703" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c704" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c705" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70a" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70b" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70c" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c70e" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c713" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c714" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c71b" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="046d", ENV{ID_MODEL}=="c71c" RUN+="/usr/sbin/hid2hci --method logitech -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
+ATTR{idVendor}!="046d", GOTO="hid2hci_logitech_end"
+
+ATTR{idProduct}=="c703" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c704" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c705" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c70a" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c70b" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c70c" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c70e" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c713" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c714" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c71b" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idProduct}=="c71c" RUN+="/lib/udev/bluez --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+
+LABEL="hid2hci_logitech_end"
+
 
 # CSR devices (in HID mode)
-ACTION=="add", ENV{ID_VENDOR}=="0a12", ENV{ID_MODEL}=="1000" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="0458", ENV{ID_MODEL}=="1000" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
-ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="1000" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
+ATTR{idVendor}=="0a12", ATTR{idProduct}=="1000" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idVendor}=="0458", ATTR{idProduct}=="1000" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{idVendor}=="05ac", ATTR{idProduct}=="1000" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
 
 # CSR devices (in HCI mode)
-#ACTION=="add", ENV{ID_VENDOR}=="0a12", ENV{ID_MODEL}=="0001" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="0458", ENV{ID_MODEL}=="003f" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="8203" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="8204" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
-#ACTION=="add", ENV{ID_VENDOR}=="05ac", ENV{ID_MODEL}=="8207" RUN+="/usr/sbin/hid2hci --method csr -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hid"
+#ATTR{idVendor}=="0a12", ATTR{idProduct}=="0001" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hid"
+#ATTR{idVendor}=="0458", ATTR{idProduct}=="003f" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hid"
+#ATTR{idVendor}=="05ac", ATTR{idProduct}=="8203" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hid"
+#ATTR{idVendor}=="05ac", ATTR{idProduct}=="8204" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hid"
+#ATTR{idVendor}=="05ac", ATTR{idProduct}=="8207" RUN+="/lib/udev/bluez --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hid"
+
+LABEL="hid2hci_end"
