diff options
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 55534244c3a0..15f40ea8d544 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) |