diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2011-11-07 22:16:02 +0200 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-11-08 12:54:09 -0200 |
commit | 16ab91ab48287aa4fc757f3618820f728ee4412f (patch) | |
tree | 9266bb78e7beedfbf08160a3309349d927b5ac7f /net/bluetooth/hci_event.c | |
parent | 89352e7d3ab372ffad8efe2aa070e0b63df42b85 (diff) | |
download | lwn-16ab91ab48287aa4fc757f3618820f728ee4412f.tar.gz lwn-16ab91ab48287aa4fc757f3618820f728ee4412f.zip |
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) set_bit(HCI_ISCAN, &hdev->flags); if (!old_iscan) mgmt_discoverable(hdev->id, 1); + if (hdev->discov_timeout > 0) { + int to = msecs_to_jiffies(hdev->discov_timeout * 1000); + queue_delayed_work(hdev->workqueue, &hdev->discov_off, + to); + } } else if (old_iscan) mgmt_discoverable(hdev->id, 0); |