Commit bae1f5d9 authored by Ville Tervo's avatar Ville Tervo Committed by Gustavo F. Padovan

Bluetooth: Treat LE and ACL links separately on timeout

Separate LE and ACL timeouts. Othervise ACL connections
on non LE hw will time out after 45 secs.
Signed-off-by: default avatarVille Tervo <ville.tervo@nokia.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent b92a6223
...@@ -1711,19 +1711,19 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int ...@@ -1711,19 +1711,19 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
return conn; return conn;
} }
static inline void hci_acl_tx_to(struct hci_dev *hdev) static inline void hci_link_tx_to(struct hci_dev *hdev, __u8 type)
{ {
struct hci_conn_hash *h = &hdev->conn_hash; struct hci_conn_hash *h = &hdev->conn_hash;
struct list_head *p; struct list_head *p;
struct hci_conn *c; struct hci_conn *c;
BT_ERR("%s ACL tx timeout", hdev->name); BT_ERR("%s link tx timeout", hdev->name);
/* Kill stalled connections */ /* Kill stalled connections */
list_for_each(p, &h->list) { list_for_each(p, &h->list) {
c = list_entry(p, struct hci_conn, list); c = list_entry(p, struct hci_conn, list);
if (c->type == ACL_LINK && c->sent) { if (c->type == type && c->sent) {
BT_ERR("%s killing stalled ACL connection %s", BT_ERR("%s killing stalled connection %s",
hdev->name, batostr(&c->dst)); hdev->name, batostr(&c->dst));
hci_acl_disconn(c, 0x13); hci_acl_disconn(c, 0x13);
} }
...@@ -1742,7 +1742,7 @@ static inline void hci_sched_acl(struct hci_dev *hdev) ...@@ -1742,7 +1742,7 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
/* ACL tx timeout must be longer than maximum /* ACL tx timeout must be longer than maximum
* link supervision timeout (40.9 seconds) */ * link supervision timeout (40.9 seconds) */
if (!hdev->acl_cnt && time_after(jiffies, hdev->acl_last_tx + HZ * 45)) if (!hdev->acl_cnt && time_after(jiffies, hdev->acl_last_tx + HZ * 45))
hci_acl_tx_to(hdev); hci_link_tx_to(hdev, ACL_LINK);
} }
while (hdev->acl_cnt && (conn = hci_low_sent(hdev, ACL_LINK, &quote))) { while (hdev->acl_cnt && (conn = hci_low_sent(hdev, ACL_LINK, &quote))) {
...@@ -1812,9 +1812,9 @@ static inline void hci_sched_le(struct hci_dev *hdev) ...@@ -1812,9 +1812,9 @@ static inline void hci_sched_le(struct hci_dev *hdev)
if (!test_bit(HCI_RAW, &hdev->flags)) { if (!test_bit(HCI_RAW, &hdev->flags)) {
/* LE tx timeout must be longer than maximum /* LE tx timeout must be longer than maximum
* link supervision timeout (40.9 seconds) */ * link supervision timeout (40.9 seconds) */
if (!hdev->le_cnt && if (!hdev->le_cnt && hdev->le_pkts &&
time_after(jiffies, hdev->le_last_tx + HZ * 45)) time_after(jiffies, hdev->le_last_tx + HZ * 45))
hci_acl_tx_to(hdev); hci_link_tx_to(hdev, LE_LINK);
} }
cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt; cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment