public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/3] shared/att: Fix attempting to send Exchange MTU on EATT bearer
Date: Wed, 25 Aug 2021 14:14:14 -0700	[thread overview]
Message-ID: <20210825211415.1057804-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20210825211415.1057804-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

EATT bearer shall use the L2CAP signalling for negotiating the MTU
size.
---
 src/shared/att.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/shared/att.c b/src/shared/att.c
index 665d7f4b8..329497728 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -411,10 +411,17 @@ static struct att_send_op *pick_next_send_op(struct bt_att_chan *chan)
 	 */
 	if (!chan->pending_req) {
 		op = queue_peek_head(att->req_queue);
-		if (op && op->len <= chan->mtu)
+		if (op && op->len <= chan->mtu) {
+			/* Don't send Exchange MTU over EATT */
+			if (op->opcode == BT_ATT_OP_MTU_REQ &&
+					chan->type == BT_ATT_EATT)
+				goto indicate;
+
 			return queue_pop_head(att->req_queue);
+		}
 	}
 
+indicate:
 	/* There is either a request pending or no requests queued. If there is
 	 * no pending indication, pick an operation from the indication queue.
 	 */
-- 
2.31.1


  reply	other threads:[~2021-08-25 21:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 21:14 [PATCH BlueZ 1/3] shared/att: Fix accepting Exchange MTU on EATT bearer Luiz Augusto von Dentz
2021-08-25 21:14 ` Luiz Augusto von Dentz [this message]
2021-08-25 21:14 ` [PATCH BlueZ 3/3] gatt: Do not always attempt to connect EATT immediately Luiz Augusto von Dentz
2021-08-25 21:33 ` [BlueZ,1/3] shared/att: Fix accepting Exchange MTU on EATT bearer bluez.test.bot
2021-08-25 22:13   ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210825211415.1057804-2-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox