first udev rules for running hid2hci
Subsystems (2)
PATCH 1/1 first udev rules for running hid2hci
Hi:
Attached is a patch that adds another set of udev rules that will run hid2hci, at least for the Dell BT adapters. Other adapters can get added in too, but I think some more attributes will be needed for them. I'm doing this as a separate set of udev rules than the PCMCIA rules so that these can be installed by default whereas the PCMCIA ones are normally placed in a different binary package for distros.
Regards
Signature · 3 lines
Mario Limonciello *Dell | Linux Engineering* [email protected]
scripts/bluetooth.rules +0 -35
@@ -1,35 +0,0 @@ -# Brain Boxes BL-620 Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Brain Boxes", SYSFS{prod_id2}=="Bluetooth PC Card", ENV{HCIOPTS}="bboxes", RUN+="bluetooth_serial" - -# Xircom CreditCard Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" - -# Xircom RealPort2 Bluetooth Adapter -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" - -# IBM Bluetooth PC Card II -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="IBM", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" - -# TDK Bluetooth PC Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="TDK", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" - -# AmbiCom BT2000C Bluetooth PC/CF Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="AmbiCom BT2000C", SYSFS{prod_id2}=="Bluetooth PC/CF Card", ENV{HCIOPTS}="bt2000c", RUN+="bluetooth_serial" - -# COM One Platinium Bluetooth PC Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="COM1 SA", SYSFS{prod_id2}=="MC310 CARD", ENV{HCIOPTS}="comone", RUN+="bluetooth_serial" - -# Sphinx PICO Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="SPHINX", SYSFS{prod_id2}=="BT-CARD", ENV{HCIOPTS}="picocard", RUN+="bluetooth_serial" - -# H-Soft blue+Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="H-Soft", SYSFS{prod_id2}=="Blue+CARD", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" - -# Compaq iPAQ Bluetooth Sleeve, Belkin F8T020, any other muppet who used an OXCF950 and didn't bother to program it appropriately. -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="CF CARD", SYSFS{prod_id2}=="GENERIC", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" - -# Zoom Bluetooth Card and Sitecom CN-504 Card -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="PCMCIA", SYSFS{prod_id2}=="Bluetooth Card", ENV{HCIOPTS}="zoom", RUN+="bluetooth_serial" - -# CC&C BT0100M -SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Bluetooth BT0100M", ENV{HCIOPTS}="bcsp 115200", RUN+="bluetooth_serial"
scripts/hid2hci.rules +8 -0
@@ -0,0 +1,8 @@ +#UDEV Rules to match on Bluetooth USB dongles that need to be switched to HCI mode upon +#being plugged into the PC's USB bus. + +#This rule covers a variety of Dell Bluetooth adapters +# it looks like a bit of an odd rule, because it is matching +# on a mouse device that is self powered, but that is where +# a HID report needs to be sent to switch modes. +ACTION=="add", SYSFS{idVendor}=="413c", ATTRS{bInterfaceProtocol}=="02", ATTRS{bmAttributes}=="e0", RUN+="/usr/sbin/hid2hci --tohci"
scripts/Makefile.am +8 -2
@@ -2,14 +2,14 @@ if PCMCIARULES rulesdir = $(sysconfdir)/udev -rules_DATA = bluetooth.rules +rules_DATA = pcmcia.rules udevdir = $(libexecdir)/udev udev_SCRIPTS = bluetooth_serial endif -EXTRA_DIST = bluetooth.rules bluetooth_serial bluetooth.init bluetooth.default +EXTRA_DIST = pcmcia.rules bluetooth_serial bluetooth.init bluetooth.default hid2hci.rules MAINTAINERCLEANFILES = Makefile.in
@@ -24,3 +24,9 @@ @rm -f $(DESTDIR)$(sysconfdir)/init.d/bluetooth @rm -f $(DESTDIR)$(sysconfdir)/default/bluetooth endif + +install-data-pm: + $(INSTALL) -D -m 644 $(srcdir)/hid2hci.rules $(DESTDIR)$(rulesdir)/rules.d/62-bluez-hid2hci.rules + +uninstall-pm: + @rm -f $(DESTDIR)$(rulesdir)/rules.d/62-bluez-hid2hci.rules
scripts/Makefile.in +9 -3
@@ -189,10 +189,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @PCMCIARULES_TRUE@rulesdir = $(sysconfdir)/udev -@PCMCIARULES_TRUE@rules_DATA = bluetooth.rules +@PCMCIARULES_TRUE@rules_DATA = pcmcia.rules @PCMCIARULES_TRUE@udevdir = $(libexecdir)/udev @PCMCIARULES_TRUE@udev_SCRIPTS = bluetooth_serial -EXTRA_DIST = bluetooth.rules bluetooth_serial bluetooth.init bluetooth.default +EXTRA_DIST = pcmcia.rules bluetooth_serial bluetooth.init bluetooth.default hid2hci.rules MAINTAINERCLEANFILES = Makefile.in all: all-am
@@ -354,7 +354,7 @@ info-am: install-data-am: install-data-local install-rulesDATA \ - install-udevSCRIPTS + install-udevSCRIPTS install-data-pm install-dvi: install-dvi-am
@@ -416,6 +416,12 @@ @INITSCRIPTS_TRUE@uninstall-local: @INITSCRIPTS_TRUE@ @rm -f $(DESTDIR)$(sysconfdir)/init.d/bluetooth @INITSCRIPTS_TRUE@ @rm -f $(DESTDIR)$(sysconfdir)/default/bluetooth + +install-data-pm: + $(INSTALL) -D -m 644 $(srcdir)/hid2hci.rules $(DESTDIR)$(rulesdir)/rules.d/62-bluez-hid2hci.rules + +uninstall-local: + @rm -f $(DESTDIR)$(rulesdir)/rules.d/62-bluez-hid2hci.rules # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
scripts/pcmcia.rules +35 -0
@@ -0,0 +1,35 @@ +# Brain Boxes BL-620 Bluetooth Adapter +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Brain Boxes", SYSFS{prod_id2}=="Bluetooth PC Card", ENV{HCIOPTS}="bboxes", RUN+="bluetooth_serial" + +# Xircom CreditCard Bluetooth Adapter +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" + +# Xircom RealPort2 Bluetooth Adapter +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Xircom", SYSFS{prod_id3}=="CBT", ENV{HCIOPTS}="xircom", RUN+="bluetooth_serial" + +# IBM Bluetooth PC Card II +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="IBM", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" + +# TDK Bluetooth PC Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="TDK", SYSFS{prod_id2}=="Bluetooth PC Card II", ENV{HCIOPTS}="tdk", RUN+="bluetooth_serial" + +# AmbiCom BT2000C Bluetooth PC/CF Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="AmbiCom BT2000C", SYSFS{prod_id2}=="Bluetooth PC/CF Card", ENV{HCIOPTS}="bt2000c", RUN+="bluetooth_serial" + +# COM One Platinium Bluetooth PC Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="COM1 SA", SYSFS{prod_id2}=="MC310 CARD", ENV{HCIOPTS}="comone", RUN+="bluetooth_serial" + +# Sphinx PICO Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="SPHINX", SYSFS{prod_id2}=="BT-CARD", ENV{HCIOPTS}="picocard", RUN+="bluetooth_serial" + +# H-Soft blue+Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="H-Soft", SYSFS{prod_id2}=="Blue+CARD", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" + +# Compaq iPAQ Bluetooth Sleeve, Belkin F8T020, any other muppet who used an OXCF950 and didn't bother to program it appropriately. +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="CF CARD", SYSFS{prod_id2}=="GENERIC", ENV{HCIOPTS}="$sysfs{manf_id},$sysfs{card_id}", RUN+="bluetooth_serial" + +# Zoom Bluetooth Card and Sitecom CN-504 Card +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="PCMCIA", SYSFS{prod_id2}=="Bluetooth Card", ENV{HCIOPTS}="zoom", RUN+="bluetooth_serial" + +# CC&C BT0100M +SUBSYSTEM=="tty", BUS=="pcmcia", SYSFS{prod_id1}=="Bluetooth BT0100M", ENV{HCIOPTS}="bcsp 115200", RUN+="bluetooth_serial"
Marcel Holtmann
maintainerHi Mario,
Quoted 6 lines
Attached is a patch that adds another set of udev rules that will run hid2hci, at least for the Dell BT adapters. Other adapters can get added in too, but I think some more attributes will be needed for them. I'm doing this as a separate set of udev rules than the PCMCIA rules so that these can be installed by default whereas the PCMCIA ones are normally placed in a different binary package for distros.
I like to have this all in one and that the PCMCIA ones are in a different binary package is a distro problem. They don't have to be since we don't have the dependency of pcmcia-cs anymore. That is ancient 2.4 stuff.
If you are doing this, then also please modify hid2hci so it can take a parameter to select the device you run it for. Currently it would switch all of them. Even if you trigger it for only one.
And I was actually more thinking to convert hid2hci into a bluetoothd plugin so the core daemon has control over it. Think about it.
Regards
Marcel
Quoted 13 lines · Marcel Holtmann
Hi Mario,
I like to have this all in one and that the PCMCIA ones are in a different binary package is a distro problem. They don't have to be since we don't have the dependency of pcmcia-cs anymore. That is ancient 2.4 stuff.
If you are doing this, then also please modify hid2hci so it can take a parameter to select the device you run it for. Currently it would switch all of them. Even if you trigger it for only one.
Quoted 9 lines
And I was actually more thinking to convert hid2hci into a bluetoothd plugin so the core daemon has control over it. Think about it.
Regards
Marcel
Hi Marcel:
That's about the response that I was expecting/thinking. I'll look into modifying hid2hci to take parameters.
Regards
Signature · 3 lines
Mario Limonciello *Dell | Linux Engineering* [email protected]