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

[backport v1.14] Bluetooth: controller: legacy: Backport v2.2 to v1.14-branch #23091

Merged

Commits on Sep 23, 2020

  1. Bluetooth: controller: legacy: Fix conn RSSI initial value

    On connection callback generated by host, application
    reading the RSSI value by using HCI LE Read RSSI Command
    received -127 dB as the first connection event has not
    occured yet in order to measure the RSSI value.
    
    Fix this by using the RSSI value of received advertising
    PDU by the initiator, and using the RSSI value of the
    received CONNECT_REQ PDU by the connectable advertiser as
    the initial value at connection setup.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    48d70cb View commit details
    Browse the repository at this point in the history
  2. Bluetooth: controller: Fix mayfly optimization

    Fix incorrect reset of mayfly pended flag. This fix reduces
    CPU use by mayfly.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    c0e8deb View commit details
    Browse the repository at this point in the history
  3. Bluetooth: controller: legacy: Fix the slow Enc Setup alternative

    Fix the implementation of slow encryption setup design
    alternative to send ENC_RSP PDU before sending REJECT_IND
    or REJECT_EXT_IND PDU.
    
    Fixes zephyrproject-rtos#19917.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    4da7a90 View commit details
    Browse the repository at this point in the history
  4. Bluetooth: controller: legacy: Add missing BT_DEBUG_ENABLED define

    Add missing BT_DEBUG_ENABLED definitions.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    dd0b338 View commit details
    Browse the repository at this point in the history
  5. Bluetooth: controller: legacy: Fix Tx Ctrl PDU leak

    Overlapping Feature Exchange requested by host with
    Encryption Setup requested by the application caused the
    controller to corrupt its Tx queue leading to Tx Ctrl PDU
    buffers from leaking from the system.
    
    Relates to zephyrproject-rtos#21299.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    0aebc45 View commit details
    Browse the repository at this point in the history
  6. Bluetooth: controller: legacy: Fix length and ping rsp

    Fix LENGTH_RSP and PING_RSP to be send after Encryption
    Setup under the cases where LENGTH_REQ or PING_REQ cross-
    over with ENC_REQ in the same connection event.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    1406d35 View commit details
    Browse the repository at this point in the history
  7. Bluetooth: controller: legacy: Fix compiler warnings

    Fix compiler warnings when central only support is used.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    cf6c675 View commit details
    Browse the repository at this point in the history
  8. Bluetooth: controller: legacy: Fix tx_time calculation for length update

    Fix tx_time calculation for the case that BT_CTRL_PHY is defined and
    there has not been a feature exchange.
    
    Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    1062c14 View commit details
    Browse the repository at this point in the history
  9. Bluetooth: controller: legacy: Ensure that a case statement is present

    When compiling a sample like a beacon, none of the `if defined()`
    statements in the switch case are actually compiled in, so the compiler
    complains of an orphan mem_release();break; sequence.
    Add a type that we know will always be compiled in in order to avoid
    this issue.
    
    Relates to commit 76bfea7 ("Bluetooth: controller: Ensure that a
    `case` statement is present").
    
    Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    b15bcfb View commit details
    Browse the repository at this point in the history
  10. Bluetooth: controller: Fix scan request when advertising directed

    Fix scan requests being processed during directed advertisiments.
    Directed advertise packets are not scannable
    
    Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
    Joakim Andersson authored and cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    0555347 View commit details
    Browse the repository at this point in the history
  11. Bluetooth: controller: Move ticker_id_prepare reset to early return

    Move the reset of ticker_id_prepare variable to the early
    return in event_connection_prepare function.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    a853629 View commit details
    Browse the repository at this point in the history
  12. Bluetooth: controller: Fix missing BT_CTLR_FILTER conditional

    Fix missing BT_CTLR_FILTER conditional compilations that
    cause compile errors when device whitelisting feature is
    disabled in builds.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    d0a0f3a View commit details
    Browse the repository at this point in the history
  13. Bluetooth: controller: Fix rejected enc procedure not terminated

    Fix issue in the handling of LL_REJECT_EXT_IND packets, this would look
    at the procedures that are enqueued, and not the procedure that was
    being rejected. This meant that although a reject was received for the
    encryption procedure, the handling for a different control procedure was
    run.
    This would result in the link being terminated as control procedure
    timer would time out for the encryption procedure.
    
    Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
    Joakim Andersson authored and cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    540897f View commit details
    Browse the repository at this point in the history
  14. Bluetooth: controller: Check if enc procedure is in progress

    Check if the encryption procedure is in progress when receiving
    rejection for the procedure.
    
    Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
    Joakim Andersson authored and cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    2a29e9e View commit details
    Browse the repository at this point in the history
  15. Bluetooth: controller: Fix ticker_job enable/disable

    Conditional compile ticker_job enable/disable.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    6129000 View commit details
    Browse the repository at this point in the history
  16. Bluetooth: controller: Remove incorrect comment

    Remove comment stating that UNKNOWN_RSP during encryption procedure
    is a workaround.
    The core spec mandates that connections should not be dropped if
    receiving this control packet during encryption procedure.
    
    Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
    Joakim Andersson authored and cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    635522e View commit details
    Browse the repository at this point in the history
  17. Bluetooth: controller: remove duplicated code

    A conditional block to save a directed advertising report flag was
    present three times.  Remove two of the blocks.
    
    Signed-off-by: Peter A. Bigot <pab@pabigot.com>
    pabigot authored and cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    097c428 View commit details
    Browse the repository at this point in the history
  18. Bluetooth: controller: legacy: Fix controller address check

    Fix controllers address check in cases of controller-based privacy.
    When controller has been instructed by the host to use privacy
    the controller should look up the peer identity address and generate
    an address based on the local IRK. In the case where no match
    is found or the local IRK is all zeroes the controller shall use
    the fallback address. If the fallback address is not valid the
    controller shall return invalid params.
    
    This commit fixes these issues:
     - Starting a private advertiser without valid random address set
       but a valid local IRK exists. In this case the advertiser should
       be able to advertise using the RPA regardless of a valid random
       or public address.
     - Starting a private advertiser with a fallback to the public
       address type or an adveriser using public address  does not
       check if a valid public address exists. The host cannot
       advertise with an all-zero public address.
    
    Signed-off-by: Joakim Andersson <joerchan@gmail.com>
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    a0a234e View commit details
    Browse the repository at this point in the history
  19. Bluetooth: controller: legacy: Fix redundant priv variable check

    Fix the redundant check of priv flag variable introduced as
    regression in commit f8877e3 ("Bluetooth: controller:
    legacy: Fix controller address check").
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    554afd6 View commit details
    Browse the repository at this point in the history
  20. Bluetooth: controller: legacy: Fix HCI LE Add Device to Whitelist

    According to BT Spec v5.1 Vol 2 Part E Section 7.8.16, if the
    device is already in the White List, the controller should not
    add the device to the White List and should return success.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    d831818 View commit details
    Browse the repository at this point in the history
  21. Bluetooth: controller: legacy: Fix Tx pool corruption

    Fix Tx pool from being corrupted when rough central device
    uses invalid packet sequence numbers, causing NULL pointer
    to be released into free data Tx pool.
    
    Fixes zephyrproject-rtos#22968.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    5c0c536 View commit details
    Browse the repository at this point in the history
  22. Bluetooth: controller: legacy: Fix Data Length Tx Rx time

    Fix Data Length Update procedure calculation of transmit
    and receive time.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    4a25ba8 View commit details
    Browse the repository at this point in the history
  23. Bluetooth: controller: legacy: Fix assert on DLE procedure stall

    Fix local initiated Data Length Update procedure from being
    stalled when a remote initiates a procedure with instant.
    
    Fixes zephyrproject-rtos#23069.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    8c74a74 View commit details
    Browse the repository at this point in the history
  24. Bluetooth: controller: legacy: Fix cond. compile error

    Fix conditional compilation error when enabling
    BT_CTLR_FAST_ENC for central only application builds.
    
    Also added additional compilation to code exclusive to
    central or peripheral role.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    624fec3 View commit details
    Browse the repository at this point in the history
  25. Bluetooth: controller: legacy: Fix DLE tx rx time on PHY update

    Fix Data Length Update transmit and receive time calculation
    on PHY update procedure completion.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    18b202b View commit details
    Browse the repository at this point in the history
  26. Bluetooth: controller: legacy: Fix mandatory min PDU len Code PHY

    Fix to return the max tx/rx time back to set default time
    after using mandatory minimum PDU length and time while
    switching back from Coded PHY to 1M PHY.
    
    Also fixes zephyrproject-rtos#23109.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    5e041b5 View commit details
    Browse the repository at this point in the history
  27. Bluetooth: controller: Add Kconfig for Optimize for Speed

    Add Kconfig option to support building the controller
    optimized for speed.
    
    Fixes zephyrproject-rtos#21601.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    499b6c1 View commit details
    Browse the repository at this point in the history
  28. Bluetooth: controller: legacy: Use slot margins only around slave

    Fix Connection Parameter Request offset calculation to only use
    slot margins around slave roles.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    4d9e876 View commit details
    Browse the repository at this point in the history
  29. Bluetooth: controller: Add ticker_stop_abs interface

    Add ticker_stop_abs interface, similar functionality as to
    ticker_stop interface to stop a running ticker but with a
    supplied absolute tick reference value.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    207f9fd View commit details
    Browse the repository at this point in the history
  30. Bluetooth: controller: legacy: Fix missing first conn event

    Fix missing first connection event due to first connection
    event ticks_slot overlapping with the initiator window
    ticks_slot.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    d77ee12 View commit details
    Browse the repository at this point in the history
  31. Bluetooth: controller: legacy: Fix regression tx pool corruption

    Fix regression in handling tx pool corruption in relation to
    commit 7a3e29a ("Bluetooth: controller: legacy: Fix Tx
    pool corruption").
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    b7d23ce View commit details
    Browse the repository at this point in the history
  32. Bluetooth: controller: Fix ticker ticks_current value

    Update the ticks_current value on last stopped ticker
    instance, so that when a new ticker instance is started
    the anchor ticks calculation uses the correct current tick
    with respect to supplied anchor ticks.
    
    Fixes zephyrproject-rtos#23805.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    1139137 View commit details
    Browse the repository at this point in the history
  33. Bluetooth: controller: legacy: Validate chan map and hop value

    Add validation of channel map and hop increment value
    received in CONNECT_IND PDU.
    
    Zero bit count leads to controller assert or divide-by-zero
    fault.
    
    Hop increment shall be between 5 and 16 by BT Specification.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    2f6a78a View commit details
    Browse the repository at this point in the history
  34. Bluetooth: controller: legacy: Simplify DLE state checks

    Simplify the Data Length Update Procedure state check when
    processing incoming LENGTH_REQ/RSP PDUs.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    c9b886f View commit details
    Browse the repository at this point in the history
  35. Bluetooth: controller: legacy: Fix DLE duplicate requests

    Fix implementation to handle back-to-back and duplicate
    LENGTH_REQ PDU reception.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    765b55d View commit details
    Browse the repository at this point in the history
  36. Bluetooth: controller: legacy: Fix slave latency during conn update

    Fix regression in cancelling slave latency during Connection
    Update Procedure.
    
    Slave latency should not be applied between the ack of a
    Connection Update Indication PDU and until the instant.
    When caching was introduced, implementation missed this
    consideration.
    
    Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
    cvinayak committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    27dda66 View commit details
    Browse the repository at this point in the history