OSDN Git Service

pL2CA_CreditsReceived_Cb is no longer useful
authorHansong Zhang <hsz@google.com>
Thu, 27 Aug 2020 22:53:42 +0000 (15:53 -0700)
committerHansong Zhang <hsz@google.com>
Thu, 27 Aug 2020 22:59:33 +0000 (15:59 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Ic8085cedcfed0f18bb50853ca19d68983e80f904

stack/avct/avct_l2c.cc
stack/avct/avct_l2c_br.cc
stack/avdt/avdt_l2c.cc
stack/gap/gap_conn.cc
stack/gatt/gatt_main.cc
stack/hid/hidd_conn.cc
stack/hid/hidh_conn.cc
stack/include/l2c_api.h
stack/l2cap/l2c_csm.cc

index 0b0869c..0a0145c 100644 (file)
@@ -56,8 +56,8 @@ const tL2CAP_APPL_INFO avct_l2c_appl = {avct_l2c_connect_ind_cback,
                                         avct_l2c_disconnect_cfm_cback,
                                         avct_l2c_data_ind_cback,
                                         avct_l2c_congestion_ind_cback,
-                                        NULL, /* tL2CA_TX_COMPLETE_CB */
-                                        NULL /* tL2CA_CREDITS_RECEIVED_CB */};
+                                        NULL,
+                                        /* tL2CA_TX_COMPLETE_CB */};
 
 /*******************************************************************************
  *
index 27fa190..6b6ed3d 100644 (file)
@@ -81,17 +81,16 @@ void avct_l2c_br_congestion_ind_cback(uint16_t lcid, bool is_congested);
 void avct_l2c_br_data_ind_cback(uint16_t lcid, BT_HDR* p_buf);
 
 /* L2CAP callback function structure */
-const tL2CAP_APPL_INFO avct_l2c_br_appl = {
-    avct_l2c_br_connect_ind_cback,
-    avct_l2c_br_connect_cfm_cback,
-    avct_l2c_br_config_ind_cback,
-    avct_l2c_br_config_cfm_cback,
-    avct_l2c_br_disconnect_ind_cback,
-    avct_l2c_br_disconnect_cfm_cback,
-    avct_l2c_br_data_ind_cback,
-    avct_l2c_br_congestion_ind_cback,
-    NULL, /* tL2CA_TX_COMPLETE_CB */
-    NULL /* tL2CA_CREDITS_RECEIVED_CB */};
+const tL2CAP_APPL_INFO avct_l2c_br_appl = {avct_l2c_br_connect_ind_cback,
+                                           avct_l2c_br_connect_cfm_cback,
+                                           avct_l2c_br_config_ind_cback,
+                                           avct_l2c_br_config_cfm_cback,
+                                           avct_l2c_br_disconnect_ind_cback,
+                                           avct_l2c_br_disconnect_cfm_cback,
+                                           avct_l2c_br_data_ind_cback,
+                                           avct_l2c_br_congestion_ind_cback,
+                                           NULL,
+                                           /* tL2CA_TX_COMPLETE_CB */};
 
 /* Browsing channel eL2CAP default options */
 const tL2CAP_FCR_OPTS avct_l2c_br_fcr_opts_def = {
index c4cb11f..d52b64d 100644 (file)
@@ -56,8 +56,8 @@ const tL2CAP_APPL_INFO avdt_l2c_appl = {avdt_l2c_connect_ind_cback,
                                         avdt_l2c_disconnect_cfm_cback,
                                         avdt_l2c_data_ind_cback,
                                         avdt_l2c_congestion_ind_cback,
-                                        NULL, /* tL2CA_TX_COMPLETE_CB */
-                                        NULL /* tL2CA_CREDITS_RECEIVED_CB */};
+                                        NULL,
+                                        /* tL2CA_TX_COMPLETE_CB */};
 
 /*******************************************************************************
  *
index fa409b4..483bdd0 100644 (file)
@@ -118,7 +118,6 @@ void gap_conn_init(void) {
   conn.reg_info.pL2CA_DataInd_Cb = gap_data_ind;
   conn.reg_info.pL2CA_CongestionStatus_Cb = gap_congestion_ind;
   conn.reg_info.pL2CA_TxComplete_Cb = gap_tx_complete_ind;
-  conn.reg_info.pL2CA_CreditsReceived_Cb = NULL;
 }
 
 /*******************************************************************************
index 134c21e..fff9f75 100644 (file)
@@ -81,8 +81,7 @@ static const tL2CAP_APPL_INFO dyn_info = {gatt_l2cif_connect_ind_cback,
                                           gatt_l2cif_disconnect_cfm_cback,
                                           gatt_l2cif_data_ind_cback,
                                           gatt_l2cif_congest_cback,
-                                          NULL,
-                                          NULL /* tL2CA_CREDITS_RECEIVED_CB */};
+                                          NULL};
 
 tGATT_CB gatt_cb;
 
index 8daa4c7..a64f6d2 100644 (file)
@@ -56,17 +56,15 @@ static void hidd_l2cif_disconnect_cfm(uint16_t cid, uint16_t result);
 static void hidd_l2cif_data_ind(uint16_t cid, BT_HDR* p_msg);
 static void hidd_l2cif_cong_ind(uint16_t cid, bool congested);
 
-static const tL2CAP_APPL_INFO dev_reg_info = {
-    hidd_l2cif_connect_ind,
-    hidd_l2cif_connect_cfm,
-    hidd_l2cif_config_ind,
-    hidd_l2cif_config_cfm,
-    hidd_l2cif_disconnect_ind,
-    hidd_l2cif_disconnect_cfm,
-    hidd_l2cif_data_ind,
-    hidd_l2cif_cong_ind,
-    NULL,
-    NULL /* tL2CA_CREDITS_RECEIVED_CB */};
+static const tL2CAP_APPL_INFO dev_reg_info = {hidd_l2cif_connect_ind,
+                                              hidd_l2cif_connect_cfm,
+                                              hidd_l2cif_config_ind,
+                                              hidd_l2cif_config_cfm,
+                                              hidd_l2cif_disconnect_ind,
+                                              hidd_l2cif_disconnect_cfm,
+                                              hidd_l2cif_data_ind,
+                                              hidd_l2cif_cong_ind,
+                                              NULL};
 
 /*******************************************************************************
  *
index be72be8..32822e9 100644 (file)
@@ -65,17 +65,16 @@ static void hidh_l2cif_data_ind(uint16_t l2cap_cid, BT_HDR* p_msg);
 static void hidh_l2cif_disconnect_cfm(uint16_t l2cap_cid, uint16_t result);
 static void hidh_l2cif_cong_ind(uint16_t l2cap_cid, bool congested);
 
-static const tL2CAP_APPL_INFO hst_reg_info = {
-    hidh_l2cif_connect_ind,
-    hidh_l2cif_connect_cfm,
-    hidh_l2cif_config_ind,
-    hidh_l2cif_config_cfm,
-    hidh_l2cif_disconnect_ind,
-    hidh_l2cif_disconnect_cfm,
-    hidh_l2cif_data_ind,
-    hidh_l2cif_cong_ind,
-    NULL, /* tL2CA_TX_COMPLETE_CB */
-    NULL /* tL2CA_CREDITS_RECEIVED_CB */};
+static const tL2CAP_APPL_INFO hst_reg_info = {hidh_l2cif_connect_ind,
+                                              hidh_l2cif_connect_cfm,
+                                              hidh_l2cif_config_ind,
+                                              hidh_l2cif_config_cfm,
+                                              hidh_l2cif_disconnect_ind,
+                                              hidh_l2cif_disconnect_cfm,
+                                              hidh_l2cif_data_ind,
+                                              hidh_l2cif_cong_ind,
+                                              NULL,
+                                              /* tL2CA_TX_COMPLETE_CB */};
 
 /*******************************************************************************
  *
index 300c5a6..640fa31 100644 (file)
@@ -271,7 +271,6 @@ typedef struct {
   tL2CA_DATA_IND_CB* pL2CA_DataInd_Cb;
   tL2CA_CONGESTION_STATUS_CB* pL2CA_CongestionStatus_Cb;
   tL2CA_TX_COMPLETE_CB* pL2CA_TxComplete_Cb;
-  tL2CA_CREDITS_RECEIVED_CB* pL2CA_CreditsReceived_Cb;
 } tL2CAP_APPL_INFO;
 
 /* Define the structure that applications use to create or accept
index 33fa428..7ae174d 100644 (file)
@@ -1105,12 +1105,6 @@ static void l2c_csm_open(tL2C_CCB* p_ccb, uint16_t event, void* p_data) {
         l2cble_send_peer_disc_req(p_ccb);
       } else {
         p_ccb->peer_conn_cfg.credits += credit;
-
-        tL2CA_CREDITS_RECEIVED_CB* cr_cb =
-            p_ccb->p_rcb->api.pL2CA_CreditsReceived_Cb;
-        if (p_ccb->p_lcb->transport == BT_TRANSPORT_LE && (cr_cb)) {
-          (*cr_cb)(p_ccb->local_cid, credit, p_ccb->peer_conn_cfg.credits);
-        }
         l2c_link_check_send_pkts(p_ccb->p_lcb, 0, NULL);
       }
       break;