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

Commit 41375c8c authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge changes I51b9273e,I182b839d,I2e689071,Ifc2fb983,Ib8e67ab9 into main

* changes:
  Rearrange events
  Don't register for unhandled events
  Always fail on a hardware error
  Update registration for events for the Controller
  Update registration for events in the Acl Layer
parents ed4ceaf4 2c9afb1f
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -229,9 +229,6 @@ typedef struct {
/*****************************************************************************
 *  Function declarations
 ****************************************************************************/
void bta_set_forward_hw_failures(bool value);
void BTA_sys_signal_hw_error();

void bta_sys_init(void);
void bta_sys_register(uint8_t id, const tBTA_SYS_REG* p_reg);
void bta_sys_deregister(uint8_t id);
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ typedef struct {
typedef struct {
  tBTA_SYS_REG* reg[BTA_ID_MAX]; /* registration structures */
  bool is_reg[BTA_ID_MAX];       /* registration structures */
  bool forward_hw_failures;
  uint16_t sys_features;         /* Bitmask of sys features */

  tBTA_SYS_CONN_CBACK* prm_cb; /* role management callback registered by DM */
+0 −12
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@
#include "stack/include/bt_hdr.h"
#include "stack/include/main_thread.h"

void BTIF_dm_on_hw_error();

/* system manager control block definition */
tBTA_SYS_CB bta_sys_cb;

@@ -58,16 +56,6 @@ void bta_sys_init(void) {
  memset(&bta_sys_cb, 0, sizeof(tBTA_SYS_CB));
}

void bta_set_forward_hw_failures(bool value) {
  bta_sys_cb.forward_hw_failures = value;
}

void BTA_sys_signal_hw_error() {
  if (bta_sys_cb.forward_hw_failures) {
    BTIF_dm_on_hw_error();
  }
}

/*******************************************************************************
 *
 * Function         bta_sys_event
+0 −7
Original line number Diff line number Diff line
@@ -2162,13 +2162,6 @@ void BTIF_dm_report_inquiry_status_change(tBTM_INQUIRY_STATE status) {
  }
}

void BTIF_dm_on_hw_error() {
  LOG_ERROR("Received H/W Error");
  usleep(100000); /* 100milliseconds */
  /* Killing the process to force a restart as part of fault tolerance */
  kill(getpid(), SIGKILL);
}

void BTIF_dm_enable() {
  BD_NAME bdname;
  bt_status_t status;
+0 −2
Original line number Diff line number Diff line
@@ -316,7 +316,6 @@ static void event_start_up_stack(bluetooth::core::CoreInterface* interface,
  BTA_dm_init();
  bta_dm_enable(btif_dm_sec_evt, btif_dm_acl_evt);

  bta_set_forward_hw_failures(true);
  btm_acl_device_down();
  CHECK(module_start_up(get_local_module(GD_CONTROLLER_MODULE)));
  BTM_reset_complete();
@@ -365,7 +364,6 @@ static void event_shut_down_stack(ProfileStopCallback stopProfiles) {
  hack_future = local_hack_future;

  bta_sys_disable();
  bta_set_forward_hw_failures(false);
  BTA_dm_on_hw_off();

  module_shut_down(get_local_module(BTIF_CONFIG_MODULE));
Loading