From 989e83b5c1dd02e27ed0612fc8623aaa18a1ab26 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 24 Sep 2020 20:45:11 -0700 Subject: [PATCH] Remove unnecessary definition Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: I9baf600d22cad78b2b93d29dd7d8975731beb47d --- internal_include/bt_target.h | 13 ------------- stack/gap/gap_conn.cc | 4 ++-- stack/l2cap/l2c_api.cc | 8 ++++---- stack/l2cap/l2c_utils.cc | 4 ++-- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/internal_include/bt_target.h b/internal_include/bt_target.h index 1cd08df08..2b929d629 100644 --- a/internal_include/bt_target.h +++ b/internal_include/bt_target.h @@ -168,14 +168,6 @@ #define L2CAP_CMD_BUF_SIZE BT_SMALL_BUFFER_SIZE #endif -#ifndef L2CAP_USER_TX_BUF_SIZE -#define L2CAP_USER_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE -#endif - -#ifndef L2CAP_USER_RX_BUF_SIZE -#define L2CAP_USER_RX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE -#endif - /* Sends L2CAP segmented packets in ERTM mode */ #ifndef L2CAP_FCR_TX_BUF_SIZE #define L2CAP_FCR_TX_BUF_SIZE BT_DEFAULT_BUFFER_SIZE @@ -208,11 +200,6 @@ #define OBX_LRG_DATA_BUF_SIZE (8080 + 26) #endif -/* Used to send data to L2CAP. */ -#ifndef GAP_DATA_BUF_SIZE -#define GAP_DATA_BUF_SIZE BT_DEFAULT_BUFFER_SIZE -#endif - /* BNEP data and protocol messages. */ #ifndef BNEP_BUF_SIZE #define BNEP_BUF_SIZE BT_DEFAULT_BUFFER_SIZE diff --git a/stack/gap/gap_conn.cc b/stack/gap/gap_conn.cc index e937f7d97..6d73a1538 100644 --- a/stack/gap/gap_conn.cc +++ b/stack/gap/gap_conn.cc @@ -228,8 +228,8 @@ uint16_t GAP_ConnOpen(const char* p_serv_name, uint8_t service_id, if (p_ccb->cfg.fcr_present) { if (ertm_info == NULL) { p_ccb->ertm_info.preferred_mode = p_ccb->cfg.fcr.mode; - p_ccb->ertm_info.user_rx_buf_size = GAP_DATA_BUF_SIZE; - p_ccb->ertm_info.user_tx_buf_size = GAP_DATA_BUF_SIZE; + p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE; + p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE; p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_INVALID_ERM_BUF_SIZE; p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_INVALID_ERM_BUF_SIZE; } else { diff --git a/stack/l2cap/l2c_api.cc b/stack/l2cap/l2c_api.cc index d3bce8268..0dbcac807 100644 --- a/stack/l2cap/l2c_api.cc +++ b/stack/l2cap/l2c_api.cc @@ -407,10 +407,10 @@ uint16_t L2CA_ErtmConnectReq(uint16_t psm, const RawAddress& p_bd_addr, p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE; if (p_ccb->ertm_info.user_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) - p_ccb->ertm_info.user_rx_buf_size = L2CAP_USER_RX_BUF_SIZE; + p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE; if (p_ccb->ertm_info.user_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) - p_ccb->ertm_info.user_tx_buf_size = L2CAP_USER_TX_BUF_SIZE; + p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE; p_ccb->max_rx_mtu = p_ertm_info->user_rx_buf_size - @@ -830,10 +830,10 @@ bool L2CA_ErtmConnectRsp(const RawAddress& p_bd_addr, uint8_t id, uint16_t lcid, p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE; if (p_ccb->ertm_info.user_rx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) - p_ccb->ertm_info.user_rx_buf_size = L2CAP_USER_RX_BUF_SIZE; + p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE; if (p_ccb->ertm_info.user_tx_buf_size == L2CAP_INVALID_ERM_BUF_SIZE) - p_ccb->ertm_info.user_tx_buf_size = L2CAP_USER_TX_BUF_SIZE; + p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE; p_ccb->max_rx_mtu = p_ertm_info->user_rx_buf_size - diff --git a/stack/l2cap/l2c_utils.cc b/stack/l2cap/l2c_utils.cc index 55626d1a5..19a6f1ee1 100644 --- a/stack/l2cap/l2c_utils.cc +++ b/stack/l2cap/l2c_utils.cc @@ -1373,8 +1373,8 @@ tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid) { L2CAP_FCR_BASIC_MODE; /* Default mode for channel is basic mode */ p_ccb->ertm_info.fcr_rx_buf_size = L2CAP_FCR_RX_BUF_SIZE; p_ccb->ertm_info.fcr_tx_buf_size = L2CAP_FCR_TX_BUF_SIZE; - p_ccb->ertm_info.user_rx_buf_size = L2CAP_USER_RX_BUF_SIZE; - p_ccb->ertm_info.user_tx_buf_size = L2CAP_USER_TX_BUF_SIZE; + p_ccb->ertm_info.user_rx_buf_size = BT_DEFAULT_BUFFER_SIZE; + p_ccb->ertm_info.user_tx_buf_size = BT_DEFAULT_BUFFER_SIZE; p_ccb->max_rx_mtu = L2CAP_MTU_SIZE; p_ccb->tx_mps = L2CAP_FCR_TX_BUF_SIZE - 32; -- 2.11.0