Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 722f4902 authored by Srinu Jella's avatar Srinu Jella Committed by Ajay Panicker
Browse files

Correct the max SDU length used in BTIF layer

Use case: OPP Tx over L2CAP are failing due to invalid PUT packet from DUT.

Steps:
1. Make the Remote device setup with OPP server which supports MTU
   of more than 8k.
2. Send file from DUT to Remote device.
3. Transfer always fails.

Failure: OPP Tx over L2CAP file transfer fail. It will always fail
if remote supports more than 8076 as the MTU.

Root Cause: Max SDU of L2CAP layer will be communicated to the upper
layers, and same length of SDU being sent from upper layer
to BTIF layer, but because of change in the max SDU of
BTIF, it will receive less bytes than expected will lead
to form incomplete PUT request.

Fix: Correct the max SDU length used from BTIF layer to be in
sync with max SDU calculation from L2CAP layer.

Change-Id: Ie037c85e798bebf6a71c56488aae37455725028c
parent 98a535fb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -269,10 +269,12 @@
#define L2CAP_EXT_CONTROL_OVERHEAD 4   /* Extended Control Field       */
#define L2CAP_MAX_HEADER_FCS       (L2CAP_PKT_OVERHEAD + L2CAP_EXT_CONTROL_OVERHEAD + L2CAP_SDU_LEN_OVERHEAD + L2CAP_FCS_LEN)
                                   /* length(2), channel(2), control(4), SDU length(2) FCS(2) */

/* To optimize this, it must be a multiplum of the L2CAP PDU length AND match the 3DH5 air
 * including the l2cap headers in each packet - to match the latter - the -5 is added
 * Changed it to  8087 to have same value between BTIF and L2cap layers
 */
#define L2CAP_MAX_SDU_LENGTH     (8080 + 26 - (L2CAP_MIN_OFFSET + L2CAP_MAX_HEADER_FCS) -5)
#define L2CAP_MAX_SDU_LENGTH     (8080 + 26 - (L2CAP_MIN_OFFSET + 6))
#define L2CAP_MAX_BUF_SIZE      (10240 + 24)

/* Part of L2CAP_MIN_OFFSET that is not part of L2CAP