diff options
author | 2024-10-25 22:49:41 +0000 | |
---|---|---|
committer | 2024-10-25 23:38:30 +0000 | |
commit | e100ef70d41f845ca959e19210b55c504480e0e8 (patch) | |
tree | ba0e1552c068fc347876c011d74901679247233b | |
parent | ae595fb4496288982f512bc8a09e191a97ce7eff (diff) |
system/stack/l2cap: Fix -Wmissing-prototype errors
Bug: 369381361
Test: m com.android.btservices
Flag: EXEMPT, no logical change
Change-Id: I9c17c0fe74e26d05fb25d07db3e4d9f738cc61b3
-rw-r--r-- | system/stack/acl/btm_acl.cc | 3 | ||||
-rw-r--r-- | system/stack/fuzzers/l2cap_fuzzer.cc | 3 | ||||
-rw-r--r-- | system/stack/include/l2cap_acl_interface.h | 3 | ||||
-rw-r--r-- | system/stack/include/l2cap_hci_link_interface.h | 3 | ||||
-rw-r--r-- | system/stack/l2cap/l2c_api.cc | 11 | ||||
-rw-r--r-- | system/stack/l2cap/l2c_ble.cc | 11 | ||||
-rw-r--r-- | system/stack/l2cap/l2c_ble_conn_params.cc | 4 | ||||
-rw-r--r-- | system/stack/l2cap/l2c_int.h | 6 | ||||
-rw-r--r-- | system/stack/l2cap/l2c_link.cc | 47 | ||||
-rw-r--r-- | system/stack/l2cap/l2c_main.cc | 5 | ||||
-rw-r--r-- | system/stack/l2cap/l2c_utils.cc | 33 | ||||
-rw-r--r-- | system/test/mock/mock_stack_l2cap_api.cc | 5 | ||||
-rw-r--r-- | system/test/mock/mock_stack_l2cap_api.h | 11 | ||||
-rw-r--r-- | system/test/mock/mock_stack_l2cap_ble.cc | 6 | ||||
-rw-r--r-- | system/test/mock/mock_stack_l2cap_ble.h | 14 | ||||
-rw-r--r-- | system/test/mock/mock_stack_l2cap_link.cc | 20 | ||||
-rw-r--r-- | system/test/mock/mock_stack_l2cap_utils.cc | 10 |
17 files changed, 27 insertions, 168 deletions
diff --git a/system/stack/acl/btm_acl.cc b/system/stack/acl/btm_acl.cc index 612fd9dc63..0c52e80bb6 100644 --- a/system/stack/acl/btm_acl.cc +++ b/system/stack/acl/btm_acl.cc @@ -76,6 +76,7 @@ #include "stack/include/l2cap_acl_interface.h" #include "stack/include/l2cdefs.h" #include "stack/include/main_thread.h" +#include "stack/l2cap/l2c_int.h" #include "types/hci_role.h" #include "types/raw_address.h" @@ -96,8 +97,6 @@ using bluetooth::legacy::hci::GetInterface; void BTM_update_version_info(const RawAddress& bd_addr, const remote_version_info& remote_version_info); -void l2c_link_hci_conn_comp(tHCI_STATUS status, uint16_t handle, const RawAddress& p_bda); - void BTM_db_reset(void); extern tBTM_CB btm_cb; diff --git a/system/stack/fuzzers/l2cap_fuzzer.cc b/system/stack/fuzzers/l2cap_fuzzer.cc index fd68f98486..2c5c3d2cde 100644 --- a/system/stack/fuzzers/l2cap_fuzzer.cc +++ b/system/stack/fuzzers/l2cap_fuzzer.cc @@ -36,6 +36,7 @@ #include "stack/include/l2cap_interface.h" #include "stack/include/l2cap_module.h" #include "stack/include/l2cdefs.h" +#include "stack/l2cap/l2c_int.h" #include "test/fake/fake_osi.h" #include "test/mock/mock_main_shim_entry.h" #include "test/mock/mock_stack_acl.h" @@ -161,8 +162,6 @@ constexpr uint16_t kSmpBrHndl = 0x0222; constexpr uint16_t kNumClassicAclBuffer = 100; constexpr uint16_t kNumLeAclBuffer = 100; -void l2c_link_hci_conn_comp(tHCI_STATUS status, uint16_t handle, const RawAddress& p_bda); - static void Fuzz(const uint8_t* data, size_t size) { memset(&btm_cb, 0, sizeof(btm_cb)); diff --git a/system/stack/include/l2cap_acl_interface.h b/system/stack/include/l2cap_acl_interface.h index 811b5c1288..7751d14255 100644 --- a/system/stack/include/l2cap_acl_interface.h +++ b/system/stack/include/l2cap_acl_interface.h @@ -32,9 +32,6 @@ void acl_write_automatic_flush_timeout(const RawAddress& bd_addr, uint16_t flush // ACL data received from HCI-ACL void l2c_rcv_acl_data(BT_HDR* p_msg); -// Segments is sent to HCI-ACL -void l2c_link_segments_xmitted(BT_HDR* p_msg); - void l2cu_resubmit_pending_sec_req(const RawAddress* p_bda); void l2c_packets_completed(uint16_t handle, uint16_t num_sent); diff --git a/system/stack/include/l2cap_hci_link_interface.h b/system/stack/include/l2cap_hci_link_interface.h index 978aadade5..8699d1aa03 100644 --- a/system/stack/include/l2cap_hci_link_interface.h +++ b/system/stack/include/l2cap_hci_link_interface.h @@ -47,9 +47,6 @@ void l2cble_notify_le_connection(const RawAddress& bda); void l2cble_use_preferred_conn_params(const RawAddress& bda); -void l2cble_process_rc_param_request_evt(uint16_t handle, uint16_t int_min, uint16_t int_max, - uint16_t latency, uint16_t timeout); - // Invoked when HCI mode is changed to HCI_MODE_ACTIVE or HCI_MODE_SNIFF void l2c_OnHciModeChangeSendPendingPackets(RawAddress remote); diff --git a/system/stack/l2cap/l2c_api.cc b/system/stack/l2cap/l2c_api.cc index cb66ec209d..a233046a74 100644 --- a/system/stack/l2cap/l2c_api.cc +++ b/system/stack/l2cap/l2c_api.cc @@ -45,13 +45,11 @@ #include "stack/include/bt_hdr.h" #include "stack/include/bt_psm_types.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/l2cap_module.h" #include "stack/include/main_thread.h" #include "stack/l2cap/l2c_int.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; extern fixed_queue_t* btu_general_alarm_queue; @@ -59,13 +57,6 @@ tL2C_AVDT_CHANNEL_INFO av_media_channels[MAX_ACTIVE_AVDT_CONN]; constexpr uint16_t L2CAP_LE_CREDIT_THRESHOLD = 64; -tBT_TRANSPORT l2c_get_transport_from_fixed_cid(uint16_t fixed_cid) { - if (fixed_cid >= L2CAP_ATT_CID && fixed_cid <= L2CAP_SMP_CID) { - return BT_TRANSPORT_LE; - } - return BT_TRANSPORT_BR_EDR; -} - uint16_t L2CA_RegisterWithSecurity(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu, uint16_t required_remote_mtu, diff --git a/system/stack/l2cap/l2c_ble.cc b/system/stack/l2cap/l2c_ble.cc index fe22262b89..9d69e5ab36 100644 --- a/system/stack/l2cap/l2c_ble.cc +++ b/system/stack/l2cap/l2c_ble.cc @@ -53,21 +53,18 @@ #include "stack/include/btm_log_history.h" #include "stack/include/btm_status.h" #include "stack/include/l2cap_acl_interface.h" +#include "stack/include/l2cap_controller_interface.h" +#include "stack/include/l2cap_hci_link_interface.h" #include "stack/include/l2cap_interface.h" #include "stack/include/l2cdefs.h" #include "stack/include/main_thread.h" #include "stack/l2cap/l2c_int.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; namespace { - constexpr char kBtmLogTag[] = "L2CAP"; - } extern tBTM_CB btm_cb; @@ -1280,8 +1277,8 @@ void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) { * Returns void * ******************************************************************************/ -void l2cble_sec_comp(RawAddress bda, tBT_TRANSPORT transport, void* /* p_ref_data */, - tBTM_STATUS btm_status) { +static void l2cble_sec_comp(RawAddress bda, tBT_TRANSPORT transport, void* /* p_ref_data */, + tBTM_STATUS btm_status) { tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bda, BT_TRANSPORT_LE); tL2CAP_SEC_DATA* p_buf = NULL; uint8_t sec_act; diff --git a/system/stack/l2cap/l2c_ble_conn_params.cc b/system/stack/l2cap/l2c_ble_conn_params.cc index f617e59d5d..1e9d4ba7ab 100644 --- a/system/stack/l2cap/l2c_ble_conn_params.cc +++ b/system/stack/l2cap/l2c_ble_conn_params.cc @@ -38,14 +38,12 @@ #include "stack/include/acl_api.h" #include "stack/include/btm_ble_api_types.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/l2cap_hci_link_interface.h" #include "stack/include/l2cap_interface.h" #include "stack/include/main_thread.h" #include "stack/l2cap/l2c_int.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; void l2cble_start_conn_update(tL2C_LCB* p_lcb); diff --git a/system/stack/l2cap/l2c_int.h b/system/stack/l2cap/l2c_int.h index 2a43844dd7..02a1fa66ad 100644 --- a/system/stack/l2cap/l2c_int.h +++ b/system/stack/l2cap/l2c_int.h @@ -784,11 +784,12 @@ void l2cu_adjust_out_mps(tL2C_CCB* p_ccb); /* Functions provided by l2c_link.cc *********************************** */ + void l2c_link_timeout(tL2C_LCB* p_lcb); void l2c_info_resp_timer_timeout(void* data); void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, uint16_t local_cid, BT_HDR* p_buf); void l2c_link_adjust_allocation(void); - +void l2c_link_hci_conn_comp(tHCI_STATUS status, uint16_t handle, const RawAddress& p_bda); void l2c_link_sec_comp(RawAddress p_bda, tBT_TRANSPORT transport, void* p_ref_data, tBTM_STATUS status); void l2c_link_adjust_chnl_allocation(void); @@ -832,10 +833,11 @@ void l2c_fcr_stop_timer(tL2C_CCB* p_ccb); /* Functions provided by l2c_ble.cc *********************************** */ + bool l2cble_create_conn(tL2C_LCB* p_lcb); void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len); void l2c_ble_link_adjust_allocation(void); - +void l2cble_start_conn_update(tL2C_LCB* p_lcb); void l2cble_credit_based_conn_req(tL2C_CCB* p_ccb); void l2cble_credit_based_conn_res(tL2C_CCB* p_ccb, tL2CAP_LE_RESULT_CODE result); void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb); diff --git a/system/stack/l2cap/l2c_link.cc b/system/stack/l2cap/l2c_link.cc index b7521ab677..3a3bb4290d 100644 --- a/system/stack/l2cap/l2c_link.cc +++ b/system/stack/l2cap/l2c_link.cc @@ -40,15 +40,13 @@ #include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/l2cap_acl_interface.h" +#include "stack/include/l2cap_controller_interface.h" #include "stack/include/l2cap_hci_link_interface.h" #include "stack/include/l2cap_security_interface.h" #include "stack/l2cap/l2c_int.h" #include "types/bt_transport.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; extern tBTM_CB btm_cb; @@ -1151,45 +1149,6 @@ void l2c_packets_completed(uint16_t handle, uint16_t num_sent) { } } -/******************************************************************************* - * - * Function l2c_link_segments_xmitted - * - * Description This function is called from the HCI Interface when an ACL - * data packet segment is transmitted. - * - * Returns void - * - ******************************************************************************/ -void l2c_link_segments_xmitted(BT_HDR* p_msg) { - uint8_t* p = (uint8_t*)(p_msg + 1) + p_msg->offset; - - /* Extract the handle */ - uint16_t handle{HCI_INVALID_HANDLE}; - STREAM_TO_UINT16(handle, p); - handle = HCID_GET_HANDLE(handle); - - /* Find the LCB based on the handle */ - tL2C_LCB* p_lcb = l2cu_find_lcb_by_handle(handle); - if (p_lcb == nullptr) { - log::warn("Received segment complete for unknown connection handle:{}", handle); - osi_free(p_msg); - return; - } - - if (p_lcb->link_state != LST_CONNECTED) { - log::info("Received segment complete for unconnected connection handle:{}:", handle); - osi_free(p_msg); - return; - } - - /* Enqueue the buffer to the head of the transmit queue, and see */ - /* if we can transmit anything more. */ - list_prepend(p_lcb->link_xmit_data_q, p_msg); - - l2c_link_check_send_pkts(p_lcb, 0, NULL); -} - tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& bd_addr) { tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR); if (p_lcb && (p_lcb->link_state == LST_CONNECTED || p_lcb->link_state == LST_CONNECTING)) { @@ -1222,7 +1181,7 @@ void l2cble_update_sec_act(const RawAddress& bd_addr, uint16_t sec_act) { * Returns pointer to CCB or NULL * ******************************************************************************/ -tL2C_CCB* l2cu_get_next_channel_in_rr(tL2C_LCB* p_lcb) { +static tL2C_CCB* l2cu_get_next_channel_in_rr(tL2C_LCB* p_lcb) { tL2C_CCB* p_serve_ccb = NULL; tL2C_CCB* p_ccb; @@ -1320,7 +1279,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) { +static BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* p_lcb, tL2C_TX_COMPLETE_CB_INFO* p_cbi) { tL2C_CCB* p_ccb; BT_HDR* p_buf; diff --git a/system/stack/l2cap/l2c_main.cc b/system/stack/l2cap/l2c_main.cc index 9259283109..057b474f5b 100644 --- a/system/stack/l2cap/l2c_main.cc +++ b/system/stack/l2cap/l2c_main.cc @@ -35,14 +35,13 @@ #include "stack/include/bt_psm_types.h" #include "stack/include/bt_types.h" #include "stack/include/hcimsgs.h" // HCID_GET_ +#include "stack/include/l2cap_acl_interface.h" #include "stack/include/l2cap_hci_link_interface.h" #include "stack/include/l2cap_interface.h" +#include "stack/include/l2cap_module.h" #include "stack/include/l2cdefs.h" #include "stack/l2cap/l2c_int.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; /******************************************************************************/ diff --git a/system/stack/l2cap/l2c_utils.cc b/system/stack/l2cap/l2c_utils.cc index 612b941895..0e923a559c 100644 --- a/system/stack/l2cap/l2c_utils.cc +++ b/system/stack/l2cap/l2c_utils.cc @@ -44,19 +44,16 @@ #include "stack/include/hci_error_code.h" #include "stack/include/hcidefs.h" #include "stack/include/l2cap_acl_interface.h" +#include "stack/include/l2cap_controller_interface.h" #include "stack/include/l2cap_hci_link_interface.h" #include "stack/include/l2cap_interface.h" +#include "stack/include/l2cap_security_interface.h" #include "stack/include/l2cdefs.h" #include "stack/l2cap/l2c_int.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; -tL2C_CCB* l2cu_get_next_channel_in_rr(tL2C_LCB* p_lcb); // TODO Move - /* The offset in a buffer that L2CAP will use when building commands. */ #define L2CAP_SEND_CMD_OFFSET 0 @@ -305,7 +302,7 @@ bool l2c_is_cmd_rejected(uint8_t cmd_code, uint8_t signal_id, tL2C_LCB* p_lcb) { * Returns Pointer to allocated packet or NULL if no resources * ******************************************************************************/ -BT_HDR* l2cu_build_header(tL2C_LCB* p_lcb, uint16_t len, uint8_t cmd, uint8_t signal_id) { +static BT_HDR* l2cu_build_header(tL2C_LCB* p_lcb, uint16_t len, uint8_t cmd, uint8_t signal_id) { BT_HDR* p_buf = (BT_HDR*)osi_malloc(L2CAP_CMD_BUF_SIZE); uint8_t* p; @@ -348,7 +345,7 @@ BT_HDR* l2cu_build_header(tL2C_LCB* p_lcb, uint16_t len, uint8_t cmd, uint8_t si * Returns void * ******************************************************************************/ -void l2cu_adj_id(tL2C_LCB* p_lcb) { +static void l2cu_adj_id(tL2C_LCB* p_lcb) { if (p_lcb->signal_id == 0) { p_lcb->signal_id++; } @@ -2209,28 +2206,6 @@ void l2cu_create_conn_br_edr(tL2C_LCB* p_lcb) { /******************************************************************************* * - * Function l2cu_get_num_hi_priority - * - * Description Gets the number of high priority channels. - * - * Returns - * - ******************************************************************************/ -uint8_t l2cu_get_num_hi_priority(void) { - uint8_t no_hi = 0; - int xx; - tL2C_LCB* p_lcb = &l2cb.lcb_pool[0]; - - for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) { - if ((p_lcb->in_use) && (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH)) { - no_hi++; - } - } - return no_hi; -} - -/******************************************************************************* - * * Function l2cu_create_conn_after_switch * * Description This continues a connection creation possibly after diff --git a/system/test/mock/mock_stack_l2cap_api.cc b/system/test/mock/mock_stack_l2cap_api.cc index c360878a6b..b8f3f4e227 100644 --- a/system/test/mock/mock_stack_l2cap_api.cc +++ b/system/test/mock/mock_stack_l2cap_api.cc @@ -37,7 +37,6 @@ namespace mock { namespace stack_l2cap_api { // Function state capture and return values, if needed -struct l2c_get_transport_from_fixed_cid l2c_get_transport_from_fixed_cid; struct L2CA_RegisterWithSecurity L2CA_RegisterWithSecurity; struct L2CA_Register L2CA_Register; struct L2CA_Deregister L2CA_Deregister; @@ -82,10 +81,6 @@ struct L2CA_LeCreditThreshold L2CA_LeCreditThreshold; } // namespace test // Mocked functions, if any -tBT_TRANSPORT l2c_get_transport_from_fixed_cid(uint16_t fixed_cid) { - inc_func_call_count(__func__); - return test::mock::stack_l2cap_api::l2c_get_transport_from_fixed_cid(fixed_cid); -} uint16_t L2CA_RegisterWithSecurity(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu, uint16_t required_remote_mtu, diff --git a/system/test/mock/mock_stack_l2cap_api.h b/system/test/mock/mock_stack_l2cap_api.h index c2d162afd2..40d746ecd3 100644 --- a/system/test/mock/mock_stack_l2cap_api.h +++ b/system/test/mock/mock_stack_l2cap_api.h @@ -39,17 +39,6 @@ namespace test { namespace mock { namespace stack_l2cap_api { - -// Shared state between mocked functions and tests -// Name: l2c_get_transport_from_fixed_cid -// Params: uint16_t fixed_cid -// Returns: tBT_TRANSPORT -struct l2c_get_transport_from_fixed_cid { - std::function<tBT_TRANSPORT(uint16_t fixed_cid)> body{ - [](uint16_t /* fixed_cid */) { return BT_TRANSPORT_AUTO; }}; - tBT_TRANSPORT operator()(uint16_t fixed_cid) { return body(fixed_cid); } -}; -extern struct l2c_get_transport_from_fixed_cid l2c_get_transport_from_fixed_cid; // Name: L2CA_RegisterWithSecurity // Params: uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, // tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu, uint16_t required_remote_mtu, diff --git a/system/test/mock/mock_stack_l2cap_ble.cc b/system/test/mock/mock_stack_l2cap_ble.cc index ee62576516..7dcd2f6bf0 100644 --- a/system/test/mock/mock_stack_l2cap_ble.cc +++ b/system/test/mock/mock_stack_l2cap_ble.cc @@ -58,7 +58,6 @@ struct l2cble_credit_based_conn_req l2cble_credit_based_conn_req; struct l2cble_credit_based_conn_res l2cble_credit_based_conn_res; struct l2cble_send_flow_control_credit l2cble_send_flow_control_credit; struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req; -struct l2cble_sec_comp l2cble_sec_comp; struct l2ble_sec_access_req l2ble_sec_access_req; struct L2CA_AdjustConnectionIntervals L2CA_AdjustConnectionIntervals; struct L2CA_SetEcosystemBaseInterval L2CA_SetEcosystemBaseInterval; @@ -158,11 +157,6 @@ void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) { inc_func_call_count(__func__); test::mock::stack_l2cap_ble::l2cble_send_peer_disc_req(p_ccb); } -void l2cble_sec_comp(const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data, - tBTM_STATUS status) { - inc_func_call_count(__func__); - test::mock::stack_l2cap_ble::l2cble_sec_comp(bda, transport, p_ref_data, status); -} tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr, uint16_t psm, bool is_originator, tBTM_SEC_CALLBACK* p_callback, void* p_ref_data) { diff --git a/system/test/mock/mock_stack_l2cap_ble.h b/system/test/mock/mock_stack_l2cap_ble.h index 6f13fed735..c5c3e45a1d 100644 --- a/system/test/mock/mock_stack_l2cap_ble.h +++ b/system/test/mock/mock_stack_l2cap_ble.h @@ -227,20 +227,6 @@ struct l2cble_send_peer_disc_req { void operator()(tL2C_CCB* p_ccb) { body(p_ccb); } }; extern struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req; -// Name: l2cble_sec_comp -// Params: const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data, -// tBTM_STATUS status Returns: void -struct l2cble_sec_comp { - std::function<void(const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data, - tBTM_STATUS status)> - body{[](const RawAddress* /* bda */, tBT_TRANSPORT /* transport */, - void* /* p_ref_data */, tBTM_STATUS /* status */) {}}; - void operator()(const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data, - tBTM_STATUS status) { - body(bda, transport, p_ref_data, status); - } -}; -extern struct l2cble_sec_comp l2cble_sec_comp; // Name: l2ble_sec_access_req // Params: const RawAddress& bd_addr, uint16_t psm, bool is_originator, // tL2CAP_SEC_CBACK* p_callback, void* p_ref_data Returns: tL2CAP_LE_RESULT_CODE diff --git a/system/test/mock/mock_stack_l2cap_link.cc b/system/test/mock/mock_stack_l2cap_link.cc index c0dea8c1fc..0c520ee594 100644 --- a/system/test/mock/mock_stack_l2cap_link.cc +++ b/system/test/mock/mock_stack_l2cap_link.cc @@ -22,17 +22,14 @@ #include "stack/include/bt_hdr.h" #include "stack/include/btm_status.h" +#include "stack/include/l2cap_acl_interface.h" +#include "stack/include/l2cap_controller_interface.h" +#include "stack/include/l2cap_hci_link_interface.h" +#include "stack/include/l2cap_security_interface.h" #include "stack/l2cap/l2c_int.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - -BT_HDR* l2cu_get_next_buffer_to_send(tL2C_LCB* /* p_lcb */) { - inc_func_call_count(__func__); - return nullptr; -} bool l2c_link_hci_disc_comp(uint16_t /* handle */, tHCI_REASON /* reason */) { inc_func_call_count(__func__); return false; @@ -41,10 +38,6 @@ tBTM_STATUS l2cu_ConnectAclForSecurity(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); return tBTM_STATUS::BTM_SUCCESS; } -tL2C_CCB* l2cu_get_next_channel_in_rr(tL2C_LCB* /* p_lcb */) { - inc_func_call_count(__func__); - return nullptr; -} void l2c_OnHciModeChangeSendPendingPackets(RawAddress /* remote */) { inc_func_call_count(__func__); } @@ -64,12 +57,11 @@ void l2c_link_role_changed(const RawAddress* /* bd_addr */, tHCI_ROLE /* new_rol tHCI_STATUS /* hci_status */) { inc_func_call_count(__func__); } -void l2c_link_sec_comp(const RawAddress* /* p_bda */, tBT_TRANSPORT /* transport */, - void* /* p_ref_data */, uint8_t /* status */) { +void l2c_link_sec_comp(const RawAddress /* bda */, tBT_TRANSPORT /* transport */, + void* /* p_ref_data */, tBTM_STATUS /* status */) { inc_func_call_count(__func__); } -void l2c_link_segments_xmitted(BT_HDR* /* p_msg */) { inc_func_call_count(__func__); } void l2c_link_timeout(tL2C_LCB* /* p_lcb */) { inc_func_call_count(__func__); } void l2c_packets_completed(uint16_t /* handle */, uint16_t /* num_sent */) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_stack_l2cap_utils.cc b/system/test/mock/mock_stack_l2cap_utils.cc index accdc72881..f485c111e4 100644 --- a/system/test/mock/mock_stack_l2cap_utils.cc +++ b/system/test/mock/mock_stack_l2cap_utils.cc @@ -29,11 +29,6 @@ // TODO(b/369381361) Enfore -Wmissing-prototypes #pragma GCC diagnostic ignored "-Wmissing-prototypes" -BT_HDR* l2cu_build_header(tL2C_LCB* /* p_lcb */, uint16_t /* len */, uint8_t /* cmd */, - uint8_t /* signal_id */) { - inc_func_call_count(__func__); - return nullptr; -} bool l2c_is_cmd_rejected(uint8_t /* cmd_code */, uint8_t /* signal_id */, tL2C_LCB* /* p_lcb */) { inc_func_call_count(__func__); return false; @@ -113,15 +108,10 @@ tL2C_RCB* l2cu_find_rcb_by_psm(uint16_t /* psm */) { inc_func_call_count(__func__); return nullptr; } -uint8_t l2cu_get_num_hi_priority(void) { - inc_func_call_count(__func__); - return 0; -} uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* /* p_ccb */, tL2CAP_CFG_INFO* /* p_cfg */) { inc_func_call_count(__func__); return 0; } -void l2cu_adj_id(tL2C_LCB* /* p_lcb */) { inc_func_call_count(__func__); } void l2cu_adjust_out_mps(tL2C_CCB* /* p_ccb */) { inc_func_call_count(__func__); } void l2cu_change_pri_ccb(tL2C_CCB* /* p_ccb */, tL2CAP_CHNL_PRIORITY /* priority */) { inc_func_call_count(__func__); |