diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-06-11 04:13:07 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-06-11 23:07:05 -0400 |
commit | 5f246e890502fed387e0f959e2224ea680c03423 (patch) | |
tree | c53a010ed567f5780b96f22637e32a40a2372f67 /include | |
parent | 975b91bb17e70c0dc33ad07f16097106a9c2c6a2 (diff) |
Bluetooth: Update HCI timeouts constants to use msecs_to_jiffies
The HCI 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
and avoiding unnecessary conversions.
The patch is similar to commit ba13ccd9 doing the same job for L2CAP
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/hci.h | 10 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 2a6b0b8b7120..7dcd3495edde 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -139,11 +139,11 @@ enum { | |||
139 | #define HCIINQUIRY _IOR('H', 240, int) | 139 | #define HCIINQUIRY _IOR('H', 240, int) |
140 | 140 | ||
141 | /* HCI timeouts */ | 141 | /* HCI timeouts */ |
142 | #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ | 142 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
143 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ | 143 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
144 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ | 144 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
145 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ | 145 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 seconds */ |
146 | #define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ | 146 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
147 | 147 | ||
148 | /* HCI data types */ | 148 | /* HCI data types */ |
149 | #define HCI_COMMAND_PKT 0x01 | 149 | #define HCI_COMMAND_PKT 0x01 |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 20fd57367ddc..75766b7f0dc7 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -598,7 +598,7 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
598 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { | 598 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { |
599 | del_timer(&conn->idle_timer); | 599 | del_timer(&conn->idle_timer); |
600 | if (conn->state == BT_CONNECTED) { | 600 | if (conn->state == BT_CONNECTED) { |
601 | timeo = msecs_to_jiffies(conn->disc_timeout); | 601 | timeo = conn->disc_timeout; |
602 | if (!conn->out) | 602 | if (!conn->out) |
603 | timeo *= 2; | 603 | timeo *= 2; |
604 | } else { | 604 | } else { |