aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2014-03-27 15:55:19 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-03-28 03:09:30 -0400
commitae55f5982a8bc6adbafb337e0b781d30d5617782 (patch)
treec1180fde026509028d3c5d5723415c20465e601f /net/bluetooth
parent8af4840a36f3d8210604ecfd5b1ce9b39745e7ba (diff)
Bluetooth: Keep msec in DISCOV_INTERLEAVED_TIMEOUT
Keep msec instead of jiffies in this define. This is needed by following patch where we want this timeout to be exposed in debugfs. Note: Value of this timeout comes from recommendation in BT Core Spec.4.0, Vol 3, Part C, chapter 13.2.1. Signed-off-by: Lukasz Rymanowski <lukasz.rymanowski@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 37706e89af50..944c4fc87905 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3351,6 +3351,8 @@ static int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
3351 3351
3352static void start_discovery_complete(struct hci_dev *hdev, u8 status) 3352static void start_discovery_complete(struct hci_dev *hdev, u8 status)
3353{ 3353{
3354 unsigned long timeout = 0;
3355
3354 BT_DBG("status %d", status); 3356 BT_DBG("status %d", status);
3355 3357
3356 if (status) { 3358 if (status) {
@@ -3366,13 +3368,11 @@ static void start_discovery_complete(struct hci_dev *hdev, u8 status)
3366 3368
3367 switch (hdev->discovery.type) { 3369 switch (hdev->discovery.type) {
3368 case DISCOV_TYPE_LE: 3370 case DISCOV_TYPE_LE:
3369 queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable, 3371 timeout = DISCOV_LE_TIMEOUT;
3370 DISCOV_LE_TIMEOUT);
3371 break; 3372 break;
3372 3373
3373 case DISCOV_TYPE_INTERLEAVED: 3374 case DISCOV_TYPE_INTERLEAVED:
3374 queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable, 3375 timeout = msecs_to_jiffies(DISCOV_INTERLEAVED_TIMEOUT);
3375 DISCOV_INTERLEAVED_TIMEOUT);
3376 break; 3376 break;
3377 3377
3378 case DISCOV_TYPE_BREDR: 3378 case DISCOV_TYPE_BREDR:
@@ -3381,6 +3381,11 @@ static void start_discovery_complete(struct hci_dev *hdev, u8 status)
3381 default: 3381 default:
3382 BT_ERR("Invalid discovery type %d", hdev->discovery.type); 3382 BT_ERR("Invalid discovery type %d", hdev->discovery.type);
3383 } 3383 }
3384
3385 if (!timeout)
3386 return;
3387
3388 queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable, timeout);
3384} 3389}
3385 3390
3386static int start_discovery(struct sock *sk, struct hci_dev *hdev, 3391static int start_discovery(struct sock *sk, struct hci_dev *hdev,