diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2011-11-07 15:16:02 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-11-08 09:54:09 -0500 |
commit | 16ab91ab48287aa4fc757f3618820f728ee4412f (patch) | |
tree | 9266bb78e7beedfbf08160a3309349d927b5ac7f /net/bluetooth/hci_event.c | |
parent | 89352e7d3ab372ffad8efe2aa070e0b63df42b85 (diff) |
Bluetooth: Add timeout field to mgmt_set_discoverable
Based on the revised mgmt API set_discoverable has a timeout parameter
to specify how long the adapter will remain discoverable. A value of 0
means "indefinitively".
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 0c11203c261a..cf9926565937 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -292,6 +292,11 @@ static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb) | |||
292 | set_bit(HCI_ISCAN, &hdev->flags); | 292 | set_bit(HCI_ISCAN, &hdev->flags); |
293 | if (!old_iscan) | 293 | if (!old_iscan) |
294 | mgmt_discoverable(hdev->id, 1); | 294 | mgmt_discoverable(hdev->id, 1); |
295 | if (hdev->discov_timeout > 0) { | ||
296 | int to = msecs_to_jiffies(hdev->discov_timeout * 1000); | ||
297 | queue_delayed_work(hdev->workqueue, &hdev->discov_off, | ||
298 | to); | ||
299 | } | ||
295 | } else if (old_iscan) | 300 | } else if (old_iscan) |
296 | mgmt_discoverable(hdev->id, 0); | 301 | mgmt_discoverable(hdev->id, 0); |
297 | 302 | ||