aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorVille Tervo <ville.tervo@nokia.com>2011-02-10 20:38:53 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-16 14:33:15 -0500
commitbae1f5d9464d231148301fcbf4e425a096a5b96d (patch)
treeb03b18feccfaf804bb87fd615eb2ab3cc8415f87 /net/bluetooth
parentb92a62238ff2d3fb88cf0f6de454f3d1b4ae5d52 (diff)
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: Ville Tervo <ville.tervo@nokia.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 92960532dea4..173bebd42825 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1711,19 +1711,19 @@ static inline struct hci_conn *hci_low_sent(struct hci_dev *hdev, __u8 type, int
1711 return conn; 1711 return conn;
1712} 1712}
1713 1713
1714static inline void hci_acl_tx_to(struct hci_dev *hdev) 1714static inline void hci_link_tx_to(struct hci_dev *hdev, __u8 type)
1715{ 1715{
1716 struct hci_conn_hash *h = &hdev->conn_hash; 1716 struct hci_conn_hash *h = &hdev->conn_hash;
1717 struct list_head *p; 1717 struct list_head *p;
1718 struct hci_conn *c; 1718 struct hci_conn *c;
1719 1719
1720 BT_ERR("%s ACL tx timeout", hdev->name); 1720 BT_ERR("%s link tx timeout", hdev->name);
1721 1721
1722 /* Kill stalled connections */ 1722 /* Kill stalled connections */
1723 list_for_each(p, &h->list) { 1723 list_for_each(p, &h->list) {
1724 c = list_entry(p, struct hci_conn, list); 1724 c = list_entry(p, struct hci_conn, list);
1725 if (c->type == ACL_LINK && c->sent) { 1725 if (c->type == type && c->sent) {
1726 BT_ERR("%s killing stalled ACL connection %s", 1726 BT_ERR("%s killing stalled connection %s",
1727 hdev->name, batostr(&c->dst)); 1727 hdev->name, batostr(&c->dst));
1728 hci_acl_disconn(c, 0x13); 1728 hci_acl_disconn(c, 0x13);
1729 } 1729 }
@@ -1742,7 +1742,7 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
1742 /* ACL tx timeout must be longer than maximum 1742 /* ACL tx timeout must be longer than maximum
1743 * link supervision timeout (40.9 seconds) */ 1743 * link supervision timeout (40.9 seconds) */
1744 if (!hdev->acl_cnt && time_after(jiffies, hdev->acl_last_tx + HZ * 45)) 1744 if (!hdev->acl_cnt && time_after(jiffies, hdev->acl_last_tx + HZ * 45))
1745 hci_acl_tx_to(hdev); 1745 hci_link_tx_to(hdev, ACL_LINK);
1746 } 1746 }
1747 1747
1748 while (hdev->acl_cnt && (conn = hci_low_sent(hdev, ACL_LINK, &quote))) { 1748 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 if (!test_bit(HCI_RAW, &hdev->flags)) { 1812 if (!test_bit(HCI_RAW, &hdev->flags)) {
1813 /* LE tx timeout must be longer than maximum 1813 /* LE tx timeout must be longer than maximum
1814 * link supervision timeout (40.9 seconds) */ 1814 * link supervision timeout (40.9 seconds) */
1815 if (!hdev->le_cnt && 1815 if (!hdev->le_cnt && hdev->le_pkts &&
1816 time_after(jiffies, hdev->le_last_tx + HZ * 45)) 1816 time_after(jiffies, hdev->le_last_tx + HZ * 45))
1817 hci_acl_tx_to(hdev); 1817 hci_link_tx_to(hdev, LE_LINK);
1818 } 1818 }
1819 1819
1820 cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt; 1820 cnt = hdev->le_pkts ? hdev->le_cnt : hdev->acl_cnt;