Commit graph

58044 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
ff56ad8074 Bluetooth: Controller: Use defines in AD Data format implementation
Use defines for AD data format field sizes and offsets when
populating AD data format in advertising PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
8465dd4f9e Bluetooth: Controller: Use HCI_AUX_PHY_TO_HCI_PHY
Use HCI_AUX_PHY_TO_HCI_PHY when populating BIG sync
established HCI event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
ba909b1666 Bluetooth: Controller: Store ISO interval in ULL context
As ISO interval is to be returned in the HCI LE BIG Sync
Established event, store it in ULL context.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
8f9de31f87 Bluetooth: controller: Initial integrate of ISOAL for Broadcast ISO
This is initial commit towards integration of ISOAL Rx for
Broadcast/Synchronized Receiver ISO support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
7c8dc9fa27 Bluetooth: Controller: Initial support for BIS on S2/S8 coding
Added implementation to support advertising on S2/S8 coding
scheme.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
e4f12c7356 Bluetooth: Controller: Use PDU_BIS_US and PDU_BIS_MAX_US correctly
Use PDU_BIS_US and PDU_BIS_MAX_US macro correctly to
calculate BIS PDU time.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
929cf24a02 Bluetooth: Controller: Fix BIS LLL events pending check from ULL Low
ULL reference count is checked in ULL_LOW context to decide
if LLL events are pending, but the reference count can be
decremented by the ULL HIGH execution context which can
prevent the set `disabled_cb` function not being called due
to no pending event to produce the done events.

Fixed by checking the reference count in the ULL HIGH
execution context using a mayfly to schedule the check.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
2a1a14cff3 Bluetooth: Controller: Consistent naming in BIS ticker op callbacks
Use consistent naming for ticker operation callback
functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
ac0d43fe73 Bluetooth: controller: Fix side effect in assertion
Fix side effect in assertion when checking a volatile
variable inside assert check.

Fixes #32904, #32923.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
7c6cf9aaf4 Bluetooth: controller: BIG Sync terminate procedure
Implementation of BIG Sync terminate procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
03a303abf1 Bluetooth: controller: BIG Sync to anchor sync on any subevent
Added implementation of BIG Sync to use any succussful
received subevent to calculate the anchor sync. Also, use
window widening on subevents if previous subevent did not
sync.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
fcf0b5ea31 Bluetooth: controller: BIG Sync subevents and terminate procedure
Implementation of ISO Synchronized Receiver data subevents
and control subevent. Implementation of terminate procedure
in the receiver side.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
2a4a036de4 Bluetooth: controller: Update ISO Broadcaster subevents
Update ISO Broadcaster subevent implementation for incorrect
calculation and use of PTO.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
30a1fe5b29 Bluetooth: controller: Update ISO Sync Terminate handling
Update the ISO Synchronized Receiver Terminate and context
release handling to check for prepares in pipeline and
accordingly call lll_disable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
6c839351fe Bluetooth: controller: Update ISO Broadcaster Terminate handling
Update the ISO Broadcaster Terminate and context release
handling to check for prepares in pipeline and accordingly
call lll_disable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
24d4ff514a Bluetooth: controller: Handle duplicate BIG complete done events
When BIG events are close such that their prepares overlap
and are placed in the pipeline, then more than one done
complete event is generated, ignore them.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
640e20204c tests: Bluetooth: bsim: Use host BIG Sync APIs
Use the host BIG Sync APIs to test the BIG Sync establish
and Sync Terminate implementation in the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
9631a4feca Bluetooth: controller: BIG subevents and terminate procedure
Implementation of ISO Broadcast data subevents and control
subevent. Implementation of terminate procedure in the
broadcaster side.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
86663d1f57 Bluetooth: controller: Use LL_BIS_OCTETS_TX_MAX & LL_BIS_OCTETS_RX_MAX
Use Kconfig option derived Tx and Rx ISO PDU size.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
0d6fbb4fef Bluetooth: controller: Fix BigInfo with correct payload count
Fix Broadcast ISO BigInfo structure to be filled with
correct payload counter value considering accumulated
latency and ticker lazy value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
8d5cd41472 Bluetooth: controller: Fix missing EVENT_TICKER_RES_MARGIN_US
Fix missing use of EVENT_TICKER_RES_MARGIN_US in Periodic
Synchronization and Synchronized Receiver implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
4d29191bf8 Bluetooth: controller: Fix ISO to advertising context association order
Fix the order in which the ISO context is associated with
the Periodic Advertising and Extended Advertising context.
This is done so that the Periodic Advertising does not try
to calculate offset to BIG event before the BIG event is
scheduled by ticker.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
4149e391ae Bluetooth: controller: Use the CSA#2 function for SubEvents
Use the CSA#2 functions for SubEvent channel selection.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
46e9679c5e Bluetooth: controller: Add function to calculate BIS access address
Added a function to calculate the BIS SubEvent access
addresses.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
aa11d9cac0 Bluetooth: controller: Add the BIG terminate event generation
Add the BIG terminate event generation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
aff7d83149 Bluetooth: controller: Fix BIG complete event generation
Fix the LE BIG complete event generation to not use the
Sync Established structure to access the status value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
b8a919be7b Bluetooth: controller: Fix BIG Sync Lost event generation
Fix the BIG Sync Lost event generation to not use the Sync
Established structure to access the reason value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
919a184172 Bluetooth: controller: Add missing BIG Sync Estab and Lost reason
Added missing LE BIG Sync Established status and LE BIG Sync
Lost reason.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
5eb2892e11 Bluetooth: controller: Fix LE BIG Sync Terminate command response
Fix Fix LE BIG Sync Terminate command response which was not
returning the BIG handle.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
56fb23fb74 Bluetooth: controller: Update BIG Terminate Sync implementation
Minor update to BIG Terminate Sync implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
eb4e81b918 Bluetooth: controller: Implement the BIG sync establish and lost
Implement the HCI LE BIG Sync Established event and HCI LE
BIG Sync Lost event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
07bb9b1858 Bluetooth: controller: Fill BIS Payload Count in BIGInfo struct
Fill BIS Payload Count in the BIGInfo struct in the Periodic
Advertising PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
4c06840269 Bluetooth: controller: Fix Adv ISO start ticker user context
Fix the Broadcast ISO ticker start caller context.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
a2153baa81 Bluetooth: controller: Handle Sync ISO notifications
Handle BIG Sync notifications in the HCI layer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
0ea0f03bc9 Bluetooth: controller: BIG Create Sync LLL implementation
Implementation of BIG Create Sync in LLL. Generation of
LE BIG Sync Established event and LE BIG Sync Lost event
notifications from the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
000833e427 tests: Bluetooth: bsim: Updates related to BIG Create Sync
Updates related to BIG Create Sync testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
c4cb0ce92d Bluetooth: controller: Initial BIG Create Sync implementation
Added initial implementation for BIG Create Sync.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
d5489837cf tests: bluetooth: bsim: Receive the BIG Info callback
Added implementation to receive the BIG Info callback.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
91be9f1001 tests: Bluetooth: bsim: Fix test_iso to sync periodic advertising
Fix the bsim test_iso application so as to sync with periodic
adveritising. Increase the timeout so that the test passes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
0cb8517e20 Bluetooth: controller: Added BIGInfo Advertising Report generation
Added experimental support to generate BIGInfo Advertising
Report.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
20af5d524e Bluetooth: controller: Add create BIG complete event
Added implementation to generate the Create BIG Complete
event after the first empty BIS PDU has been transmitted.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
fdec0f593a Bluetooth: controller: Fix populate offset in latest advertising PDU
Fix implementation to populate the aux, sync and ISO offset
in the latest PDU. If both the current and latest of the
double buffer has been filled and LLL did not pick the
latest PDU, then the offset should be filled into the latest
PDU (and not into the first/current PDU).

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
c5bede254a Bluetooth: Controller: Fix missing traversal of ADI to find BIGInfo
Fix missing traversal of ADI field in advertised Common
Extended Payload Format. This will cause invalid offset used
for other fields and BigInfo field following the ADI when
Periodic Advertising ADI feature is supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
acd3ccca6a Bluetooth: Controller: Fix missing traversal of CTEInfo to find BIGInfo
Fix missing traversal of CTEInfo field in advertised Common
Extended Payload Format. This will cause invalid offset used
for other fields and BigInfo field following the CTE Info
when Extended Directed Advertising is used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
2b921f1977 Bluetooth: controller: Added BIS event with empty PDU
Added implementation to fill the BIG Offset, calculate the
BIS Access Address and CRC init, scheduling and transmission
of BIS empty PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
699a2ec730 Bluetooth: controller: Fix ticker user id used to terminate BIG
Fix incorrect ticker user id used to terminate BIG events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
c06028fa67 Bluetooth: controller: Refactoring of BIS data members
Refactored Broadcast ISO related data members across ULL and
LLL contexts.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
71e15176e1 Bluetooth: controller: BIGInfo in ACAD with mandatory parameters
Construction of BIGInfo with mandatory parameters and
placing it in the ACAD of Periodic Advertising PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
ac431f598f Bluetooth: controller: Fix pdu_big_info structure
Fix pdu_big_info structure for the incorrect definitions of
GIV and GSKD data members.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
136bb35111 tests: Bluetooth: bsim: Check ISO allocation release on terminate
Added tests to check Broadcast ISO allocations are released
on terminate, and new Broadcast ISO create is successful.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00