aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-03-01 17:32:37 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-03-01 17:35:57 -0500
commit17b02e625662906f370a3eb5e7495cf06ed7d4a4 (patch)
treedb12888e81d5520bb050700d9179842976795f22 /net
parentba13ccd9b911e043c0f11e60cbb72bd4de194205 (diff)
Bluetooth: Update MGMT and SMP timeout constants to use msecs_to_jiffies
The MGMT and SMP timeout constants are always used in form of jiffies. So just include the conversion from msecs in the define itself. This has the advantage of making the code where the timeout is used more readable. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/mgmt.c5
-rw-r--r--net/bluetooth/smp.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 7bd7d57a8775..40b3da3d5e62 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -116,7 +116,7 @@ static const u16 mgmt_events[] = {
116#define INQUIRY_LEN_BREDR 0x08 /* TGAP(100) */ 116#define INQUIRY_LEN_BREDR 0x08 /* TGAP(100) */
117#define INQUIRY_LEN_BREDR_LE 0x04 /* TGAP(100)/2 */ 117#define INQUIRY_LEN_BREDR_LE 0x04 /* TGAP(100)/2 */
118 118
119#define SERVICE_CACHE_TIMEOUT (5 * 1000) 119#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000)
120 120
121#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \ 121#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \
122 !test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) 122 !test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
@@ -1298,8 +1298,7 @@ static bool enable_service_cache(struct hci_dev *hdev)
1298 return false; 1298 return false;
1299 1299
1300 if (!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) { 1300 if (!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) {
1301 schedule_delayed_work(&hdev->service_cache, 1301 schedule_delayed_work(&hdev->service_cache, CACHE_TIMEOUT);
1302 msecs_to_jiffies(SERVICE_CACHE_TIMEOUT));
1303 return true; 1302 return true;
1304 } 1303 }
1305 1304
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index f6a6d8be3051..75937d73d8ae 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -29,7 +29,7 @@
29#include <linux/scatterlist.h> 29#include <linux/scatterlist.h>
30#include <crypto/b128ops.h> 30#include <crypto/b128ops.h>
31 31
32#define SMP_TIMEOUT 30000 /* 30 seconds */ 32#define SMP_TIMEOUT msecs_to_jiffies(30000)
33 33
34static inline void swap128(u8 src[16], u8 dst[16]) 34static inline void swap128(u8 src[16], u8 dst[16])
35{ 35{
@@ -186,8 +186,7 @@ static void smp_send_cmd(struct l2cap_conn *conn, u8 code, u16 len, void *data)
186 hci_send_acl(conn->hchan, skb, 0); 186 hci_send_acl(conn->hchan, skb, 0);
187 187
188 cancel_delayed_work_sync(&conn->security_timer); 188 cancel_delayed_work_sync(&conn->security_timer);
189 schedule_delayed_work(&conn->security_timer, 189 schedule_delayed_work(&conn->security_timer, SMP_TIMEOUT);
190 msecs_to_jiffies(SMP_TIMEOUT));
191} 190}
192 191
193static __u8 authreq_to_seclevel(__u8 authreq) 192static __u8 authreq_to_seclevel(__u8 authreq)