Skip to content
Snippets Groups Projects
  1. Feb 07, 2023
    • Henri Chataing's avatar
      RootCanal: Declare the supported commands in controller properties · 0ed8d7d8
      Henri Chataing authored
      The Supported Commands mask is no longer set by DualModeController as
      the list of implemented commands. This allows for setting unimplemented
      commands as supported for feature discovery when testing new profiles.
      
      The Supported Command mask value is unmodified in this CL, only adding
      some commands that were implemented but missing from the HCI command
      mapping:
      
      - HCI Set Event Mask Page 2
      - HCI Add SCO Connection
      - HCI LE Remote Connection Parameter Request Reply
      - HCI LE Remote Connection Parameter Request Negative Reply
      
      The ability to configure supported commands from the JSON config file
      is temporarily disabled as unimplemented commands now raise FATAL
      errors and configured values are likely to be incorrect...
      
      Test: m root-canal && atest pts-bot
      Bug: 266087760
      Change-Id: I9c8960ba65d885f3606a89d2dcc0781aa599c71f
      0ed8d7d8
    • Henri Chataing's avatar
      pdl: Specialize Field::Fixed into FixedScalar and FixedEnum · 36db1e2b
      Henri Chataing authored
      There existed an implicit assumption that width, value and
      enum_id, tag_id were mutually exclusive in the Field::Fixed
      case.
      This change makes the assumption explicit by modiyfing
      the AST to add specialized cases.
      
      Test: cargo build && cargo test
      Change-Id: Ib51f61ad2cd39f8686ad9d94a6699cf2b3b318e7
      36db1e2b
    • Henri Chataing's avatar
      Annotate AST nodes with loc, size information · 1fb992a2
      Henri Chataing authored
      Test: cargo build && cargo test
      Change-Id: Ibede334254e6faa7920139a68747792e87ed05a3
      1fb992a2
    • Henri Chataing's avatar
      RootCanal: Cleanup SendCommandCompleteUnknownEvent · 5ef351ce
      Henri Chataing authored
      Use the CommandComplete builder to simplify the code.
      
      Test: m root-canal
      Change-Id: I59e07c72761744bd77a142af21fc67e8c47066f1
      5ef351ce
  2. Feb 06, 2023
    • Henri Chataing's avatar
      RootCanal: Reuse device addresses · 7e20b8c2
      Henri Chataing authored
      The address is directly derived from the device identifier.
      This change modifies TestModel to reuse identifiers from
      disconnected devices.
      
      The option is enabled by default and disabled by passing the
      parameter --disable_address_reuse
      
      Test: m root-canal && manual check
      Bug: 253682053
      Change-Id: Ie97763c1eae46df75d548a54b273cf8d363c7bb9
      7e20b8c2
    • Henri Chataing's avatar
      RootCanal: Fix OOB reference in IncomingAclPacket · 2685816c
      Henri Chataing authored
      IncomingAclPacket took an illegal reference to
      the end index of a vector.
      
      Bug: 268037653
      Test: m root-canal + manual validation
      Change-Id: I8b431453256877f9cd173671e4eb7c46a29d57a8
      2685816c
  3. Feb 04, 2023
    • Henri Chataing's avatar
      RootCanal: Use the Supported Commands mask as source of truth · 974327ab
      Henri Chataing authored
      DualModeController now distinguishes between
      - supported commands: commands enabled in the supported commands mask
      - implemented commands: commands for which an implementation is provided
      
      Command are handled following this logic:
      - implemented and supported command: registered handler invoked
      - supported but not implemented command: raise an assert
      - unsupported commands: send command complete which ERR_UNKNOWN_COMMAND
      
      Test: m root-canal
      Bug: 266087760
      Change-Id: Ie930d368bd5c20d67fbc3a5f49f68763e12bfb50
      974327ab
  4. Feb 03, 2023
  5. Feb 02, 2023
    • Henri Chataing's avatar
      RootCanal: Validate the Supported Commands mask · 0eb595e7
      Henri Chataing authored
      Validate the set of supported commands according to the
      constraints described in the section Vol 4, Part E § 3 Overview of
      commands and events of the specification.
      
      The check is non-fatal but displays instead the commands that
      should be or should not be implemented following these rules.
      
      Test: m root-canal
      Change-Id: I12751149f77ba4d22b30280edbd6da1ade5ef7e9
      0eb595e7
    • Henri Chataing's avatar
      RootCanal: Rename model/controller/vendor -> · 33e5f782
      Henri Chataing authored
      model/controller/vendor_commands
      
      The name vendor is reserved for external dependencies
      
      Test: m root-canal
      Change-Id: I005f57dbb8fdbc26cca9fc9129d8263a33607b19
      33e5f782
    • Henri Chataing's avatar
      RootCanal: Minor fixes · 53d12da5
      Henri Chataing authored
      - Replace ASSERT => LOG_ALWAYS_FATAL
      - Replace include of os/log.h => log.h
      - Iterate loop by reference
      
      Test: m root-canal
      Change-Id: I0b9978fcff2b4b9e6a50373d9f3f661fbc53ce06
      53d12da5
  6. Feb 01, 2023
  7. Jan 31, 2023
    • Rahul Arya's avatar
      Rust PDL backend · caa5be2f
      Rahul Arya authored
      This is a zero-copy Rust backend that supports most of PDL (excluding
      groups, checksums, custom types), BUT only little-endian packets.
      
      This is needed for Rust-GATT (scoped for U). It is not a permanent
      solution, I expect to unify / replace this with the official Rust PDL
      once it is ready, but until that point arrives I don't want to remain
      blocked.
      
      Ignore-AOSP-First: Security bug
      Bug: 255880936
      Test: unit
      
      Change-Id: I7d2305c20288d576aa1a5731b0d7e54727366947
      caa5be2f
  8. Jan 21, 2023
  9. Jan 20, 2023
  10. Jan 19, 2023
    • Martin Geisler's avatar
      pdl: Add support for reserved fields · e9418901
      Martin Geisler authored
      Test: atest pdl_tests pdl_rust_generator_tests_{le,be}
      Change-Id: Ie09c2fa09694f940e8584d56df3beb5019f91cf3
      e9418901
    • Martin Geisler's avatar
      pdl: Explain possible canonical test failures · a1ee89e3
      Martin Geisler authored
      Test: atest pdl_tests pdl_rust_generator_tests_{le,be}
      Change-Id: I6366b88f2b4683baf21e31519ccd981b6e81a380
      a1ee89e3
    • Martin Geisler's avatar
      pdl: Parse structs like packets · 001619d1
      Martin Geisler authored
      The auto-generated “Packet” suffix now seems wrong, so I removed it.
      This means that both “packet Foo” and “struct Foo” will generate the
      following Rust types:
      
          pub struct Foo
          pub struct FooBuilder
          struct FooData
      
      One potential problem with this: if someone has a “packet Packet”,
      this now collides with “trait Packet” from our preamble. We might need
      to correct for this when we integrate the generated code with clients.
      
      Test: atest pdl_tests pdl_rust_generator_tests_{le,be}
      Change-Id: I19354010e46ef1b5738fee9f7fb13ff7778d1b03
      001619d1
    • Martin Geisler's avatar
      pdl: Move get_uint and put_uint to common module · d69fc851
      Martin Geisler authored
      We will need access to both of them from the parser next.
      
      Test: atest pdl_tests pdl_rust_generator_tests_{le,be}
      Change-Id: I7cfd79f2ef811765cd7b3653b8ed1b0ddb14fc70
      d69fc851
  11. Jan 17, 2023
    • Martin Geisler's avatar
      pdl: Test canonical vectors using Serde · cae12168
      Martin Geisler authored
      Being able to serialize data with Serde allows us to test enums using
      the canonical test vectors: we can take the output of PDL and
      serialize it to JSON, which we then compare with the canonical test
      vectors.
      
      While this was motivated by the need for testing, Serde support can be
      useful in general so I think this is an overall nice change. The
      support is behind an off-by-default feature flag, just in case people
      don’t want the generated code.
      
      Test: atest pdl_tests pdl_rust_generator_tests_{le,be}
      Change-Id: I6a19a939df7b449d350dbcda8a7daa2cb96733a2
      cae12168
    • Martin Geisler's avatar
      pdl: Add support for enums · d9892bbd
      Martin Geisler authored
      This adds support for parsing and serializing enum fields.
      
      The canonical test vectors work.
      
      Tests have been added to the canonical PDL files: they demonstrate
      that we can generate valid Rust code. A test was added to show that we
      need “#[repr(u64)]” for an enum with a maximum discriminant.
      
      Test: atest pdl_tests pdl_rust_generator_tests_{le,be}
      Change-Id: Id65bf831ddde8ade9780f89096842ef9516cf4c3
      d9892bbd
  12. Jan 13, 2023
    • Martin Geisler's avatar
      pdl: Rework reading of scalar fields · 40b64d7f
      Martin Geisler authored
      This CL reverts the code reading scalar fields to match the logic in
      the Python backend. This approach will make it simpler to update the
      two backends going forward.
      
      Test: atest pdl_tests pdl_rust_generator_tests_{le,be}
      Change-Id: I49ddb3dae8eab1bb00cf730eda50a051d326ce2c
      40b64d7f
    • Henri Chataing's avatar
      Fix failure in h4 recovery logic · ba7d9d51
      Henri Chataing authored
      The packet idc is not removed from the packet before being
      sent to the command handler.
      
      Bug: 261261502
      Test: atest rootcanal_test_host
      Change-Id: I9aa66e0f765c185405e002ae21d35ad784c9f9d8
      ba7d9d51
  13. Jan 12, 2023
    • Henri Chataing's avatar
      RootCanal H4: Add recovery state · ef82b746
      Henri Chataing authored
      The recovery state is entered when an invalid Idc
      is received. In recovery state, all bytes are dropped
      until a valid HCI Reset command is received.
      The reasoning is that this issue occurs when the emulator
      is rebooted, leaving bytes in the VirtIO console.
      The next valid command should be HCI Reset command then.
      
      Test: atest rootcanal_test_host
      Bug: 261261502
      Change-Id: I6e5482d9b2642fa789e6ed415ce3833663097bff
      ef82b746
  14. Jan 11, 2023
    • Henri Chataing's avatar
      RootCanal: Pass RSSI information in device Receive / Send methods · 483d319f
      Henri Chataing authored
      Bug: 264630489
      Test: m root-canal
      Change-Id: I1fff099890032e51aaaa087176df09ffb8ce3e68
      483d319f
    • Henri Chataing's avatar
      RootCanal: Fix potential use-after-free issues · d77e5333
      Henri Chataing authored
      The tasks registered within LinkLayerController capture
      the pointer to the Controller instance for member access.
      These tasks can outlive the Controller instance if the
      controller is deleted (e.g. through the test channel, or
      because the TCP connection is lost). In this case
      attempting to execute the task callback would cause a
      use-after-free invalid pointer access.
      
      This change bypasses the issue by capturing a weak pointer
      to the instance to check if it is live before running the
      task callback.
      
      Test: m root-canal && launch_cvd
      Change-Id: I5384fc056fc4fbc0095b99ef7113fd4f706803ba
      d77e5333
  15. Jan 10, 2023
  16. Jan 07, 2023
  17. Jan 06, 2023
  18. Jan 03, 2023
  19. Jan 02, 2023
    • Henri Chataing's avatar
      RootCanal: Improvements in rootcanal_test_host · 158545c8
      Henri Chataing authored
      Apply some modifications to improve the flakiness of tests
      CanUnsubscribeTaskFromWithinTask and UnsubScribeWaitsUntilCompletion
      
      Test: atest --host --rerun-until-failure 1000 -t AsyncManagerSocketTest rootcanal_test_host
      Bug: 263327055
      Change-Id: I43e41749cfd34a1e9ce2e5fe6e6eaf70f8951d84
      158545c8
  20. Dec 28, 2022
  21. Dec 23, 2022
  22. Dec 22, 2022
Loading