diff options
-rw-r--r-- | net/bluetooth/hci_event.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 55534244c3a0..963f9662eaa8 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1646,20 +1646,28 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu | |||
1646 | conn->type = SCO_LINK; | 1646 | conn->type = SCO_LINK; |
1647 | } | 1647 | } |
1648 | 1648 | ||
1649 | if (conn->out && ev->status == 0x1c && conn->attempt < 2) { | 1649 | switch (ev->status) { |
1650 | conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | | 1650 | 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); | 1651 | conn->handle = __le16_to_cpu(ev->handle); |
1658 | conn->state = BT_CONNECTED; | 1652 | conn->state = BT_CONNECTED; |
1659 | 1653 | ||
1660 | hci_conn_add_sysfs(conn); | 1654 | hci_conn_add_sysfs(conn); |
1661 | } else | 1655 | break; |
1656 | |||
1657 | case 0x1c: /* SCO interval rejected */ | ||
1658 | case 0x1f: /* Unspecified error */ | ||
1659 | if (conn->out && conn->attempt < 2) { | ||
1660 | conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | | ||
1661 | (hdev->esco_type & EDR_ESCO_MASK); | ||
1662 | hci_setup_sync(conn, conn->link->handle); | ||
1663 | goto unlock; | ||
1664 | } | ||
1665 | /* fall through */ | ||
1666 | |||
1667 | default: | ||
1662 | conn->state = BT_CLOSED; | 1668 | conn->state = BT_CLOSED; |
1669 | break; | ||
1670 | } | ||
1663 | 1671 | ||
1664 | hci_proto_connect_cfm(conn, ev->status); | 1672 | hci_proto_connect_cfm(conn, ev->status); |
1665 | if (ev->status) | 1673 | if (ev->status) |