When an advertising set is not configured for periodic advertising,
the correct error to return is BT_HCI_ERR_CMD_DISALLOWED
Fixes EBQ test failure of HCI/DDI/BI-70-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
If more than one CIS in the same CIG was shutdown at the same time
(e.g. due to supervision timeout), the mayfly calling cis_tx_lll_flush
would be busy and the assert would be triggered
cis_tx_lll_flush now operates similar to cis_disabled_cb; Loop through
all CISes for a CIG and flush any marked as LLL_CIS_FLUSH_PENDING
Signed-off-by: Troels Nilsson <trnn@demant.com>
If the connection handle given to a Read/Write Authenticated Payload
Timeout HCI command is a CIS or BIS handle, the error returned has to
be BT_HCI_ERR_CMD_DISALLOWED with the new TCRL
Fixes EBQ test failures in HCI/BIS/BI-14-C, HCI/BIS/BI-15-C,
HCI/CIS/BI-20-C and HCI/CIS/BI-22-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
Fix incorrect payload count at CIS Establish due to existing
CIG event overlapping the ACL event at the instant when the
CIS gets the active flag set.
The overlapping CIG event picked up the new CIS that had its
active flag set in the current CIG event instead of at the
actual CIS offset which is in the next CIG event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix CIS offset calculation due to use of decremented ACL
event counter, where as the CIS offset is inquired in the
next ACL event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix incorrect CIS offset in use if instant is picked from
the peer sent CIS RSP PDU. Instead, keep the instant that
was sent in the CIS REQ PDU as the instant to send in the
CIS IND PDU.
This fixes CIS failed to be established when dissimilar
ACL and ISO intervals are in use.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix incorrect payload count at CIS Establish due to existing
CIG event overlapping the ACL event at the instant when the
CIS gets the active flag set.
The overlapping CIG event picked up the new CIS that had its
active flag set in the current CIG event instead of at the
actual CIS offset which is in the next CIG event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Peripheral CIS sorted by CIG implemenation to use CIS
offset stored in LLL context which is the correct offset
from the CIG anchor point. CIS offset in the ULL context
is the offset from the ACL anchor point at the time of
the CIS establishment.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix CIS event_count_prepare use missed as part of fixes
related to commit be91cfedfb ("Bluetooth: Controller: Fix
incorrect event_count when CIG overlaps").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ull_hdr_get_cb() for advanced scheduling to return
ticks_slot for Peripheral role.
Relates to commit d6c3e04eb8 ("Bluetooth: Controller:
Central maximum data PDU size time spacing").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Several members of the ull_hdr can be removed, saving 12 bytes
from all ULL instances used (and a bit of code as well)
ticks_active_to_start is always 0 and can be removed completely
ticks_prepare_to_start is always set to
HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_XTAL_US), so replace usage
of it by this constant
ticks_preempt_to_start is always set to
HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_PREEMPT_MIN_US), so replace
usage of it by this constant
In addition, remove logic handling usage of XON_BITMASK since it
was only used by the long removed legacy LL
Signed-off-by: Troels Nilsson <trnn@demant.com>
The lost_payloads calculation in ull_conn_iso_start() could easily
end up negative for CIS with FT > 1; Add a check to avoid this
Signed-off-by: Troels Nilsson <trnn@demant.com>
The options for BT_CTLR_CENTRAL_ISO and
BT_CTLR_PERIPHERAL_ISO did not have the proper defaults not
dependencies when BT_LL_SW_SPLIT=y
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The current overhead check needlessly flushes some events for
CONFIG_BT_TICKER_SLOT_AGNOSTIC resulting in some lost or incomplete
advertising events; Use a lower overhead value for this configuration
to avoid that
Signed-off-by: Troels Nilsson <trnn@demant.com>
For a CIG with a CIG Sync Delay larger than a SDU interval, we cannot
be sure that we can target the very next ISO event when the CIG event
is ongoing; Only reduce event_offset if CIG Sync Delay is smaller
than an SDU interval
Signed-off-by: Troels Nilsson <trnn@demant.com>
ENTROPY_NRF_CRACEN_CTR_DRBG symbol is based on devicetree
node with compatible nordic,nrf-cracen-ctrdrbg. It does not
have to be selected explicitly.
Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
Fix connection update microsecond interval variable data
type, to use 32-bit so that a value upto 2000 seconds, i.e.
4 seconds interval and 499 peripheral latency can be stored.
Regression in commit abfe5f17a9 ("Bluetooth: Controller:
1 ms connection").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove a kconfig dependency on BOARD_NATIVE_POSIX which
does not really exist anymore.
Replace a comment mention of native_posix with native_posix.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The ISO configs set defaults based upon BT_ISO_MAX_CHAN and other
configs defined in `bluetooth/Kconfig.iso`.
By adding these dependencies the error messages resulting from
adding `CONFIG_BT_CTLR_PERIPHERAL_ISO=y` to a project configuration
file will become less confusing.
Now the build will output:
```
warning: BT_CTLR_PERIPHERAL_ISO (
defined at subsys/bluetooth/controller/Kconfig:976,
subsys/bluetooth/controller/Kconfig:984) was assigned the value 'y' but
got the value 'n'. See ...
```
Previously we would get:
```
warning: default value 0 on BT_CTLR_CONN_ISO_STREAMS
(defined at subsys/bluetooth/controller/Kconfig:993)
clamped to 1 due to being outside the active range ([1, 64])
```
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Update Kconfig to not select BT_TICKER_REMAINDER_SUPPORT for nrf54L
Add BSim tests to cover using a ticker without BT_TICKER_REMAINDER_SUPPORT
and expire info enabled
Signed-off-by: Troels Nilsson <trnn@demant.com>
A few things were not flagged by CONFIG_BT_TICKER_REMAINDER_SUPPORT
that should have been; This caused building without it to fail
Initialize remainder to 0 where used with ticker_next_slot_get_ext(),
since it may not get set if remainder support is off
Signed-off-by: Troels Nilsson <trnn@demant.com>
Fix end time capture be on radio event end irrespective of
direction finding support. Let the timer clear use radio
end or radio phy end, for no direction finding or direction
finding support, respectively.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix single timer use end time capture from being disabled
as end time and timer clear use the same PPI.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix active mode extended scanning assert raised when calling
radio_tmr_start_us() due to stale radio_tmr_end_get() value.
Active mode extended scanning did not drop reception of
ADV_EXT_IND PDU when setup to receive ADV_SCAN_RSP PDUs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix BT_CTLR_LOW_LAT_ULL dependency after changes in
commit 5119896c7d ("Bluetooth: Controller: Fix
BT_CTLR_LOW_LAT_ULL conditional code").
BT_CTLR_LOW_LAT_ULL is independent of BT_CTLR_LOW_LAT, where
the later prevents any ULL execution inside a radio event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Simplify the defines calculating the minimum required ISO
PDU length and the buffer count.
Co-authored-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ISO Tx PDU buffer count required when SDU fragmentation
is used.
Rename BT_CTLR_CONN_ISO_SDU_LEN_MAX to
BT_CTLR_ISO_TX_SDU_LEN_MAX so the value is common to both
Broadcast and Connected ISO transmissions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Rename the internal BT_CTLR_ISO_TX_BUFFERS to
BT_CTLR_ISO_TX_PDU_BUFFERS correct represent the number
of actual ISO PDU buffers allocated in the Controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix HCI command buffer allocation failure, that can cause
loss of Host Number of Completed Packets command.
Fail by rejecting the HCI Host Buffer Size command if the
required number of HCI command buffers are not allocated in
the Controller implementation.
When Controller to Host data flow control is supported in
the Controller only build, ensure that BT_BUF_CMD_TX_COUNT
is greater than or equal to (BT_BUF_RX_COUNT + Ncmd),
where Ncmd is supported maximum Num_HCI_Command_Packets in
the Controller implementation.
Relates to commit 81614307e9 ("Bluetooth: Add workaround
for no command buffer available")'.
Relates to commit 297f4f481f ("Bluetooth: Split HCI
command & event buffers to two pools").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression in scan aux release now that aux context is
retrieved from the node rx when supporting multiple chain
reception.
Relates to commit a8065926ac ("Bluetooth: Controller: Fix
to release aux context stored in node rx").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Extends the API for Advertising Coding Selection.
The API is extended to set the Advertising Coding Selection
(Host Support) bit. With this feature, the primary and
secondary PHY can now explicitly report S=2 or S=8 coding
in the extended advertising report. Previously, the report
only indicated LE Coded regardless of whether S=2 or S=8
data coding was used. The API now sets the host support bit
and ensures that the advertising PHY coding scheme is
conveyed to the application via the scan callback.
The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION,
and requires a controller that selects
CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.
Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>
Fix to release aux context stored in node rx, and not in the
superior scan or sync context as the one in the superior scan
or sync context could be reset or have a different new aux
context when multiple advertising chain reception is used.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix assertion due to changes introduced to support multiple
advertising chain reception.
Auxiliary context association with the Periodic Sync context
was not cleared due to which when terminating a Periodic
Synchronization triggered an assertion check, under race
conditions, detecting that the auxiliary context was already
released.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The BLE acronym is not an official description of Bluetooth
LE, and the Bluetooth SIG only ever refers to it as Bluetooth
Low Energy or Bluetooth LE, so Zephyr should as well.
This commit does not change any board or vendor specific
documentation, and the term BLE may still be used in those.
It will be up to the vendors to update it if they want,
since many of them are using the term BLE in their
products.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix missing sync_delay and transport_latency information in HCI
LE BIG Complete event.
Relates to commit 1a640e4711 ("Bluetooth: controller:
Included transport latency in LE_Big_Established").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix incorrect device address reported in the LE Periodic
Advertising Sync Established event when using Periodic
Advertiser List.
During Extended Scanning there can be an ADV_EXT_IND PDU
received between currently being received ADV_EXT_IND PDU
and AUX_ADV_IND PDU; if the one received between has an
address match then incorrectly the Periodic Synchronization
was established to the device whos AUX_ADV_IND PDU is being
received. Fix by storing the auxiliary context that has the
address match and compare with it when matching the SID in
SyncInfo of AUX_ADV_IND PDU being received prior to creating
the synchronization.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix BT_CTLR_LOW_LAT_ULL conditional compilation code by
decoupling it from BT_CTLR_LOW_LAT code.
BT_CTLR_LOW_LAT_ULL makes ULL execution context to tailchain
in comparison to continuously process in a while loop.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
We have previously fixed an issue with shifting and
assigning the value without a cast, but coverity
is still complaining about aa[1] and aa[0] with:
"Casting narrower unsigned aa[1] to wider signed type
int effectively tests its lower bound."
Using the common function, sys_get_le24, should fix this issue.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds API for Advertising Coding Selection.
Introduces two new advertising options to configure the advertiser's
requirement concerning coding scheme when LE Coded PHY is configured.
While the Bluetooth v6.0 specification makes a distinction betweeen
preferred and required advertising PHY options, a simplification is
made to only expose the required PHY options. Inline with how LE Coded
PHY is implemented; this API will set both the primary and secondary
advertising PHY's to the same coding scheme.
The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION, and requires
a controller that selects CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.
Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>