Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Controller: Deprecate tinycrypt part2 (testing) #81221

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Commits on Nov 14, 2024

  1. Bluetooth: Controller: Fix to reschedule before overlap when yielding

    Fix to reschedule before overlap and be collision resolved
    in the next periodic interval for tickers using slot window
    yield.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    784eaf4 View commit details
    Browse the repository at this point in the history
  2. Bluetooth: Controller: Introduce ticker reschedule with drift

    Introduce ticker reschedule with drift so that role like
    AUX_ADV_IND can start after overlapping states and roles
    using time reservations.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    0aa02e3 View commit details
    Browse the repository at this point in the history
  3. Bluetooth: Controller: Ext Adv Auxiliary PDUs with ticks_slot_window

    Add implementation for Extended Advertising Auxiliary PDUs
    to use ticks slot window feature.
    
    This will allow the periodic scheduling of AUX_ADV_IND PDUs
    to drift upto 10 ms advertising delay minus the ticks_slot
    time reservation of the AUX_ADV_IND PDU when overlapping
    with other states/roles that cannot be moved around, to
    avoid skipping them.
    
    Having an active Extended Advertising simultaneously with
    an ISO Synchronized Receiver or Connected ISO connection
    will now have less ISO SDU loss when using 10 ms ISO
    intervals.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    120c64d View commit details
    Browse the repository at this point in the history
  4. Bluetooth: Controller: Fix ISO Sync Receiver skipped ISO SDU

    Fix ISO Sync Receiver implementation to correctly reflect
    the payload number and timestamp.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    6810dd2 View commit details
    Browse the repository at this point in the history
  5. Bluetooth: Controller: Fix ISO Sync Receiver time reservations

    Fix ISO Sync Receiver time reservation calculation to use
    peer broadcasted bis_spacing and sub_interval, instead of
    incorrectly calculating using local implementation used
    tMSS value.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    716532c View commit details
    Browse the repository at this point in the history
  6. Bluetooth: Controller: Fix ISO Sync Receiver is_abort_cb

    Fix ISO Sync Receiver implementation to correctly prevent
    subevent from pre-empted in the unreserve time space.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    b166e67 View commit details
    Browse the repository at this point in the history
  7. tests: Bluetooth: Audio: Remove uses of K_FOREVER in syswg for TX

    Several tests were using K_FOREVER when allocating the
    buffer for TX in the system workqueue, which is illegal behavior.
    
    The solution chosen was to create a TX thread to handle TX,
    similar to the solution used in the audio shell and some
    sample applications.
    
    This way we can continue to use K_FOREVER when allocting buffers
    and it will always be done in a round-robin fashion while
    TXing as much as possible, by always enqueuing all the buffers
    with mock data.
    
    Since this works for all streams (both broadcast and unicast),
    it was obvious to use the same implementation for all tests,
    and thus cleaning up the tests a bit and more them more similar.
    
    Signed-off-by: Emil Gydesen <[email protected]>
    Thalley authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    ef729a7 View commit details
    Browse the repository at this point in the history
  8. tests: Bluetooth: CAP: Remove dup adv in acceptor bsim test

    Remove a duplicated advertising set in the CAP acceptor babblesim
    test. The advertising set is configured in test_start_adv.
    
    Signed-off-by: Emil Gydesen <[email protected]>
    Thalley authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    226dc43 View commit details
    Browse the repository at this point in the history
  9. tests: Bluetooth: CAP: Acceptor bsim test use ext_adv

    The BSIM test for the CAP acceptor used legacy instead
    of extended advertising.
    
    This also adds the required advertising data and validation
    on the CAP initiator and CAP commander.
    
    Signed-off-by: Emil Gydesen <[email protected]>
    Thalley authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    e09fd77 View commit details
    Browse the repository at this point in the history
  10. tests: bsim: Bluetooth: Align audio test Controller Kconfig

    Align audio test Controller Kconfig value same as used with
    nRF53bsim.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    c1b8b7a View commit details
    Browse the repository at this point in the history
  11. tests: bsim: Bluetooth: Enable some high reliability CAP tests

    Enable some high reliability CAP tests by increasing ISO Tx
    buffer counts in the Controller to sufficiently generate
    number of complete when multiple SDUs are transmitted in
    single ISO interval with use of pre-transmissions.
    
    Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
    cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    5522ef0 View commit details
    Browse the repository at this point in the history
  12. temporary: squash of PR 80136

    Squash of commits from PR 80136
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    c3b36f6 View commit details
    Browse the repository at this point in the history
  13. temporary: squash of PR 80368

    Squash of commits from PR 80368
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    6905b8e View commit details
    Browse the repository at this point in the history
  14. test: bluetooth: bsim: mesh: test_access: Increase timeout between proc

    Increase timeout between procedures in access_tx_transmitt test to avoid
    packet loss.
    
    Signed-off-by: Pavel Vasilyev <[email protected]>
    PavelVPV authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    3da61a3 View commit details
    Browse the repository at this point in the history
  15. bt: crypto/host: remove CONFIG_BT_USE_PSA_API symbol

    As part of the deprecation process of TinyCrypt in Zephyr codebase
    (zephyrproject-rtos#79566) this commit removes CONFIG_BT_USE_PSA_API symbol. This
    was used in BT crypto/host modules to select PSA crypto API over
    TinyCrypt (which was the default until now). Since TinyCrypt is
    removed and PSA crypto API is the new standard library for crypto
    operations, CONFIG_BT_USE_PSA_API is no more needed.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    d20b7f7 View commit details
    Browse the repository at this point in the history
  16. bt: use PSA for HCI ECC and rename BT_TINYCRYPT_ECC

    As part of the deprecation process of TinyCrypt in Zephyr codebase
    (zephyrproject-rtos#79566) this commit sets PSA Crypto API as the default library
    to perform ECC-DH in HCI, replacing TinyCrypt. Therefore the
    symbol BT_TINYCRYPT_ECC is renamed as BT_SEND_ECC_EMULATION.
    Rreference in samples/tests are also fixed.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    33cefd2 View commit details
    Browse the repository at this point in the history
  17. bt-mesh: remove BT_MESH_USES_TINYCRYPT

    As part of the deprecation process of TinyCrypt in Zephyr codebase
    (zephyrproject-rtos#79566) this commit removes TinyCrypt usage from BT mesh and
    also the related CONFIG_BT_MESH_USES_TINYCRYPT symbol and it sets
    PSA Crypto APIs as the default library for crypto operations.
    Tests are also updated in this commit.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    53efa29 View commit details
    Browse the repository at this point in the history
  18. bt: change dependencies for BT_RPA

    As part of the deprecation process of TinyCrypt in Zephyr codebase
    (zephyrproject-rtos#79566) this commit modified the dependencies of BT_RPA. Instead
    of selecting TinyCrypt, it relies on BT_HOST_CRYPTO or
    BT_CTLR_CRYPTO. This helps both in the deprecation process of
    TinyCrypt, but also this is more correct dependency since these
    2 symbols are extensively used in the rpa.c source code.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    895dbe6 View commit details
    Browse the repository at this point in the history
  19. samples: bt: some RAM footprint reductions

    As part of the work of deprecating TinyCrypt in favor of
    PSA crypto API, this commit fixes some kconfigs in order to
    reduce the RAM footprint. In all involved samples RAM usage
    was extremely high even with TinyCrypt (usually > 98%) and
    of course it got overflowed once TinyCrypt got replaced by
    Mbed TLS's PSA Crypto API.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    d13ea6d View commit details
    Browse the repository at this point in the history
  20. tests: bluetooth: replace TinyCrypt with PSA in unit tests

    Replace all references to TinyCrypt with PSA Crypto API in BT unit
    tests.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    bc2b2e3 View commit details
    Browse the repository at this point in the history
  21. tests: bt: add Mbed TLS headers to the build

    Include Mbed TLS headers to the build system. This is required
    because these tests do not follow the "standard build pattern"
    of Mbed TLS in Zephyr, otherwise include files would be already
    available after the library has been linked. In these examples
    some BT source files and Kconfigs are manually added to the
    CmakeLists.txt file bypassing the standard library build pattern,
    so Mbed TLS headers must also be added manually.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    ca1628b View commit details
    Browse the repository at this point in the history
  22. tests: bt: increase PSA key slots count when necessary

    Increase the number of key slots in the PSA Crypto core
    for some tests using more keys than the default (16).
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    a4cd870 View commit details
    Browse the repository at this point in the history
  23. tests: bt: enable entropy sources where missing

    Moving from TinyCrypt to PSA Crypto API caused an entropy source
    to be always required, so this commit adds it in tests where
    necessary.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    69395c1 View commit details
    Browse the repository at this point in the history
  24. boards: qemu_cortex_m3: enable test random generator for BT

    BT uses PSA Crypto API to perform crypto operations and, on this
    platform, these APIs are implemented through Mbed TLS. In order
    to properly initialize this library, a random number generator
    is required. Since this platform does not have a true random
    number generator, we enable the test one. This holds only
    when BT is enabled, of course.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    183420a View commit details
    Browse the repository at this point in the history
  25. tests: Bluetooth: Audio: Increase RX buf count for bsim

    The tests were using the default of 1 which is very low,
    especially when we might have multiple RX streams.
    
    Signed-off-by: Emil Gydesen <[email protected]>
    Thalley authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    fe3d4da View commit details
    Browse the repository at this point in the history
  26. drivers: entropy: ease runtime requirements on BT HCI

    On platforms like nrf5340 there are 2 CPUs:
    - one is the cpu_net which takes care of the radio stuff and
      owns the HW random generator
    - one is the cpu_app which holds application data and polls
      cpu_net through HCI commands when it needs some random data.
    
    The PSA core implemented in Mbed TLS needs random data at initialization
    time, which happens early in the boot process. If we wait for BT to
    be ready before issuing the HCI command, then PSA core intialization
    will fail. In facts there is no need for the BT to be completely
    initialized just to ask for some random data from the cpu_app to
    the cpu_net since the HW random generator will likely be already
    functional in the cpu_net.
    So let's just try the HCI command and, if something is not right,
    it will fail anyway. There's no need to anticipate the failure.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    29e9d7f View commit details
    Browse the repository at this point in the history
  27. boards: native_sim: enable ENTROPY_GENERATOR if BT

    On the native_sim platform, BT relies on Mbed TLS to implement
    PSA Crypto API. This library requires a valid entropy source
    to initialize properly. Therefore we enable ENTROPY_GENERATOR
    at board level instead of editing _all_ the samples/tests
    configuration files to make a more compact change.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    8cd09ae View commit details
    Browse the repository at this point in the history
  28. tests: bt_crypto: fix kconfig for qemu_cortex_m3

    Increase test and main stack sizes for the qemu_cortex_m3 platform
    in order to be able to successfully run the test.
    
    Signed-off-by: Valerio Setti <[email protected]>
    valeriosetti authored and cvinayak committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    8f79404 View commit details
    Browse the repository at this point in the history