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

Commit 492306dc authored by Henri Chataing's avatar Henri Chataing Committed by Gerrit Code Review
Browse files

Merge "RootCanal: Add configuration placeholder for toggling support for vendor commands" into main

parents ba8d5134 5cfc187e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1876,6 +1876,7 @@ ControllerProperties::ControllerProperties(

      case ControllerPreset::CSR_RCK_PTS_DONGLE:
        // Configuration extracted with the helper script controller_info.py
        vendor_csr = true;
        br_supported = true;
        le_supported = true;
        hci_version = bluetooth::hci::HciVersion::V_4_2;
@@ -1966,6 +1967,13 @@ ControllerProperties::ControllerProperties(
    // TODO(b/270606199): support send_acl_data_before_connection_complete
  }

  // Apply selected vendor features.
  if (config.has_vendor()) {
    if (config.vendor().has_csr()) {
      vendor_csr = config.vendor().csr();
    }
  }

  if (!CheckSupportedFeatures()) {
    INFO(
        "Warning: LMP and/or LE features are not consistent. Please make sure"
+3 −0
Original line number Diff line number Diff line
@@ -158,6 +158,9 @@ struct ControllerProperties {
  // Provide parameters returned by vendor specific commands.
  std::vector<uint8_t> le_vendor_capabilities{};

  // Enable the support for the CSR vendor command.
  bool vendor_csr{true};

  bool SupportsLMPFeature(bluetooth::hci::LMPFeaturesPage0Bits bit) const {
    return (lmp_features[0] & static_cast<uint64_t>(bit)) != 0;
  }
+7 −0
Original line number Diff line number Diff line
@@ -2819,6 +2819,13 @@ void DualModeController::LeEnergyInfo(CommandView command) {
// Implement the command specific to the CSR controller
// used specifically by the PTS tool to pass certification tests.
void DualModeController::CsrVendorCommand(CommandView command) {
  if (!properties_.vendor_csr) {
    SendCommandCompleteUnknownOpCodeEvent(OpCode(CSR_VENDOR));
    return;
  }

  DEBUG(id_, "<< CSR");

  // The byte order is little endian.
  // The command parameters are formatted as
  //
+7 −0
Original line number Diff line number Diff line
@@ -47,6 +47,11 @@ message ControllerQuirks {
  optional bool hardware_error_before_reset = 3;
}

message VendorFeatures {
  // Enable the support for the CSR vendor command.
  optional bool csr = 1;
}

message Controller {
  // Configure the controller preset. Presets come with a pre-selection
  // of features and quirks, but these can be overridden with the next fields.
@@ -61,6 +66,8 @@ message Controller {
  // Activate assertion checks in RootCanal for missing RootCanal features
  // or Host stack misbehavior.
  optional bool strict = 4;
  // Configure support for vendor features.
  optional VendorFeatures vendor = 5;
}

message TcpServer {