All of lore.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 3/4] shared/mgmt: Add mgmt_get_mtu
Date: Wed, 22 Sep 2021 14:34:01 -0700	[thread overview]
Message-ID: <20210922213402.1978215-3-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20210922213402.1978215-1-luiz.dentz@gmail.com>

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

This adds mgmt_get_mtu function which can be used to query the
transport MTU.
---
 src/shared/mgmt.c | 8 ++++++++
 src/shared/mgmt.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c
index cec8993e7..41457b430 100644
--- a/src/shared/mgmt.c
+++ b/src/shared/mgmt.c
@@ -963,3 +963,11 @@ bool mgmt_unregister_all(struct mgmt *mgmt)
 
 	return true;
 }
+
+uint16_t mgmt_get_mtu(struct mgmt *mgmt)
+{
+	if (!mgmt)
+		return 0;
+
+	return mgmt->mtu;
+}
diff --git a/src/shared/mgmt.h b/src/shared/mgmt.h
index 808bf4c7f..56add613d 100644
--- a/src/shared/mgmt.h
+++ b/src/shared/mgmt.h
@@ -76,3 +76,5 @@ unsigned int mgmt_register(struct mgmt *mgmt, uint16_t event, uint16_t index,
 bool mgmt_unregister(struct mgmt *mgmt, unsigned int id);
 bool mgmt_unregister_index(struct mgmt *mgmt, uint16_t index);
 bool mgmt_unregister_all(struct mgmt *mgmt);
+
+uint16_t mgmt_get_mtu(struct mgmt *mgmt);
-- 
2.31.1


  parent reply	other threads:[~2021-09-22 21:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 21:33 [PATCH BlueZ 1/4] shared/mgmt: Set MTU to UINT16_MAX Luiz Augusto von Dentz
2021-09-22 21:34 ` [PATCH BlueZ 2/4] lib: Fix HCI_MAX_ACL_SIZE Luiz Augusto von Dentz
2021-09-22 21:34 ` Luiz Augusto von Dentz [this message]
2021-09-22 21:34 ` [PATCH BlueZ 4/4] adapter: Truncate number of LTKs loaded if over MGMT MTU Luiz Augusto von Dentz
2021-09-22 21:55 ` [BlueZ,1/4] shared/mgmt: Set MTU to UINT16_MAX bluez.test.bot
2021-09-22 22:35 ` bluez.test.bot
2021-09-23 21:25   ` 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=20210922213402.1978215-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.