linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* L2CAP mtu preference set by user space clarification
@ 2019-12-17  6:36 chethan tn
  2019-12-18  0:19 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 6+ messages in thread
From: chethan tn @ 2019-12-17  6:36 UTC (permalink / raw)
  To: Bluez mailing list, chethan ಚೇತನ್,
	Chethan T N, nsathish41, sathish.narasimman

Hi,

I would like to understand why the Source device L2CAP mtu is always
set to the remote device mtu during L2CAP connection?

https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git/tree/net/bluetooth/l2cap_core.c#n3370
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git/tree/net/bluetooth/l2cap_core.c#n3474



I tried to set the specific MTU for specific profile connection( For
Ex: A2DP connection - PSM  25) patch mentioned below, but the same is
not reflected because of the below code.

https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git/tree/net/bluetooth/l2cap_core.c#n3474

Here the patch to set the MTU from the use space bluez.

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 58e1534a4..7d8a718c0 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -1573,6 +1573,7 @@ static bool a2dp_server_listen(struct a2dp_server *server)
                                BT_IO_OPT_SOURCE_BDADDR,
                                btd_adapter_get_address(server->adapter),
                                BT_IO_OPT_PSM, AVDTP_PSM,
+                               BT_IO_OPT_OMTU, AVDTP_MTU,
                                BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
                                BT_IO_OPT_MASTER, true,
                                BT_IO_OPT_INVALID);
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 51ead684a..786702cec 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -2394,6 +2394,7 @@ static GIOChannel *l2cap_connect(struct avdtp *session)
                                BT_IO_OPT_DEST_BDADDR,
                                device_get_address(session->device),
                                BT_IO_OPT_PSM, AVDTP_PSM,
+                               BT_IO_OPT_OMTU, AVDTP_MTU,
                                BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
                                BT_IO_OPT_INVALID);
        if (!io) {
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index 621a6e3cf..372b2579d 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h



Can you please suggest what is the best way to set the L2CAP mtu as
user defined.


Thanks

Chethan

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-31  5:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17  6:36 L2CAP mtu preference set by user space clarification chethan tn
2019-12-18  0:19 ` Luiz Augusto von Dentz
2020-01-28  7:01   ` Sathish Narasimman
2020-01-30  5:19     ` Sathish Narasimman
2020-01-30 19:12     ` Luiz Augusto von Dentz
2020-01-31  5:07       ` Sathish Narasimman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).