Skip to content

Bluetooth: nordic lll: deduplicate CIS flush-timeout paths via shared helpers#34

Draft
cvinayak with Copilot wants to merge 2 commits into
copilot/update-nordic-lll-interleaved-packingfrom
copilot/refactor-flush-timeout-logic
Draft

Bluetooth: nordic lll: deduplicate CIS flush-timeout paths via shared helpers#34
cvinayak with Copilot wants to merge 2 commits into
copilot/update-nordic-lll-interleaved-packingfrom
copilot/refactor-flush-timeout-logic

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown

Central and peripheral CIS LLL paths duplicated the same flush-timeout mechanics (subevent-limit math, Tx/Rx BN advancement, and Rx lost-data reporting) across mid-event flush, event-close finalization, and lazy-update flows. This change factors those repeated paths into shared helpers while preserving existing timeout conditions and interleaved guards.

  • Shared flush helper surface

    • Added subsys/bluetooth/controller/ll_sw/nordic/lll/lll_conn_iso_flush.h.
    • Introduced:
      • lll_flush_subevent_limit(nse, bn, payload_count)
      • lll_flush_tx_advance(cis_lll)
      • lll_flush_rx_advance(cis_lll)
      • shared Rx lost-data body helper used by both roles.
  • Central ISO refactor (lll_central_iso.c)

    • Replaced inline u formula at flush sites with lll_flush_subevent_limit(...).
    • Replaced repeated Tx/Rx BN advancement sequences with lll_flush_tx_advance(...) / lll_flush_rx_advance(...).
    • Reduced local iso_rx_data_lost() to role-specific timestamp derivation + shared lost-data helper call.
  • Peripheral ISO refactor (lll_peripheral_iso.c)

    • Applied the same helper substitutions in:
      • payload_count_flush()
      • payload_count_rx_flush_or_txrx_inc()
      • payload_count_lazy()
    • Reduced local iso_rx_data_lost() similarly to timestamp derivation + shared helper invocation.

Example of the call-site simplification:

payload_count = cis_lll->rx.payload_count + cis_lll->rx.bn_curr - 1U;
u = lll_flush_subevent_limit(cis_lll->nse, cis_lll->rx.bn, payload_count);

if (/* existing flush condition unchanged */) {
	lll_flush_rx_advance(cis_lll);
}

Copilot AI changed the title [WIP] Refactor duplicated flush-timeout logic into shared helper functions Bluetooth: nordic lll: deduplicate CIS flush-timeout paths via shared helpers Jul 1, 2026
Copilot AI requested a review from cvinayak July 1, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants