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

Commit 4c8f833c authored by Chris Manton's avatar Chris Manton
Browse files

Add param BTM_acl_after_controller_started::controller_t

Towards injectable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
Change-Id: If496d94615ebca3e459f9b2dbe6b114710258d7a
parent 2492f9e8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -361,6 +361,8 @@ struct sACL_CONN {
};
typedef sACL_CONN tACL_CONN;

struct controller_t;

/****************************************************
 **      ACL Management API
 ****************************************************/
@@ -386,7 +388,7 @@ struct sACL_CB {
  friend uint16_t acl_get_supported_packet_types();
  friend uint8_t btm_handle_to_acl_index(uint16_t hci_handle);
  friend void BTM_SetDefaultLinkSuperTout(uint16_t timeout);
  friend void BTM_acl_after_controller_started();
  friend void BTM_acl_after_controller_started(const controller_t* controller);
  friend void BTM_default_block_role_switch();
  friend void BTM_default_unblock_role_switch();
  friend void acl_initialize_power_mode(const tACL_CONN& p_acl);
+1 −3
Original line number Diff line number Diff line
@@ -217,13 +217,11 @@ void hci_btm_set_link_supervision_timeout(tACL_CONN& link, uint16_t timeout) {
 ******************************************************************************/
void btm_acl_init(void) { btm_cb.acl_cb_.Init(); }

void BTM_acl_after_controller_started() {
void BTM_acl_after_controller_started(const controller_t* controller) {
  internal_.btm_set_default_link_policy(
      HCI_ENABLE_CENTRAL_PERIPHERAL_SWITCH | HCI_ENABLE_HOLD_MODE |
      HCI_ENABLE_SNIFF_MODE | HCI_ENABLE_PARK_MODE);

  const controller_t* controller = controller_get_interface();

  /* Create ACL supported packet types mask */
  btm_cb.acl_cb_.btm_acl_pkt_types_supported =
      (HCI_PKT_TYPES_MASK_DH1 + HCI_PKT_TYPES_MASK_DM1);
+1 −1
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ static void decode_controller_support() {
  BTM_TRACE_DEBUG("Local supported SCO packet types: 0x%04x",
                  btm_cb.btm_sco_pkt_types_supported);

  BTM_acl_after_controller_started();
  BTM_acl_after_controller_started(controller_get_interface());
  btm_sec_dev_reset();

  if (controller->supports_rssi_with_inquiry_results()) {
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ void BTM_block_role_switch_for(const RawAddress& peer_addr);
void BTM_default_unblock_role_switch();
void BTM_default_block_role_switch();

void BTM_acl_after_controller_started();
void BTM_acl_after_controller_started(const controller_t* controller);

/*******************************************************************************
 *