Fix compilation error if CONFIG_BT_CTLR_DF is not defined.
If DF was not enabled, there was missing CONFIG_BT_CTLR_DF_MAX_-
ANT_SW_PATTERN_LEN and undeclared symbol was found.
Split ll_df.h into two parts:
- ll_df.h that is generally includeable and allows to successfully
compile sources when DF is not enabled.
- ll_df_internal.h to be used in soucres that are compiled when
DF is enabled.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Direction Finding requires initalization of a set of registers
in Radio peripheral. Also it requires information about antenna
matrix unit that are provided by end user in DTS overlay.
Implemented initialization step is responsible for validation of
hardware information delivered by DTS and setting up DF related
registers in Radio.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add support for Direction Finding antenna configuration in
Nordic hal of Bluetooth controller.
Add handling of response for HCI_LE_Read_Antenna_Information
HCI command in controller (upper and lower link layer).
Handling of response to the command requires antenna matrix
configuration.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
After nrfx glue code was decoupled from nrfx sources, it is no longer
feasible to use those inclusions in the <nrfx/hal/nrf_*.h> form (there
is no point in adding the main directory of the hal_nordic module as
an include path solely for this reason). Remove then the nrfx/ part.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Defined 625 and 1250 as context specific interval common to ULL and LLL.
Checked with bluetooth sanity checks.
Fixes#23314.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Some proprietary protocols that reuse the Bluetooth LLCP logic requires
that the CPR interval has a valid range that differs from the Bluetooth
specification defined.
Vendor must implement the function (ull_vendor.h)
uint16_t ull_conn_interval_min_get(struct ll_conn *conn)
that returns the valid limit for the given connection.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Allow vendor specific increase of user operation capacity for LLL, to
support queuing additional ticker operations from lower link layer
context. These would typically take place in lll_xxx_prepare.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Add implementation of HCI_Set_Connecitonless_CTE_TX_Enable
command to HCI. Add scratch implementation of command handling
functions to controller.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Correct names of kconfig entries to mach to style of other entries.
Style correction in hci.c. Use the same approach of checking if
Kconfig entry is enabled.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fixed misalignment of bitflag in ll_conn type causing unintentional
overwrite between unions. Common flag must be present in master/slave
uinons as well. Problem is only present when enabling feature
CONFIG_BT_CTLR_CONN_META, which is default disabled.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Reserve two link rx buffer for each supported Broadcast ISO
sync instance, for establishment and for sync lost node rx
generation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For tx_power_max_get and tx_power_floor, only allow for
positive values of txpower if they are defined.
Signed-off-by: Aurora Sletnes Bjørlo <aurora.sletnes@nordicsemi.no>
Rename Kconfig BT_CTLR_SCAN_SYNC_ISO_MAX to
BT_CTLR_SCAN_SYNC_ISO_SET, to be consistent with other
Kconfig naming.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
AUX_CONNECT_RSP PDU static buffer definition was missing one
byte required for the Extended Header Flags.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Document with comments, the explanation of node rx count and
the design of the free rx PDU management.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix for scenarios where in active PHY Update Procedure or
Connection Update Procedure could cause temporary depletion
of the free Rx PDUs in the queue between LL/HCI thread
context to LLL context. Symptoms being on-air NACKing during
the above said procedures, causing supervision timeouts due
to procedures not completing at instants.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the implementation of PA/LNA PPI configuration
which was done on every Tx or Rx as common code to be
executed once per radio reset. And only setup the timeout
and enabling of PPI at every Tx or Rx.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For PA/LNA implementation use NRF_P0/P1 defines instead of
the deprecated NRF_GPIO to reference GPIO Port 0 registers.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the missing GPIOTE channel disable when GPIOTE channel
is alternately used between PA and LNA use.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression in PA/LNA support wherein the GPIO pins where
left in undefined state after each radio event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression, add back missing call to radio_setup HAL
interface. This is needed to setup the initial PA/LNA GPIO
states.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
SWI IRQ line mapping for nRF5340 shall use
CONFIG_SOC_NRF5340_CPUNET for conditional compilation
instead of the board define, so as to allow new boards to
use the BLE controller implementation.
Fixes#30488.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove is_enabled flag in LLL of BIS events context, as the
status returned from ticker_stop interface is sufficient to
determine if the Broadcast ISO Sync was established or not.
HCI Command Disallow as reason is to be returned if sync was
not established or sync was loss prior to call of HCI LE
BIG Terminate Command was called.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move lll_sync_iso.h as common to all vendors, as currently
there is nothing that is vendor specific.
Fixes#31044.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
We have convenient PHY_1M, PHY_2M and PHY_CODED symbols defined but
they are not used too much in the code. This replaces all usages of
magic numbers and other symbols as PHY constants with those symbols.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Implements the ull_sync_iso_setup function which starts the
ticker for ISO sync. Furthermore, ll_big_sync_terminate
will not stop the ticker as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implements handling of the BIG sync commands in the ULL.
LLL support and handling of ACAD (biginfo) remaining.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adjust the PPI used by nRF51x and nRF52x so that PPI 0-5 is
available for application's use or for SW PWM driver use.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Under CONFIG_BT_TICKER_EXT configuration, the ticker interface has been
extended to support enabling/disabling must-expire scheduling. This
means that conn and slave ticker start calls can now omit must-expire
default-on configuration, relying on LLL updating the mode as needed.
Signed-off-by: Morten Priess <mtpr@oticon.com>
We allocate nodes on receiving AUX_CONNECT_REQ, but we can only use
them if AUX_CONNECT_RSP is sent successfully. If that fails, we need
to release those nodes.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
If we allocate a node in LLL and it turns out that we don't need it
(e.g. allocated connection on AUX_CONNECT_REQ, but connection handshake
did not complete and we don't need it) we still need to send it to ULL
to be released. We can use existing NODE_RX_TYPE_DC_PDU_RELEASE node
type for this purpose, but we just need to make sure it's passed from
LLL to ULL properly.
Also, since this now does not only release DC PDUs, let's change its
name to a more generic one.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
After slave connection is created only adv instance is stopped, we also
need to stop aux separately if enabled.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Make sure phy is properly initialized to 1M when ext adv is supported
and legacy advertising instance is being enabled.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This adds handling for received AUX_CONNECT_REQ PDU which enables slave
connection with extended advertising.
Once AUX_CONNECT_REQ is received, standard checks are performed to
determine if we have resource to create connection, however unlike for
CONNECT_IND an rx node is temporarily kept in LLL until AUX_CONNECT_RSP
is successfully sent. This is to prevent creating a connection in case
response PDU was not sent for whatever reason.
A separate scratch buffer is created for AUX_CONNECT_RSP since default
radio scratch buffer is already used by received AUX_CONNECT_REQ.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Connection structs need to be initialized when advertising is enabled
on connectable extended advertising instance.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Connection created from extended advertising instance uses the same phy
as on secondary channels.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
transmitWindowDelay is either 2.5ms or 3.75ms when AUX_CONNECT_REQ is
used (for 1M/2M and Coded respectively). It also uses the same unit
as transmitWindowOffset (1.25ms) so we can just simply add both.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
The same helper will be used for legacy and extended advertising so we
better pass AdvA and TargetA directly instead of complete advertising
PDU. This is because those fields are at different locations in legacy
and extended advertising PDUs so caller can figure them out.
Also, we can now check for directed advertising using TargetA since it
will be only supplied for such advertising (NULL otherwise).
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Release the LF clock requested in blocking mode used to wait
to settle, which has already been asynchronously requested.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix lll_clock_wait function to wait for LF clock to settle
only once after power up.
Regression introduced in commit 2b4763076e ("bluetooth:
controller: Adapt to onoff clock control").
Fixes#30480.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>