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

Commit aa222462 authored by Henri Chataing's avatar Henri Chataing
Browse files

RootCanal: Enable Connected Isochronous Stream support

Adds the configuration for Connected Isochronous Streams
and enables the feature by default.

Test: None
Bug: 253535400
Change-Id: I40fbd61fc354de2a76553d6d1304e6f17296d953
parent b3f56567
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ message ControllerFeatures {
  optional bool ll_privacy = 3;
  optional bool le_2m_phy = 4;
  optional bool le_coded_phy = 5;
  // Enable the support for both LL Connected Isochronous Stream Central
  // and LL Connected Isochronous Stream Peripheral.
  optional bool le_connected_isochronous_stream = 6;
}

message ControllerQuirks {
+33 −12
Original line number Diff line number Diff line
@@ -108,13 +108,13 @@ static constexpr uint64_t LlFeatures() {
      LLFeaturesBits::LE_PING,
      LLFeaturesBits::LL_PRIVACY,
      LLFeaturesBits::EXTENDED_SCANNER_FILTER_POLICIES,
      LLFeaturesBits::LE_2M_PHY, LLFeaturesBits::LE_CODED_PHY,
      LLFeaturesBits::LE_2M_PHY,
      LLFeaturesBits::LE_CODED_PHY,
      LLFeaturesBits::LE_EXTENDED_ADVERTISING,
      LLFeaturesBits::LE_PERIODIC_ADVERTISING,

      // TODO: breaks AVD boot tests with LE audio
      // LLFeaturesBits::CONNECTED_ISOCHRONOUS_STREAM_CENTRAL,
      // LLFeaturesBits::CONNECTED_ISOCHRONOUS_STREAM_PERIPHERAL,
      LLFeaturesBits::CONNECTED_ISOCHRONOUS_STREAM_CENTRAL,
      LLFeaturesBits::CONNECTED_ISOCHRONOUS_STREAM_PERIPHERAL,
  };

  uint64_t value = 0;
@@ -377,20 +377,17 @@ static std::array<uint8_t, 64> SupportedCommands() {
      // OpCodeIndex::LE_MODIFY_SLEEP_CLOCK_ACCURACY,
      OpCodeIndex::LE_READ_BUFFER_SIZE_V2,
      // OpCodeIndex::LE_READ_ISO_TX_SYNC,
      // OpCodeIndex::LE_SET_CIG_PARAMETERS,
      // OpCodeIndex::LE_SET_CIG_PARAMETERS_TEST,
      // OpCodeIndex::LE_CREATE_CIS,
      // OpCodeIndex::LE_REMOVE_CIG,
      // OpCodeIndex::LE_ACCEPT_CIS_REQUEST,
      // OpCodeIndex::LE_REJECT_CIS_REQUEST,
      OpCodeIndex::LE_SET_CIG_PARAMETERS,
      OpCodeIndex::LE_SET_CIG_PARAMETERS_TEST, OpCodeIndex::LE_CREATE_CIS,
      OpCodeIndex::LE_REMOVE_CIG, OpCodeIndex::LE_ACCEPT_CIS_REQUEST,
      OpCodeIndex::LE_REJECT_CIS_REQUEST,
      // OpCodeIndex::LE_CREATE_BIG,
      // OpCodeIndex::LE_CREATE_BIG_TEST,
      // OpCodeIndex::LE_TERMINATE_BIG,
      // OpCodeIndex::LE_BIG_CREATE_SYNC,
      // OpCodeIndex::LE_BIG_TERMINATE_SYNC,
      // OpCodeIndex::LE_REQUEST_PEER_SCA,
      // OpCodeIndex::LE_SETUP_ISO_DATA_PATH,
      // OpCodeIndex::LE_REMOVE_ISO_DATA_PATH,
      OpCodeIndex::LE_SETUP_ISO_DATA_PATH, OpCodeIndex::LE_REMOVE_ISO_DATA_PATH,
      // OpCodeIndex::LE_ISO_TRANSMIT_TEST,
      // OpCodeIndex::LE_ISO_RECEIVE_TEST,
      // OpCodeIndex::LE_ISO_READ_TEST_COUNTERS,
@@ -1794,6 +1791,19 @@ static std::vector<OpCodeIndex> ll_privacy_commands_ = {
    OpCodeIndex::LE_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT,
};

// Commands enabled by the LL Connected Isochronous Stream feature bit.
// Central and Peripheral support bits are enabled together.
static std::vector<OpCodeIndex> ll_connected_isochronous_stream_commands_ = {
    OpCodeIndex::LE_SET_CIG_PARAMETERS,
    OpCodeIndex::LE_SET_CIG_PARAMETERS_TEST,
    OpCodeIndex::LE_CREATE_CIS,
    OpCodeIndex::LE_REMOVE_CIG,
    OpCodeIndex::LE_ACCEPT_CIS_REQUEST,
    OpCodeIndex::LE_REJECT_CIS_REQUEST,
    OpCodeIndex::LE_SETUP_ISO_DATA_PATH,
    OpCodeIndex::LE_REMOVE_ISO_DATA_PATH,
};

static void SetLLFeatureBit(uint64_t& le_features, LLFeaturesBits bit,
                            bool set) {
  if (set) {
@@ -1864,6 +1874,17 @@ ControllerProperties::ControllerProperties(
      SetLLFeatureBit(le_features, LLFeaturesBits::LE_CODED_PHY,
                      features.le_coded_phy());
    }
    if (features.has_le_connected_isochronous_stream()) {
      SetLLFeatureBit(le_features,
                      LLFeaturesBits::CONNECTED_ISOCHRONOUS_STREAM_CENTRAL,
                      features.le_connected_isochronous_stream());
      SetLLFeatureBit(le_features,
                      LLFeaturesBits::CONNECTED_ISOCHRONOUS_STREAM_PERIPHERAL,
                      features.le_connected_isochronous_stream());
      SetSupportedCommandBits(supported_commands,
                              ll_connected_isochronous_stream_commands_,
                              features.le_connected_isochronous_stream());
    }
  }

  // Apply selected quirks.