Fix uninitialized advertiser rl_idx used to check own identity
in CONNECT_IND received for directed advertisements.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This API will be deprecated in favor of the new API that clearly
specifies whether it works on logical or physical levels.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Some compilers can't resolve the conditional if/else/else construction
in ull_conn event_len_prep function, and fail with an 'uninitialized
variables' error. The change has no functional impact.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Fix infinite recursion in host-based bt_rand function. This would call
HCI LE Random Number command, which would in turn call bt_rand, causing
an infinite recursion.
bt_rand -> prng_reseed -> BT_HCI_OP_LE_RAND -> le_rand -> bt_rand
To solve this issue the controller should avoid doing calls into the
host, so all calls to bt_rand in the controller should be replaced with
a call to a controller function.
Fixes#22202
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Since a peer MIC failure closes the event, it does not allow a terminate
acknowledge. For that reason a peer MIC fail for central role must force
a conn_cleanup.
Signed-off-by: Morten Priess <mtpr@oticon.com>
This fixes the EBQ tests 129 and 130. These tests check behaviour for
the DLE procedure when Encoded PHY or 2M PHY are not supported.
See also BT core spec. Version 5.1, Vol6, Part B, Section 5.1.9
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
When clearing the whitelist, possible white listings in resolve list
were left. These are now also cleared.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Clean up the nRF cmake include file to remove redundant
check for BT_LLL_VENDOR_NORDIC inside the file.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
SMI TX is different than other controller features in that it does not
necessarily imply any software changes; whether SMI TX is supported
may be simply a matter of hardware calibration. This change supports
using the same software on chips that do or do not support SMI TX
depending on calibration.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
As a part of a ticker extension interface, it is now possible to specify
a slot_window when starting a ticker. When setting the
ticks_slot_window to a non-zero value, it is requested that the node
timeout is re-located to a position within the window, where the node
does not collide with other nodes - aligning to the end of the window.
The solution takes into consideration if a node has already been
updated with drift correction (e.g. ADV randomization), subtracting this
from the window.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Updated the lll_conn_flush interface to pass the connection
handle while the LLL connection context stored handle has
been invalidated.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Zephyr aims to enable supporting of multiple SW defined
BLE LL. There is a complex hierarchy of defines in the
CMake files controlling the compilation units that part of
the final library. Adding another SW LL implementation
from a different SoC provider will make the main controller
CMake file unmaintable.
As such, split the into vendor-specific CMake files for
easier additions.
Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
generated_dts_board.h is pretty redundant and confusing as a name. Call
it devicetree.h instead.
dts.h would be another option, but DTS stands for "devicetree source"
and is the source code format, so it's a bit confusing too.
The replacement was done by grepping for 'generated_dts_board' and
'GENERATED_DTS_BOARD'.
Two build diagram and input-output SVG files were updated as well, along
with misc. documentation.
hal_ti, mcuboot, and ci-tools updates are included too, in the west.yml
update.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Moving struct definitions into header file and adding API to
allow accessing data-structures from lll context
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Under race conditions it is possible that there is no call
to k_sem_give to the waiting k_sem_take in the ull_disable
function.
ull_disable function checks for reference count before
using a mayfly to schedule lll_disable, which in turn
would close requested currently active role event leading
to done event being propogated to ULL. Done event would
then call the set disabled_cb callback when the reference
count is zero, giving the semaphore to the waiting
k_sem_give in the ull_disable.
Under race conditions if the reference count reached zero
after the reference count check and before the disabled_cb
was assigned in the ull_disable function, then there are
chances that a k_sem_give is not called while ull_disable
proceeds to waiting using k_sem_take.
Fixes#21586.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix controllers address check in cases of controller-based
privacy is supported but not used to start advertising.
This fixes regression introduced in
commit 896619ad40 ("Bluetooth: controller: Fix
controller address check").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the event_len_prep routine to increase readability without
affecting code size
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
There is an obscure bug in the case that CFG_BT_CTLR_PHY is not defined;
when a feature-exchange already has happened the lr->max_tx_time and
lr->max_rx_time are not calculated.
This bug is fixed by this commit.
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
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>
Fix bug when connecting using whitelist and split controller.
The peer address was set to an all zeroes address.
Bug using shell:
bt init
bt wl-add <addr>
bt wl-connect on
Connected: 00:00:00:00:00:00 (public)
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Pass the scanner LLL context in the generated connection
complete event with unknown connecion id for HCI Create
Connection Cancel Command Response.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Directed advertising timeout released PDU Rx quota which it
should not be.
Relates to assert in #21006.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
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>
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>
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>
Remove the 4us advanced radio reception, the implementation
passes all timing conformance tests without this.
This change should reduce some radio power consumption by
avoiding redundant reception duration.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Low frequency and high frequency clocks had separate devices
while they are actually handled by single peripheral with single
interrupt. The split was done probably because opaque subsys
argument in the API was used for other purposes and there was
no way to pass the information which clock should be controlled.
Implementation changes some time ago and subsys parameter was
no longer used. It now can be used to indicate which clock should
be controlled.
Change become necessary when nrf5340 is taken into account where
there are more clocks and current approach would lead to create
multiple devices - mess.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
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>
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 #21299.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit targets solving issue #17731 over the Nordic LL LEGACY
arch of the BLE stack in Zephyr. This functionality is exposed
to the user as HCI Zephyr Command extensions
- BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL
- BT_HCI_OP_VS_READ_TX_POWER_LEVEL
which enable Tx power read/write operations within BLE radio events
on a per role/connection basis.
The functionality is enabled upon the Kconfig advanced configuration
triggered by
- BT_CTLR_TX_PWR_DYNAMIC_CONTROL
depending on the enablement of Zephyr HCI vendor-specific command
extensions.
Signed-off-by: Andrei Stoica <stoica.razvan.andrei@gmail.com>
This commit targets solving issue #17731 over the LL_SW_SPLIT
arch of the BLE stack in Zephyr. This functionality is exposed
to the user as HCI Zephyr Command extensions
- BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL
- BT_HCI_OP_VS_READ_TX_POWER_LEVEL
which enable Tx power read/write operations within BLE radio events
on a per role/connection basis.
The functionality is enabled upon the Kconfig advanced configuration
triggered by
- BT_CTLR_TX_PWR_DYNAMIC_CONTROL
depending on the enablement of Zephyr HCI vendor-specific command
extensions.
Necessary low-level radio HAL functionality and power definitions
are also supplied to address the high-level functionality of
controlling the Tx power.
Signed-off-by: Andrei Stoica <stoica.razvan.andrei@gmail.com>
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>
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.
Fixes#21299.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix implementation for the missing reset of version
information procedure request state value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move invalidation of connection handle when flushing TX buffers into
LLL context. Otherwise, LLL may or may not see invalidated handle
depending on mayfly scheduling.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>