Bluetooth: RFCOMM: Introduce Kconfig for max L2CAP MTU

Intorduces CONFIG_BLUETOOTH_RFCOMM_L2CAP_MTU which sets default as
CONFIG_BLUETOOTH_L2CAP_IN_MTU since it will make sure that RFCOMM
frames can be fit in ACL buffer to avoid fragmentation and at the
same time profiles can utilize the size of ACL buffer while configuring
RFCOMM MTU.

Once fragementation is handled, this can be configured to higher values
based on the profiles supported and its L2CAP PDU size requirement.

The maximum value possible is 32676 which is max RFCOMM frame size
given in the spec.

Change-Id: I57e178ea4da846243067c3e072d1f4c5536a3ee3
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
This commit is contained in:
Jaganath Kanakkassery 2016-08-29 18:13:06 +05:30 committed by Johan Hedberg
commit 6ffbf795ce
2 changed files with 10 additions and 1 deletions

View file

@ -451,4 +451,13 @@ config BLUETOOTH_BREDR_NAME
Bluetooth BR/EDR name. Name can be up to 248 bytes long (excluding
NULL termination). Can be empty string.
endif # BLUETOOTH_BREDR
if BLUETOOTH_RFCOMM
config BLUETOOTH_RFCOMM_L2CAP_MTU
int "L2CAP MTU for RFCOMM frames"
default BLUETOOTH_L2CAP_IN_MTU
range BLUETOOTH_L2CAP_IN_MTU 32767
help
Maximum size of L2CAP PDU for RFCOMM frames.
endif # BLUETOOTH_RFCOMM
endif # BLUETOOTH

View file

@ -633,7 +633,7 @@ static int rfcomm_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan)
BT_DBG("session %p initialized", session);
session->br_chan.chan.ops = &ops;
session->br_chan.rx.mtu = RFCOMM_DEFAULT_MTU;
session->br_chan.rx.mtu = CONFIG_BLUETOOTH_RFCOMM_L2CAP_MTU;
session->state = BT_RFCOMM_STATE_INIT;
*chan = &session->br_chan.chan;