Commit graph

9523 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
dbfff2397f Bluetooth: Controller: Fix ISO Sync anchor point PDU CRC ok
Fix ISO Sync implementation to use the CRC ok status of
anchor point PDU, and not the last PDU receive, when
generating the event done message.

Without this fix, ISO sync is lost if there is continous
CRC error in the last PDU before the event is done.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-23 11:38:58 +01:00
Aleksandr Khromykh
5e81918fff Bluetooth: Mesh: fix gatt network id advertising
Per prf spec 7.2.2.2.1, "A node that does not support
the Proxy feature or has the Proxy feature disabled
shall not advertise with Network ID".
The PR aligns implementation with the specification.

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2021-11-22 23:04:12 -05:00
Morten Priess
7a6666a0e7 Bluetooth: controller: Introduce preferred central conn spacing config
Adds configuration BT_CTLR_SCHED_ADVANCED_CENTRAL_CONN_SPACING to enable
per-application preferred central connection spacing. This is an
extension of feature BT_CTLR_SCHED_ADVANCED, which when enabled, adds
user defined spacing between existing, and new central initiated
connections.

This is crucial for ensuring that centrals acting as ACL connection
based multi-channel streaming sources do not get overlapping
connections, and that spacing allows full frame transfer without
scheduling collision.

Due to the simple, compile-time configuration, use is limited to
specific applications in which the specified spacing is required.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-11-22 22:23:48 -05:00
Wolfgang Puffitsch
b56310d4d4 Bluetooth: controller: Wait for accept/reject from host for LL_CIS_RSP
Wait until host has accepted/rejected a CIS before responding with
LL_CIS_RSP.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-11-22 22:20:19 -05:00
Pavel Vasilyev
70b0734b5e Bluetooth: Mesh: Add option to call update cb on every retransmission
A user may want to control message parameters (for example, delay
parameter) on every retransmission of a published message (for example,
see section 1.4.1 of the mesh model specification). This is essential
for lighting messages as time gap between messages retransmitted via
the publish-retransmit mechanism introduces unwanted jitter/pop-corn
when such retransmissions are received by a large 'group' of lights.

This commit adds an option to `struct bt_mesh_model_pub` to make the
access layer call `bt_mesh_model_pub.update` callback on every
retransmission. This also addes few macros and functions that can be
used for further calculations.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-11-22 11:52:56 +02:00
Tobias Scharnowski
9d5c36da82 Bluetooth: hci: Fix incomplete acl mtu setup
This change is supposed to fix the issue of incomplete acl mtu
initialization in the absence of BREDR. Find further information here:
https://github.com/zephyrproject-rtos/zephyr/issues/39549

Signed-off-by: Tobias Scharnowski <tobias.scharnowski@rub.de>
2021-11-20 13:32:27 -05:00
Krzysztof Chruscinski
c0808e3f59 logging: Minimal mode configuration cleanup
Remove LOG_MINIMAL kconfig option which was confusing
since LOG_MODE_MINIMAL existed. LOG_MINIMAL was used to
force minimal mode but because of invalid dependencies
it was leading to issues.

Refactored code to use LOG_MODE_MINIMAL everywhere and
renamed LOG_MINIMAL to LOG_DEFAULT_MINIMAL which has impact
on defualt logging mode (which still can be later changed
in conf file or in menuconfig).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-20 11:58:40 -05:00
Vinayak Kariappa Chettimada
f216915638 Bluetooth: Controller: Limit maximum ACL Tx buffer size to 251 octets
Limit the maximum ACL Tx buffer size to 251 octets due to
implementation restricted use of uint8_t for PDU len field,
also used as the Tx buffer size data type.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-19 20:12:58 +01:00
Vinayak Kariappa Chettimada
7309a6b0c8 Bluetooth: Controller: Fix compile warning filling 24-bit value
Fix compile warning filling 24-bit value in 3 octets using
sys_put_le32, used sys_put_le24 instead.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-19 11:53:59 +01:00
Vinayak Kariappa Chettimada
44539dc293 Bluetooth: Controller: Remove misplaced function declaration
Remove misplaced declaration of ll_tx_ack_put in
ull_internal.h file while it is already present in
ull_conn_internal.h.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-19 11:53:24 +01:00
Vinayak Kariappa Chettimada
8fbbf2baef Bluetooth: Controller: BIS initial implementation review rework
Changes here are related to review rework.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
61eb655ab6 Bluetooth: Controller: Use ceiling_fraction function
Use ceiling_fraction function instead of repeated explicit
code to ceil calculations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
1d922038fb Bluetooth: Controller: Fix PA and LNA conditional compilation
Fix PA and LNA conditional compilation post move of the
configuration to devicetree.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
cf2af8bf3a Bluetooth: Controller: Fix endianness between CPU and PDU contents
Fix missing endianness conversion between CPU and PDU
contents assignments.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
4fe004c563 Bluetooth: Controller: Use defines for channel map count and hop range
Use defines for channel map count and hop range.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
e72d86397b Bluetooth: Controller: Use define for invalid advertising handle
Use define for invalid advertising handle.

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