From 1f6cf09bcd50d14f5eefa0ba948166ac5d306b88 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Fri, 2 Oct 2020 11:21:58 -0700 Subject: [PATCH] L2cap fixed channel tx complete is unused Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: Iae3801999b031c904f048acd3e4c27745938b520 --- stack/include/l2c_api.h | 2 -- stack/l2cap/l2c_int.h | 3 --- stack/l2cap/l2c_link.cc | 4 ---- stack/l2cap/l2c_utils.cc | 4 ---- stack/smp/smp_l2c.cc | 12 ------------ 5 files changed, 25 deletions(-) diff --git a/stack/include/l2c_api.h b/stack/include/l2c_api.h index 29c9d4e48..feb0ad8a7 100644 --- a/stack/include/l2c_api.h +++ b/stack/include/l2c_api.h @@ -600,8 +600,6 @@ typedef struct { tL2CA_FIXED_CONGESTION_STATUS_CB* pL2CA_FixedCong_Cb; uint16_t default_idle_tout; - tL2CA_TX_COMPLETE_CB* - pL2CA_FixedTxComplete_Cb; /* fixed channel tx complete callback */ } tL2CAP_FIXED_CHNL_REG; /******************************************************************************* diff --git a/stack/l2cap/l2c_int.h b/stack/l2cap/l2c_int.h index 7bc3b5344..dd6afeff5 100644 --- a/stack/l2cap/l2c_int.h +++ b/stack/l2cap/l2c_int.h @@ -528,7 +528,6 @@ typedef void(tL2C_FCR_MGMT_EVT_HDLR)(uint8_t, tL2C_CCB*); typedef struct { uint16_t local_cid; uint16_t num_sdu; - tL2CA_TX_COMPLETE_CB* cb; } tL2C_TX_COMPLETE_CB_INFO; /* The offset in a buffer that L2CAP will use when building commands. @@ -600,8 +599,6 @@ extern void l2cu_set_acl_hci_header(BT_HDR* p_buf, tL2C_CCB* p_ccb); extern void l2cu_check_channel_congestion(tL2C_CCB* p_ccb); extern void l2cu_disconnect_chnl(tL2C_CCB* p_ccb); -extern void l2cu_tx_complete(tL2C_TX_COMPLETE_CB_INFO* p_cbi); - extern void l2cu_send_peer_ble_par_req(tL2C_LCB* p_lcb, uint16_t min_int, uint16_t max_int, uint16_t latency, uint16_t timeout); diff --git a/stack/l2cap/l2c_link.cc b/stack/l2cap/l2c_link.cc index 04c61b52f..8564eb091 100644 --- a/stack/l2cap/l2c_link.cc +++ b/stack/l2cap/l2c_link.cc @@ -1112,7 +1112,6 @@ static void l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf, } else { l2c_link_send_to_lower_ble(p_lcb, p_buf); } - if (p_cbi) l2cu_tx_complete(p_cbi); } /******************************************************************************* @@ -1402,8 +1401,6 @@ BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb, /* Highest priority are fixed channels */ int xx; - p_cbi->cb = NULL; - for (xx = 0; xx < L2CAP_NUM_FIXED_CHNLS; xx++) { p_ccb = p_lcb->p_fixed_ccbs[xx]; if (p_ccb == NULL) continue; @@ -1437,7 +1434,6 @@ BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb, } /* Prepare callback info for TX completion */ - p_cbi->cb = l2cb.fixed_reg[xx].pL2CA_FixedTxComplete_Cb; p_cbi->local_cid = p_ccb->local_cid; p_cbi->num_sdu = 1; diff --git a/stack/l2cap/l2c_utils.cc b/stack/l2cap/l2c_utils.cc index c39d13c2e..cdb3ecd91 100644 --- a/stack/l2cap/l2c_utils.cc +++ b/stack/l2cap/l2c_utils.cc @@ -2885,10 +2885,6 @@ tL2C_CCB* l2cu_find_ccb_by_cid(tL2C_LCB* p_lcb, uint16_t local_cid) { return (p_ccb); } -void l2cu_tx_complete(tL2C_TX_COMPLETE_CB_INFO* p_cbi) { - if (p_cbi->cb != NULL) p_cbi->cb(p_cbi->local_cid, p_cbi->num_sdu); -} - /****************************************************************************** * * Function l2cu_set_acl_hci_header diff --git a/stack/smp/smp_l2c.cc b/stack/smp/smp_l2c.cc index f652c295b..d1a3dceb1 100644 --- a/stack/smp/smp_l2c.cc +++ b/stack/smp/smp_l2c.cc @@ -32,8 +32,6 @@ #include "smp_int.h" -static void smp_tx_complete_callback(uint16_t cid, uint16_t num_pkt); - static void smp_connect_callback(uint16_t channel, const RawAddress& bd_addr, bool connected, uint16_t reason, tBT_TRANSPORT transport); @@ -60,7 +58,6 @@ void smp_l2cap_if_init(void) { fixed_reg.pL2CA_FixedConn_Cb = smp_connect_callback; fixed_reg.pL2CA_FixedData_Cb = smp_data_received; - fixed_reg.pL2CA_FixedTxComplete_Cb = smp_tx_complete_callback; fixed_reg.pL2CA_FixedCong_Cb = NULL; /* do not handle congestion on this channel */ @@ -203,15 +200,6 @@ static void smp_data_received(uint16_t channel, const RawAddress& bd_addr, /******************************************************************************* * - * Function smp_tx_complete_callback - * - * Description SMP channel tx complete callback - * - ******************************************************************************/ -static void smp_tx_complete_callback(uint16_t cid, uint16_t num_pkt) {} - -/******************************************************************************* - * * Function smp_br_connect_callback * * Description This callback function is called by L2CAP to indicate that -- 2.11.0