Skip to content

Commit 7cb127d

Browse files
committed
[Bluetooth] Add option to disable eSCO connection creation
It has been reported that some eSCO capable headsets are not able to connect properly. The real reason for this is unclear at the moment. So for easier testing add a module parameter to disable eSCO connection creation. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent ec8dab3 commit 7cb127d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎net/bluetooth/sco.c‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
#define BT_DBG(D...)
5454
#endif
5555

56-
#define VERSION "0.5"
56+
#define VERSION "0.6"
57+
58+
static int disable_esco = 0;
5759

5860
static const struct proto_ops sco_sock_ops;
5961

@@ -193,7 +195,10 @@ static int sco_connect(struct sock *sk)
193195

194196
err = -ENOMEM;
195197

196-
type = lmp_esco_capable(hdev) ? ESCO_LINK : SCO_LINK;
198+
if (lmp_esco_capable(hdev) && !disable_esco)
199+
type = ESCO_LINK;
200+
else
201+
type = SCO_LINK;
197202

198203
hcon = hci_connect(hdev, type, dst);
199204
if (!hcon)
@@ -994,6 +999,9 @@ static void __exit sco_exit(void)
994999
module_init(sco_init);
9951000
module_exit(sco_exit);
9961001

1002+
module_param(disable_esco, bool, 0644);
1003+
MODULE_PARM_DESC(disable_esco, "Disable eSCO connection creation");
1004+
9971005
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
9981006
MODULE_DESCRIPTION("Bluetooth SCO ver " VERSION);
9991007
MODULE_VERSION(VERSION);

0 commit comments

Comments
 (0)