--- net/bluetooth/hci_conn.c.orig 2008-01-28 09:15:50.000000000 +0100 +++ net/bluetooth/hci_conn.c 2008-02-14 10:34:09.000000000 +0100 @@ -332,6 +332,9 @@ if (type == ACL_LINK) return acl; + if (lmp_esco_capable(hdev) && lmp_esco_capable(acl)) + type=ESCO_LINK; + if (!(sco = hci_conn_hash_lookup_ba(hdev, type, dst))) { if (!(sco = hci_conn_add(hdev, type, dst))) { hci_conn_put(acl); @@ -346,7 +349,7 @@ if (acl->state == BT_CONNECTED && (sco->state == BT_OPEN || sco->state == BT_CLOSED)) { - if (lmp_esco_capable(hdev)) + if (type==ESCO_LINK) hci_setup_sync(sco, acl->handle); else hci_add_sco(sco, acl->handle); --- net/bluetooth/hci_event.c.orig 2008-01-28 09:15:31.000000000 +0100 +++ net/bluetooth/hci_event.c 2008-02-14 10:26:35.000000000 +0100 @@ -720,7 +720,7 @@ struct hci_conn *sco = conn->link; if (sco) { if (!ev->status) { - if (lmp_esco_capable(hdev)) + if (lmp_esco_capable(hdev) && lmp_esco_capable(conn)) hci_setup_sync(sco, conn->handle); else hci_add_sco(sco, conn->handle); @@ -771,7 +771,8 @@ hci_dev_unlock(hdev); - if (ev->link_type == ACL_LINK || !lmp_esco_capable(hdev)) { + if (ev->link_type == ACL_LINK || !lmp_esco_capable(hdev) + || !lmp_esco_capable(conn)) { struct hci_cp_accept_conn_req cp; bacpy(&cp.bdaddr, &ev->bdaddr); --- net/bluetooth/sco.c.orig 2008-01-28 09:15:14.000000000 +0100 +++ net/bluetooth/sco.c 2008-02-14 10:36:54.000000000 +0100 @@ -189,7 +189,7 @@ struct sco_conn *conn; struct hci_conn *hcon; struct hci_dev *hdev; - int err, type; + int err; BT_DBG("%s -> %s", batostr(src), batostr(dst)); @@ -200,9 +200,7 @@ err = -ENOMEM; - type = lmp_esco_capable(hdev) ? ESCO_LINK : SCO_LINK; - - hcon = hci_connect(hdev, type, dst); + hcon = hci_connect(hdev, SCO_LINK, dst); if (!hcon) goto done;