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

Commit d7782164 authored by Myles Watson's avatar Myles Watson Committed by Automerger Merge Worker
Browse files

Merge "L2CAP: Use GD for flush" into main am: a11f19f6 am: f232b152

parents dead2f04 f232b152
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@ struct classic_impl : public security::ISecurityManagerListener {
    }
    uint16_t handle = flush_complete.GetConnectionHandle();
    connections.execute(
        handle, [=](ConnectionManagementCallbacks* callbacks) { callbacks->OnFlushOccurred(); });
        handle, [](ConnectionManagementCallbacks* callbacks) { callbacks->OnFlushOccurred(); });
  }

  void on_read_remote_version_information(
+17 −0
Original line number Diff line number Diff line
@@ -716,6 +716,8 @@ class ClassicShimAclConnection
    return connection_->locally_initiated_;
  }

  void Flush() { connection_->Flush(); }

 private:
  OnDisconnect on_disconnect_;
  const shim::legacy::acl_classic_link_interface_t interface_;
@@ -884,6 +886,14 @@ struct shim::legacy::Acl::impl {
    handle_to_classic_connection_map_[handle]->EnqueuePacket(std::move(packet));
  }

  void Flush(HciHandle handle) {
    if (IsClassicAcl(handle)) {
      handle_to_classic_connection_map_[handle]->Flush();
    } else {
      LOG_ERROR("handle %d is not a classic connection", handle);
    }
  }

  bool IsLeAcl(HciHandle handle) {
    return handle_to_le_connection_map_.find(handle) !=
           handle_to_le_connection_map_.end();
@@ -1431,6 +1441,13 @@ void shim::legacy::Acl::WriteData(HciHandle handle,
                                  std::move(packet)));
}

void shim::legacy::Acl::flush(HciHandle handle) { pimpl_->Flush(handle); }

void shim::legacy::Acl::Flush(HciHandle handle) {
  handler_->Post(
      common::BindOnce(&Acl::flush, common::Unretained(this), handle));
}

void shim::legacy::Acl::CreateClassicConnection(const hci::Address& address) {
  GetAclManager()->CreateConnection(address);
  LOG_DEBUG("Connection initiated for classic to remote:%s",
+3 −0
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ class Acl : public hci::acl_manager::ConnectionCallbacks,
  void WriteData(uint16_t hci_handle,
                 std::unique_ptr<packet::RawBuilder> packet);

  void Flush(uint16_t hci_handle);

  void Dump(int fd) const;
  void DumpConnectionHistory(int fd) const;

@@ -125,6 +127,7 @@ class Acl : public hci::acl_manager::ConnectionCallbacks,
  void on_incoming_acl_credits(uint16_t handle, uint16_t credits);
  void write_data_sync(uint16_t hci_handle,
                       std::unique_ptr<packet::RawBuilder> packet);
  void flush(uint16_t hci_handle);

 private:
  os::Handler* handler_;
+4 −0
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@ void bluetooth::shim::ACL_WriteData(uint16_t handle, BT_HDR* p_buf) {
  osi_free(p_buf);
}

void bluetooth::shim::ACL_Flush(uint16_t handle) {
  Stack::GetInstance()->GetAcl()->Flush(handle);
}

void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) {
  hci::LeAddressManager::AddressPolicy address_policy =
      is_le_privacy_enabled
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ void ACL_IgnoreLeConnectionFrom(const tBLE_BD_ADDR& legacy_address_with_type);
void ACL_Disconnect(uint16_t handle, bool is_classic, tHCI_STATUS reason,
                    std::string comment);
void ACL_WriteData(uint16_t handle, BT_HDR* p_buf);
void ACL_Flush(uint16_t handle);
void ACL_ConfigureLePrivacy(bool is_le_privacy_enabled);
void ACL_Shutdown();
void ACL_IgnoreAllLeConnections();
Loading