Thread (7 messages) flat view 7 messages, 2 authors, 2021-09-23
STALE1811d

[PATCH BlueZ 3/4] shared/mgmt: Add mgmt_get_mtu

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2021-09-22 21:34:08
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luiz Augusto von Dentz <redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help