Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f05300fe authored by Henri Chataing's avatar Henri Chataing Committed by Gerrit Code Review
Browse files

Merge "system/stack/acl: Fix -Wmissing-prototype errors" into main

parents 7e36f462 ca3326e7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -27,15 +27,13 @@
#include "stack/btm/btm_sec.h"
#include "stack/connection_manager/connection_manager.h"
#include "stack/include/acl_api.h"
#include "stack/include/ble_acl_interface.h"
#include "stack/include/btm_ble_addr.h"
#include "stack/include/btm_ble_privacy.h"
#include "stack/include/gatt_api.h"
#include "stack/include/l2cap_hci_link_interface.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;
+6 −32
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@
#include "stack/include/btm_status.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hcimsgs.h"
#include "stack/include/inq_hci_link_interface.h"
#include "stack/include/l2cap_acl_interface.h"
#include "stack/include/l2cdefs.h"
#include "stack/include/main_thread.h"
@@ -88,9 +89,6 @@
#define PROPERTY_AUTO_FLUSH_TIMEOUT "bluetooth.core.classic.auto_flush_timeout"
#endif

// TODO(b/369381361) Enfore -Wmissing-prototypes
#pragma GCC diagnostic ignored "-Wmissing-prototypes"

using namespace bluetooth;
using bluetooth::legacy::hci::GetInterface;

@@ -212,27 +210,6 @@ void StackAclBtmAcl::hci_start_role_switch_to_central(tACL_CONN& p_acl) {
  p_acl.rs_disc_pending = BTM_SEC_RS_PENDING;
}

void hci_btm_set_link_supervision_timeout(tACL_CONN& link, uint16_t timeout) {
  if (link.link_role != HCI_ROLE_CENTRAL) {
    /* Only send if current role is Central; 2.0 spec requires this */
    log::warn("Can only set link supervision timeout if central role:{}", RoleText(link.link_role));
    return;
  }

  if (!bluetooth::shim::GetController()->IsSupported(
              bluetooth::hci::OpCode::WRITE_LINK_SUPERVISION_TIMEOUT)) {
    log::warn(
            "UNSUPPORTED by controller write link supervision timeout:{:.2f}ms "
            "bd_addr:{}",
            supervision_timeout_to_seconds(timeout), link.RemoteAddress());
    return;
  }
  log::debug("Setting link supervision timeout:{:.2f}s peer:{}", double(timeout) * 0.01,
             link.RemoteAddress());
  link.link_super_tout = timeout;
  btsnd_hcic_write_link_super_tout(link.Handle(), timeout);
}

/* 3 seconds timeout waiting for responses */
#define BTM_DEV_REPLY_TIMEOUT_MS (3 * 1000)

@@ -302,10 +279,6 @@ tACL_CONN* StackAclBtmAcl::btm_bda_to_acl(const RawAddress& bda, tBT_TRANSPORT t
  return nullptr;
}

tACL_CONN* acl_get_connection_from_address(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
  return internal_.btm_bda_to_acl(bd_addr, transport);
}

void StackAclBtmAcl::btm_acl_consolidate(const RawAddress& identity_addr, const RawAddress& rpa) {
  tACL_CONN* p_acl = &btm_cb.acl_cb_.acl_db[0];
  for (uint8_t index = 0; index < MAX_L2CAP_LINKS; index++, p_acl++) {
@@ -356,7 +329,7 @@ tACL_CONN* StackAclBtmAcl::acl_get_connection_from_handle(uint16_t hci_handle) {
  return &btm_cb.acl_cb_.acl_db[index];
}

tACL_CONN* acl_get_connection_from_handle(uint16_t handle) {
static tACL_CONN* acl_get_connection_from_handle(uint16_t handle) {
  return internal_.acl_get_connection_from_handle(handle);
}

@@ -803,8 +776,9 @@ static void maybe_chain_more_commands_after_read_remote_version_complete(uint8_t
  btm_iot_save_remote_versions(p_acl_cb);
}

void btm_process_remote_version_complete(uint8_t status, uint16_t handle, uint8_t lmp_version,
                                         uint16_t manufacturer, uint16_t lmp_subversion) {
static void btm_process_remote_version_complete(uint8_t status, uint16_t handle,
                                                uint8_t lmp_version, uint16_t manufacturer,
                                                uint16_t lmp_subversion) {
  tACL_CONN* p_acl_cb = internal_.acl_get_connection_from_handle(handle);
  if (p_acl_cb == nullptr) {
    log::warn("Received remote version complete for unknown acl");
@@ -2376,7 +2350,7 @@ void acl_disconnect_from_handle(uint16_t handle, tHCI_STATUS reason, std::string
// 7.1.6 Disconnect command
// Only a subset of reasons are valid and will be accepted
// by the controller
bool is_disconnect_reason_valid(const tHCI_REASON& reason) {
static bool is_disconnect_reason_valid(const tHCI_REASON& reason) {
  switch (reason) {
    case HCI_ERR_AUTH_FAILURE:
    case HCI_ERR_PEER_USER:
+6 −8
Original line number Diff line number Diff line
@@ -44,19 +44,17 @@
#include "main/shim/entry.h"
#include "osi/include/stack_power_telemetry.h"
#include "stack/btm/btm_int_types.h"
#include "stack/include/acl_api.h"
#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_log_history.h"
#include "stack/include/btm_status.h"
#include "stack/include/l2cap_hci_link_interface.h"
#include "stack/include/sco_hci_link_interface.h"
#include "types/raw_address.h"

// TODO(b/369381361) Enfore -Wmissing-prototypes
#pragma GCC diagnostic ignored "-Wmissing-prototypes"

using namespace bluetooth;

void l2c_OnHciModeChangeSendPendingPackets(RawAddress remote);
void btm_sco_chk_pend_unpark(tHCI_STATUS status, uint16_t handle);
void btm_cont_rswitch_from_handle(uint16_t hci_handle);
extern tBTM_CB btm_cb;

namespace {
@@ -750,7 +748,7 @@ void btm_pm_proc_mode_change(tHCI_STATUS hci_status, uint16_t hci_handle, tHCI_M
 * Returns          none.
 *
 ******************************************************************************/
void process_ssr_event(tHCI_STATUS status, uint16_t handle, uint16_t /* max_tx_lat */,
static void process_ssr_event(tHCI_STATUS status, uint16_t handle, uint16_t /* max_tx_lat */,
                              uint16_t max_rx_lat) {
  if (pm_mode_db.count(handle) == 0) {
    log::warn("Received sniff subrating event with no active ACL");
+1 −1
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include "stack/connection_manager/connection_manager.h"
#include "stack/include/acl_api.h"
#include "stack/include/acl_api_types.h"
#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_ble_privacy.h"
#include "stack/include/btm_inq.h"
@@ -57,7 +58,6 @@ using namespace ::bluetooth;
extern tBTM_CB btm_cb;

void btm_inq_db_reset(void);
void btm_pm_reset(void);
/******************************************************************************/
/*               L O C A L    D A T A    D E F I N I T I O N S                */
/******************************************************************************/
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ void acl_packets_completed(uint16_t handle, uint16_t num_packets);
void acl_process_supported_features(uint16_t handle, uint64_t features);
void acl_process_extended_features(uint16_t handle, uint8_t current_page_number,
                                   uint8_t max_page_number, uint64_t features);
void btm_pm_reset();
void btm_pm_on_mode_change(tHCI_STATUS status, uint16_t handle, tHCI_MODE current_mode,
                           uint16_t interval);
void btm_pm_on_sniff_subrating(tHCI_STATUS status, uint16_t handle,
Loading