Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Add udev rule for Ralink WiFi+BT module w/ bccmd
@ 2012-03-19  4:41 Eric Miao
  2012-03-19 17:37 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Miao @ 2012-03-19  4:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Eric Miao

Some Ralink WiFi + CSR BT module needs bluetooth radio to be
turned on explicitly with bccmd by the following command:

  bccmd psset -r 0x028c 0x0001

The HCI will be probed successfully, but due to the default
OFF state of the radio, no scan or connection can be made.
This patch adds the udev rule so that once the HCI is up,
udev will invoke bccmd with warm reset to turn on the radio.

[1] https://bugs.launchpad.net/bugs/781556
[2] https://bugs.meego.com/show_bug.cgi?id=3498
[3] http://ubuntuforums.org/showthread.php?t=1776108
[4] http://ubuntuforums.org/showthread.php?t=1703941

Signed-off-by: Eric Miao <eric.miao@canonical.com>
---
 .gitignore                    |    1 +
 Makefile.am                   |    7 ++++++-
 scripts/bluetooth-bccmd.rules |   12 ++++++++++++
 3 files changed, 19 insertions(+), 1 deletions(-)
 create mode 100644 scripts/bluetooth-bccmd.rules

diff --git a/.gitignore b/.gitignore
index 137d2e5..accff4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,6 +39,7 @@ sap/sap.c
 scripts/bluetooth.rules
 scripts/97-bluetooth.rules
 scripts/97-bluetooth-hid2hci.rules
+scripts/97-bluetooth-bccmd.rules
 
 sbc/sbcdec
 sbc/sbcenc
diff --git a/Makefile.am b/Makefile.am
index bd587eb..b0145dc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -406,6 +406,10 @@ if HID2HCI
 udev_files += scripts/bluetooth-hid2hci.rules
 endif
 
+if BCCMD
+udev_files += scripts/bluetooth-bccmd.rules
+endif
+
 if PCMCIA
 udevdir = @UDEV_DIR@
 
@@ -420,7 +424,8 @@ endif
 CLEANFILES += $(rules_DATA)
 
 EXTRA_DIST += scripts/bluetooth.rules \
-		scripts/bluetooth-hid2hci.rules scripts/bluetooth-serial.rules
+		scripts/bluetooth-hid2hci.rules scripts/bluetooth-serial.rules \
+		scripts/bluetooth-bccmd.rules
 
 EXTRA_DIST += doc/manager-api.txt \
 		doc/adapter-api.txt doc/device-api.txt \
diff --git a/scripts/bluetooth-bccmd.rules b/scripts/bluetooth-bccmd.rules
new file mode 100644
index 0000000..e654abf
--- /dev/null
+++ b/scripts/bluetooth-bccmd.rules
@@ -0,0 +1,12 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION!="add", GOTO="bccmd_end"
+SUBSYSTEM!="bluetooth", GOTO="bccmd_end"
+
+# Some bluetooth modules require special bccmd parameters to be set
+
+# Ralink RT5390 + CSR BS8510 WiFi/BT Combo cards on some HP laptops,
+# they need to explicitly turn on the radio followed by a warm reset
+SUBSYSTEM=="bluetooth", SUBSYSTEMS=="usb", ATTRS{idVendor}=="148f", ATTRS{idProduct}=="2000|1000", RUN+="/usr/sbin/bccmd -d $kernel psset -r 0x028c 0x0001"
+
+LABEL="bccmd_end"
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-20 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19  4:41 [PATCH] Add udev rule for Ralink WiFi+BT module w/ bccmd Eric Miao
2012-03-19 17:37 ` Marcel Holtmann
2012-03-20  1:55   ` Eric Miao
2012-03-20 14:36     ` Eric Miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox