Skip to contentSkip to conversation

Fix SCO on Broadcom Bluetooth adapters

PATCH In review Olivier Galibert 5 participants 7 messages Mar 14, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix SCO on Broadcom Bluetooth adapters

Broadcom USB Bluetooth adapters report a maximum of zero SCO packets in-flight, killing SCO. Use a reasonable count instead in that case.

---

I don't think that could be reasonably done as a quirk. Simple examination of the .inf coming with the windows driver shows that 100+ different models may be having this problem. Also, it can't break already working adapters, so why bother.

 net/bluetooth/hci_event.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
net/bluetooth/hci_event.c +7 -0
@@ -324,6 +324,13 @@ static void hci_cc_info_param(struct hci
 		hdev->acl_pkts = hdev->acl_cnt = __le16_to_cpu(bs->acl_max_pkt);
 		hdev->sco_pkts = hdev->sco_cnt = __le16_to_cpu(bs->sco_max_pkt);
 
+		/* Some buggy USB bluetooth adapters, Broadcom in
+		   particular, answer zero as the max number of sco
+		   packets in flight.  Use a reasonable value
+		   instead */
+		if (hdev->sco_pkts == 0)
+			hdev->sco_pkts = hdev->sco_cnt = 8
+
 		BT_DBG("%s mtu: acl %d, sco %d max_pkt: acl %d, sco %d", hdev->name,
 			hdev->acl_mtu, hdev->sco_mtu, hdev->acl_pkts, hdev->sco_pkts);
 		break;
#1 lore raw
Quoted 3 lines · Olivier Galibert

Broadcom USB Bluetooth adapters report a maximum of zero SCO packets in-flight, killing SCO. Use a reasonable count instead in that case.

Printk("broken Broadcom USB detected, working around"), I'd say. Then you can also remove the comment :-). Maybe 4 is reasonable value for some really broken thing, or something...

Quoted 1 line

Pavel

Quoted 17 lines
net/bluetooth/hci_event.c +7 -0
@@ -324,6 +324,13 @@ static void hci_cc_info_param(struct hci
 		hdev->acl_pkts = hdev->acl_cnt = __le16_to_cpu(bs->acl_max_pkt);
 		hdev->sco_pkts = hdev->sco_cnt = __le16_to_cpu(bs->sco_max_pkt);
 
+		/* Some buggy USB bluetooth adapters, Broadcom in
+		   particular, answer zero as the max number of sco
+		   packets in flight.  Use a reasonable value
+		   instead */
+		if (hdev->sco_pkts == 0)
+			hdev->sco_pkts = hdev->sco_cnt = 8
+
 		BT_DBG("%s mtu: acl %d, sco %d max_pkt: acl %d, sco %d", hdev->name,
 			hdev->acl_mtu, hdev->sco_mtu, hdev->acl_pkts, hdev->sco_pkts);
 		break;
Signature · 1 line
189:    private string AtomSTSZ = "stsz";
maintainer
#2 lore raw
In reply to Olivier Galibert

Hi Olivier,

Quoted 11 lines

Broadcom USB Bluetooth adapters report a maximum of zero SCO packets in-flight, killing SCO. Use a reasonable count instead in that case.

---

I don't think that could be reasonably done as a quirk. Simple examination of the .inf coming with the windows driver shows that 100+ different models may be having this problem. Also, it can't break already working adapters, so why bother.

your patch might break devices where this value is chosen on purpose, so it is not acceptable and must be done with a quirk. Another reason is that I don't allow any stupid vendor specific workarounds inside the Bluetooth core unless they are implemented as quirks. The core has no vendor information at all.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw
Quoted 1 line · Marcel Holtmann

your patch might break devices where this value is chosen on purpose

Please do tell me how one is supposed to do sco communications when this value is chosen on purpose and I'll be happy to implement that. I have found no clue about that in the bluetooth specs.

Meanwhile, I'll implement it with a quirk, and I can guarantee that you're not going to like the result. I have a list of 104 (iirc) device ids that may need it, and given that hardware is supposed to work they will have to be added until proven otherwise.

And it won't fix the uart versions either.

OG.

#4 lore raw
Quoted 4 lines · Olivier Galibert

Meanwhile, I'll implement it with a quirk, and I can guarantee that you're not going to like the result. I have a list of 104 (iirc) device ids that may need it, and given that hardware is supposed to work they will have to be added until proven otherwise.

Just add a wildcard quirk so your fixup is called for every single device and then does the check. Keeps the fix out of the core and clearly documented while keeping the list short.

#5 lore raw
Quoted 3 lines · Alan Cox

Just add a wildcard quirk so your fixup is called for every single device and then does the check. Keeps the fix out of the core and clearly documented while keeping the list short.

Errr, ok, I'm all for doing that but I'm not sure what "that" means. You want the test/fix to be put in a function somewhere to be defined and hci_event to call it where I put the if initially?

OG.

PS: It's only 51 after all. For now, that is, since we know there
will be new ones with the same problem.

#6 lore raw
In reply to Olivier Galibert
Quoted 19 lines · On Tue, 14 Mar 2006 12:12:48 +0100 Olivier Galibert wrote:

Broadcom USB Bluetooth adapters report a maximum of zero SCO packets in-flight, killing SCO. Use a reasonable count instead in that case.

---

I don't think that could be reasonably done as a quirk. Simple examination of the .inf coming with the windows driver shows that 100+ different models may be having this problem. Also, it can't break already working adapters, so why bother.

 net/bluetooth/hci_event.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

net/bluetooth/hci_event.c static void hci_cc_info_param(struct hci · line 332

Quoted 9 lines
net/bluetooth/hci_event.c +6 -0
@@ -324,6 +324,13 @@ static void hci_cc_info_param(struct hci
 		hdev->acl_pkts = hdev->acl_cnt = __le16_to_cpu(bs->acl_max_pkt);
 		hdev->sco_pkts = hdev->sco_cnt = __le16_to_cpu(bs->sco_max_pkt);
 
+		/* Some buggy USB bluetooth adapters, Broadcom in
+		   particular, answer zero as the max number of sco
+		   packets in flight.  Use a reasonable value
+		   instead */
+		if (hdev->sco_pkts == 0)
+			hdev->sco_pkts = hdev->sco_cnt = 8

missing trailing ';'

---
~Randy