From 11d4544b0a7e7d58da86d972ade6cd3d1c5c0eb9 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Wed, 23 Sep 2020 15:38:40 -0700 Subject: [PATCH] L2cap: Store MTU and ERTM info during registration So that L2cap can auto respond to config req/rsp. Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I8b68bd2d0e200a5dae9936ab46a259442987f219 --- stack/l2cap/l2c_api.cc | 2 ++ stack/l2cap/l2c_int.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/stack/l2cap/l2c_api.cc b/stack/l2cap/l2c_api.cc index 739d29999..d59909806 100644 --- a/stack/l2cap/l2c_api.cc +++ b/stack/l2cap/l2c_api.cc @@ -121,6 +121,8 @@ uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, p_rcb->log_packets = enable_snoop; p_rcb->api = p_cb_info; p_rcb->real_psm = psm; + p_rcb->ertm_info = p_ertm_info == nullptr ? tL2CAP_ERTM_INFO{} : *p_ertm_info; + p_rcb->required_mtu = std::max(required_mtu, L2CAP_DEFAULT_MTU); return (vpsm); } diff --git a/stack/l2cap/l2c_int.h b/stack/l2cap/l2c_int.h index ce654d775..b2717c4c8 100644 --- a/stack/l2cap/l2c_int.h +++ b/stack/l2cap/l2c_int.h @@ -201,6 +201,8 @@ typedef struct { uint16_t real_psm; /* This may be a dummy RCB for an o/b connection but */ /* this is the real PSM that we need to connect to */ tL2CAP_APPL_INFO api; + tL2CAP_ERTM_INFO ertm_info; + uint16_t required_mtu; } tL2C_RCB; #define L2CAP_CBB_DEFAULT_DATA_RATE_BUFF_QUOTA 100 -- 2.11.0