Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
Expand Down Expand Up @@ -40,7 +40,11 @@ CONFIG_BT_ISO_PERIPHERAL=n

# ISO Streams
CONFIG_BT_ISO_MAX_CHAN=4
CONFIG_BT_ISO_TX_BUF_COUNT=1
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
CONFIG_BT_ISO_TX_BUF_COUNT=12
Comment on lines +43 to +47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be further explained in a GH issue?

This isn't something I understand as it is written here

Copy link
Contributor Author

@cvinayak cvinayak Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will create a detailed GH issue in the coming days... need to put some effort on simple sample rather that the audio tests to be able to reproduce/demo the issue.

The related code is:

static void hci_ipc_rx(uint8_t *data, size_t len)
{
uint8_t pkt_indicator;
struct net_buf *buf = NULL;
size_t remaining = len;
LOG_HEXDUMP_DBG(data, len, "IPC data:");
pkt_indicator = *data++;
remaining -= sizeof(pkt_indicator);
switch (pkt_indicator) {
case HCI_IPC_CMD:
buf = hci_ipc_cmd_recv(data, remaining);
break;
case HCI_IPC_ACL:
buf = hci_ipc_acl_recv(data, remaining);
break;
case HCI_IPC_ISO:
buf = hci_ipc_iso_recv(data, remaining);
break;
default:
LOG_ERR("Unknown HCI type %u", pkt_indicator);
return;
}
if (buf) {
k_fifo_put(&tx_queue, buf);
LOG_HEXDUMP_DBG(buf->data, buf->len, "Final net buffer:");
}
}

This function can return without call to k_fifo_put(), and there is no resumption/dequeue of Rx when the buffers are available later in time, causing the buffers/stream inside IPC to be stagnate until any next trigger that would call the hci_ipc_rx() again.

The next trigger would be a num complete event (or disconnect or any reports?) going upstream (one side of the Newton's Cradle, say one item strikes), consequently (other side of the Newton's Cradle, one item now strikes) new buffers are enqueued from upstream.

This effect can happen in either direction, I believe.

CONFIG_BT_ISO_RX_BUF_COUNT=1

# Controller
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CONFIG_IPC_SERVICE=y
CONFIG_MBOX=y

CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this reduction for mesh?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just being consistent with other conf files. I did not have the expertise to validate why we need HEAP at the first place at all. Is it like IPC uses unallocated RAM and this value overlaps such that IPC can function?


CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
Expand Down
10 changes: 7 additions & 3 deletions samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this reduction for all ISO .confs?

Isn't it only the combined one?
Or is this just done to be consistent for all of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just being consistent with other conf files.


CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
Expand Down Expand Up @@ -39,7 +39,11 @@ CONFIG_BT_ISO_PERIPHERAL=y

# ISO Streams
CONFIG_BT_ISO_MAX_CHAN=4
CONFIG_BT_ISO_TX_BUF_COUNT=1
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
CONFIG_BT_ISO_TX_BUF_COUNT=12
CONFIG_BT_ISO_RX_BUF_COUNT=1

# Controller
Expand Down Expand Up @@ -82,8 +86,8 @@ CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
# ISO Connection Oriented
CONFIG_BT_CTLR_CENTRAL_ISO=y
CONFIG_BT_CTLR_PERIPHERAL_ISO=y
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_GROUPS=1
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_STREAMS_PER_GROUP=2
CONFIG_BT_CTLR_CONN_ISO_SDU_LEN_MAX=247
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX=251
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto, do we need this reduction for DF?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just being consistent with other conf files.


CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
Expand Down
18 changes: 11 additions & 7 deletions samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144
CONFIG_CBPRINTF_REDUCED_INTEGRAL=y

CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
Expand Down Expand Up @@ -46,7 +46,11 @@ CONFIG_BT_ISO_PERIPHERAL=y
CONFIG_BT_ISO_TX_MTU=310
CONFIG_BT_ISO_RX_MTU=310
CONFIG_BT_ISO_MAX_CHAN=4
CONFIG_BT_ISO_TX_BUF_COUNT=1
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
CONFIG_BT_ISO_TX_BUF_COUNT=8
CONFIG_BT_ISO_RX_BUF_COUNT=1

# Controller
Expand Down Expand Up @@ -100,8 +104,8 @@ CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_ADV_PERIODIC=y
CONFIG_BT_CTLR_SYNC_TRANSFER_SENDER=y
CONFIG_BT_CTLR_ADV_ISO=y
CONFIG_BT_CTLR_ADV_ISO_SET=2
CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=4
CONFIG_BT_CTLR_ADV_ISO_SET=1
CONFIG_BT_CTLR_ADV_ISO_STREAM_COUNT=2
CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX=2
CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX=247

Expand All @@ -118,16 +122,16 @@ CONFIG_BT_CTLR_SYNC_ISO_PDU_LEN_MAX=251
# ISO Connection Oriented
CONFIG_BT_CTLR_CENTRAL_ISO=y
CONFIG_BT_CTLR_PERIPHERAL_ISO=y
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_GROUPS=1
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_STREAMS_PER_GROUP=2
CONFIG_BT_CTLR_CONN_ISO_SDU_LEN_MAX=247
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX=251
CONFIG_BT_CTLR_CONN_ISO_LOW_LATENCY_POLICY=y

# ISO Transmissions
CONFIG_BT_CTLR_ISOAL_SOURCES=4
CONFIG_BT_CTLR_ISO_TX_BUFFERS=12
CONFIG_BT_CTLR_ISOAL_SOURCES=2
CONFIG_BT_CTLR_ISO_TX_BUFFERS=8
CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE=255

# ISO Receptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
Expand All @@ -20,11 +20,18 @@ CONFIG_BT_OBSERVER=n
CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV=y
CONFIG_BT_ISO_BROADCASTER=y
CONFIG_BT_ISO_MAX_CHAN=4
CONFIG_BT_ISO_TX_BUF_COUNT=1
CONFIG_BT_CENTRAL=n
CONFIG_BT_PERIPHERAL=n

# ISO Streams
CONFIG_BT_ISO_MAX_CHAN=4
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
CONFIG_BT_ISO_TX_BUF_COUNT=12
CONFIG_BT_ISO_RX_BUF_COUNT=1

# ISO Broadcast Controller
CONFIG_BT_LL_SW_SPLIT=y
CONFIG_BT_CTLR_ADV_PERIODIC=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
Expand Down Expand Up @@ -35,7 +35,11 @@ CONFIG_BT_ISO_PERIPHERAL=n

# ISO Streams
CONFIG_BT_ISO_MAX_CHAN=2
CONFIG_BT_ISO_TX_BUF_COUNT=1
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
CONFIG_BT_ISO_TX_BUF_COUNT=12
CONFIG_BT_ISO_RX_BUF_COUNT=1

# Controller
Expand All @@ -46,8 +50,8 @@ CONFIG_BT_CTLR_SCAN_DATA_LEN_MAX=191
# ISO Connection Oriented
CONFIG_BT_CTLR_CENTRAL_ISO=y
CONFIG_BT_CTLR_PERIPHERAL_ISO=n
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_GROUPS=1
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_STREAMS_PER_GROUP=2
CONFIG_BT_CTLR_CONN_ISO_SDU_LEN_MAX=247
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX=251
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
Expand Down Expand Up @@ -35,7 +35,11 @@ CONFIG_BT_ISO_PERIPHERAL=y

# ISO Streams
CONFIG_BT_ISO_MAX_CHAN=2
CONFIG_BT_ISO_TX_BUF_COUNT=1
# In theory, CONFIG_BT_ISO_TX_BUF_COUNT=1, should be sufficient but this count
# is used in the context of IPC which falls into a "Newton's Cradle" effect
# where probably (CONFIG_BT_CTLR_ISO_TX_BUFFERS - CONFIG_BT_ISO_TX_BUF_COUNT)
# buffers get throttled. Hence, always have the value equal or greater.
CONFIG_BT_ISO_TX_BUF_COUNT=12
CONFIG_BT_ISO_RX_BUF_COUNT=1

# Controller
Expand All @@ -46,8 +50,8 @@ CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=191
# ISO Connection Oriented
CONFIG_BT_CTLR_CENTRAL_ISO=n
CONFIG_BT_CTLR_PERIPHERAL_ISO=y
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_GROUPS=1
CONFIG_BT_CTLR_CONN_ISO_STREAMS=2
CONFIG_BT_CTLR_CONN_ISO_STREAMS_PER_GROUP=2
CONFIG_BT_CTLR_CONN_ISO_SDU_LEN_MAX=247
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX=251
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=6144

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Reduce from 310 bytes, in nrf5340_cpunet_iso-bt_ll_sw_split.conf
# to be able to fit in 64KB RAM, in case needed in the future.

# Example:
# CONFIG_BT_ISO_TX_MTU=247
# CONFIG_BT_ISO_RX_MTU=251
Comment on lines +1 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in #80733 (comment): This is messy. We shouldn't have overlays/extra conf files that need to be added in a specific order to work, especially when it's not documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is repo wide use of extra_configs in sample.yaml and testcase.yaml files to use overrides of Kconfig values from prj.conf and use of EXTRA_CONF_FILE is better organization wise compared to use of list of Kconfigs under extra_configs.

OVERLAY_CONFIG is deprecated, but it did convey that something was overlay-ed!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OVERLAY_CONFIG is deprecated, but it did convey that something was overlay-ed!

Right :D I should stop calling them overlays

There is repo wide use of extra_configs in sample.yaml and testcase.yaml files to use overrides of Kconfig values from prj.conf and use of EXTRA_CONF_FILE is better organization wise compared to use of list of Kconfigs under extra_configs.

If we have several places where we use multiple extra configs that needs to be specific in a specific order, that's not a good reason to do it here either. IMO that just show that we have this other places too.

A file called testcase.yaml does/should not be used as documentation. If these values are required for this specific board to work, then that needs to be documented and/or applied automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is documented in the snippets section that the processing order of the snippets, .conf and .overlay files are "in the order they are listed".

Processing order
****************
Snippets are processed in the order they are listed in the :makevar:`SNIPPET`
variable, or in the order of the ``-S`` arguments if using west.
To apply ``bar`` after ``foo``:
.. code-block:: console
cmake -Sapp -Bbuild -DSNIPPET="foo;bar" [...]
cmake --build build
The same can be achieved with west as follows:
.. code-block:: console
west build -S foo -S bar [...] app
When multiple snippets set the same configuration, the configuration value set
by the last processed snippet ends up in the final configurations.
For instance, if ``foo`` sets ``CONFIG_FOO=1`` and ``bar`` sets
``CONFIG_FOO=2`` in the above example, the resulting final configuration will
be ``CONFIG_FOO=2`` because ``bar`` is processed after ``foo``.
This principle applies to both Kconfig fragments (``.conf`` files) and
devicetree overlays (``.overlay`` files).

1 change: 1 addition & 0 deletions samples/bluetooth/hci_ipc/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ tests:
tags: bluetooth
extra_args:
- CONF_FILE="nrf5340_cpunet_iso-bt_ll_sw_split.conf"
- EXTRA_CONF_FILE="overlay-nrf5340_cpunet_iso_nrf21540_ek-bt_ll_sw_split.conf"
- DTC_OVERLAY_FILE="./boards/nrf5340_audio_dk_nrf5340_cpunet_nrf21540_ek.overlay"
platform_allow:
- nrf5340_audio_dk/nrf5340/cpunet
Expand Down
11 changes: 11 additions & 0 deletions subsys/bluetooth/controller/Kconfig.ll_sw_split
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,17 @@ config BT_CTLR_ADV_RESERVE_MAX
corresponding to the Advertising Data present at the time of the
start/enable of Advertising is used.

config BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT
bool "Drift Extended Advertising Auxiliary PDUs within a slot window"
depends on BT_TICKER_EXT && \
BT_BROADCASTER && \
BT_CTLR_ADV_EXT
default y if BT_CTLR_SYNC_ISO || BT_CTLR_CONN_ISO
help
Drift Extended Advertising Auxiliary PDUs within a slot window to
avoid overlapping with other periodically scheduled states/roles; and
be placed before or after such overlapping states/roles.

config BT_CTLR_ADV_ISO_RESERVE_MAX
bool "Use maximum Broadcast ISO event time reservation"
depends on BT_CTLR_ADV_ISO
Expand Down
37 changes: 31 additions & 6 deletions subsys/bluetooth/controller/ll_sw/ull_adv_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@
static struct ll_adv_aux_set ll_adv_aux_pool[CONFIG_BT_CTLR_ADV_AUX_SET];
static void *adv_aux_free;

#if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \
(defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \
defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO))
#if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \
defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
static void ticker_update_op_cb(uint32_t status, void *param);
#endif /* CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO */

static struct ticker_ext ll_adv_aux_ticker_ext[CONFIG_BT_CTLR_ADV_AUX_SET];
#endif /* !CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO */
#endif /* CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT ||
* (CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
*/

Check notice on line 85 in subsys/bluetooth/controller/ll_sw/ull_adv_aux.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/ull_adv_aux.c:85 -#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \ - (defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \ - defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)) -#if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \ - defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) +#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \ + (defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)) +#if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO) static void ticker_update_op_cb(uint32_t status, void *param); #endif /* CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO */ static struct ticker_ext ll_adv_aux_ticker_ext[CONFIG_BT_CTLR_ADV_AUX_SET]; -#endif /* CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT || - * (CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) +#endif /* CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT || \ + * (CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) \
#endif /* (CONFIG_BT_CTLR_ADV_AUX_SET > 0) */

static uint16_t did_unique[PDU_ADV_SID_COUNT];
Expand Down Expand Up @@ -2600,6 +2607,12 @@
aux_handle = ull_adv_aux_handle_get(aux);
interval_us = aux->interval * PERIODIC_INT_UNIT_US;

#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT)
ll_adv_aux_ticker_ext[aux_handle].ticks_slot_window =
ULL_ADV_RANDOM_DELAY + aux->ull.ticks_slot;
ll_adv_aux_ticker_ext[aux_handle].is_drift_in_window = 1U;
#endif /* CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT */

#if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
if (aux->lll.adv->sync) {
const struct ll_adv_sync_set *sync = HDR_LLL2ULL(aux->lll.adv->sync);
Expand All @@ -2612,14 +2625,22 @@
}

ll_adv_aux_ticker_ext[aux_handle].ext_timeout_func = ticker_cb;
#endif /* !CONFIG_BT_CTLR_ADV_PERIODIC || !CONFIG_BT_TICKER_EXT_EXPIRE_INFO */

#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \
(defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \
defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO))
ret_cb = TICKER_STATUS_BUSY;
ret = ticker_start_ext(
#else /* !CONFIG_BT_CTLR_ADV_PERIODIC || !CONFIG_BT_TICKER_EXT_EXPIRE_INFO */
#else /* !CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT &&
* !(CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
*/

ret_cb = TICKER_STATUS_BUSY;
ret = ticker_start(
#endif /* !CONFIG_BT_CTLR_ADV_PERIODIC || !CONFIG_BT_TICKER_EXT_EXPIRE_INFO */
#endif /* !CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT &&
* !(CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
*/
TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_THREAD,
(TICKER_ID_ADV_AUX_BASE + aux_handle),
ticks_anchor, 0U,
Expand All @@ -2628,12 +2649,16 @@
(aux->ull.ticks_slot + ticks_slot_overhead),
ticker_cb, aux,
ull_ticker_status_give, (void *)&ret_cb
#if defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \
(defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \
defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO))
,
&ll_adv_aux_ticker_ext[aux_handle]
#endif /* !CONFIG_BT_CTLR_ADV_PERIODIC || !CONFIG_BT_TICKER_EXT_EXPIRE_INFO */
#endif /* CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT ||
* (CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO)
*/
);
ret = ull_ticker_status_take(ret, &ret_cb);

Check notice on line 2661 in subsys/bluetooth/controller/ll_sw/ull_adv_aux.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

subsys/bluetooth/controller/ll_sw/ull_adv_aux.c:2661 -#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \ - (defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \ - defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)) +#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \ + (defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)) ret_cb = TICKER_STATUS_BUSY; ret = ticker_start_ext( -#else /* !CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT && - * !(CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) +#else /* !CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT && \ + * !(CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) \ */ ret_cb = TICKER_STATUS_BUSY; ret = ticker_start( -#endif /* !CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT && - * !(CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) +#endif /* !CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT && \ + * !(CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) \ */ - TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_THREAD, - (TICKER_ID_ADV_AUX_BASE + aux_handle), - ticks_anchor, 0U, - HAL_TICKER_US_TO_TICKS(interval_us), - HAL_TICKER_REMAINDER(interval_us), TICKER_NULL_LAZY, - (aux->ull.ticks_slot + ticks_slot_overhead), - ticker_cb, aux, - ull_ticker_status_give, (void *)&ret_cb -#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \ - (defined(CONFIG_BT_CTLR_ADV_PERIODIC) && \ - defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)) - , - &ll_adv_aux_ticker_ext[aux_handle] -#endif /* CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT || - * (CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) + TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_THREAD, + (TICKER_ID_ADV_AUX_BASE + aux_handle), ticks_anchor, 0U, + HAL_TICKER_US_TO_TICKS(interval_us), HAL_TICKER_REMAINDER(interval_us), + TICKER_NULL_LAZY, (aux->ull.ticks_slot + ticks_slot_overhead), ticker_cb, aux, + ull_ticker_status_give, (void *)&ret_cb +#if defined(CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT) || \ + (defined(CONFIG_BT_CTLR_ADV_PERIODIC) && defined(CONFIG_BT_TICKER_EXT_EXPIRE_INFO)) + , + &ll_adv_aux_ticker_ext[aux_handle] +#endif /* CONFIG_BT_CTLR_ADV_AUX_SLOT_WINDOW_DRIFT || \ + * (CONFIG_BT_CTLR_ADV_PERIODIC && CONFIG_BT_TICKER_EXT_EXPIRE_INFO) \ */ - ); + );

return ret;
}
Expand Down
Loading
Loading