OSDN Git Service

tL2C_TX_COMPLETE_CB_INFO is unused
authorHansong Zhang <hsz@google.com>
Fri, 2 Oct 2020 18:26:23 +0000 (11:26 -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: I5f59b1d3cb903303a76d8e53a189732188d13f56

stack/l2cap/l2c_int.h
stack/l2cap/l2c_link.cc

index dd6afef..5234560 100644 (file)
@@ -523,13 +523,6 @@ typedef struct {
 
 typedef void(tL2C_FCR_MGMT_EVT_HDLR)(uint8_t, tL2C_CCB*);
 
-/* Necessary info for postponed TX completion callback
-*/
-typedef struct {
-  uint16_t local_cid;
-  uint16_t num_sdu;
-} tL2C_TX_COMPLETE_CB_INFO;
-
 /* The offset in a buffer that L2CAP will use when building commands.
 */
 #define L2CAP_SEND_CMD_OFFSET 0
index 8564eb0..bcb00ff 100644 (file)
 void btm_sco_acl_removed(const RawAddress* bda);
 void btm_ble_decrement_link_topology_mask(uint8_t link_role);
 
-static void l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf,
-                                   tL2C_TX_COMPLETE_CB_INFO* p_cbi);
-static BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb,
-                                            tL2C_TX_COMPLETE_CB_INFO* p_cbi);
+static void l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf);
+static BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb);
 
 /*******************************************************************************
  *
@@ -918,17 +916,16 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid,
       if (!list_is_empty(p_lcb->link_xmit_data_q)) {
         p_buf = (BT_HDR*)list_front(p_lcb->link_xmit_data_q);
         list_remove(p_lcb->link_xmit_data_q, p_buf);
-        l2c_link_send_to_lower(p_lcb, p_buf, NULL);
+        l2c_link_send_to_lower(p_lcb, p_buf);
       } else if (single_write) {
         /* If only doing one write, break out */
         break;
       }
       /* If nothing on the link queue, check the channel queue */
       else {
-        tL2C_TX_COMPLETE_CB_INFO cbi;
-        p_buf = l2cu_get_next_buffer_to_send(p_lcb, &cbi);
+        p_buf = l2cu_get_next_buffer_to_send(p_lcb);
         if (p_buf != NULL) {
-          l2c_link_send_to_lower(p_lcb, p_buf, &cbi);
+          l2c_link_send_to_lower(p_lcb, p_buf);
         }
       }
     }
@@ -961,7 +958,7 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid,
 
       p_buf = (BT_HDR*)list_front(p_lcb->link_xmit_data_q);
       list_remove(p_lcb->link_xmit_data_q, p_buf);
-      l2c_link_send_to_lower(p_lcb, p_buf, NULL);
+      l2c_link_send_to_lower(p_lcb, p_buf);
     }
 
     if (!single_write) {
@@ -971,11 +968,10 @@ void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid,
               (l2cb.controller_le_xmit_window != 0 &&
                (p_lcb->transport == BT_TRANSPORT_LE))) &&
              (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) {
-        tL2C_TX_COMPLETE_CB_INFO cbi;
-        p_buf = l2cu_get_next_buffer_to_send(p_lcb, &cbi);
+        p_buf = l2cu_get_next_buffer_to_send(p_lcb);
         if (p_buf == NULL) break;
 
-        l2c_link_send_to_lower(p_lcb, p_buf, &cbi);
+        l2c_link_send_to_lower(p_lcb, p_buf);
       }
     }
 
@@ -1105,8 +1101,7 @@ static void l2c_link_send_to_lower_ble(tL2C_LCB* p_lcb, BT_HDR* p_buf) {
       l2cb.ble_round_robin_unacked);
 }
 
-static void l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf,
-                                   tL2C_TX_COMPLETE_CB_INFO* p_cbi) {
+static void l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf) {
   if (p_lcb->transport == BT_TRANSPORT_BR_EDR) {
     l2c_link_send_to_lower_br_edr(p_lcb, p_buf);
   } else {
@@ -1393,8 +1388,7 @@ tL2C_CCB* l2cu_get_next_channel_in_rr(tL2C_LCB* p_lcb) {
  * Returns          pointer to buffer or NULL
  *
  ******************************************************************************/
-BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb,
-                                     tL2C_TX_COMPLETE_CB_INFO* p_cbi) {
+BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb) {
   tL2C_CCB* p_ccb;
   BT_HDR* p_buf;
 
@@ -1433,10 +1427,6 @@ BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb,
           return (NULL);
         }
 
-        /* Prepare callback info for TX completion */
-        p_cbi->local_cid = p_ccb->local_cid;
-        p_cbi->num_sdu = 1;
-
         l2cu_check_channel_congestion(p_ccb);
         l2cu_set_acl_hci_header(p_buf, p_ccb);
         return (p_buf);