--- net/bluetooth/sco.c.orig 2007-12-17 18:03:14.000000000 +0900 +++ net/bluetooth/sco.c 2007-12-17 18:18:53.000000000 +0900 @@ -200,7 +200,11 @@ err = -ENOMEM; - type = lmp_esco_capable(hdev) ? ESCO_LINK : SCO_LINK; + if (sco_pi(sk)->force_sco) { + type = SCO_LINK; + } else { + type = lmp_esco_capable(hdev) ? ESCO_LINK : SCO_LINK; + } hcon = hci_connect(hdev, type, dst); if (!hcon) @@ -660,12 +664,23 @@ { struct sock *sk = sock->sk; int err = 0; + int len; + unsigned int force_sco; BT_DBG("sk %p", sk); lock_sock(sk); switch (optname) { + case SCO_FORCESCO: + len = sizeof(unsigned int); + if (copy_from_user((char *)&force_sco, optval, len)) { + err = -EFAULT; + break; + } + sco_pi(sk)->force_sco = (force_sco != 0); + break; + default: err = -ENOPROTOOPT; break; @@ -681,6 +696,7 @@ struct sco_options opts; struct sco_conninfo cinfo; int len, err = 0; + unsigned int force_sco; BT_DBG("sk %p", sk); @@ -721,6 +737,14 @@ break; + case SCO_FORCESCO: + force_sco = sco_pi(sock)->force_sco; + len = sizeof(unsigned int); + if (copy_to_user(optval, (char *)&force_sco, len)) + err = -EFAULT; + + break; + default: err = -ENOPROTOOPT; break; --- net/bluetooth/hci_conn.c.orig 2007-11-29 15:53:15.000000000 +0900 +++ net/bluetooth/hci_conn.c 2007-12-17 18:03:28.000000000 +0900 @@ -355,7 +355,8 @@ if (acl->state == BT_CONNECTED && (sco->state == BT_OPEN || sco->state == BT_CLOSED)) { - if (lmp_esco_capable(hdev)) + //if (lmp_esco_capable(hdev)) + if (type == ESCO_LINK) hci_setup_sync(sco, acl->handle); else hci_add_sco(sco, acl->handle); --- include/net/bluetooth/sco.h.orig 2007-12-17 18:02:54.000000000 +0900 +++ include/net/bluetooth/sco.h 2007-12-17 18:04:17.000000000 +0900 @@ -51,6 +51,8 @@ __u8 dev_class[3]; }; +#define SCO_FORCESCO 0x03 + /* ---- SCO connections ---- */ struct sco_conn { struct hci_conn *hcon; @@ -74,6 +76,7 @@ struct bt_sock bt; __u32 flags; struct sco_conn *conn; + unsigned int force_sco :1; }; #endif /* __SCO_H */