Bluetooth: L2CAP: Derive rx credits from MTU and MPS
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 4 Sep 2018 10:39:21 +0000 (13:39 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 27 Sep 2018 10:52:08 +0000 (12:52 +0200)
commit96cd8eaa131f0ffd4cfae09e1b4bdfafb9570907
tree6d5f16337fdb75ac7cc472ef78f35e82ba2b7cfc
parentfe1493101ac1313cbdbef1af65342fb17d944e71
Bluetooth: L2CAP: Derive rx credits from MTU and MPS

Give enough rx credits for a full packet instead of using an arbitrary
number which may not be enough depending on the MTU and MPS which can
cause interruptions while waiting for more credits, also remove
debugfs entry for l2cap_le_max_credits.

With these changes the credits are restored after each SDU is received
instead of using fixed threshold, this way it is garanteed that there
will always be enough credits to send a packet without waiting more
credits to arrive.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/l2cap.h
net/bluetooth/l2cap_core.c