From b0d9b4b9b74f713d0e913d8a35fd162f1889f614 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 24 Sep 2020 19:28:17 -0700 Subject: [PATCH] L2CAP: peer_cfg_bits is unused Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: Icec4e536f28a649779f747d34a7d76295f5ef10f --- stack/include/l2c_api.h | 9 --------- stack/l2cap/l2c_fcr.cc | 2 -- stack/l2cap/l2c_int.h | 1 - stack/l2cap/l2c_utils.cc | 6 ------ 4 files changed, 18 deletions(-) diff --git a/stack/include/l2c_api.h b/stack/include/l2c_api.h index 1a75312d5..5051b93ea 100644 --- a/stack/include/l2c_api.h +++ b/stack/include/l2c_api.h @@ -159,15 +159,6 @@ struct tL2CAP_LE_CFG_INFO { uint16_t credits = L2CAP_LE_CREDIT_DEFAULT; }; -/* L2CAP channel configured field bitmap */ -#define L2CAP_CH_CFG_MASK_MTU 0x0001 -#define L2CAP_CH_CFG_MASK_QOS 0x0002 -#define L2CAP_CH_CFG_MASK_FLUSH_TO 0x0004 -#define L2CAP_CH_CFG_MASK_FCR 0x0008 -#define L2CAP_CH_CFG_MASK_FCS 0x0010 - -typedef uint16_t tL2CAP_CH_CFG_BITS; - /********************************* * Callback Functions Prototypes *********************************/ diff --git a/stack/l2cap/l2c_fcr.cc b/stack/l2cap/l2c_fcr.cc index b0dcb4e3a..9ef4b3b05 100644 --- a/stack/l2cap/l2c_fcr.cc +++ b/stack/l2cap/l2c_fcr.cc @@ -1970,7 +1970,6 @@ uint8_t l2c_fcr_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { /* Peer desires to bypass FCS check, and streaming or ERTM mode */ if (p_cfg->fcs_present) { p_ccb->peer_cfg.fcs = p_cfg->fcs; - p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_FCS; } max_retrans_size = p_ccb->ertm_info.fcr_tx_buf_size - sizeof(BT_HDR) - @@ -2001,7 +2000,6 @@ uint8_t l2c_fcr_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { /* Everything ok, so save the peer's adjusted fcr options */ p_ccb->peer_cfg.fcr = p_cfg->fcr; - if (p_cfg->fcr_present) p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_FCR; } else if (fcr_ok == L2CAP_PEER_CFG_UNACCEPTABLE) { /* Allow peer only one retry for mode */ if (p_ccb->peer_cfg_already_rejected) diff --git a/stack/l2cap/l2c_int.h b/stack/l2cap/l2c_int.h index bcf1c2374..057113f65 100644 --- a/stack/l2cap/l2c_int.h +++ b/stack/l2cap/l2c_int.h @@ -262,7 +262,6 @@ typedef struct t_l2c_ccb { uint8_t flags; tL2CAP_CFG_INFO our_cfg; /* Our saved configuration options */ - tL2CAP_CH_CFG_BITS peer_cfg_bits; /* Store what peer wants to configure */ tL2CAP_CFG_INFO peer_cfg; /* Peer's saved configuration options */ fixed_queue_t* xmit_hold_q; /* Transmit data hold queue */ diff --git a/stack/l2cap/l2c_utils.cc b/stack/l2cap/l2c_utils.cc index 8e4f31eae..3d64cc6db 100644 --- a/stack/l2cap/l2c_utils.cc +++ b/stack/l2cap/l2c_utils.cc @@ -1335,9 +1335,6 @@ tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid) { if (p_lcb) l2cu_enqueue_ccb(p_ccb); - /* clear what peer wants to configure */ - p_ccb->peer_cfg_bits = 0; - /* Put in default values for configuration */ memset(&p_ccb->our_cfg, 0, sizeof(tL2CAP_CFG_INFO)); memset(&p_ccb->peer_cfg, 0, sizeof(tL2CAP_CFG_INFO)); @@ -1770,7 +1767,6 @@ uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { /* Save the accepted value in case of renegotiation */ p_ccb->peer_cfg.mtu = p_cfg->mtu; p_ccb->peer_cfg.mtu_present = true; - p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_MTU; } else /* Illegal MTU value */ { p_cfg->mtu = L2CAP_MIN_MTU; @@ -1792,7 +1788,6 @@ uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { { p_ccb->peer_cfg.flush_to_present = true; p_ccb->peer_cfg.flush_to = p_cfg->flush_to; - p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_FLUSH_TO; } } /* Reload flush_to from a previously accepted config request */ @@ -1809,7 +1804,6 @@ uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) { if (p_cfg->qos.service_type <= SVC_TYPE_GUARANTEED) { p_ccb->peer_cfg.qos = p_cfg->qos; p_ccb->peer_cfg.qos_present = true; - p_ccb->peer_cfg_bits |= L2CAP_CH_CFG_MASK_QOS; } else /* Illegal service type value */ { p_cfg->qos.service_type = SVC_TYPE_BEST_EFFORT; -- 2.11.0