* [PATCH] first udev rules for running hid2hci
@ 2008-10-23 20:17 Mario Limonciello
2008-10-23 20:58 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2008-10-23 20:17 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
[-- Attachment #1.1: Type: text/plain, Size: 513 bytes --]
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
--
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: hid2hci_udev.patch --]
[-- Type: text/x-patch; name="hid2hci_udev.patch", Size: 8411 bytes --]
diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/bluetooth.rules bluez-4.12.new/scripts/bluetooth.rules
--- bluez-4.12/scripts/bluetooth.rules 2008-10-07 13:28:29.000000000 -0500
+++ bluez-4.12.new/scripts/bluetooth.rules 1969-12-31 18:00:00.000000000 -0600
@@ -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"
diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/hid2hci.rules bluez-4.12.new/scripts/hid2hci.rules
--- bluez-4.12/scripts/hid2hci.rules 1969-12-31 18:00:00.000000000 -0600
+++ bluez-4.12.new/scripts/hid2hci.rules 2008-10-23 15:09:14.000000000 -0500
@@ -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"
diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/Makefile.am bluez-4.12.new/scripts/Makefile.am
--- bluez-4.12/scripts/Makefile.am 2008-10-07 13:28:29.000000000 -0500
+++ bluez-4.12.new/scripts/Makefile.am 2008-10-23 15:11:15.000000000 -0500
@@ -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
diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/Makefile.in bluez-4.12.new/scripts/Makefile.in
--- bluez-4.12/scripts/Makefile.in 2008-10-07 13:28:29.000000000 -0500
+++ bluez-4.12.new/scripts/Makefile.in 2008-10-23 15:13:03.000000000 -0500
@@ -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:
diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/pcmcia.rules bluez-4.12.new/scripts/pcmcia.rules
--- bluez-4.12/scripts/pcmcia.rules 1969-12-31 18:00:00.000000000 -0600
+++ bluez-4.12.new/scripts/pcmcia.rules 2008-10-23 15:09:14.000000000 -0500
@@ -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"
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] first udev rules for running hid2hci
2008-10-23 20:17 [PATCH] first udev rules for running hid2hci Mario Limonciello
@ 2008-10-23 20:58 ` Marcel Holtmann
2008-10-23 21:05 ` Mario Limonciello
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2008-10-23 20:58 UTC (permalink / raw)
To: Mario Limonciello; +Cc: linux-bluetooth@vger.kernel.org
Hi Mario,
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] first udev rules for running hid2hci
2008-10-23 20:58 ` Marcel Holtmann
@ 2008-10-23 21:05 ` Mario Limonciello
0 siblings, 0 replies; 3+ messages in thread
From: Mario Limonciello @ 2008-10-23 21:05 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org
[-- Attachment #1.1: Type: text/plain, Size: 886 bytes --]
Marcel Holtmann wrote:
> 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.
>
> 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
--
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com
[-- Attachment #1.2: Type: text/html, Size: 1678 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-23 21:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-23 20:17 [PATCH] first udev rules for running hid2hci Mario Limonciello
2008-10-23 20:58 ` Marcel Holtmann
2008-10-23 21:05 ` Mario Limonciello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox