From: Mario Limonciello <mario_limonciello@dell.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: [PATCH] first udev rules for running hid2hci
Date: Thu, 23 Oct 2008 15:17:20 -0500 [thread overview]
Message-ID: <4900DBD0.3040108@dell.com> (raw)
[-- 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 --]
next reply other threads:[~2008-10-23 20:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-23 20:17 Mario Limonciello [this message]
2008-10-23 20:58 ` [PATCH] first udev rules for running hid2hci Marcel Holtmann
2008-10-23 21:05 ` Mario Limonciello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4900DBD0.3040108@dell.com \
--to=mario_limonciello@dell.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox