OSDN Git Service

L2cap fixed channel tx complete is unused
authorHansong Zhang <hsz@google.com>
Fri, 2 Oct 2020 18:21:58 +0000 (11:21 -0700)
committerHansong Zhang <hsz@google.com>
Thu, 8 Oct 2020 19:15:35 +0000 (12:15 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Iae3801999b031c904f048acd3e4c27745938b520

stack/include/l2c_api.h
stack/l2cap/l2c_int.h
stack/l2cap/l2c_link.cc
stack/l2cap/l2c_utils.cc
stack/smp/smp_l2c.cc

index 29c9d4e..feb0ad8 100644 (file)
@@ -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;
 
 /*******************************************************************************
index 7bc3b53..dd6afef 100644 (file)
@@ -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);
index 04c61b5..8564eb0 100644 (file)
@@ -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;
 
index c39d13c..cdb3ecd 100644 (file)
@@ -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
index f652c29..d1a3dce 100644 (file)
@@ -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