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

Commit fa4ce329 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I5a31f506,If496d946

* changes:
  Consolidate assignment btm_cb.acl_cb_.btm_acl_pkt_types_supported
  Add param BTM_acl_after_controller_started::controller_t
parents 56f45b7e d4e784d5
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);
+9 −10
Original line number Diff line number Diff line
@@ -217,34 +217,32 @@ 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 =
  uint16_t btm_acl_pkt_types_supported =
      (HCI_PKT_TYPES_MASK_DH1 + HCI_PKT_TYPES_MASK_DM1);

  if (controller->supports_3_slot_packets())
    btm_cb.acl_cb_.btm_acl_pkt_types_supported |=
    btm_acl_pkt_types_supported |=
        (HCI_PKT_TYPES_MASK_DH3 + HCI_PKT_TYPES_MASK_DM3);

  if (controller->supports_5_slot_packets())
    btm_cb.acl_cb_.btm_acl_pkt_types_supported |=
    btm_acl_pkt_types_supported |=
        (HCI_PKT_TYPES_MASK_DH5 + HCI_PKT_TYPES_MASK_DM5);

  /* Add in EDR related ACL types */
  if (!controller->supports_classic_2m_phy()) {
    btm_cb.acl_cb_.btm_acl_pkt_types_supported |=
    btm_acl_pkt_types_supported |=
        (HCI_PKT_TYPES_MASK_NO_2_DH1 + HCI_PKT_TYPES_MASK_NO_2_DH3 +
         HCI_PKT_TYPES_MASK_NO_2_DH5);
  }

  if (!controller->supports_classic_3m_phy()) {
    btm_cb.acl_cb_.btm_acl_pkt_types_supported |=
    btm_acl_pkt_types_supported |=
        (HCI_PKT_TYPES_MASK_NO_3_DH1 + HCI_PKT_TYPES_MASK_NO_3_DH3 +
         HCI_PKT_TYPES_MASK_NO_3_DH5);
  }
@@ -253,13 +251,14 @@ void BTM_acl_after_controller_started() {
  if (controller->supports_classic_2m_phy() ||
      controller->supports_classic_3m_phy()) {
    if (!controller->supports_3_slot_edr_packets())
      btm_cb.acl_cb_.btm_acl_pkt_types_supported |=
      btm_acl_pkt_types_supported |=
          (HCI_PKT_TYPES_MASK_NO_2_DH3 + HCI_PKT_TYPES_MASK_NO_3_DH3);

    if (!controller->supports_5_slot_edr_packets())
      btm_cb.acl_cb_.btm_acl_pkt_types_supported |=
      btm_acl_pkt_types_supported |=
          (HCI_PKT_TYPES_MASK_NO_2_DH5 + HCI_PKT_TYPES_MASK_NO_3_DH5);
  }
  btm_cb.acl_cb_.btm_acl_pkt_types_supported = btm_acl_pkt_types_supported;
}

/*******************************************************************************
+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);

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