public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Bluetooth: Change default MTU for L2CAP ATT channel
@ 2012-05-30 18:08 Andre Guedes
  2012-05-30 18:08 ` [PATCH 2/3] Bluetooth: Check MTU value in l2cap_sock_setsockopt_old Andre Guedes
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andre Guedes @ 2012-05-30 18:08 UTC (permalink / raw)
  To: linux-bluetooth

This patch changes the default MTU value for L2CAP ATT fixed channel
to L2CAP_DEFAULT_MTU (672 octets).

Differently from others L2CAP channels, in L2CAP ATT fixed channel
there is no MTU negotiation. The MTU value for that channel is up to
the L2CAP implementation. The only restriction in L2CAP spec is the
MTU value must not be less than 23 octets.

At ATT protocol level (on top of L2CAP), we have the ATT_MTU which
defines the maximum size of any ATT message sent between client and
server. GATT profile defines ATT_MTU default value to 23 octets. If
a GATT based profile wants to use ATT_MTU greater than 23 octets
(e.g. HID over GATT profile), it should negotiate a new value by
executing the GATT Exchange MTU sub-procedure.

Thus, in order to support any value of ATT_MTU negotiated at ATT
protocol level, our L2CAP implementation should have L2CAP ATT
fixed channel MTU equal or greater than ATT_MAX_MTU (512 octets).

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/l2cap_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 953ac53..9f513b1 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -449,7 +449,7 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
 	case L2CAP_CHAN_CONN_ORIENTED:
 		if (conn->hcon->type == LE_LINK) {
 			/* LE connection */
-			chan->omtu = L2CAP_LE_DEFAULT_MTU;
+			chan->omtu = L2CAP_DEFAULT_MTU;
 			chan->scid = L2CAP_CID_LE_DATA;
 			chan->dcid = L2CAP_CID_LE_DATA;
 		} else {
-- 
1.7.10.2


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

end of thread, other threads:[~2012-05-31 19:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 18:08 [PATCH 1/3] Bluetooth: Change default MTU for L2CAP ATT channel Andre Guedes
2012-05-30 18:08 ` [PATCH 2/3] Bluetooth: Check MTU value in l2cap_sock_setsockopt_old Andre Guedes
2012-05-31 13:42   ` Gustavo Padovan
2012-05-31 19:08     ` Andre Guedes
2012-05-30 18:08 ` [PATCH 3/3] Bluetooth: Rename L2CAP_LE_DEFAULT_MTU Andre Guedes
2012-05-31 13:33 ` [PATCH 1/3] Bluetooth: Change default MTU for L2CAP ATT channel Gustavo Padovan
2012-05-31 19:08   ` Andre Guedes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox