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

Commit 3cb813f9 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Straighten out stack/acl/btm_acl::btm_read_remote_version_complete am: 1e07a3a0

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1438551

Change-Id: I39a09c44ed84df9c6f4d5c076d0b7fc171813b35
parents 7424956d 1e07a3a0
Loading
Loading
Loading
Loading
+38 −28
Original line number Diff line number Diff line
@@ -805,30 +805,26 @@ void BTM_default_block_role_switch() {
 * Returns          void
 *
 ******************************************************************************/
void btm_read_remote_version_complete(uint8_t* p) {
  tACL_CONN* p_acl_cb = &btm_cb.acl_cb_.acl_db[0];
  uint8_t status;
  uint16_t handle;
  int xx;
  BTM_TRACE_DEBUG("btm_read_remote_version_complete");

  STREAM_TO_UINT8(status, p);
  STREAM_TO_UINT16(handle, p);
static void btm_process_remote_version_complete(uint8_t status, uint16_t handle,
                                                uint8_t lmp_version,
                                                uint16_t manufacturer,
                                                uint16_t lmp_subversion) {
  tACL_CONN* p_acl_cb = internal_.acl_get_connection_from_handle(handle);
  if (p_acl_cb == nullptr) {
    LOG_WARN("Received remote version complete for unknown device");
    return;
  }

  /* Look up the connection by handle and copy features */
  for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_acl_cb++) {
    if ((p_acl_cb->in_use) && (p_acl_cb->hci_handle == handle)) {
  if (status == HCI_SUCCESS) {
        STREAM_TO_UINT8(p_acl_cb->lmp_version, p);
        STREAM_TO_UINT16(p_acl_cb->manufacturer, p);
        STREAM_TO_UINT16(p_acl_cb->lmp_subversion, p);
    p_acl_cb->lmp_version = lmp_version;
    p_acl_cb->manufacturer = manufacturer;
    p_acl_cb->lmp_subversion = lmp_subversion;

    if (p_acl_cb->transport == BT_TRANSPORT_BR_EDR) {
      internal_.btm_read_remote_features(p_acl_cb->hci_handle);
    }
        bluetooth::common::LogRemoteVersionInfo(
            handle, status, p_acl_cb->lmp_version, p_acl_cb->manufacturer,
            p_acl_cb->lmp_subversion);
    bluetooth::common::LogRemoteVersionInfo(handle, status, lmp_version,
                                            manufacturer, lmp_subversion);
  } else {
    bluetooth::common::LogRemoteVersionInfo(handle, status, 0, 0, 0);
  }
@@ -837,9 +833,23 @@ void btm_read_remote_version_complete(uint8_t* p) {
    l2cble_notify_le_connection(p_acl_cb->remote_addr);
    l2cble_use_preferred_conn_params(p_acl_cb->remote_addr);
  }
      break;
    }
}

void btm_read_remote_version_complete(uint8_t* p) {
  uint8_t status;
  uint16_t handle;
  uint8_t lmp_version;
  uint16_t manufacturer;
  uint16_t lmp_subversion;

  STREAM_TO_UINT8(status, p);
  STREAM_TO_UINT16(handle, p);
  STREAM_TO_UINT8(lmp_version, p);
  STREAM_TO_UINT16(manufacturer, p);
  STREAM_TO_UINT16(lmp_subversion, p);

  btm_process_remote_version_complete(status, handle, lmp_version, manufacturer,
                                      lmp_subversion);
}

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