]> Pileus Git - ~andy/linux/commitdiff
Bluetooth: Disable fast connectable when disabling connectable
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 15 Mar 2013 22:07:10 +0000 (17:07 -0500)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 18 Mar 2013 17:02:09 +0000 (14:02 -0300)
When the connectable setting is disabled the fast connectable setting
must also be disabled. This is so that we're consistent with the
pre-requisites for enabling fast connectable, one of which is that the
connectable setting is enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/mgmt.c

index f03b10cf92e358702192b712f7f52cdc273c320a..98f6295edbecd791b777ebfca7dc0f7cbce4dda5 100644 (file)
@@ -1119,6 +1119,9 @@ static int set_connectable(struct sock *sk, struct hci_dev *hdev, void *data,
 
        hci_req_add(&req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
 
+       if (!cp->val && test_bit(HCI_FAST_CONNECTABLE, &hdev->dev_flags))
+               write_fast_connectable(&req, false);
+
        err = hci_req_run(&req, set_connectable_complete);
        if (err < 0)
                mgmt_pending_remove(cmd);