summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btusb.c
diff options
context:
space:
mode:
authorPeter Hurley2014-02-10 02:59:24 +0100
committerMarcel Holtmann2014-02-14 22:39:32 +0100
commit8981be9b2fe5553af35a43865d9ab4271c3aa2e2 (patch)
tree717062972b1186decc17184b29b9e7ecce80cde3 /drivers/bluetooth/btusb.c
parentBluetooth: Refactor write_room() calculation (diff)
downloadkernel-qcow2-linux-8981be9b2fe5553af35a43865d9ab4271c3aa2e2.tar.gz
kernel-qcow2-linux-8981be9b2fe5553af35a43865d9ab4271c3aa2e2.tar.xz
kernel-qcow2-linux-8981be9b2fe5553af35a43865d9ab4271c3aa2e2.zip
Bluetooth: Fix write_room() calculation
The skb truesize of a 12-byte payload with a 10-byte head/tail reserve is 768 bytes. Consequently, even with 40 tx_credits, at most 6 packets could be queued at any one time: 40 tx_credits * 127-byte mtu < 768-byte truesize * 7 This error could also cause the tx queue to apparently stall if credit flow control is disabled (where tx_credits is fixed at 5), or if the receiver only granted a limited number of tx credits (eg., less than 7). Instead, track the outstanding number of queued packets not yet sent in wmem_alloc and allow for a maximum of 40 queued packets. Report the space avail for a single write() as the mtu * number of packets left before reaching the maximum. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Tested-By: Alexander Holler <holler@ahsoftware.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
0 files changed, 0 insertions, 0 deletions