From c666229f40d9f6a98587eb46cc5bb4dccc1179bd Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 27 Aug 2020 15:53:42 -0700 Subject: [PATCH] pL2CA_CreditsReceived_Cb is no longer useful Bug: 159815595 Tag: #refactor Test: compile & verify basic functions working Change-Id: Ic8085cedcfed0f18bb50853ca19d68983e80f904 --- stack/avct/avct_l2c.cc | 4 ++-- stack/avct/avct_l2c_br.cc | 21 ++++++++++----------- stack/avdt/avdt_l2c.cc | 4 ++-- stack/gap/gap_conn.cc | 1 - stack/gatt/gatt_main.cc | 3 +-- stack/hid/hidd_conn.cc | 20 +++++++++----------- stack/hid/hidh_conn.cc | 21 ++++++++++----------- stack/include/l2c_api.h | 1 - stack/l2cap/l2c_csm.cc | 6 ------ 9 files changed, 34 insertions(+), 47 deletions(-) diff --git a/stack/avct/avct_l2c.cc b/stack/avct/avct_l2c.cc index 0b0869cba..0a0145c20 100644 --- a/stack/avct/avct_l2c.cc +++ b/stack/avct/avct_l2c.cc @@ -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 */}; /******************************************************************************* * diff --git a/stack/avct/avct_l2c_br.cc b/stack/avct/avct_l2c_br.cc index 27fa19059..6b6ed3dcb 100644 --- a/stack/avct/avct_l2c_br.cc +++ b/stack/avct/avct_l2c_br.cc @@ -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 = { diff --git a/stack/avdt/avdt_l2c.cc b/stack/avdt/avdt_l2c.cc index c4cb11f91..d52b64dd2 100644 --- a/stack/avdt/avdt_l2c.cc +++ b/stack/avdt/avdt_l2c.cc @@ -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 */}; /******************************************************************************* * diff --git a/stack/gap/gap_conn.cc b/stack/gap/gap_conn.cc index fa409b409..483bdd006 100644 --- a/stack/gap/gap_conn.cc +++ b/stack/gap/gap_conn.cc @@ -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; } /******************************************************************************* diff --git a/stack/gatt/gatt_main.cc b/stack/gatt/gatt_main.cc index 134c21e8f..fff9f75f2 100644 --- a/stack/gatt/gatt_main.cc +++ b/stack/gatt/gatt_main.cc @@ -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; diff --git a/stack/hid/hidd_conn.cc b/stack/hid/hidd_conn.cc index 8daa4c79c..a64f6d284 100644 --- a/stack/hid/hidd_conn.cc +++ b/stack/hid/hidd_conn.cc @@ -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}; /******************************************************************************* * diff --git a/stack/hid/hidh_conn.cc b/stack/hid/hidh_conn.cc index be72be801..32822e998 100644 --- a/stack/hid/hidh_conn.cc +++ b/stack/hid/hidh_conn.cc @@ -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 */}; /******************************************************************************* * diff --git a/stack/include/l2c_api.h b/stack/include/l2c_api.h index 300c5a6d4..640fa31f1 100644 --- a/stack/include/l2c_api.h +++ b/stack/include/l2c_api.h @@ -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 diff --git a/stack/l2cap/l2c_csm.cc b/stack/l2cap/l2c_csm.cc index 33fa42893..7ae174ddb 100644 --- a/stack/l2cap/l2c_csm.cc +++ b/stack/l2cap/l2c_csm.cc @@ -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; -- 2.11.0