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

Commit 6c8f475e authored by Henri Chataing's avatar Henri Chataing
Browse files

system/stack/btu: Fix -Wmissing-prototype errors

Bug: 369381361
Test: m com.android.btservices
Flag: EXEMPT, no logical change
Change-Id: I9f22d660df900ba7ab2a6faa04fd998e4fbe2da3
parent a0f0f303
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -22,12 +22,11 @@

#include "main/shim/hci_layer.h"
#include "main/shim/stack.h"
#include "stack/include/btu_hcif.h"
#include "stack/include/main_thread.h"

static const hci_t* hci;

void btu_hci_msg_process(BT_HDR* p_msg);

static void post_to_main_message_loop(BT_HDR* p_msg) {
  if (do_in_main_thread(base::Bind(&btu_hci_msg_process, p_msg)) != BT_STATUS_SUCCESS) {
    bluetooth::log::error("do_in_main_thread failed");
+0 −2
Original line number Diff line number Diff line
@@ -273,7 +273,6 @@ cc_library_static {
        "btm/btm_sec_cb.cc",
        "btm/btm_security_client_interface.cc",
        "btm/security_event_parser.cc",
        "btu/btu_event.cc",
        "btu/btu_hcif.cc",
        "connection_manager/connection_manager.cc",
        "eatt/eatt.cc",
@@ -1990,7 +1989,6 @@ cc_test {
        ":TestMockStackL2cap",
        ":TestMockStackMetrics",
        ":TestMockStackSmp",
        "btu/btu_event.cc",
        "btu/btu_hcif.cc",
        "btu/main_thread.cc",
        "test/stack_btu_test.cc",
+0 −1
Original line number Diff line number Diff line
@@ -118,7 +118,6 @@ source_set("stack") {
    "btm/hfp_lc3_decoder_linux.cc",
    "btm/hfp_msbc_encoder.cc",
    "btm/hfp_msbc_decoder.cc",
    "btu/btu_event.cc",
    "btu/btu_hcif.cc",
    "btu/main_thread.cc",
    "eatt/eatt.cc",

system/stack/btu/btu_event.cc

deleted100644 → 0
+0 −45
Original line number Diff line number Diff line
/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "btm_iso_api.h"
#include "osi/include/allocator.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
#include "stack/include/btu_hcif.h"

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

using bluetooth::hci::IsoManager;

void btu_hci_msg_process(BT_HDR* p_msg) {
  /* Determine the input message type. */
  switch (p_msg->event & BT_EVT_MASK) {
    case BT_EVT_TO_BTU_HCI_EVT:
      btu_hcif_process_event((uint8_t)(p_msg->event & BT_SUB_EVT_MASK), p_msg);
      osi_free(p_msg);
      break;

    case BT_EVT_TO_BTU_HCI_ISO:
      IsoManager::GetInstance()->HandleIsoData(p_msg);
      osi_free(p_msg);
      break;

    default:
      osi_free(p_msg);
      break;
  }
}
+25 −11
Original line number Diff line number Diff line
@@ -36,10 +36,12 @@

#include <cstdint>

#include "btm_iso_api.h"
#include "common/metrics.h"
#include "internal_include/bt_target.h"
#include "main/shim/hci_layer.h"
#include "osi/include/allocator.h"
#include "stack/include/acl_api.h"
#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/ble_hci_link_interface.h"
#include "stack/include/bt_hdr.h"
@@ -48,6 +50,7 @@
#include "stack/include/btm_iso_api.h"
#include "stack/include/btm_sec_api_types.h"
#include "stack/include/btm_status.h"
#include "stack/include/btu_hcif.h"
#include "stack/include/dev_hci_link_interface.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hci_evt_length.h"
@@ -60,18 +63,10 @@
#include "types/hci_role.h"
#include "types/raw_address.h"

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

using namespace bluetooth;
using base::Location;
using bluetooth::hci::IsoManager;

bool BTM_BLE_IS_RESOLVE_BDA(const RawAddress& x);  // TODO remove
void BTA_sys_signal_hw_error();                    // TODO remove
void acl_disconnect_from_handle(uint16_t handle, tHCI_STATUS reason,
                                std::string comment);  // TODO remove

/******************************************************************************/
/*            L O C A L    F U N C T I O N     P R O T O T Y P E S            */
/******************************************************************************/
@@ -212,7 +207,7 @@ static void btu_hcif_log_event_metrics(uint8_t evt_code, const uint8_t* p_event)
 * Returns          void
 *
 ******************************************************************************/
void btu_hcif_process_event(uint8_t /* controller_id */, const BT_HDR* p_msg) {
static void btu_hcif_process_event(uint8_t /* controller_id */, const BT_HDR* p_msg) {
  uint8_t* p = (uint8_t*)(p_msg + 1) + p_msg->offset;
  uint8_t hci_evt_code, hci_evt_len;
  uint8_t ble_sub_code;
@@ -582,12 +577,12 @@ struct cmd_with_cb_data {
  base::Location posted_from;
};

void cmd_with_cb_data_init(cmd_with_cb_data* cb_wrapper) {
static void cmd_with_cb_data_init(cmd_with_cb_data* cb_wrapper) {
  new (&cb_wrapper->cb) hci_cmd_cb;
  new (&cb_wrapper->posted_from) Location;
}

void cmd_with_cb_data_cleanup(cmd_with_cb_data* cb_wrapper) {
static void cmd_with_cb_data_cleanup(cmd_with_cb_data* cb_wrapper) {
  cb_wrapper->cb.~hci_cmd_cb();
  cb_wrapper->posted_from.~Location();
}
@@ -1443,3 +1438,22 @@ static void btu_ble_proc_ltk_req(uint8_t* p, uint16_t evt_len) {
/**********************************************
 * End of BLE Events Handler
 **********************************************/

void btu_hci_msg_process(BT_HDR* p_msg) {
  /* Determine the input message type. */
  switch (p_msg->event & BT_EVT_MASK) {
    case BT_EVT_TO_BTU_HCI_EVT:
      btu_hcif_process_event((uint8_t)(p_msg->event & BT_SUB_EVT_MASK), p_msg);
      osi_free(p_msg);
      break;

    case BT_EVT_TO_BTU_HCI_ISO:
      IsoManager::GetInstance()->HandleIsoData(p_msg);
      osi_free(p_msg);
      break;

    default:
      osi_free(p_msg);
      break;
  }
}
Loading