linux/net/bluetooth/rfcomm
Peter Hurley 8981be9b2f 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>
2014-02-14 13:39:32 -08:00
..
core.c Bluetooth: Don't fail RFCOMM tty writes 2014-02-14 13:39:32 -08:00
Kconfig tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
Makefile [Bluetooth] Move CRC table into RFCOMM core 2005-10-28 19:20:36 +02:00
sock.c Bluetooth: Refuse peer RFCOMM address reading when not connected 2014-02-13 09:51:39 +02:00
tty.c Bluetooth: Fix write_room() calculation 2014-02-14 13:39:32 -08:00