Commit graph

21541 commits

Author SHA1 Message Date
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
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
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
b0d8a738c5 Bluetooth: controller: Add Broadcast ISO Sync and Sync Lost release
Add implementation to release Broadcast ISO Sync, Sync Lost
event and ISO instance allocations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
b81d5595d3 Bluetooth: controller: Add data members related to ISO sync loss
Add data members related to implementing the Broadcast ISO
Sync Lost event generation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Vinayak Kariappa Chettimada
3d85babf65 Bluetooth: controller: Rename ll_adv_iso and ll_sync_iso
Rename ll_adv_iso and ll_sync_iso structs to ll_adv_iso_set
and ll_sync_iso_set.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-18 16:48:47 +01:00
Piotr Pryga
ea1340acd3 Bluetooth: host: Add handling of failures in per sync established evt
Handling of HCI_LE_Periodic_Advertising_Sync_Established didn't
have implemented handling of possible failures of periodic
advertising synchronization.
There are two situations definded by BT 5.3 Core spec:
- There is no AUX_SYNC_IND pdu within 6 periodic advertising events.
  If that happens, status of the command is set to (0x3E) Connection
  Failed To Be Established / Synchronization Timeout.
- Periodic advertising has wrong CTE type while periodic advertising
  list is not used to determine the advertiser to listen.
  In this case status of the command is set to (0x1A) Unsupported
  Remote Feature.

The commit provides missing functionality.
In case of error, the periodic advertising will be deleted and
application will be notified by call to terminated callback.
The callback data were extended by err member. It provides
information why periodic advertising was terminated.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-11-18 17:12:22 +02:00
Johann Fischer
fdcc104455 usb: remove Kconfig option USB_UART_CONSOLE
Since there are no more users and dependencies of
Kconfig option USB_UART_CONSOLE in the tree,
remove the remains and the option USB_UART_CONSOLE.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-18 14:29:18 +01:00
Johann Fischer
4151f42710 usb: cdc_acm: use same init level and priority as serial drivers
Use same init level and priority as serial drivers.
Align priority to the changes in
commit ad1450510a ("drivers: serial: Refactor drivers
to use shared init priority Kconfig")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-18 14:29:18 +01:00
Flavio Ceolin
252aaf7637 pm: suspend: Simplify exit logic
Do not have the "forced" bit cleared up scattered across the function.
Do it only in one place at the exit of the function.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-18 13:56:15 +01:00
Flavio Ceolin
4998c52ba8 pm: Make pm_power_state_force multicore aware
Change pm_power_state_force to receive which cpu the state should be
forced. Also, it changed the API behavior to force the given state only
when the idle thread for that core is executed.

In a multicore environment force arbitrarily a core to suspend is not
safe because the kernel cannot infer what that cpu is running and how it
impacts the overall system, for example, if it is holding a lock that is
required by a thread that is running in another cpu.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-18 13:56:15 +01:00
Martin Tverdal
0d4f685dbd Bluetooth: Host: avoid runtime warning in bt_enable
Avoid runtime warning in bt_enable when CONFIG_BT_SETTINGS
and CONFIG_BT_DEVICE_NAME_DYNAMIC is not set.
This warning was intoroduced in
commit d76bba4b5e
("Bluetooth: host: Device name handling of invalid length")

Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
2021-11-17 12:40:20 +01:00
Christopher Friedt
5dc6686c63 logging: log_core: do not alias atomic_t
Previously, a `uint32_t` was aliased as an `atomic_t`. However,
with #39531, `atomic_t` is now a `long` under the hood, which
is 64-bit on 64-bit platforms.

Fixes #40369

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-17 12:25:10 +01:00
Jani Hirsimäki
8a51a79d89 net: l2: ppp: possibility to have a custom MRU/MTU
Reading a set MTU from the used net_if when starting LCP.
This enables also other custom MTU/MRU to be set for the link than
the default CONFIG_NET_PPP_MTU_MRU (set by a ppp driver during
initialization).

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2021-11-16 21:25:47 -05:00
Andries Kruithof
f023b5f611 Bluetooth: controller: push topic branch to main
Pushes all work done in the topic-ble-llcp branch into main branch
This is a refactoring of the LL control procedures; the refactored
control procedures are hidden behind a KConfig option and
per default disabled

Goal of the refactoring:

close issue Link Layer Control Procedure overhaul #15256
make it easier to add/update control procedures
Refactoring consists in principal of writing explicit state machines
for the control procedures.
To reduce the risk of regression errors unit-tests have been added

Following control procedures are implemented:

Connection update procedure
Channel map update procedure
Encryption procedure
Feature exchange procedure
Version exchange procedure
ACL termination procedure
Connection parameters request procedure
LE Ping procedure
Data Length Update procedure
PHY update procedure
Min. nr. Of channels used procedure
Constant Tone extension request procedure

This is a joined work by the people listed in the signed-off-by
list (in alphabetical order)

Signed-off-by: Andries Kruithof Andries.Kruithof@nordicsemi.no
Signed-off-by: Erik Brockhoff erbr@oticon.com
Signed-off-by: Piotr Pryga piotr.pryga@nordicsemi.no
Signed-off-by: Szymon Janc szymon.janc@codecoup.pl
Signed-off-by: Thomas Ebert Hansen thoh@oticon.com
Signed-off-by: Tommie Skriver tosk@demant.com

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2021-11-16 21:24:37 -05:00
Dominik Ermel
020d44456d mgmt/mcumgr/lib: Fix multi-image upload not working
The commit fixes the issue where duplicated code in
img_mgmt_impl_upload_inspect caused redirecting all image uploads,
in multi-image configuration, to the first image.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-16 21:24:09 -05:00