Return-Path: From: Eric Miao To: linux-bluetooth@vger.kernel.org Cc: Eric Miao Subject: [PATCH] Add udev rule for Ralink WiFi+BT module w/ bccmd Date: Mon, 19 Mar 2012 12:41:43 +0800 Message-Id: <1332132103-23374-1-git-send-email-eric.miao@canonical.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: 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 --- .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