diff options
author | David S. Miller <davem@davemloft.net> | 2009-04-20 05:16:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-20 05:16:44 -0400 |
commit | 9a5120ddd18ff93c304c9ead0b5c4278d9b417e2 (patch) | |
tree | f0825468d0496c4b6d7ce39c1d948f3685ca978c /net | |
parent | eb39c57ff7782bc015da517af1d9c3b2592e721e (diff) | |
parent | 9499237a1c42a27fbcc7ed1d59e34df2b574cdfb (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_event.c | 38 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 2 |
2 files changed, 29 insertions, 11 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 55534244c3a..15f40ea8d54 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -866,8 +866,16 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s | |||
866 | hci_dev_lock(hdev); | 866 | hci_dev_lock(hdev); |
867 | 867 | ||
868 | conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); | 868 | conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); |
869 | if (!conn) | 869 | if (!conn) { |
870 | goto unlock; | 870 | if (ev->link_type != SCO_LINK) |
871 | goto unlock; | ||
872 | |||
873 | conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); | ||
874 | if (!conn) | ||
875 | goto unlock; | ||
876 | |||
877 | conn->type = SCO_LINK; | ||
878 | } | ||
871 | 879 | ||
872 | if (!ev->status) { | 880 | if (!ev->status) { |
873 | conn->handle = __le16_to_cpu(ev->handle); | 881 | conn->handle = __le16_to_cpu(ev->handle); |
@@ -1646,20 +1654,28 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu | |||
1646 | conn->type = SCO_LINK; | 1654 | conn->type = SCO_LINK; |
1647 | } | 1655 | } |
1648 | 1656 | ||
1649 | if (conn->out && ev->status == 0x1c && conn->attempt < 2) { | 1657 | switch (ev->status) { |
1650 | conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | | 1658 | case 0x00: |
1651 | (hdev->esco_type & EDR_ESCO_MASK); | ||
1652 | hci_setup_sync(conn, conn->link->handle); | ||
1653 | goto unlock; | ||
1654 | } | ||
1655 | |||
1656 | if (!ev->status) { | ||
1657 | conn->handle = __le16_to_cpu(ev->handle); | 1659 | conn->handle = __le16_to_cpu(ev->handle); |
1658 | conn->state = BT_CONNECTED; | 1660 | conn->state = BT_CONNECTED; |
1659 | 1661 | ||
1660 | hci_conn_add_sysfs(conn); | 1662 | hci_conn_add_sysfs(conn); |
1661 | } else | 1663 | break; |
1664 | |||
1665 | case 0x1c: /* SCO interval rejected */ | ||
1666 | case 0x1f: /* Unspecified error */ | ||
1667 | if (conn->out && conn->attempt < 2) { | ||
1668 | conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | | ||
1669 | (hdev->esco_type & EDR_ESCO_MASK); | ||
1670 | hci_setup_sync(conn, conn->link->handle); | ||
1671 | goto unlock; | ||
1672 | } | ||
1673 | /* fall through */ | ||
1674 | |||
1675 | default: | ||
1662 | conn->state = BT_CLOSED; | 1676 | conn->state = BT_CLOSED; |
1677 | break; | ||
1678 | } | ||
1663 | 1679 | ||
1664 | hci_proto_connect_cfm(conn, ev->status); | 1680 | hci_proto_connect_cfm(conn, ev->status); |
1665 | if (ev->status) | 1681 | if (ev->status) |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 1d0fb0f23c6..374536e050a 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -1194,6 +1194,8 @@ void rfcomm_dlc_accept(struct rfcomm_dlc *d) | |||
1194 | 1194 | ||
1195 | rfcomm_send_ua(d->session, d->dlci); | 1195 | rfcomm_send_ua(d->session, d->dlci); |
1196 | 1196 | ||
1197 | rfcomm_dlc_clear_timer(d); | ||
1198 | |||
1197 | rfcomm_dlc_lock(d); | 1199 | rfcomm_dlc_lock(d); |
1198 | d->state = BT_CONNECTED; | 1200 | d->state = BT_CONNECTED; |
1199 | d->state_change(d, 0); | 1201 | d->state_change(d, 0); |