Bluetooth: Add support for set_discoverable management command

This patch adds a set_discoverable command to the management interface
as well as the corresponding event. The command is used to control the
discoverable state of adapters.

Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
Johan Hedberg
2010-12-29 16:00:25 +02:00
committed by Gustavo F. Padovan
parent eec8d2bcc8
commit 73f22f6238
4 changed files with 158 additions and 6 deletions

View File

@@ -278,8 +278,11 @@ static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb)
clear_bit(HCI_PSCAN, &hdev->flags);
clear_bit(HCI_ISCAN, &hdev->flags);
if (param & SCAN_INQUIRY)
if (param & SCAN_INQUIRY) {
set_bit(HCI_ISCAN, &hdev->flags);
mgmt_discoverable(hdev->id, 1);
} else
mgmt_discoverable(hdev->id, 0);
if (param & SCAN_PAGE)
set_bit(HCI_PSCAN, &hdev->flags);