Skip to content

Commit a4a70cb

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: btusb: Fix not handling ZPL/short-transfer
[ Upstream commit 7b05933 ] Requesting transfers of the exact same size of wMaxPacketSize may result in ZPL/short-transfer since the USB stack cannot handle it as we are limiting the buffer size to be the same as wMaxPacketSize. Also, in terms of throughput this change has the same effect to interrupt endpoint as 290ba20 "Bluetooth: Improve USB driver throughput by increasing the frame size" had for the bulk endpoint, so users of the advertisement bearer (e.g. BT Mesh) may benefit from this change. Fixes: 5e23b92 ("[Bluetooth] Add generic driver for Bluetooth USB devices") Signed-off-by: Luiz Augusto von Dentz <[email protected]> Tested-by: Kiran K <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d757218 commit a4a70cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/bluetooth/btusb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,10 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
13521352
if (!urb)
13531353
return -ENOMEM;
13541354

1355-
size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
1355+
/* Use maximum HCI Event size so the USB stack handles
1356+
* ZPL/short-transfer automatically.
1357+
*/
1358+
size = HCI_MAX_EVENT_SIZE;
13561359

13571360
buf = kmalloc(size, mem_flags);
13581361
if (!buf) {

0 commit comments

Comments
 (0)