Skip to content

Commit 7b05933

Browse files
committed
Bluetooth: btusb: Fix not handling ZPL/short-transfer
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]>
1 parent 39e4bfb commit 7b05933

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
@@ -1345,7 +1345,10 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
13451345
if (!urb)
13461346
return -ENOMEM;
13471347

1348-
size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
1348+
/* Use maximum HCI Event size so the USB stack handles
1349+
* ZPL/short-transfer automatically.
1350+
*/
1351+
size = HCI_MAX_EVENT_SIZE;
13491352

13501353
buf = kmalloc(size, mem_flags);
13511354
if (!buf) {

0 commit comments

Comments
 (0)