aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-15 14:06:51 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 13:07:52 -0400
commit72c6fb915ff2d30ae14053edee4f0d30019bad76 (patch)
tree78513272787c14712c47af74cfed3d6bfe1d32a5
parent61a3d4f9d52c00b2016bc27fc66b10a194043f76 (diff)
Bluetooth: Fix incorrect LE CoC PDU length restriction based on HCI MTU
The l2cap_create_le_flowctl_pdu() function that l2cap_segment_le_sdu() calls is perfectly capable of doing packet fragmentation if given bigger PDUs than the HCI buffers allow. Forcing the PDU length based on the HCI MTU (conn->mtu) would therefore needlessly strict operation on hardware with limited LE buffers (e.g. both Intel and Broadcom seem to have this set to just 27 bytes). This patch removes the restriction and makes it possible to send PDUs of the full length that the remote MPS value allows. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Cc: stable@vger.kernel.org
-rw-r--r--net/bluetooth/l2cap_core.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 4a90438d99df..52b56808d5d3 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2358,12 +2358,8 @@ static int l2cap_segment_le_sdu(struct l2cap_chan *chan,
2358 2358
2359 BT_DBG("chan %p, msg %p, len %zu", chan, msg, len); 2359 BT_DBG("chan %p, msg %p, len %zu", chan, msg, len);
2360 2360
2361 pdu_len = chan->conn->mtu - L2CAP_HDR_SIZE;
2362
2363 pdu_len = min_t(size_t, pdu_len, chan->remote_mps);
2364
2365 sdu_len = len; 2361 sdu_len = len;
2366 pdu_len -= L2CAP_SDULEN_SIZE; 2362 pdu_len = chan->remote_mps - L2CAP_SDULEN_SIZE;
2367 2363
2368 while (len > 0) { 2364 while (len > 0) {
2369 if (len <= pdu_len) 2365 if (len <= pdu_len)