--- a/debian/bluez.install +++ b/debian/bluez.install @@ -18,6 +18,7 @@ usr/bin/rfcomm lib/udev/hid2hci lib/udev/rules.d/97-bluetooth-hid2hci.rules +lib/udev/rules.d/97-bluetooth-bccmd.rules lib/systemd # usr/share/dbus-1 usr/share/man/man1/sdptool.1 --- /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" --- a/Makefile.am +++ b/Makefile.am @@ -406,6 +406,10 @@ udev_files += scripts/bluetooth-hid2hci.rules endif +if BCCMD +udev_files += scripts/bluetooth-bccmd.rules +endif + if PCMCIA udevdir = @UDEV_DIR@ --- a/Makefile.in +++ b/Makefile.in @@ -206,6 +206,7 @@ @DUND_TRUE@am__append_78 = compat/dund.1 @DUND_FALSE@am__append_79 = compat/dund.1 @DATAFILES_TRUE@@HID2HCI_TRUE@am__append_80 = scripts/bluetooth-hid2hci.rules +@DATAFILES_TRUE@@HID2HCI_TRUE@am__append_84 = scripts/bluetooth-bccmd.rules @DATAFILES_TRUE@@PCMCIA_TRUE@am__append_81 = scripts/bluetooth-serial.rules @MCAP_TRUE@am__append_82 = -I$(builddir)/health @TEST_TRUE@am__append_83 = $(unit_test_eir_OBJECTS) @@ -1392,7 +1393,7 @@ @DUND_TRUE@compat_dund_LDADD = lib/libbluetooth-private.la @DATAFILES_TRUE@rulesdir = @UDEV_DIR@/rules.d @DATAFILES_TRUE@udev_files = scripts/bluetooth.rules $(am__append_80) \ -@DATAFILES_TRUE@ $(am__append_81) +@DATAFILES_TRUE@ $(am__append_84) $(am__append_81) @DATAFILES_TRUE@@PCMCIA_TRUE@dist_udev_SCRIPTS = scripts/bluetooth_serial @DATAFILES_TRUE@rules_DATA = $(foreach file,$(udev_files), scripts/97-$(notdir $(file))) AM_YFLAGS = -d --- a/debian/bluez.postinst +++ b/debian/bluez.postinst @@ -28,6 +28,7 @@ #reload udev rules if [ -x /etc/init.d/udev ]; then invoke-rc.d udev reload || true + udevadm trigger --action=add --subsystem-match=bluetooth fi ;;