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

Commit 471be496 authored by Myles Watson's avatar Myles Watson
Browse files

Revert "hci: Remove SimultaneousLeHost bit"

This reverts commit 66e6e21a.

The SimultaneousLeHost bit was deprecated in version 4.1 of the
spec, but some Bluetooth chips still need it to be set.

Bug: 179958088
Test: atest bluetooth_test_gd
      observe LMP features on a Pixel 3 when using GD controller
Tag: #gd-refactor
Change-Id: Ie8f8a8c9322a6301388ba9415d998e218ef008b1
parent 1550f80f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -446,7 +446,9 @@ struct Controller::impl {
  }

  void write_le_host_support(Enable enable) {
    std::unique_ptr<WriteLeHostSupportBuilder> packet = WriteLeHostSupportBuilder::Create(enable);
    // Since Bluetooth Core Spec 4.1, this bit should be 0, but some controllers still require it
    Enable simultaneous_le_host = Enable::ENABLED;
    std::unique_ptr<WriteLeHostSupportBuilder> packet = WriteLeHostSupportBuilder::Create(enable, simultaneous_le_host);
    hci_->EnqueueCommand(
        std::move(packet),
        module_.GetHandler()->BindOnceOn(this, &Controller::impl::check_status<WriteLeHostSupportCompleteView>));
+2 −2
Original line number Diff line number Diff line
@@ -2251,12 +2251,12 @@ packet ReadLeHostSupport : Command (op_code = READ_LE_HOST_SUPPORT) {
packet ReadLeHostSupportComplete : CommandComplete (command_op_code = READ_LE_HOST_SUPPORT) {
  status : ErrorCode,
  le_supported_host : Enable,
  _reserved_ : 8, // simultaneous_le_host (ignored and always 0)
  _reserved_ : 8, // simultaneous_le_host reserved since 4.1
}

packet WriteLeHostSupport : Command (op_code = WRITE_LE_HOST_SUPPORT) {
  le_supported_host : Enable,
  _reserved_ : 8, // simultaneous_le_host (ignored and always 0)
  simultaneous_le_host : Enable,  // According to the spec, this should be 0x00 since 4.1
}

packet WriteLeHostSupportComplete : CommandComplete (command_op_code = WRITE_LE_HOST_SUPPORT) {
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ DEFINE_AND_INSTANTIATE_WriteSimplePairingModeReflectionTest(write_simple_paring_
std::vector<uint8_t> write_simple_paring_mode_complete = {0x0e, 0x04, 0x01, 0x56, 0x0c, 0x00};
DEFINE_AND_INSTANTIATE_WriteSimplePairingModeCompleteReflectionTest(write_simple_paring_mode_complete);

std::vector<uint8_t> write_le_host_supported = {0x6d, 0x0c, 0x02, 0x01, 0x00};
std::vector<uint8_t> write_le_host_supported = {0x6d, 0x0c, 0x02, 0x01, 0x01};
DEFINE_AND_INSTANTIATE_WriteLeHostSupportReflectionTest(write_le_host_supported);

std::vector<uint8_t> write_le_host_supported_complete = {0x0e, 0x04, 0x01, 0x6d, 0x0c, 0x00};
+4 −1
Original line number Diff line number Diff line
@@ -40,7 +40,10 @@ async fn provide_controller(mut hci: CommandSender) -> Arc<ControllerExports> {
    assert_success!(
        hci.send(WriteSimplePairingModeBuilder { simple_pairing_mode: Enable::Enabled })
    );
    assert_success!(hci.send(WriteLeHostSupportBuilder { le_supported_host: Enable::Enabled }));
    assert_success!(hci.send(WriteLeHostSupportBuilder {
        le_supported_host: Enable::Enabled,
        simultaneous_le_host: Enable::Enabled
    }));

    let name = null_terminated_to_string(
        assert_success!(hci.send(ReadLocalNameBuilder {})).get_local_name(),