]> Pileus Git - ~andy/linux/blobdiff - net/bluetooth/hci_event.c
[Bluetooth] Support the case when headset falls back to SCO link
[~andy/linux] / net / bluetooth / hci_event.c
index 0aba21a03b3c0fc590d4d18a7c7975a9121c7ff2..6bc5a0506c6c0dbbb032113cff193da07942a032 100644 (file)
@@ -1314,8 +1314,16 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu
        hci_dev_lock(hdev);
 
        conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
-       if (!conn)
-               goto unlock;
+       if (!conn) {
+               if (ev->link_type == ESCO_LINK)
+                       goto unlock;
+
+               conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr);
+               if (!conn)
+                       goto unlock;
+
+               conn->type = SCO_LINK;
+       }
 
        if (!ev->status) {
                conn->handle = __le16_to_cpu(ev->handle);