summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2012-08-29 10:02:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-02 10:30:08 -0700
commitdcc8dbc21ff2052c0df6dee3e1a36c3ef4f1133c (patch)
tree6fc28055b407f59a94f9086b85269c9ea98c6b15 /net
parentf51909c0af2ebc533eaf48c7daff503b3e54d983 (diff)
downloadlinux-3.10-dcc8dbc21ff2052c0df6dee3e1a36c3ef4f1133c.tar.gz
linux-3.10-dcc8dbc21ff2052c0df6dee3e1a36c3ef4f1133c.tar.bz2
linux-3.10-dcc8dbc21ff2052c0df6dee3e1a36c3ef4f1133c.zip
Bluetooth: mgmt: Fix enabling SSP while powered off
commit 3d1cbdd6aefff711bcf389fdabc4af9bc22e8201 upstream. When new BT USB adapter is plugged in it's configured while still being powered off (HCI_AUTO_OFF flag is set), thus Set SSP will only set dev_flags but won't write changes to controller. As a result remote devices won't use Secure Simple Pairing with our device due to SSP Host Support flag disabled in extended features and may also reject SSP attempt from our side (with possible fallback to legacy pairing). This patch ensures HCI Write Simple Pairing Mode is sent when Set Powered is called to power on controller and clear HCI_AUTO_OFF flag. Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Acked-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4bb03b11112..78186b08386 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2801,6 +2801,12 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
if (scan)
hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
+ if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) {
+ u8 ssp = 1;
+
+ hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, 1, &ssp);
+ }
+
update_class(hdev);
update_name(hdev, hdev->dev_name);
update_eir(hdev);