Re: [PATCH] Bluetooth: Get a more accurate PDU len

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 25 May 2012, Gustavo Padovan wrote:

From: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx>

Both FCS and Extended header might be or might not be present in a ERTM
channel.

Signed-off-by: Gustavo Padovan <gustavo.padovan@xxxxxxxxxxxxxxx>
---
net/bluetooth/l2cap_core.c |    8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index c07c134..40d1d6f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2143,6 +2143,14 @@ static int l2cap_segment_sdu(struct l2cap_chan *chan,
	pdu_len = min_t(size_t, pdu_len, L2CAP_BREDR_MAX_PAYLOAD);

	/* Adjust for largest possible L2CAP overhead. */
+	if (chan->fcs)
+		pdu_len -= L2CAP_FCS_SIZE;
+
+	if (test_bit(FLAG_EXT_CTRL, &chan->flags))
+		pdu_len -= L2CAP_EXT_HDR_SIZE;
+	else
+		pdu_len -= L2CAP_ENH_HDR_SIZE;
+
	pdu_len -= L2CAP_EXT_HDR_SIZE + L2CAP_FCS_SIZE;

Don't you want to remove this last line?


	/* Remote device may have requested smaller PDUs */
--
1.7.10.1

--
Mat Martineau
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux