Commit graph

9523 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
ae5ad392bc Bluetooth: Controller: Refactor out the filter check function
Refactor the filter check function so that it can be reused
for the Extended Auxiliary PDU filtering.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
8869d916bc Bluetooth: Controller: Add constant qualifier to radio_ar_resolve func
Add constant qualifier to radio_ar_resolve function's
parameters.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
ee0a5aadec Bluetooth: Controller: Minor move function alongwith global functions
Minor move of lll_scan_aux_isr_aux_setup function alongwith
other global functions in the file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
4d01637926 Bluetooth: Controller: Implement direct addr type in ext adv report
Implement setting the correct directed advertisers address
type in the Extended Advertising Report.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
230088687f Bluetooth: Controller: Add filter access list for extended scan
Add implementation to filter using access list the received
extended auxiliary PDUs. Use resolving list addresses when
resolving list is enabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
ec14316ad2 Bluetooth: Controller: Fix Extended Adv Report directed addr type
Fix Extended Advertising Report to return correct directed
address type.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
9268a3c47e Bluetooth: Controller: Fix Extended Scanning filter for ADV_EXT_IND PDU
Fix Extended scanning filter implementation to permit
ADV_EXT_IND PDUs without AdvA so that AUX_ADV_IND PDU can
be received and to filter that PDU based on whether AdvA
is present.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
c66f4b258f Bluetooth: Controller: Fix minor indentation in scan filter code
Fix minor indentation in the implementation of scan filter
policy.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
9dc6660364 Bluetooth: Controller: Fix extended adv report data status
Fix Extended Advertising Report data status to have
"Incomplete, data truncated, no more to come" when data
length is more than "Scan_Max_data".

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
f8c5e0d515 Bluetooth: Controller: Cleanup scan event LLL done handling
Cleanup the scan event LLL done handling for abort on late
schedule, preemption pipeline abort, preemption current
event yield, duration expire, and connection establishment.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:58 +01:00
Vinayak Kariappa Chettimada
478eb2110c Bluetooth: Controller: Fix nrf52833dk_nrf52833 gpio debug pins
Fix Controller's GPIO debug pins use for nRF52833 DK.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:52:14 +01:00
Vinayak Kariappa Chettimada
0a850fe59e Bluetooth: Controller: Use 32-bit value for time reservations
Use 32-bit value variables when calculating Extended
Advertising and Periodic Advertising radio event time
reservations to consistently use 32-bit variables for
microsecond time units when calculating radio event where
there is possibility to reserve for scheduling of back to
back chained PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:51:55 +01:00
Krzysztof Chruscinski
8aedcba6c9 bluetooth: monitor: Add support for logging v2
Added support for logging v2 backend API in bluetooth monitor backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-03 16:00:17 +01:00
Rubin Gerritsen
4af5b7efa5 Bluetooth: Host: Fix setting long adv data with long AD fields
Previously, if the AD field length was greater than the maximum
fragment size - 2 bytes, an out of bounds access would occur.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/39852

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2021-11-02 13:25:01 +01:00
Asbjørn Sæbø
3b44a6d4aa Bluetooth: Audio: CCID - updates for upmerge
Updates to the CCID module for upmerge to Zephyr main

- add bt_ prefix to the ccid_get() function, add explaining comment,
  use defined value for limit
- update copyright statement
- update Kconfig to current practice

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-11-02 13:23:42 +01:00
Asbjørn Sæbø
c1f1b34c31 Bluetooth: Audio: Content Control ID module
This commit adds the content control ID (CCID) module from the
topic-le-audio branch.  This is required to the le-audio media control
files and call control files, which depend upon CCID.

The commit is a pure copy of the files and content in the
topic-le-audio branch, with the following exceptions:

- files are in bluetooth/audio instead of bluetooth/host/audio, with
  some include paths updated as a consequence
- as a consequence, CMake files and Kconfig files updates are done in
  other locations

The CCID module is written by
Emil Gydesen <emil.gydesen@nordicsemi.no>

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2021-11-02 13:23:42 +01:00
Szymon Janc
47ac14282d bluetooth: host: Add support for SMP error code 0x0f
This error code informs that peer device rejected key during
keys distribution phase.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-11-01 21:48:52 -04:00
Jacob Siverskog
6d1e632e53 bluetooth: host: avoid freeing structure that's part of a linked list
see https://github.com/zephyrproject-rtos/zephyr/pull/39507 for
context.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-11-01 11:18:04 -04:00
Jacob Siverskog
7e74ec6c31 bluetooth: host: reset channel request on send failure
make sure channel request reference is cleared if send fails. without
this change this could happen when att_handle_rsp was called:

1. reqs before call:
head: 0x2000f8e8, tail: 0x2000f8c0, elements:
- addr 0x2000f8e8, function pointer NULL
- addr 0x2000f8c0, function pointer 0x35c1d

2. att_handle_rsp called, calling bt_att_req_free with address
0x2000f8e8

3. reqs after call:
head: 0x2000f8e8, tail:	0x2000f8c0, elements:
- addr 0x2000f8e8, function pointer NULL
- addr 0x2000f8d4, function pointer NULL
- addr 0x2000f8ac, function pointer NULL
- addr 0x2000f898, function pointer NULL
- addr 0x2000f884, function pointer NULL
- addr 0x2000f870, function pointer 0xd92b7e7c
- addr 0x2000f85c, function pointer 0x462a03a9
- addr 0x2000f848, function pointer 0xf77b2f4b
- addr 0x2000f834, function pointer 0x33714775
- addr 0x2000f820, function pointer 0x31ba37f8
- addr 0x2000f80c, function pointer 0x5fda8494
- addr 0x2000f7f8, function pointer 0xbcff174e
- addr 0x2000f7e4, function pointer 0x341393f
- addr 0x2000f7d0, function pointer 0xbcfee8b8
- addr 0x2000f7bc, function pointer 0x1e73d9e5

which obviously is broken.

closes #39506.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-11-01 11:18:04 -04:00
Piotr Pryga
06a8053901 Bluetooth: controller: ULL: fix dequeue of IQ samples reports
Dequeue and  scheduling IQ samples report towards host
was working by accident. IQ samples were casted to
pointer to struct pdu_adv. Then type of PDU was checked.
Fortunately the IQ samples hadn't got PDU_ADV_TYPE_EXT_IND
in memory pointed by struct pdu_adv->type.

NODE_RX_TYPE_IQ_SAMPLE_REPORT must have separate execution
path in rx_demux_rx.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-11-01 11:14:46 -04:00
Piotr Pryga
a9ab805983 BLuetooth: controller: hci: fix wrong sync handle in IQ samples report
There were no assignment to iq_report->hdr.handle in the code
hence all IQ samples reports had the same handle value which
was zero.

Since the handle is related with ll_sync_set pointer the handle
value may not be set in LLL.

The best place to set handle value is thread context where
bt_hci_evt_le_connectionless_iq_report is prepared.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-11-01 11:14:46 -04:00
Emil Gydesen
7958e86c66 Bluetooth: shell: Fix uninitalized values for iso big create
A few values were not initialized when creating a
big in the iso shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-01 09:02:24 -04:00
Emil Gydesen
4151f0ec90 Bluetooth: ISO: Fix typo in hci_le_cis_estabilished
The function should have been named
hci_le_cis_established.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-28 10:37:34 -04:00
Lingao Meng
9181ae44e6 Bluetooth: Mesh: Fix missing enable adv thread
When user only use pb-gatt provisioning, which unable to
send out connectable advertising, due to adv thread not started.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-10-28 10:36:55 -04:00
Morten Priess
cd470da214 Bluetooth: controller: Send disconnect complete when CIS is terminated
Previously the host would handle disconnecting associated CISes and
invoking callbacks when a host ACL conn was disconnected.

This responsibility has now been moved to the controller, which needs to
send a NODE_RX_TYPE_TERMINATE with the CIS handle for proper
disconnection in the host. This is in accordance with the spec.

As disconnect reason, the CIS uses the ACL reason, which is passed to
the host along with the handle.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-10-28 11:18:40 +02:00
Emil Gydesen
f6e829a68b Bluetooth: ISO: Make bt_iso_remove_data_path static
Make bt_iso_remove_data_path static as it is only used by iso.c

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-27 15:12:43 -04:00
Emil Gydesen
6f09a69679 Bluetooth: ISO: Make iso_new static
Make iso_new static as it is only used by iso.c

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-27 15:12:43 -04:00
Emil Gydesen
9d17138f92 Bluetooth: ISO: Make hci_le_remove_cig static
Make the function static as it is only used by iso.c

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-27 15:12:43 -04:00
Vinayak Kariappa Chettimada
7496e3f0cf Bluetooth: Controller: Select CSA#2 for Extended Advertising Support
Select CONFIG_BT_CTLR_CHAN_SEL_2 when CONFIG_BT_CTLR_ADV_EXT
is enabled.

Relates to commit 651137ee11 ("Bluetooth: Controller: Fix
Extended Advertising channel use").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-27 11:33:07 +02:00
Vinayak Kariappa Chettimada
c6ae4d52f7 Bluetooth: Controller: Fix LOW_LAT_ULL_DONE synchronization counting
Fix BT_CTLR_LOW_LAT_ULL_DONE synchronization counting so
that done events are processed before pipeline enqueue
decisions are taken in LLL.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-27 11:32:48 +02:00
Emil Gydesen
254108bcf5 Bluetooth: Audio: Mark VOCS and VOCS_CLIENT as experimental
The implementation and its API is still considered experimental.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-27 10:53:24 +02:00
Emil Gydesen
6cf9138eac Bluetooth: Audio: Mark MICS and MICS_CLIENT as experimental
The implementation and its API is still considered experimental.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-27 10:53:24 +02:00
Emil Gydesen
46e299daa8 Bluetooth: Audio: Mark AICS and AICS_CLIENT as experimental
The implementation and its API is still considered experimental.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-27 10:53:24 +02:00
Emil Gydesen
864d1aa4ed Bluetooth: Audio: Mark VCS and VCS_CLIENT as experimental
The implementation and its API is still considered experimental.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-27 10:53:24 +02:00
Vinayak Kariappa Chettimada
39a667659f Bluetooth: Controller: Fix incorrect periodic advertising interval
Fix incorrect Periodic Advertising interval when Coded PHY
support is built, chain PDUs is used and Extended
Advertising is disable while the Periodic Advertising
continues to be active.

Related to commit a379196b48 ("Bluetooth: controller:
nRF5: Back-to-Back Radio Tx interface").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-27 10:51:55 +02:00
Szymon Janc
742ee977ca bluetooth: ATT: Ignore signed writes on EATT bearer
Core Specification 5.3 Vol 3. Part G. 4.2:
The Signed Write Without Response sub-procedure shall only be supported
on the LE Fixed Channel Unenhanced ATT bearer.

This was affecting GATT/SR/GAW/BI-38-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-10-25 19:24:17 -04:00
Emil Gydesen
4257f0b8a1 Bluetooth: Shell: Fix bad string formats in GATT shell
Some shell prints didn't use the correct format for some
values, causing warnings/build errors.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-25 19:22:05 -04:00
Vinayak Kariappa Chettimada
fefb0a00e4 Bluetooth: Controller: Fix extended advertising set remove
Fix extended advertising set remove and clear, to reset the
PDU double buffer to keep one initialized PDU. This is done
to prevent common extended payload format contents from
being overwritten and corrupted due to same primary PDU
buffer being used to remove AdvA if auxiliary PDU is
allocated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-25 16:29:49 +02:00
Vinayak Kariappa Chettimada
4bf88a43fd Bluetooth: Controller: Reset adv and scan resp to one allocated PDU
Reset allocated advertising and scan response PDUs to one
initial PDU in the double buffers when advertsing set is
removed or cleared.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-25 16:29:49 +02:00
Vinayak Kariappa Chettimada
55b130bc28 Bluetooth: Controller: Remove global lll_adv_pdu_release function
Remove lll_adv_pdu_release function which is not referenced
outside its current use.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-10-25 16:29:49 +02:00
Jacob Siverskog
046f29a8cb Bluetooth: ATT: Fix typo in defines
Fix typo in ATT first/last attribute defines.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-10-23 20:39:36 -04:00
Torsten Rasmussen
9a2be89557 kconfig: bluetooth: experimental settings now uses select EXPERIMENTAL
With the introduction of `EXPERIMENTAL` and `WARN_EXPERIMENTAL` in
Zephyr all subsys/bluetooth and drivers/bluetooth/hci settings having
`[EXPERIMENTAL]` in their prompt has has been updated to include
`select EXPERIMENTAL` so that developers can enable warnings when
experimental features are enabled.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-10-22 13:59:21 +02:00
Abe Kohandel
190848177e bluetooth: ots: Enable testing with assert
Fix compilation and logic issues to allow testing OTS functionality with
assert enabled.

The compilation fixes are simple and do not require an explanation.

The assertion in bt_ots_dir_list_init was logically reversed. Its
purpose is to ensure the directory list is not already initialized
and as such should assert that the dir_list is not set (i.e. is NULL).

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-10-21 11:21:13 -04:00
Emil Gydesen
1a11d1bd25 Bluetooth: ISO: Move some broadcast iso code to better group functionality
Better group code specific for e.g. ISO broadcaster and
ISO sync receiver.

No code has been changed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-18 12:43:38 +02:00
Emil Gydesen
a56cbed603 Bluetooth: ISO: Split ISO broadcast config
Splitt he ISO broadcast config into broadcaster and
sync receiver. This will allow a device that only
wants to one of the roles to have a much more optimized
configuration.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-18 12:43:38 +02:00
Krzysztof Chruscinski
eb3375f47c shell: Add __printf_like to shell_fprintf
Add __printf_like modifier to validate strings used by shell.
Fixing warnings triggered by this change.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-10-14 16:32:19 -04:00
Emil Gydesen
6e99941f6a Bluetooth: ISO: Remove bt_iso_data_path struct
The struct basically only had a pointer to
bt_iso_chan_path as well as duplicating the pid and
the direction.

The commit removes the struct as it was more confusing than helpful,
and instead use the PID for the bt_iso_chan_path and
supply the direction as a argument instead.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-11 21:05:05 -04:00
Emil Gydesen
f546ef4cde Bluetooth: ISO: Fix missing fallback to HCI for ISO data path
A recent change broke the fallback to using a simple
HCI data path configuration in case that the application
does not provide a data path.

This commit fixes that issue, while retaining the
intended update from the change that broke the fallback,
as well as making the code a bit easier to read
and more documented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-11 21:05:05 -04:00
Thomas Ebert Hansen
e69b159c34 Bluetooth: host: Fix endianess bug in value_handle
The characteristic value handle is missing an endianess conversion.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2021-10-11 21:04:51 -04:00
Piotr Pryga
1c8af8cfe5 Bluetooth: controller: df: fix handling of max count of IQ reports
There was an error in handling of max number of IQ reports
generated by controller. Accordin to BT Core Spec 5.1 the host
may request a number of CTEs to be sampled and reported by
controller while enable IQ sampling. The max_cte_count value
set to zero means sample all CTEs in a periodic advertising chain.

The commit fixes wrong handling of the max_cte_count provided
value to generate expected number of IQ reports.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-10-11 21:01:36 -04:00