Bluetooth: Fix adding discoverable to adv instance flags
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 9 Mar 2016 15:30:33 +0000 (17:30 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 10 Mar 2016 18:51:29 +0000 (19:51 +0100)
When lookup up the advertising instance flags for the default
advertising instance (0) the discoverable flag should be filled in
based on the HCI_DISCOVERABLE flag.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_request.c

index c78ee2dc93237475eb002ae61a737e0137c387f9..77be344efd18190b612953d44381adbbf5d78b01 100644 (file)
@@ -866,6 +866,9 @@ static u32 get_adv_instance_flags(struct hci_dev *hdev, u8 instance)
                if (hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE))
                        flags |= MGMT_ADV_FLAG_CONNECTABLE;
 
+               if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE))
+                       flags |= MGMT_ADV_FLAG_DISCOV;
+
                return flags;
        }