Commit graph

8508 commits

Author SHA1 Message Date
Jonathan Rico
584f653de2 Bluetooth: conn: Don't deadlock on BT_RECV_WORKQ_SYS
My recent change overlooked this configuration, which is not tested in CI
currently.

If someone had enabled it, they would've just gotten an unfixable assert.

The correct test would be checking if the current thread is the system wq,
but I think the compiler can't know that and can't remove the "dead" code.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-03-14 10:21:23 +02:00
Théo Battrel
4a55bc00f0 Bluetooth: Shell: Add support for EAD
Add new commands to manage the Encrypted Advertising Data feature.

Overview of those new commands:

- `bt encrypted-ad set-keys`: set key materials (session key and
  initialisation vector) used for encrypted and decryption of EAD;
- `bt encrypted-ad add-ad`: store a given advertising data structure;
- `bt encrypted-ad add-ead`: encrypt the given advertising data
  structres and store the generated AD structure;
- `bt encrypted-ad commit-ad`: set the AD of the selected advertiser
  with the stored AD;
- `bt encrypted-ad clear-ad`: remove all stored AD;
- `bt encrypted-ad decrypt-scan`: decrypt data using the previously set
  key materials when receiving AD with type `0x31`.

The documentation of the Bluetooth Shell has been updated to include
those new commands.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-03-13 18:51:03 +02:00
Vinayak Kariappa Chettimada
bd5e906f68 Bluetooth: Controller: Fix assertion establishing periodic sync
When the AUX_ADV_IND and AUX_SYNC_IND are close to each
other, the duration between them is not sufficient to
schedule a new instance of ticker to establish
synchronization. This processing time introduces latencies
detected by the prepare callback.

When the sync offset is low, schedule the start of the
reception to next periodic interval.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-03-13 12:33:08 +01:00
Vinayak Kariappa Chettimada
11bae5cfa9 Bluetooth: Controller: Fix missing radio timer comp and range delay
Fix missing PPI to timer start compensation and missing
inclusion of range delay in the calculation of packet
header receive timeout value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-03-13 12:32:54 +01:00
Vinayak Kariappa Chettimada
92ad509902 Bluetooth: Controller: Fix ext adv param checking intervals
Fix Extended Advertising Parameter check to exclude legacy
high duty cycle directed advertising from validating the
intervals as advertising interval parameter values are not
applicable for high duty cycle directed advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-03-13 12:32:40 +01:00
Emil Gydesen
093ffdf117 Bluetooth: Host: Add NULL check for callback_list
If no callbacks have been registered then callback_list
is NULL, in which case we can skip searching.

This also fixes a NULL-pointer acces in the while loop
as previous_callback would be NULL when it gets
dereferenced as previous_callback->_next.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-13 11:16:06 +00:00
Morten Priess
a30795e1f6 Bluetooth: controller: Fixes for BIGinfo endianness issues
The BIGinfo PDU bitsets were not accessed in a portable maner for
endianness independence, and need to be handled as bit-manipulations.

Add utility functions to access PDU bitset variables independent of
endianness. Use macros to abstract the offsets and widths.

Conversion of BIG_Handle to LE in HCI layer incorrectly use
sys_cpu_to_le16, which fail because target type is 8-bit.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2024-03-13 11:13:17 +00:00
Emil Gydesen
025032232c Bluetooth: BAP: Shell: Fix issue with stopping broadcast sink
When the broadcast sink is stopped, the sink was also
set to NULL via

default_broadcast_sink.bap_sink = NULL;

However the lifetime of the broadcast sink does not
follow the state of the streams, and it still exists
afterwards. The broadcast sink can only be terminated
(deleted) via the term_broadcast_sink command.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:57:49 +00:00
Emil Gydesen
164529145b Bluetooth: Audio: Shell: CAP change microphone gain command
Adds the change microphone gain command to the CAP commander shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Emil Gydesen
fa6a7c1b77 Bluetooth: CAP: Commander change microphone gain procedure
Adds the CAP Commander Change Microphone Gain procedure.
This procedure changes the microphone gain on one or more
CAP Acceptors.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Emil Gydesen
63fbeebb9a Bluetooth: BAP: Shell: Add missing err check for bt_bap_ep_get_info
Two places we did not have an error check from calling
bt_bap_ep_get_info before accessing the result. These
have simply been added (without an else), as they are
(very) unlikely to fail.

This was caught by coverity and thus fixes those
coverity issues.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 09:46:24 +00:00
Lyle Zhu
3e8d1182d4 Bluetooth: HFP: Add data sent callback
Set struct bt_rfcomm_dlc_ops::sent.

Get the data sending result through
sent callback.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-12 09:45:27 +00:00
Lyle Zhu
cb3d1c9ee9 Bluetooth: RFCOMM: Add data sent cb for RFCOMM
Currently, the upper layer cannot know
whether the data is successfully sent
through DLC.

Add a field "sent" for RFCOMM DLC ops.
Notify upper-layer of the sending
result through the field "sent".

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-12 09:45:27 +00:00
Emil Gydesen
8f0e648e48 Bluetooth: CAP: Shell: Add proper broadcast commands
Adds additional broadcast commands and modifies the existing
ones to use the CAP API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 09:45:10 +00:00
Nithin Ramesh Myliattil
6ce38c1aa7 bluetooth: id: fix adv sets with same id use different RPA
The fix is to check if any of the adv set's rpa expired
callback returns false, then all adv sets continues with
the old RPA.

Note: Fix is applicable only to adv sets which shares the
same id.

Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
2024-03-11 14:24:41 +01:00
Aleksandr Khromykh
aa87ed5d8a Bluetooth: Mesh: make models metadata const
Commit adds const qualifier to models metadata.
Specification claims: Composition Metadata Page 0
shall not change during a term of a node on the network.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-03-11 09:26:12 +01:00
Emil Gydesen
826ac0755b bluetooth: audio: shell: Improve indentation when printing codecs
Codecs can be printed at different levels:
level 0: Generic and unicast
level 1: subgroup codec configs
level 2: BIS codec configs

This commit ensures that the indentation level
is correctly increase based on where the codec configuration
data is printed.

This also updates the documentation for the BAP shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-09 14:10:17 -06:00
Emil Gydesen
f7cbc9b943 Bluetooth: Audio: Shell: Add human-readable printing of codec metadata
print_codec_cfg and print_codec_cap has been modified to print the
codec metadata in a more human-readable way, so it is easier to read.

This also adds the (final) human readable support when
parsing and printing BASEs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-09 14:10:17 -06:00
Emil Gydesen
dd5925301e Bluetooth: Audio: Shell: Add human-readable printing of codec configs
print_codec_cfg has been modified to print the codec configs in a more
human-readable way, so it is easier to read.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-09 14:10:17 -06:00
Emil Gydesen
675c8e86a4 Bluetooth: Audio: Shell: Add human-readable printing of remote caps
print_codec_cap has been modified to print the remote caps in a more
human-readable way, so it is easier to read and understand the remote
server's capabilities.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-09 14:10:17 -06:00
Emil Gydesen
c1272195f0 Bluetooth: BAP: Shell: Modify bcast sink streams to use shell_stream
Modify the broadcast_sink_streams to be an array of shell_stream
instead of bt_bap_stream, so that it can be used in a similar way
as the rest of the streams.

To help the transition, a new helper function,
bap_stream_from_shell_stream, was added.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-09 14:09:49 -06:00
Emil Gydesen
2d11fbe532 Bluetooth: BAP: BA: Add additional PAST log in past_available
Add additional logging in past_available to easily see the PAST
support of the broadcast assistant and scan delegator devices.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-09 14:09:00 -06:00
Emil Gydesen
913ca370c7 Bluetooth: BAP: Add input validation for bt_bap_ep_get_info
The function did not have a NULL check for the parameters,
and thus did not fail correctly on invalid input.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-09 16:13:24 +01:00
Alberto Escolar Piedras
7ad69d968a Bluetooth: Controller: nrf5_dppi.h: Use nrfx HAL to set subscriptions
A few paths used only when there is Coded Phy support were
still setting the subscribe registers directly.
Let's use the nRFx HAL for this so it works properly also
in simulation.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-08 09:35:21 +01:00
Alberto Escolar Piedras
005623df92 Bluetooth: Controller: nrf5_ppi.h: Use nrfx HAL to set PPI always
Quite a few paths used only when there is Coded Phy
support were still setting the PPI directly.
Let's use the nRFx HAL for this so it works properly also
in simulation.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-08 09:35:21 +01:00
Ivan Iushkov
9fa4cd8226 Bluetooth: add missing initilization of sync_info member
During manual testing with UBSAN enabled, it was found that
bt_le_per_adv_sync_cb synced() callback in application
sometimes gets unexpected different values in
`sync_info.recv_enabled` field.

The UBSAN output contained the following warnings message:
runtime error:
load of value 65, which is not a valid value for type '_Bool'

It tunrned out that struct bt_le_per_adv_sync_synced_info sync_info
inside bt_hci_le_past_received_common() contains uninitialized
recv_enabled member.
Set it to true by default to avoid possible issues.

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-03-07 14:33:19 +00:00
Chang An
3605d57ae1 LE Audio: bt_bap_broadcast_sink_cb.syncable should provide the BIGInfo
Modify bt_bap_broadcast_sink_cb.syncable to provide the BIGInfo
instead of just the encryption field.

Signed-off-by: Chang An <chang.an_1@nxp.com>
2024-03-07 11:09:12 +00:00
Troels Nilsson
9ce9d57732 Bluetooth: Controller: Fix per adv interval value check
Invalid values should result in BT_HCI_ERR_INVALID_PARAM

The interval check should only fail with
BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL if the requested range
cannot be fulfilled by the controller (ie. there is no overlap
with the supported range)

Fixes EBQ tests HCI/DDI/BI-53-C through HCI/DDI/BI-61-C and
HCI/CCO/BI-64-C

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-03-07 10:58:40 +00:00
Emil Gydesen
a472133587 Bluetooth: BAP: Apply missing guards for Kconfig values
Some pieces of code were missing proper guards for Kconfig
values, which could cause compile issues

The massive amount of #if in bap.c clearly indicates that the
file should be split, as it contains many things that are specific
for various roles.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-07 10:58:32 +00:00
Andries Kruithof
fd2ccbc5ba Bluetooth: audio: BAP: set the past_avail status
While refactoring the handling of callbacks the setting of past_avail
status got deleted (and it was in the wrong place). Adding it back at
the correct place.

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-03-07 10:58:10 +00:00
Andries Kruithof
7540535284 Bluetooth: audio: BAP: allow for multiple callbacks
The existing implementation allows for only one callback per procedure.
This creates problems when for example adding CAP functionality.
The callbacks are here implemented as an SLIST

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-03-07 10:58:10 +00:00
Rubin Gerritsen
a5a13201e4 Bluetooth: Controller: Remove experimental from LE Set Host Feature
Out-of-tree controllers do not necessarily mark the LE Set Host Feature
command as experimantal.

Add an additional entry to solve this like done for other ISO entries.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-03-07 10:57:31 +00:00
Giancarlo Stasi
95851583b8 Bluetooth: Controller: Vendor Specific: support for Scan Request Reports
Add support for vendor specific Set Scan Request Reports command and
Scan Request Received Event, available for legacy advertising.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2024-03-07 10:57:09 +00:00
Lyle Zhu
40cf23daff Bluetooth: Rename BT_BREDR to BT_CLASSIC
Rename BT_BREDR to BT_CLASSIC
Rename CONFIG_BT_BREDR to CONFIG_BT_CLASSIC

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-07 11:26:45 +02:00
Lyle Zhu
83bfa4c91b Bluetooth: Host: Move BR headers to subfolder classic
Move BR/EDR header files from "include/zephyr/
bluetooth" to subfolder "include/zephyr/bluetooth/
classic".

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-07 11:26:45 +02:00
Lyle Zhu
081024b7fa Bluetooth: Host: Include full path of l2cap_br_interface.h
The header file l2cap_interface.h has been included by
tests/bsim/bluetooth/host/* cases.

To avoid potential issue, include full path of header
l2cap_br_interface.h in file l2cap_interface.h.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-07 11:26:45 +02:00
Lyle Zhu
3a927a2833 Bluetooth: Host: Move BR/EDR files to host/classic
Add subfolder "subsys/bluetooth/host/classic".
Move BR/EDR source files to the subfolder.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-07 11:26:45 +02:00
Jonathan Rico
76015745df Bluetooth: ATT: lock scheduler when sending from user thread
`att_req_send_process` is not thread safe.

In the case where the current context is pre-emptible (e.g. when a user
sends something over GATT from the main thread):

The iterator in `att_req_send_process` can get interrupted mid-processing,
breaking the logic and resulting in an assert/crash/data corruption.

Additionally, the connection state check in this fn is also not
thread-safe, the RX thread could pre-empt us and disconnect right before
we attempt to send on an ATT bearer that is on it.

This is a hotfix until we have a generalized solution for the host API
surface. It seems a lot of our logic assumes cooperative priority.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-03-07 11:16:55 +02:00
Omkar Kulkarni
0483d68334 Bluetooth: Mesh: Add missing model extensions
DFD Server, DFU Server, and DFU Client models are extended models
that extend other underlaying models. If BT_MESH_MODEL_EXTENSIONS
is not enabled, extension hierarchy is not initialized and this
results in issues in subscriptions and errors in representation
of hierarchy in CDP1. Since extensions are spec defined, force
selection of this option here to prevent users forgetting about it.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-03-06 10:21:59 +00:00
Anders Storrø
6af7ad5a52 Bluetooth: Mesh: Prevent duplicate cdb appkeys
Fixes issue where it is possible to store the same appkey
multiple times in CDB implementation.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2024-03-06 10:21:27 +00:00
Thomas PUJOLLE
4dae6623bc Bluetooth: BT_HCI_RESERVE set to 1 if BT_SILABS_HCI
Was previously causing execution errors due to default value 0

Signed-off-by: Thomas PUJOLLE <TPU24175@open-groupe.com>
2024-03-05 16:00:30 +01:00
Anas Nashif
e2f3912c5a x86: revert removing soc.h from atom soc
This was part of the mega hwmv2 commit. Looks like hpet drivers heavily
relies on soc.h. Reverting this for now while we look for a proper fix
and remove reliance on soc.h for drivers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-04 20:07:30 +01:00
Lyle Zhu
5bd03fd41b Bluetooth: HFP: Fix session pointer invalid issue
The dlc->session is invalid in the callback
hfp_hf_disconnected. The behavior of obtaining
an ACL connection handle through an invalid
pointer is unknown.

Add a field "struct bt_conn *acl" to "struct
bt_hfp_hf". Save acl connect handle to "struct
bt_hfp_hf::acl" in function bt_hfp_hf_accept.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-04 14:07:22 +01:00
Emil Gydesen
6976ad82ea Bluetooth: BAP: Add can_recv to bt_bap_ep_info
Similar to the can_send, the can_recv field indicates whether
or not this endpoint can receive data.

This commit also slightly refactors and optimized how the
can_send field is set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-04 14:05:07 +01:00
Pavel Vasilyev
23049346e0 Bluetooth: Mesh: Fix dev key selection in SAR Cfg Client
For dev key encrypiton, BT_MESH_KEY_DEV_REMOTE should be used instead of
BT_MESH_KEY_DEV regardless of whether the destination is a local element
or remote.

BT_MESH_MSG_CTX_INIT_DEV macro selects correct key.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-03-04 14:03:09 +01:00
Alberto Escolar Piedras
9aec7af1c5 Bluetooth: Controller: Build hci_vendor.c also for simulation
The FICR is also modelled in simulation, but changing this
conditional compile was forgotten, so it was only being
built for real HW.
A test had provided its own version of this function so it would
avoid a runtime warning due to the lack of static address. But
this needs to be removed as it conflicts with the function
provided now always by the nordic controller SW.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-04 12:14:15 +00:00
Fabio Baltieri
12d89c65be Bluetooth: Controller: re-add missing hci_vendor.c reference
Move the nordic and openisa vendor file under ll_sw and add them back to
the list when building for nRF platforms, this was inadvertently removed
in

7bd2804c24 Bluetooth: Controller: Build vendor LLL as library

and is currently causing a:

<wrn> bt_id: No static addresses stored in controller

and random address on nRF devices.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-03-04 12:14:15 +00:00
Torsten Rasmussen
8dc3f85622 hwmv2: Introduce Hardware model version 2 and convert devices
This is a squash of the ``collab-hwm`` branch which converts all
in-tree boards to hardware model version 2 including build system
changes, board updates and soc conversions.

This squash is a combination of the following commits:

ca214745a1 soc: Remove soc_legacy folder and move ARM Kconfig
f12cb0979f scripts: ci: check_compliance: remove HWMv1 checks
1807bcf4d4 boards: mimx8mq_evk: port to HWMv2
3ec2299c62 soc: nxp: port imx8mq SOC to HWMv2
8ea02f4e63 boards: verdin_imx8mp: convert to HVMv2
f2eb7652ce boards: phyboard_pollux: move to HVMv2
ab509a5ee0 boards: nxp: mimx8mp_evk: port M7 core to HWMv2
06ad037f99 soc: nxp: imx8mp: port M7 core to HWMv2
3f9e706859 boards: mimx8mm_phyboard: convert to HVMv2
204372d264 boards: imx8mm_evk: port CM4 core to HWMv2
f82c961a46 soc: nxp: imx8mm: port iMX8MM M4 core to HVMv2
6987b2e305 boards: pico_pi: convert to HVMv2
84484e6707 boards: warp7: convert to HWMv2
ae443d1e3c boards: meerkat96: port to HWMv2
e3629c64e6 boards: colibri_imx7d: port to HWMv2
fc835d893d soc: nxp: convert iMX7 Dual core to HWMv2
29ef2f23eb boards: udoo_neo_full: convert to HWMv2
fd49b1749e soc: nxp: convert iMX6 SoloX core to HWMv2
1e59b7a3fd soc: nxp: imxrt11xx: only set
           CONFIG_CPU_HAS_FPU_DOUBLE_PRECISION for M7
69bb0eb258 hwmv2: MAINTAINERS: Fix NXP maintainer yaml
1c4458890f boards: firefly: roc_rk3568_pc: Fix SMP configuration
651a4370ad boards: Fix variants and revisions
196cfda66d tests/samples: Drop default revision identifiers
6ec6b1d75a boards: Drop revision from twister identifiers for
           default revisions
b774cdd59f scripts: utils: board_v1_to_v2: drop board_legacy prefix
7aa36e6640 boards: riscv: esp32c3_luatos_core: make usb variant
fe25709a9c twister: add unit_testing soc and board
f88f211b4e scripts: ci: check_compliance: improve the "not sorted"
           command
b21a455dfb bluetooth: controller: Fix openisa checks
fdc76c48a7 workflow: compliance: Add rename limit
14ecafc67d dts: bindings: vendor-prefixes: Sort entries
dbc366c3c7 soc: nxp: lpc: Move wrong configurations
8e02c08f96 maintainers: Fix invalid paths
b1b85e2495 boards: up: Fix spaces
58cc4013b3 maintainers: Fix xen path
66ce5c0b09 boards/soc: Add missing copyright headers
bb47243254 boards: qemu: x86: Remove pointless file
2e816a8a3a samples: tests: update esp32-based board naming
9aeab17139 samples: tests: remove platform_exclude of esp32 boards
a4fe97b9de boards: shields: m5stack_core2_ext: update board name
615fcab94a samples: ipm_esp32: fix board labels and skip testing
7752f69b7f boards: legacy: remove index entry for xtensa/riscv
           boards.
3eba827956 MAINTAINERS: update Espressif entries
914362bbd5 boards: xtensa: yd_esp32: Convert to v2
a62278fd23 boards: xtensa: xiao_esp32s3: Convert to v2
b6a11ccec4 boards: xtensa: olimex_esp32_evb: Convert to v2
c1067c16d2 boards: xtensa: odroid_go: Convert to v2
b8340b0109 boards: xtensa: m5stickc_plus: Convert to v2
9d81e417be boards: xtensa: m5stack_stamps3: Convert to v2
c296672720 boards: xtensa: m5stack_core2: Convert to v2
fada12aa9d boards: xtensa: m5stack_atoms3_lite: Convert to v2
fe37ebac1e boards: xtensa: m5stack_atoms3: Convert to v2
d32828fe6a boards: xtensa: kincony_kc868_a32: Convert to v2
5afba7855b boards: xtensa: heltec_wireless_stick_lite_v3: Convert to
           v2
ca48c17723 boards: xtensa: heltec_wifi_lora32_v2: Convert to v2
db1fd4d229 boards: xtensa: esp32s3_luatos_core: Convert to v2
a78b2552eb boards: xtensa: esp32s3_devkitm: Convert to v2
cc96061d96 boards: xtensa: esp32s2_saola: Convert to v2
ed854e05d1 boards: xtensa: esp32s2_lolin_mini: Convert to v2
4fa1ae8110 boards: xtensa: esp32s2_franzininho: Convert to v2
5543040a18 boards: xtensa: esp_wrover_kit: Convert to v2
2335ae79b3 boards: xtensa: esp32_ethernet_kit: Convert to v2
f910b7ad4f boards: xtensa: esp32_devkitc_wrover: Convert to v2
32104db555 boards: xtensa: esp32_devkitc_wroom: Convert to v2
e23a41200d boards: riscv: icev_wireless: Convert to v2
3c670e4e53 boards: riscv: xiao_esp32c3: Convert to v2
fc7c6a060b boards: riscv: stamp_c3: Convert to v2
22c2edb89c boards: riscv: esp32c3_luatos_core: Convert to v2
0a96dcb778 boards: riscv: esp32c3_devkitm: Convert to v2
be1ee1c446 vendors: update vendors lists
5e6c62137f soc: espressif_esp32: Port to HWMv2
037a3b52a4 boards: Raspberry Pi pico pwm led adjustment
7277cae6fa samples: blinky_pwm: enable pwm_leds in rpi_pico overlay
da3e49d34e boards: nxp: update selection of
           FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET
bc8424dd3b soc: nxp: imxrt: move FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET
           to SOC level
041cb52939 soc: brcm: bcm_vk: Rename to bcnvk
576b43a95c soc: Fix SOC_FAMILY name mismatches
e8f3e6494d hwmv2: boards: intel: adsp: Fix runner after paths
           renamed
550399e927 boards: weact: stm32g431_core: Add wrongly deleted file
           back
08708c909e tests: drivers: flash: Renamed missed board rename
06dac41e68 hwmv2: Convert Seagate Faze board to hwmv2
dd8f842b40 hwmv2: nxp: update MAINTAINER paths for hwmv2
b4d1c04978 hwmv2: lpc: updated overlay and conf files in samples and
           tests
067c69089e boards: nxp: convert lpcxpresso55s69 to hwmv2
097205b40a hwmv2: Global fix of lpc54114_m4 overlay and conf files
d8cfa6fb29 boards: nxp: convert lpcxpresso54114 to hwmv2
c29ed228c6 boards: nxp: convert lpcxpresso55s36 to hwmv2
88cfd3d6ac boards: nxp: convert lpcxpresso55s28 to hwmv2
ad30c940ee boards: nxp: convert lpcxpresso55s16 to hwmv2
9e5a10ec80 boards: nxp: convert lpcxpresso55s06 to hwmv2
5650c83268 boards: nxp: convert lpcxpresso51u68 to hwmv2
82cf44be45 boards: nxp:  convert lpcxpresso11u68 to hwmv2
1a9c405a6f soc: nxp: convert LPC SOC family to hardware model V2
f2b536d253 boards: intel: doc: hwmv2: Fix some renamed paths
5ee6058710 samples/tests: Use board revisions
b76687602f boards: Add yaml files for boards missing revisions
32ae4918d0 boards: nordic: Fix board names
cc1dabca65 MAINTAINERS: Update for renamed folders
a37ddce659 soc: xilinx: Rename to xlnx
a1393a07f6 soc: xenvm: Rename to xen
813ed00f67 soc: raspberry_pi: Rename to raspberrypi
71317d6798 soc: cadence: Rename to cdns
8cb0c51ec6 soc: broadcom: Rename to brcm
2b9db15c69 soc: andes: Rename to andestech
0101216ce1 soc: altera: Rename to altr
4b4c3ca65d boards: wurth_elektronik: Rename to we
cdc3ef499f boards: ublox: Rename to u-blox
cabdd4ad05 boards: space_cubics: Rename to sc
4b5bd7ae8a boards: seeed_studio: Rename to seeed
a992785ceb boards: raspberry_pi: Rename to raspberrypi
3c1cdc20fe boards: laird_connect: Rename to lairdconnect
291c7cde2b boards: cadence: Rename to cdns
95db897526 boards: broadcom: Rename to brcm
0a47b94879 boards: beagleboard: Change to beagle
9f9f221c24 boards: andes: Rename to andestech
e7869ca38a boards: altera: Rename to altr
bf2fb5eca3 various: Change SOC_FAMILY_NRF to SOC_FAMILY_NORDIC_NRF
e25730ba56 modules: tf-m: Rename from nordic_nrf to nordic
9e3466606a boards: nordic_nrf: Rename to nordic
09a398dcc8 soc: nordic_nrf: Rename to nordic
cb8ffc74f8 boards: renode: Add documentation index
2291ff4b55 boards: arm: riscv32_virtual: Convert to v2
484b7f1996 soc: riscv_renode_virtual: Port to HWMv2
cc5c2fb0c7 soc: raspberry_pi: Fix SOC_SERIES and SOC mismatch
59cb580513 soc: arm: designstart: Fix SOC_SERIES and SOC mismatch
aa9e0de7af samples: Fix invalid links
a1480cf1cf maintainers: Fix paths
0d719e004b boards: Update documentation links
eb5c3e6f79 boards: wurth_elektronik: Drop duplicate prefix
a34a3640b7 boards: waveshare: Drop duplicate prefix
cf50e950e7 boards: weact: Drop duplicate prefix
737cfb548f boards: sparkfun: Drop duplicate prefix
505494c97a boards: segger: Drop duplicate prefix
4eaf69f37a boards: ruuvi: Drop duplicate prefix
a1335caeae boards: ronoth: Drop duplicate prefix
a9f7f30bf6 boards: raytac: Drop duplicate prefix
80db4c81b3 boards: qemu: Drop duplicate prefix
433d7e9976 boards: particle: Drop duplicate prefix
4ea79d19e7 boards: olimex: Drop duplicate prefix
fd4ae6f6a8 boards: mikroe: Drop duplicate prefix
36080549bd boards: khados: Drop duplicate prefix
169bf8ae1d boards: intel: Drop duplicate prefix
25f04d5222 boards: holyiot: Drop duplicate prefix
11c2af0de8 boards: google: Drop duplicate prefix
d5128f4016 boards: ebyte: Drop duplicate prefix
44fbc68cad boards: dragino: Drop duplicate prefix
f7fe431b44 boards: contextual_electronics: Drop duplicate prefix
9094fea63b boards: circuit_dojo: Drop duplicate prefix
b632acc1fc boards: blue_clover: Drop duplicate prefix
1a3316ebdc boards: bbc: Drop duplicate prefix
71c0344f8c boards: arduino: Drop duplicate prefix
f0176fc25f boards: altera: Drop duplicate prefix
36b920ed0f boards: adi: Drop duplicate prefix
22520368d9 boards: adafruit: Drop duplicate prefix
296acfb2bc boards: actinius: Drop duplicate prefix
55063380b7 boards: 96boards: Drop duplicate prefix
1f93394b55 boards: nxp: convert mimxrt595_evk to hardware model v2
e7a4fd2ec1 soc: nxp: rt5xx: convert RT5xx SOC to HWMv2
01942f1d11 twister: normalize platform name when storing files/data
477c8b84dd twister: tests: test with slashes in platform names
64e3e816c4 soc: Add include guards
3a7aa2fa49 gitignore: update the compliance file list
84e1c17ad9 scripts: ci: check_compliance: add a check for board yml
           file
a90f53ad57 boards: sync up the vendor tags and vendor-list
af9aa65299 dts: vendor-prefixes: add keep-sorted markers
50f0bf05a3 dts: vendor-prefixes: sort the vendor list
a10b614aa4 dts: vendor-prefixes: ensure all prefixes are lowercase
5abe735e93 manifest: update SOF sha for NXP HWMv2
9ab8f64ca9 modules: rename SOC_FAMILY_IMX
483ff8dd4d modules: mcux: remove SOC_FAMILY_NXP_ADSP
f113dd5342 samples: update board name
39b31287d9 boards: nxp: Convert i.MX ADSP boards to hardware model
           v2
1511e356a2 soc: nxp: Port i.MX ADSP family to hardware model v2
c91e25ab47 soc: mec: rename all mec1501x reference to mec15xx
1c231fd939 hwmv2: boards: Convert IMXRT boards
417cff1e60 hwmv2: soc: Port IMXRT family to HWMV2
28d4e41b1b hwmv2: clean up arm64 soc and board empty directory
2b520f83cb hwmv2: port NXP SoC LS1046A to V2
bf7899c645 hwmv2: port nxp_ls1046ardb board to V2
33f7b61866 samples/tests: Rename numaker boards
8f20ea6e93 boards: nuvoton: numaker_pfm: Split into 2 boards
7cf4ff43a1 drivers: pinctrl: imx: align with hwm v2
c68e1fea4e drivers: clock_control: ccm_rev2: align with hwm v2
           update
3b49014a0f hwmv2: move imx8mn EVK board to V2
14f344eeab hwmv2: move imx8mp EVK board to V2
40f3f8f22d hwmv2: move imx8mm EVK board to V2
10bf79ea51 hwmv2: move imx8m soc for a-core to V2
8727d5ca80 hwmv2: move imx93 EVK board to V2
c81ef01563 hwmv2: move imx93 soc to V2
5836c1b699 modules: mcux: introduce CONFIG_MCUX_CORE_SUFFIX
338f6f2bf1 doc: update board porting guide to match new hardware
           model
9639a1b5dc soc: silabs: drop useless defconfigs
981807444e soc: silabs: introduce SOC_GECKO_SDID
5d07e82485 soc: silabs: SOC_FAMILY_* replace SOC_GECKO_SERIES*
2fd081ac86 soc: silabs: align comments with soc tree
66d425f571 soc: silabs: split in families
5bd38f47a9 arch: arch: kconfig: Fix wrong placement of endmenu
00c6ef25be tests/samples: Rename overlay files for renamed boards
0c639b8378 boards: Fix bools and selections
c2ef907d1d drivers: flash: it8xxx2: Add missing Kconfigs
553de2ebc9 soc: ite: ec: it8xxx2: Fix SOC_SERIES being in wrong file
b8ec0080c2 boards: Documentation link fixes
eb7025e50f tests: Update board names for hwmv2
10ef3d4bd2 boards: silab: Add documentation index file
ba9fdaa1d6 boards: arm: efr32_radio: Convert to v2
86c8d4a0ca boards: arm: efm32pg_stk3402a: Convert to v2
575ac5cafb manifest: Update hal_silabs
87b2907304 boards: arm: efr32_thunderboard: Convert to v2
14b30055ab boards: arm: efr32mg_sltb004a: Convert to v2
0012bfc15d boards: arm: efr32xg24_dk2601b: Convert to v2
f526225ead boards: arm: efm32wg_stk3800: Convert to v2
19e7df29df boards: arm: efm32pg_stk3401a: Convert to v2
0bd7d963d6 boards: arm: efm32hg_slstk3400a: Convert to v2
795a90f9bf boards: arm: efm32gg_stk3701a: Convert to v2
43d5540be7 boards: arm: efm32gg_slwstk6121a: Convert to v2
065148d856 boards: arm: efm32gg_sltb009a: Convert to v2
1dc9a8aa17 soc: silabs_exx32: Port to HWMv2
763571e878 tests: Expand names
dae301b8a3 boards: xen: xenvm: Expand name
19e60eef36 boards: qemu: qemu_cortex_a53: Expand names
a0a7c30f28 soc: intel: intel_adsp: Fix issues
df9a4223fe scripts: ci: introduce soc name check in check_compliance
ed401abaff soc: emsdsp: align SoC name defined in soc.yml to Kconfig
           SOC setting
fc78e5eaa4 MAINTAINERS: update RISC-V arch area paths
4e586958ff boards: convert QEMU RISC-V 64 bit board to Zephyr HWMv2
f4c31a2b86 boards: convert QEMU RV32E board to Zephyr HWMv2
5b2ffc652b boards: convert QEMU RISC-V 32 bit board to Zephyr HWMv2
5db061a4c6 soc/riscv: convert the QEMU virt RISCV-32 SoC to HWMv2
6547845e9d boards: convert SparkFun RED-V Things Plus to Zephyr
           HWMv2
95a1f96399 boards: convert SiFive HiFive Unmatched to Zephyr HWMv2
e563eb0a62 soc/sifive/sifive_freedom: add SiFive Freedom FU740 SoC
8914bc58b6 boards: convert SiFive HiFive Unleashed to Zephyr HWMv2
7e8de1e781 soc/sifive/sifive_freedom: add SiFive Freedom U540 SoC
bfcc2ed18f boards: convert SiFive HiFive1 Rev. B to Zephyr HWMv2
330fc38f9f boards: convert SiFive HiFive1 to Zephyr HWMv2
b9e06f4c38 soc/sifive/sifive_freedom: add SiFive Freedom E310 SoC
4b90b30b9d scripts: west_commands: completion: Add hwmv2 complete to
           fish
0f6842e2fa scripts: west_commands: completion: Add hwmv2 complete to
           zsh
b2af1e1737 scripts: west: list_boards: Fix hwmv2 output
686a4b78b8 scripts: west_commands: completion: Add hwmv2 complete to
           bash
396b6bb856 soc: nxp: fix typo in SoC name
765299c627 soc: broadcom: align SoC names defined in soc.yml to
           Kconfig SOC setting
7efd46eb41 soc: arm: align SoC names defined in soc.yml to Kconfig
           SOC setting
505cbc5c42 soc: mec: align SoC names defined in soc.yml to Kconfig
           SOC setting
951a140701 soc: ti: define SOC name in Kconfig
a795d28810 snippets: Initial HWMv2 support
f9a957e6f6 boards: nordic: nrf9160dk: Fix missing nrf52840 config
df994e7ee8 soc: xilinx: zync7000: Remove xilinx from soc series name
8dfabd56ca soc: cypress: Add protection guard to file
447b951593 tests: kernel: tickless: Remove old board name
bad5dfa71f boards: nordic: nrf5340dk: Fix board names
ad2e863f39 soc: atmel: Use new family prefix
3f08e714b2 soc: intel_adsp: hwmv2: Align SOC_SERIES_INTEL_ACE name
           and value
6734597a76 soc: intel_adsp_cavs: hwmv2: Align SOC_SERIES name and
           value
2908af0bcc boards: nrf51dk/dongle: change SoC to nRF51822
d1ceb29fca soc: align CONFIG_SOC values to match soc.yml names
4768ccaf70 tests: drivers: gpio: gpio_api_1pin: exclude hifive1
ebdb0879ad boards: nxp: s32z2xxdc2: convert to hwmv2
ae82580d08 boards: nxp: mr_canhubk3: convert to hwmv2
c5f0defbae boards: nxp: ucans32k1sic: convert to hwmv2
1e46cabce6 soc: nxp: convert NXP S32 family to hwmv2
f2f85133f2 soc: stm32: Rename series path
86642f4e78 soc: stm32: Rename Kconfig SOC_SERIES symbols
c61e807896 soc: stm32: Cleanup Kconfig.defconfig files
ca46c8abc9 tests: Fix board names
fbfed5f48f maintainers: Update synopsys entries
8cd8b1cc47 boards: synopsys: Add documentation index
6f6cc57a04 boards: arc: hsdk4xd: Convert to v2
c4c14a54ca soc: snps_arc_hsdk4xd: Port to HWMv2
06c2054e5c boards: arc: iotdk: Convert to v2
ff0e0fce1b soc: snps_arc_iot: Port to HWMv2
334264c46a boards: arc: emsdp: Convert to v2
8b947a0e91 soc: snps_emsdp: Port to HWMv2
990417bbde tests: Update board names for hwmv2
e12719154a boards: arc: em_starterkit: Convert to v2
437a430fbe soc: snps_emsk: Port to HWMv2
f93387f968 boards: arc: hsdk: Convert to v2
1cf2498b13 soc: snps_arc_hsdk: Port to HWMv2
47abe81256 boards: arc: nsim: Convert to v2
1e33786dc4 soc: snps_nsim: Port to HWMv2
7f081914db boards: arc: qemu_arc: Convert to v2
bc97349dbd soc: snps_qemu: Port to HWMv2
a9902ff58e boards: Use zephyr_file for file links
126e1a4e72 boards: Fix invalid documentation links
899f0257c3 boards: stm32wb: Restore missing .defconfig files
790c10b1ee soc: x86/atom: imply mmu, do not select it
faee62088d boards: x86: remove qemu_x86_tiny_768
c34d186a57 x86: atom: remove soc.h with unused content
1be3a9e9d3 x86: remove legacy ia32, use atom instead
60e6b400f9 boards: qemu: move qemu_x86 -> x86
c4fbac27e8 boards: infineon: Add documentation index
b4dd29a9c4 maintainers: Update paths for hwmv2
380f5fdb2b boards: cypress: Add documentation index
9de981be05 boards: arm: xmc47_relax_kit: Convert to v2
6394e8a348 boards: arm: xmc45_relax_kit: Convert to v2
04dbf17e19 soc: xmc_4xxx: Port to HWMv2
c9731f1bce boards: arm: cy8cproto_063_ble: Convert to v2
53d41869d1 boards: arm: cy8cproto_062_4343w: Convert to v2
46c4f01427 boards: arm: cy8ckit_062s4: Convert to v2
d285e19cf2 boards: arm: cy8ckit_062_wifi_bt: Convert to v2
2bebd7298c boards: arm: cy8ckit_062_ble: Convert to v2
af243274c2 soc: psoc6 and psoc_6: Port to HWMv2
105a2bae84 cmake: modules: boards: Fix board deprecation for HWMv2
dca54e000a cmake: modules: boards: Enhance board aliases for HWMv2
fc314e8e3f cmake: modules: boards: Fix BOARD_ALIAS
9a7c2ce6d5 soc: gaisler: Move Kconfig file
1ac56d0501 soc: soc_legacy: mips: Remove out file
c054381a7a boards: adjust few boards/ paths
4d93b8d9fd boards: convert all microchip MEC boards to hwmv2
ab2fcb1245 soc: convert microchip_mec to hwmv2
ead4b57a7b soc: arm64: intel_socfpga: hwmv2: Rename SoCs
d4c143d306 MAINTAINERS: intel_socfpga: Adjust to HWMv2 move
70a66ac03a boards: arm64: intel_socfpga: Move boards to
           subdirectories
8a85c07799 boards: arm64: intel_socfpga_agilex5_socdk: move to HWMv2
8c253a99fc boards: arm64: intel_socfpga_agilex_socdk: move to HWMv2
ab883b8019 soc: arm64: intel_socfpga: Move and convert to HWMv2
7c8b7a153b soc: arm: intel_socfpga_std: Rename with HWMv2
8dc2b911f6 soc: board: intel_socfpga_std: Align names to 'Cyclone V'
402366117a soc: arm: intel_socfpga_std: Align board subdirectory
f0a8d12745 boards: arm: cyclonev_socdk: Move to HWMv2
2271f17a86 soc: arm: intel_socfpga_std: Move and convert to HWMv2
841c2a9d99 boards: riscv: beaglev_fire: Convert to v2
3b314531ab boards: riscv: mpfs_icicle: Convert to v2
d4ea2bf70b boards: riscv: m2gl025_miv: Convert to v2
5256e9fcc3 soc: microchip_miv: Port to HWMv2
18e5cf1d51 maintainers: Update path for hwmv2
eab8628f98 boards: arm: qemu_cortex_m3: Convert to v2
1532f2fee1 soc: ti_lm3s6965: Port to HWMv2
430ca6a475 maintainers: Update ambiq paths
a9b9b41b91 boards: ambiq: Add index
db0271ecbb boards: arm: apollo4p_blue_kxr_evb: Convert to v2
957e2b2061 boards: arm: apollo4p_evb: Convert to v2
5a90a44454 soc: ambiq: Port to HWMv2
a20c113fbd boards: nxp: convert ip_k66f to hwmv2
34e3852a54 boards: nxp: convert usb_kw24d512 to hwmv2
20ad604de6 boards: nxp: convert twr_kv58f220m to hwmv2
2e2a7b7656 boards: nxp: twr_ke18f: convert to hwmv2
f7dcc2eb5e boards: nxp: convert rddrone_fmuk66 to hwmv2
b58e90a2e9 boards: nxp: convert hexiwear to hwmv2
aae6e9e454 boards: nxp: frdm_kw41z: convert to hwmv2
1d3baac2d6 boards: nxp: convert frdm_kl25z to hwmv2
3b1d21483f boards: nxp: frdm_k82f: port to hwmv2
6046e6ded9 boards: nxp: port frdm_k64f to hwmv2
0a7bf9fd79 boards: nxp: port frdm_k22f to hwmv2
dce697c823 boards: nxp: add toctree placeholder
666a353409 soc: nxp: kinetis: convert kinetis SOC family to hardware
           model V2
89f0a6034b maintainers: Update paths for renesas boards/socs
004bd43c48 tests/samples/snippets: Update board names for hwmv2
a6d756923d boards: arm and arm64: rcar_h3ulcb: Convert to v2
3801216b8d boards: arm64: rcar_salvator_xs_m3: Convert to v2
b7cc30aaea boards: arm: rcar_h3_salvatorx_cr7: Convert to v2
866427ea29 boards: arm: arduino_uno_r4: Convert to v2
2689b3f0ee soc: ra: Port to HWMv2
e7ebc727c8 boards: arm: da1469x_dk_pro: Convert to v2
903265b2bb boards: arm: da14695_dk_usb: Convert to v2
529a78ed51 soc: smartbond: Port to HWMv2
97cf636ae0 boards: arm: rcar_spider_cr52: Convert to v2
6d0c53f3a1 soc: rcar: Port to HWMv2
44e0aa0668 soc: renesas: rzt2m: Move folder structure for more SoCs
85238fc205 boards: misc: Fixed STM32 based boards doc links
dffc08af56 boards: riscv: niosv_m: move and convert to HWMv2
545093abe4 boards: riscv: niosv_g: move and convert to HWMv2
ecfa192f1b soc: riscv: intel_niosv: move and convert to HWMv2
fd1e8cdc30 hwmv2: sof: intel_adsp: submanifest provisional link
8bf067e625 doc: boards: intel_adsp: Re-order pages
4833275ccd MAINTAINERS: intel_adsp: Adjust to HWMv2 move
b9a70e5ea2 soc: intel_adsp: tools: pylint compliance workaround
18c70cc4bf hwmv2: tests: boards: intel_adsp: Adjust board names
ca52baf9de hwmv2: boards: intel_adsp: Overhaul board configurations
d1b3bcce64 soc: boards: xtensa: intel_adsp_ace: Rename with HWMv2
f362a8ae2c doc: soc: boards: intel_adsp_cavs25: Rename with HWMv2
51dee5da92 tests: samples: boards: intel_adsp_cavs25: Rename with
           HWMv2
e66c35e0d0 boards: xtensa: intel_adsp_cavs25: Rename board with
           HWMv2
d1491a4810 soc: boards: xtensa: intel_adsp_cavs25: Rename with HWMv2
fa0fca79c4 scripts: west: runners: intel_adsp: Adjust path to HWMv2
acd18bfaf7 boards: xtensa: intel_adsp_ace20_lnl: move and convert to
           HWMv2
546c94b958 boards: xtensa: intel_adsp_ace15_mtpm: move and convert
           to HWMv2
8aab718c3e boards: xtensa: intel_adsp_cavs25_tgph: change to board
           variant
30f17424a4 boards: xtensa: intel_adsp_cavs25: move and convert to
           HWMv2
35a97cb524 soc: xtensa: intel_adsp: HWMv2 workaround for SOF config
fdc20fdff6 soc: xtensa: intel_adsp: move and convert to HWMv2
22dc2b6391 cmake: improved board handling for revisions
2f1e33a2e6 cmake: improve arch error message for invalid arch
           selection
c47c37d3db sample: basic: blinky_pwm: Exclude rpi_pico w variant
7a788b9a18 boards: raspberry_pi: rpi_pico: Use full name for w
           variant
7046b92d41 tests: atmel_sam: adc: Fix sam4e_xpro adc build
253ee9638c tests: atmel_sam0: Update platform name
ccb4c63324 samples: atmel_sam0: Update platform name
2d4acf9230 boards: arduino_nano_33_iot: Convert to HWMv2
a60d28969a boards: arduino_mkrzero: Convert to HWMv2
0409e51d3f boards: arduino_zero: Convert to HWMv2
1b2528df1b boards: wio_terminal: Convert to HWMv2
af1096e7ca boards: ev11l78a: Convert to HWMv2
0b1db9c53d boards: adafruit_trinket_m0: Convert to HWMv2
e9874671e2 boards: adafruit_itsybitsy_m4_express: Convert to HWMv2
ba6c014071 boards: adafruit_grand_central_m4_express: Convert to
           HWMv2
33ad4a51ca boards: adafruit_feather_m0_lora: Convert to HWMv2
9812f3d54e boards: adafruit_feather_m0_basic_proto: Convert to HWMv2
c76b1fbeca boards: serpente: Convert to HWMv2
649789e433 boards: seeeduino_xiao: Convert to HWMv2
6b3bdb7364 boards: same54_xpro: Convert to HWMv2
93dda5ee4b boards: samr34_xpro: Convert to HWMv2
e48e1f5d5b boards: samc21n_xpro: Convert to HWMv2
f11cf73df1 boards: saml21_xpro: Convert to HWMv2
ac73ed6dcd boards: samd20_xpro: Convert to HWMv2
0fdbe3552e boards: samd21_xpro: Convert to HWMv2
854cff3905 boards: samr21_xpro: Convert to HWMv2
a87ea5bc0a soc: atmel: sam0: Port to HWMv2
706e5d27cd boards: riscv: neorv32: Convert to v2
d1edcdd088 soc: neorv32: Port to HWMv2
0f7add89ca boards: native_sim/posix: Add 64bit versions as variants
b6edad8d68 soc: soc_legacy: remove the arm/st_stm32 folder
c58e0822a6 boards: Convert nucleo_f207zg to HWM v2
b987093a80 soc: v2: stm32: Migrate STM32F2 series
2096fd4652 samples: bluetooth: hci_uart: Fix wrongly converted board
           names
830f9c5a82 MAINTAINERS: Update Atmel entries
527cd9d8cd CODEOWNERS: Update Atmel entries
83af7d0c1c samples: atmel_sam: Update platform name
fd9b84d457 tests: atmel_sam: Update platform name
3c72fe863c boards: arduino_due: Convert to HWMv2
37dfacbf9e boards: RoboKit1: Convert to HWMv2
1108d7b0ed boards: sam_v71_xult: Convert to HWMv2
bed44a5c28 boards: sam_e70_xplained: Convert to HWMv2
40448c5a9f boards: sam4s_xplained: Convert to HWMv2
31273692c0 boards: sam4l_ek: Convert to HWMv2
35b5d33ef0 boards: sam4e_xpro: Convert to HWMv2
3b84b9910a soc: atmel: Port SAM family to HWMv2
da00d0e7b9 boards: Convert nucleo_wba55cg to HWM v2
fb2103f89e boards: Convert nucleo_wba52cg to HWM v2
1f9a533fbc soc: st: stm32: Migrate STM32WBA series
3f92f65b28 boards: fix documentation for alientek and blues boards
7646b74aaf boards: stm32l4: doc: add zephyr_file to defconfig path
fea54ddcd9 boards: Convert adi_eval_adin2111ebz to HWM v2
d47f1878b1 boards: Convert adi_eval_adin1110ebz to HWM v2
ae42be236b boards: Convert swan_r5 to HWM v2
83bd1a9ecc boards: Convert stm32l4r9i_disco to HWM v2
39c26f09ed boards: Convert stm32l496g_disco to HWM v2
29d03c970b boards: Convert stm32l476g_disco to HWM v2
74acec315c boards: Convert sensortile_box to HWM v2
fee6d8676e boards: Convert pandora_stm32l475 to HWM v2
008b5d9392 boards: Convert nucleo_l4r5zi to HWM v2
24e357d623 boards: Convert nucleo_l4a6zg to HWM v2
2c5f9dcce0 boards: Convert nucleo_l496zg to HWM v2
4da061646f boards: Convert nucleo_l476rg to HWM v2
15956a69b8 tests: drivers: flash: stm32: update platform name
80324f7707 boards: Convert nucleo_l452re_p to HWM v2
9893e0d111 boards: Convert nucleo_l452re to HWM v2
46f92b227b boards: Convert nucleo_l433rc_p to HWM v2
ed5d1bb4cd boards: Convert nucleo_l432kc to HWM v2
325f95ec20 boards: Convert nucleo_l412rb_p to HWM v2
d055676307 boards: Convert disco_l475_iot1 to HWM v2
c7a415d92c boards: Convert b_l4s5i_iot01a to HWM v2
d15144f582 soc: st: stm32: Migrate STM32L4 series
a63ff71bcb boards: nrf_bsim: Add new nrf5340 board definitions
b53c6f412c boards: nrf_bsim: Remove redundant option setting
83eb4fc069 MAINTAINERS: intel_ish: Adjust to HWMv2 move
715685b19f boards: x86: intel_ish: move and convert intel_ish boards
           to HWMv2
5b9ef94106 soc: x86: intel_ish: move and convert to HWMv2
12b297707a boards: Convert stm32wb5mmg to HWM v2
cdcea932bc boards: Convert stm32wb5mm_dk to HWM v2
0a3ae2b223 boards: Convert nucleo_wb55rg to HWM v2
20b4ce17d5 soc: st: stm32: Migrate STM32WB series
47c65400d6 soc: st: stm32: fix stm32l0 family
59ec56f9e6 boards: Convert stm32h573i_dk to HWM v2
dc5977dbba boards: Convert nucleo_h563zi to HWM v2
a6e4928543 soc: st: stm32: Migrate STM32H5 series
99f248e048 soc: stm32u5: Fix references after conversion to hw
           modelv2
15f16834e6 boards: Convert stm32u5a9j_dk to HWM v2
c1ee449ef1 boards: Convert sensortile_box_pro to HWM v2
db4deddf9d boards: Convert nucleo_u5a5zj_q to HWM v2
2fd3ed43d2 boards: Convert nucleo_u575zi_q to HWM v2
902fceb173 boards: Convert b_u585i_iot02a to HWM v2
d716ca1a10 soc: st: Migrate stm32u5 series to new hw model
b7abc89428 hwmv2: boards: x86: doc: Adjust common docs to new
           locations
69b334f54b MAINTAINERS: Change paths to native and nrf*bsim boards
614611a528 boards: nrf*_bsim: Convert to HW model v2
5821b9ec2e board: native_sim/posix: Convert to hwmv2
04cbad174e soc: native: Convert to HWMv2
24ca0febfc boards: nrf_bsim: Fix path to pinctrl_soc.h
9a32559a2d cmake: FindHostTools: Fix for hwmv2 for host based
           targets
c4b11e0251 boards: longan_nano: port to HWMv2
97edd05be3 boards: gd32vf103c_starter: port to HWMv2
9cf624c410 boards: gd32vf103v_eval: port to HWMv2
b40bf25e5e soc: gd_gd32: reorganize folders
71600d7e95 soc: gd_gd32: move pinctrl_soc.h content back to soc
           folder
2bd84a1bc5 soc: gd_gd32: port gd32vf103 series to HWMv2
9dc342143b boards: doc: fix a bunch of broken reference
10392d693d doc: boards: split out shields
b2def8ed3a boards: acrn: fix title
bf7d3efe78 boards: riscv: tlsr9518adk80d: Convert to v2
c579770e1d soc: telink_tlsr: Port to HWMv2
9131540109 soc: stm32h7: Couple of tests fixes following migration
2efcefc089 boards: Convert stm32h7b3i_dk to HWM v2
d9b295a85b boards: Convert stm32h750b_dk to HWM v2
a2f56bdcd5 boards: Convert stm32h747i_disco to HWM v2
00314155df boards: Convert stm32h735g_disco to HWM v2
b08819dff7 boards: Convert nucleo_h7a3zi_q to HWM v2
56456c16e5 boards: Convert nucleo_h753zi to HWM v2
91f9198dc4 boards: Convert nucleo_h745zi_q to HWM v2
96f1bafbf9 boards: Convert nucleo_h743zi to HWM v2
b290f25baa boards: Convert nucleo_h723zg to HWM v2
9fbe6bf191 boards: Convert fk7b0m1_vbt6 to HWM v2
44bcfe57c7 boards: Convert arduino_portenta_h7 to HWM v2
4c86af7eae boards: Convert arduino_opta_m4 to HWM v2
b4f852f738 boards: Convert arduino_giga_r1 to HWM v2
bac9789264 soc: st: Migrate stm32h7 series to new hw model
a954e1722d boards: stm32l0: Cleanup board _defconfig files after
           migration
7e8515b241 boards: Convert ronoth_lodev to HWM v2
25246c21ef boards: Convert nucleo_l073rz to HWM v2
09396eb2e6 boards: Convert nucleo_l053r8 to HWM v2
70c004fd83 boards: Convert nucleo_l031k6 to HWM v2
e3daa98e79 boards: Convert nucleo_l011k4 to HWM v2
a2de60c6da boards: Convert dragino_nbsn95 to HWM v2
e877ce9cec boards: Convert dragino_lsn50 to HWM v2
2b50218c23 boards: Convert b_l072z_lrwan1 to HWM v2
4a65f55916 soc: st: Migrate stm32l0 series to new hw model
cc6e6be01f boards: fix few leftover ITE board references
a837303268 soc: stm32: Protect Kconfig symbols by SOC_FAMILY_STM32
88e5959f17 hwm2: Fix unit_testing: it is also a legacy board by now
95e06e8663 cmake: Fix uses of old SOC path
d517d3cc24 soc: set linker script for ra4m1
68f9aeddab soc: ite: add SOC_SERIES_ITE_IT8XXX2 guards around ITE
           options
ccf4f48f01 boards: convert ite boards to hwmv2
4a6e286a3b soc: convert ite_ec to hwmv2
12e375f826 doc: handle arch / soc / board docs in new hardware model
b4db917de9 boards: Add documentation index files
d6e0d27efe samples: bluetooth: hci_uart: Fix wrong named files
bc16a7a727 tests: Update board names for hwmv2
2834883843 boards: riscv: rv32m1_vega: Convert to v2
9c68231ba9 soc: openisa_rv32m1: Port to HWMv2
986e9619fd soc: starfive_jh71xx: Port to HWMv2
e82932e787 boards: riscv: litex_vexriscv: Convert to v2
cb9339f88f soc: litex_vexriscv: Port to HWMv2
1cd4c34654 boards: riscv: opentitan_earlgrey: Convert to v2
92eadf06b8 soc: opentitan: Port to HWMv2
a8659e170b boards: riscv: titanium_ti60_f225: Convert to v2
359133d725 soc: efinix_sapphire: Port to HWMv2
6d466429ed soc: soc_legacy: riscv: litex_vexriscv: Add updated paths
a1ff441eb3 boards: riscv: adp_xc7k_ae350: Convert to v2
ef82a8255c soc: ae350: Port to HWMv2
282204758a samples: boards: stm32: ccm: fix include path
8ca9341195 samples: basic: threads: fix broken reference
8a947f446d boards: nrf52840dk: fix rst syntax
324cb41153 boards: nordic_nrf: fix broken references
963c74df1c boards: intel_(ish|adl|ehl|rpl), up_squared: fix include
           paths
8d518ce504 boards: legacy: drop empty folders
0fef0cef5b boards: mps2: fix table formatting
e52ccc244f boards: add HWMv2 board index
c7426eca5e boards: arm: add legacy tag
1eba9d8a8f boards: acrn: create vendor folder
8d92edc727 tests: kernel: Adjust qemu_x86_tiny_768 configuration
           HWMv2
75117d1b2d scripts: ensure posix path is used with --cmakeformat
0b0384b56a maintainers: update paths after HWMv2 changes
c1b77b223d boards: arm: pan1783: Convert to v2
91a077b2ab boards: posix: nrf_bsim: Update paths
413b6c2a40 cmake: modules: configuration_files: Add board identifier
           overlay file
4f572ba24f treewide: Update board names for hwmv2
cb348c7edf boards: arm: nrf54l15pdk_nrf54l15: Convert to v2
811ad90566 boards: arm: nrf54h20pdk_nrf54h20: Convert to v2
d44ef90cf8 soc: nordic_nrf: Migrate nRF54H/nRF54L to v2 and fix nrf
c860f205de boards: arm: nrf9151dk_nrf9151: Convert to v2
fba98a1763 soc: nordic_nrf: Migrate nRF9151 to v2
5c156a2d35 boards: arm: 96b_carbon_nrf51: Convert to v2
cfc47a3a4b boards: arm: nrf9161dk_nrf9161: Convert to v2
37129b4e44 boards: arm: nrf9131ek_nrf9131: Convert to v2
a923beba5d boards: arm: bl5340_dvk: Convert to v2
d242b2703b boards: arm: raytac_mdbt53v_db_40_nrf5340: Convert to v2
9c80d4e644 boards: arm: raytac_mdbt53_db_40: Convert to v2
28268c4938 boards: arm: nrf5340_audio_dk_nrf5340: Convert to v2
33ad2b5bc6 boards: arm: thingy53_nrf5340: Convert to v2
40daa94f2d boards: arm: nrf9160_innblue22: Convert to v2
2b0dbb9d51 boards: arm: nrf9160_innblue21: Convert to v2
ee6f7697ac boards: arm: sparkfun_thing_plus_nrf9160: Convert to v2
594e4bad6b boards: arm: circuitdojo_feather_nrf9160: Convert to v2
a5803ba099 boards: arm: actinius_icarus: Convert to v2
db8c275456 boards: arm: actinius_icarus_bee: Convert to v2
30177cf53d boards: arm: actinius_icarus_som: Convert to v2
486504cf24 boards: arm: actinius_icarus_som_dk: Convert to v2
dd0672a64c boards: arm: nrf9160dk_*: Convert to v2
c1565b3d14 boards: arm: xiao_ble: Convert to v2
6dd2723314 boards: arm: qemu_cortex_m0: Convert to v2
ee1ce24a42 boards: arm: bbc_microbit: Convert to v2
1952d559f2 boards: arm: rm1xx_dvk: Convert to v2
9e12c3d8bd boards: arm: nrf51dongle_nrf51422: Convert to v2
0ffbc1da33 boards: arm: nrf51_blenano: Convert to v2
be52dfb7b6 boards: arm: nrf51_vbluno51: Convert to v2
4c29d1827f boards: arm: nrf51_ble400: Convert to v2
5b4a9556fd boards: arm: raytac_mdbt53_db_40_nrf5340: Fix typo
69e5d87a15 boards: arm: contextualelectronics_abc: Convert to v2
5e4ace1bbe boards: arm: degu_evk: Convert to v2
2762460a64 boards: arm: pan1781_evb: Convert to v2
fdc3913e76 boards: arm: ubx_evkninab1_nrf52832: Convert to v2
9c9c3a09a1 boards: arm: holyiot_yj16019: Convert to v2
109edc296f boards: arm: blueclover_plt_demo_v2_nrf52832: Convert to
           v2
7bfcdbbe8f boards: arm: decawave_dwm1001_dev: Convert to v2
0fbb543983 boards: arm: acn52832: Convert to v2
073e0f8080 boards: arm: we_proteus2ev_nrf52832: Convert to v2
197a19f396 boards: arm: ebyte_e73_tbb_nrf52832: Convert to v2
1616fc8ae5 boards: arm: nrf52_vbluno52: Convert to v2
5622077738 boards: arm: nrf52_sparkfun: Convert to v2
a6289516e4 boards: arm: 96b_nitrogen: Convert to v2
439d836883 boards: arm: nrf52_blenano2: Convert to v2
16e65f09c4 boards: arm: arduino_nicla_sense_me: Convert to v2
862efd5a21 boards: arm: thingy52_nrf52832: Convert to v2
dede0f6cd3 boards: arm: nrf52_adafruit_feather: Convert to v2
91e864ea29 boards: arm: nrf52832_mdk: Convert to v2
47ec3e416b boards: arm: ruuvi_ruuvitag: Convert to v2
52f797a227 boards: arm: pinetime_devkit0: Convert to v2
433db339f9 boards: arm: ubx_evkannab1_nrf52832: Convert to v2
a646d3f2d5 boards: arm: ubx_bmd300eval_nrf52832: Convert to v2
d0d434bf86 cmake: print identifier instead of variant
c3f5ed8157 boards: arm: we_proteus3ev_nrf52840: Convert to v2
eecff8ee7a boards: arm: nrf52840_mdk_usb_dongle: Convert to v2
34507614f6 boards: arm: nrf52840_mdk: Convert to v2
f02b56cb96 boards: arm: nrf52840_blip: Convert to v2
600c55c92a boards: arm: nrf52840_papyr: Convert to v2
f294bfc5e4 boards: arm: reel_board: Convert to v2
882524d2a0 boards: arm: nrf21540dk_nrf52840: Convert to v2
4bce0e9b39 boards: arm: nrf52840dongle_nrf52840: Convert to v2
d0229c771f boards: arm: particle_argon: Convert to v2
23a0570e64 boards: arm: particle_boron: Convert to v2
b6d3e1764f boards: arm: particle_xenon: Convert to v2
499f3e7902 boards: arm: rak5010_nrf52840: Convert to v2
9ae6b1804d boards: arm: rak4631_nrf52840: Convert to v2
fe2c90da5c boards: arm: pinnacle_100_dvk: Convert to v2
3d4d46698c boards: arm: ubx_evkninab3_nrf52840: Convert to v2
b1afbf0158 boards: arm: ubx_bmd380eval_nrf52840: Convert to v2
9f9897c872 boards: arm: ubx_bmd345eval_nrf52840: Convert to v2
f7fb2030c7 boards: arm: ubx_bmd340eval_nrf52840: Convert to v2
7186432662 boards: arm: raytac_mdbt50q_db_40_nrf52840: Convert to v2
32c4bdc0c4 boards: arm: pan1780_evb: Convert to v2
7b64c638a8 boards: arm: pan1770_evb: Convert to v2
156ee8ad8a boards: arm: mg100: Convert to v2
3d33dadeb0 boards: arm: arduino_nano_33_ble: Convert to v2
4fee7371d2 boards: arm: adafruit_itsybitsy_nrf52840: Convert to v2
ad37a0c222 boards: arm: adafruit_feather_nrf52840: Convert to v2
cf85b7169f boards: arm: bt510: Convert to v2
44b67ac430 boards: arm: bt610: Convert to v2
7dbb65d371 boards: arm: ubx_evkninab4_nrf52833: Convert to v2
5e79cb957d boards: arm: raytac_mdbt50q_db_33_nrf52833: Convert to v2
12bd83a218 boards: arm: pan1782_evb: Convert to v2
1a135ec352 boards: arm: bbc_microbit_v2: Convert to v2
4dbe97e5ea boards: arm: nrf52833dk: Convert to v2
d632b90043 boards: arm: ubx_bmd360eval_nrf52811: Convert to v2
cc1a30f24b boards: arm: we_ophelia1ev_nrf52805: Convert to v2
df0df9000b boards: arm: ubx_bmd330eval_nrf52810: Convert to v2
d2c7972a9a boards: arm: nrf52dk: Convert to v2
202c2bf447 boards: arm: bl654_sensor_board: Convert to v2
c3e36f2042 boards: arm: bl654_usb: Convert to v2
b9dd58aea1 boards: arm: bl654_dvk: Convert to v2
0e1898b093 boards: arm: bl653_dvk: Convert to v2
286f4a7524 boards: arm: bl652_dvk: Convert to v2
d1709cdb37 boards: update nRF51dk board to board scheme v2.
8f040cff2c boards: Update nrf5340dk_nrf5340 to HWMv2 scheme
8c90fae8e0 boards: update nRF52840dk_nrf52840/nrf52811 board to
           board scheme v2.
c828dcc60e boards: common: openocd-nrf5: Add HWMv2 support
c79f1b0d94 kconfig: soc: adopt Nordic SoC series to support hw model
           v2 scheme
3584b30fc1 tests: Update board names for hwmv2
94024d940e boards: arm: arty_a7: Convert to v2
8053c3a8df boards: arm: scobc_module1: Convert to v2
d5473b76fe soc: designstart: Port to HWMv2
f5792b05e7 boards: arm: fvp_baser_aemv8r_aarch32: Convert to v2
ff202daa8e soc: fvp_aemv8r_aarch32: Port to HWMv2
e66cbc2945 boards: arm: v2m_musca_s1: Convert to v2
33b47b2edb boards: arm: v2m_musca_b1: Convert to v2
baeebd31d2 soc: musca: Port to HWMv2
73b257a3f9 boards: arm: v2m_beetle: Convert to v2
85de0888ec soc: beetle: Port to HWMv2
867960a891 manifest: Update modules
6ca677ed3a boards: arm: mps2: Convert to v2
bcf4ad19d4 twister: build_dir: convert / to _ to support hwmv2
0ac386683f soc: Kconfig.v2: Add SOC_PART_NUMBER
9242c3c78f soc: stm32: soc.yml: reorder series
248d17f160 boards: stm32: cleanup
0a67265e99 boards: stm32: fix for boards with revisions
f8d44317ee soc: stm32l5: Rename overlays for nucleo_l552ze_q ns
           target.
400343d17e soc: stm32: Set default on USE_DT_CODE_PARTITION
d783ef549a soc: stm32l5: Update stm32l5 non secure targets in
           various places
643aeac552 boards: Convert stm32l562e_dk to HWM v2
e601d64344 boards: Convert nucleo_l552ze_q to HWM v2
2f7a387b32 soc: st: Migrate stm32l5 series to new hw model
519752efcd boards: xenvm: doc: Remove reference to deleted file
06263dd717 boards: xenvm: Unset HEAP_MEM_POOL_SIZE in gicv3 variant
66b0df5526 boards: qemu_cortex_a53: Fix Kconfig warnings in SMP
           variant
fa07bd9419 boards: mps3: Fix non-secure variant
8f6f0726dd boards: Move xenvm under xen
7b155a7031 boards: Raspberry Pi vendor fix
804697afa5 boards: Move 96b_aerocore to 96boards
d2f001e320 boards: x86: acrn: move and convert to HWMv2
ec7f7b3c30 tests: kernel: qemu_x86: adjust to the HWMv2
89dfcddc7e boards: x86: qemu_x86_tiny@768: change to board variant
eb724eb6a7 boards: x86: qemu_x86: optimize default HWMv2
           configurations
6f1043cde6 boards: x86: qemu_x86: move and convert to HWMv2
cab924cbfb soc: x86: ia32: move and convert to HWMv2
237fdff918 soc: x86: lakemont: move and convert to HWMv2
03042b7704 boards: move 96b_carbon to 96boards folder
767b94414e boards: rename vendor seeed to seeed_studio
07fa3a3d79 boards: Convert olimex_lora_stm32wl_devkit to HWM v2
ba01d3beca boards: Convert nucleo_wl55jc to HWM v2
7ce84f4041 boards: Convert lora_e5_mini to HWM v2
b988bae576 boards: Convert lora_e5_dev_board to HWM v2
6fbf39c726 soc: v2: stm32: Migrate STM32WL series
4a41878442 soc: st: stm32g4: add missing include
1e79ba15f6 boards: Convert weact_stm32g431_core to HWM v2
ffdcb60185 boards: Convert nucleo_g474re to HWM v2
d6acb08d3e boards: Convert nucleo_g431rb to HWM v2
90e592ffd1 boards: Convert b_g474e_dpow1 to HWM v2
eb8a7e3441 soc: st: stm32: Migrate STM32G4 series
ada469f237 tests: Update board names for hwmv2
0342433187 boards: arm: npcx9m6f_evb: Convert to v2
c10248d964 boards: arm: npcx7m6fb_evb: Convert to v2
21ddc5e6a6 boards: arm: npcx4m8f_evb: Convert to v2
5500f3ef21 soc: npcx*: Port to HWMv2
e7baf09ede soc: m48x: Port to HWMv2
5bae4a6480 boards: arm: numaker_pfm_m467: Convert to v2
3b0bd70c8c soc: m46x: Port to HWMv2
d52eab9e83 boards: Convert stm32g081b_eval to HWM v2
6f2835cb11 boards: Convert stm32g071b_disco to HWM v2
ca36d331d2 boards: Convert stm32g0316_disco to HWM v2
662cc4e09b boards: Convert nucleo_g0b1re to HWM v2
dd9bc29769 boards: Convert nucleo_g071rb to HWM v2
353da23ffb boards: Convert nucleo_g070rb to HWM v2
acc932b424 boards: Convert nucleo_g031k8 to HWM v2
cea9b140fd boards: Convert google_twinkie_v2 to HWM v2
52e025943a soc: st: stm32: Migrate STM32G0 series
1c7347686a ci: update check_compliance to not create duplicate lines
           in Kconfig
9debd98799 hwmv2: boards: up_squared_pro_700: Add missed intel_adl
           changes
adab07c42f boards: Convert msp_exp432p401r_launchxl to HWM v2
642aacdcdf soc: ti_simplelink: Add missing SoC
48637066d3 boards: Fix file paths in documentation
e983bc2a23 samples/tests: Fix mps3 board name
61e0f32716 boards: Convert stm32f3_seco_d23 to HWM v2
a1688ff641 boards: Convert stm32f3_disco to HWM v2
35fb228599 boards: Convert stm32373c_eval to HWM v2
10e5d1122b boards: Convert nucleo_f334r8 to HWM v2
c319cb19f0 boards: Convert nucleo_f303re to HWM v2
11725ccac1 boards: Convert nucleo_f303k8 to HWM v2
400f7f6a4f boards: Convert nucleo_f302r8 to HWM v2
8d84861390 soc: v2: stm32: Migrate STM32F3 series
85b9eee7e8 boards: arm: kv260_r5: Convert to v2
dafbd638e4 boards: arm: mercury_xu: Convert to v2
3ecd12f415 boards: arm: qemu_cortex_r5: Convert to v2
5db2390e9d soc: xilinx_zyncmp: Port to HWMv2
9ba8195cdc boards: arm: qemu_cortex_a9: Convert to v2
8e94b85361 boards: arm: zybo: Convert to v2
c970127fc2 soc: xilinx_zynq7000: Port to HWMv2
394c75373c boards: arm: ast1030_evb: Convert to v2
f2a1cc8714 soc: ast10x0: Port to HWMv2
28f3f25945 boards: arm: cc3235sf_launchxl: Convert to v2
c3e480f740 boards: arm: cc3220sf_launchxl: Convert to v2
fd5847123f boards: arm: beagleconnect_freedom: Convert to v2
76ba9a0587 boards: arm: cc1352p1_launchxl: Convert to v2
719baa8850 boards: arm: cc1352r1_launchxl: Convert to v2
5060a61ae1 boards: arm: cc1352r_sensortag: Convert to v2
99584be1c5 boards: arm: cc26x2r1_launchxl: Convert to v2
2dc8933942 soc: ti_simplelink: Port to HWMv2
a5b004663b scripts/utils/board_v1_to_v2.py: couple of fixes
77c2c333e5 boards: move 96b_stm32_sensor_mez to 96boards
c14ff98650 boards: stm32f411e_disco: delete obsolete file
bcdc268ccf boards: Convert stm32mp157c_dk2 to HWM v2
0c8ba92e1f boards: Convert 96b_avenger96 to HWM v2
b54fe33077 soc: v2: stm32: Migrate STM32MP1 series
2ba3639b2a boards: Convert nucleo_c031c6 to HWM v2
dbc5ed79f5 soc: st: stm32: Migrate STM32C0 series
ce6d493aa3 boards: Convert stm32l1_disco to HWM v2
a28086a9ca boards: Convert nucleo_l152re to HWM v2
1b2a511d06 boards: Convert 96b_wistrio to HWM v2
ce281f09ab soc: v2: stm32: Migrate STM32L1 series
cdb5364fd7 boards: Convert stm32f769i_disco to HWM v2
768f173dcb boards: Convert stm32f7508_dk to HWM v2
21bbbbd9cb boards: Convert stm32f746g_disco to HWM v2
bab4265693 boards: Convert stm32f723e_disco to HWM v2
58f8fe82ba boards: Convert nucleo_f767zi to HWM v2
37e9084070 boards: Convert nucleo_f756zg to HWM v2
d467e7053a boards: Convert nucleo_f746zg to HWM v2
5f2808d7cc boards: Convert nucleo_f722ze to HWM v2
bbb73e7550 soc: st: Migrate stm32f7 series to new hw model
e9094afc4d soc: st: stm32: stm32f4: change SOC_STM32F405XG to
           SOC_STM32F405XX
a1712cdd53 boards: Convert stm32f4_disco to HWM v2
5be404b365 boards: Convert stm32f469i_disco to HWM v2
baaa697ab2 boards: Convert stm32f429i_disc1 to HWM v2
69ecab3c90 boards: Convert stm32f412g_disco to HWM v2
2a572e3fb0 boards: Convert stm32f411e_disco to HWM v2
ecfbf42757 boards: Convert stm32f401_mini to HWM v2
e0191d03bb boards: Convert steval_fcu001v1 to HWM v2
4454648976 boards: Convert segger_trb_stm32f407 to HWM v2
f0ad6ee6b8 boards: Convert olimex_stm32_p405 to HWM v2
1f5e228ec8 boards: Convert olimex_stm32_h407 to HWM v2
834bdb615e boards: Convert olimex_stm32_h405 to HWM v2
8f27fa8de2 boards: Convert olimex_stm32_e407 to HWM v2
f8633a9038 boards: Convert nucleo_f446ze to HWM v2
07e0bd2c07 boards: Convert nucleo_f446re to HWM v2
24d7f625dc boards: Convert nucleo_f429zi to HWM v2
157a8cde53 boards: Convert nucleo_f413zh to HWM v2
4ec99c31b0 boards: Convert nucleo_f412zg to HWM v2
a21546140a boards: Convert nucleo_f411re to HWM v2
43f01ab6de boards: Convert nucleo_f410rb to HWM v2
60c16bcb8b boards: Convert nucleo_f401re to HWM v2
2db228d730 boards: Convert mikroe_mini_m4_for_stm32 to HWM v2
73fc26225c boards: Convert mikroe_clicker_2 to HWM v2
6b62d90114 boards: Convert google_dragonclaw to HWM v2
fa845af309 boards: Convert blackpill_f411ce to HWM v2
5c8c3c3be0 boards: Convert blackpill_f401ce to HWM v2
3c02db1290 boards: Convert blackpill_f401cc to HWM v2
7eeb723cb7 boards: Convert black_f407zg_pro to HWM v2
4f9461d068 boards: Convert black_f407ve to HWM v2
a821de8532 boards: Convert az3166_iotdevkit to HWM v2
ba580c7236 boards: Convert adi_sdp_k1 to HWM v2
eb272ddf19 boards: Convert adafruit_feather_stm32f405 to HWM v2
58ed121c3a boards: Convert 96b_stm32_sensor_mez to HWM v2
b0d70959d3 boards: Convert 96b_neonkey to HWM v2
b1088baadc boards: Convert 96b_carbon to HWM v2
18d867b0a9 boards: Convert 96b_argonkey to HWM v2
ee6ede7119 boards: Convert 96b_aerocore2 to HWM v2
b48e70ead9 soc: v2: stm32: Migrate STM32F4 series
14d2b955da cmake: convert path to CMake style before writing Kconfig
           files
9c4ac6a202 boards: posix: bsim: Update paths
14b57f56d7 tests: drivers: gpio: gpio_ite_it8xxx2_v2: Temp fix
f3b173be18 scripts: board_v1_to_v2: Update following move to
           boards_legacy
05b50f6691 cmake: CMake soc dir variable improvements for HWMv2
a188e01a12 hwmv2: move all ported boards and socs to their final
           location
22c53e97b5 hwmv2: move all non-ported legacy boards and socs to
           legacy folders
53f3b181b0 soc: ti_k3: Port to HWMv2
9f19a2075a soc: rk3568: Port to HWMv2
b8928b1628 soc: rk3399: Port to HWMv2
cda3a74868 boards: arm64: qemu_kvm_arm64: Convert to v2
70d704bd20 soc: x86: atom: move and convert to HWMv2
4789e1068e boards: x86: intel_rpl: move and convert raptor_lake
           boards to HWMv2
384307e3dc soc: x86: raptor_lake: move and convert to HWMv2
ed025df674 boards: x86: intel_ehl: move and convert elkhart_lake
           boards to HWMv2
994b6e1731 soc: x86: elkhart_lake: move and convert to HWMv2
73b30a04cf boards: x86: up_squared_pro_7000: move and convert to
           HWMv2
83b133c207 boards: x86: intel_adl: move and convert alder_lake
           boards to HWMv2
847a12f1e4 soc: alder_lake: move and convert to HWMv2
67f4c8d2a1 samples: up_squared: adjust gpio_counter to HWMv2
5326b5bfc0 boards: x86: up_squared: move and convert to HWMv2
cfd5e691b4 soc: apollo_lake: move and convert to HWMv2
ac9c235741 boards: xtensa: qemu_xtensa: Convert to v2
f198c3a761 ci: update to osource for soc/Kconfig.defconfig files
e438e6cad4 ci: add SOC_SERIES_ as false positive in
           check_compliance.py
95e34da7c1 soc: v2: Convert st_stm32 to st/stm32
313717df76 soc: mps3: Fix missing family
392c3969ed boards: arm: am62x_m4: Convert to v2
8f245d764d tests: Update board names for hwmv2
8f71bb7b4f boards: arm64: khadas_edgev: Convert to v2
e27d23aad0 soc: rk3399: Port to HWMv2
80823b860e boards: arm64: roc_rk3568_pc: Convert to v2
72e4483dec soc: rk3568: Port to HWMv2
bed94669e3 boards: arm64: phycore_am62x_a53: Convert to v2
c01af5a7b8 soc: ti_k3: Port to HWMv2
1e563b4ca3 boards: arm64: xenvm: Convert to v2
76e484adae soc: xenvm: Port to HWMv2
34412f7fe2 boards: arm64: rpi_4b: Convert to v2
9be50e2ca9 soc: bcm2711: Port to HWMv2
bbbed12c2f boards: arm64: qemu_kvm_arm64: Convert to v2
4f5ec7ff8f soc: qemu_virt_arm64: Port to HWMv2
d8d1b9f200 boards: arm64: qemu_cortex_a53: Convert to v2
30bd34b31e soc: qemu_cortex_a53: Port to HWMv2
c20d0dcbb6 boards: arm64: fvp_baser_aemv8r: Convert to v2
02ed6af463 boards: arm64: fvp_base_revc_2xaemv8a: Convert to v2
1b175003a4 soc: fvp_aemv8*: Port to HWMv2
de231b911d boards: v2: Clean up obsolete comments
aa9597f6d9 boards: Convert waveshare_open103z to HWM v2
9644828c81 boards: Convert stm32vl_disco to HWM v2
86ab2bd430 boards: Convert stm32_min_dev to HWM v2
d88d3ddcc4 boards: Convert stm32f103_mini to HWM v2
0ccc0204e1 boards: Convert stm3210c_eval to HWM v2
dd9972d782 boards: Convert olimex_stm32_h103 to HWM v2
a2c2e1406d boards: Convert olimexino_stm32 to HWM v2
2d9c62e118 boards: Convert nucleo_f103rb to HWM v2
e8ba99dc59 soc: v2: stm32: Migrate STM32F1 series
9a93916604 tests: Update board names for hwmv2
9c4d94844d boards: arm: bcm958401m2: Convert to v2
feaf4ffba1 boards: arm: bcm958402m2: Convert to v2
87f0827121 soc: bcm_vk: Port to HWMv2
4526be24a5 boards: arm: quick_feather: Convert to v2
cd921d2b97 boards: arm: qomu: Convert to v2
b3c04051fc soc: quicklogic_eos_s3: Port to HWMv2
a73a9e7533 boards: v2: Clean up obsolete comments
8d87bcc167 boards: Convert stm32f0_disco to HWM v2
1933585785 boards: Convert stm32f072_eval to HWM v2
6f9fe5429d boards: Convert stm32f072b_disco to HWM v2
9dc78e4025 boards: Convert stm32f030_demo to HWM v2
35113e8923 boards: Convert nucleo_f091rc to HWM v2
b276aee9a4 boards: Convert nucleo_f070rb to HWM v2
795f8d611b boards: Convert nucleo_f042k6 to HWM v2
2d82646443 boards: Convert nucleo_f031k6 to HWM v2
959786f12d boards: Convert nucleo_f030r8 to HWM v2
81670db2e9 boards: Convert legend to HWM v2
8980430aad boards: Convert google_kukui to HWM v2
ac020f66e0 dts: stm32f0: fix few warnings
5140e4551a boards: v2: doc: Add vendors
77d640e0c9 soc: v2: stm32: Migrate STM32F0 series
0131e1c159 soc: v2: Add st_stm32 structure and common folder
36b63787a7 boards: v2: Add documentation index for converted boards
ae02fc5047 boards: sparc: qemu_leon3: Convert to v2
f38f7bb223 boards: sparc: gr716a: Convert to v2
d3cca3580e soc: gr716a: Port to HWMv2
6a8a0c1647 boards: sparc: generic_leon3: Convert to v2
faf22185ce soc: leon3: Port to HWMv2
e94762ecdc tests: Update board names for hwmv2
9afcc27e05 boards: xtensa: qemu_xtensa: Convert to v2
3e4a17018f soc: dc233c: Port to HWMv2
9188fdcd78 boards: xtensa: xt-sim: Convert to v2
fcaa41cb5d soc: xtensa_sample_controller: Port to HWMv2
dbc413f7f7 scripts: board_v1_to_v2: Fix CONFIG_SOC_SERIES_ exclusion
6be3d4bc80 kconfig: remove Kconfig BOARD_RPI_PICO_W safe guard.
f4442fa698 boards: v2: Add documentation index for converted boards
ec5fbd67f7 boards: nios2: qemu_nios2: Convert to v2
d3ef220460 soc: nios2-qemu: Port to HWMv2
a223f284b5 boards: nios2: altera_max10: Convert to v2
c381edcb73 soc: nios2f-zephyr: Port to HWMv2
97401c7d2a boards: mips: qemu_malta: Convert to v2
e7a3243a24 soc: qemu_malta: Port to HWMv2
bec82c690d boards: v2: Add documentation index for converted boards
94f6f9b636 boards: arm: w5500_evb_pico: Convert to v2
209235ab6e boards: arm: sparkfun_pro_micro_rp2040: Convert to v2
e5b1885907 boards: arm: adafruit_qt_py_rp2040: Convert to v2
4c750818f9 boards: arm: adafruit_kb2040: Convert to v2
8d3896caa4 boards: arm: rpi_pico: Convert to v2
42cff42c42 soc: rpi_pico: Port to HWMv2
c2df4ca9cb scripts: improve yaml schema and board.yml validation for
           revisions
3970f90f71 cmake: clear BOARD_CACHE when invalid board identifier is
           given
3a70ee9ccd cmake: improve board revision handling
3cda715fae scripts: board_v1_to_v2: Don't add select
           CONFIG_SOC_SERIES_FOO
dc56a543f3 scripts: board_v1_to_v2: Add License + copyright
87147f88c4 cmake: prefer cache BOARD_IDENTIFIER over extracting from
           BOARD
65f5dc5b8c cmake: fail when board identifier is applied in legacy hw
           model
7db2b6efd8 cmake: cache BOARD_IDENTIFIER to preserve it between
           CMake invocations
85dddac5a2 scripts: using extend in list_boards for variant list
6ae5c4e7fd scripts: utils: add board v1->v2 conversion utility
ef834a12d0 maintainers: update Renesas RZT2M path
3ab7830625 boards: renesas: add documentation entry
a0c2ca0491 boards: arm: add documentation entry
27ff3654b7 boards: gigadevice: add documentation entry
6e02f43c0a maintainers: update GD32 paths
1bfcf1d974 boards: gd32l233r_eval: convert to HWMv2
6e621ee43f boards: gd32f470i_eval: convert to HWMv2
219b149768 boards: gd32f450z_eval: convert to HWMv2
91c52b0d39 boards: gd32f450v_start: convert to HWMv2
f0e0a973f6 boards: gd32f407v_start: convert to HWMv2
6f592b64c9 boards: gd32f403z_eval: convert to HWMv2
4bcb4b2ac8 boards: gd32f350r_eval: convert to HWMv2
fdc7ed6eb0 boards: gd32e507z_eval: convert to HWMv2
770376250d boards: gd32e507v_start: convert to HWMv2
a6d8b92e86 boards: gd32e103v_eval: convert to HWMv2
a5f8e5daa1 boards: gd32a503v_eval: convert to HWMv2
5ee799cc5f boards: gd32f450i_eval: convert to HWMv2
8aa8ce4ac8 soc: gigadevice: port to HWMv2
4e203c14c7 cmake: enhanced board entry file handling
312265ee04 scripts: make SoC field mandatory in board.yml
c12ae3bcbc boards: update Renesas rzt2m board.yml to contain SoC
           information
c5321c1dbe cmake: make SoC optional for boards containing a single
           SoC
bcc06c60ae scripts: support SoC list output for boards
db9e46010c twister: update testcase.yaml and sample.yaml to
           mps3/an547 identifier
a988adee7d boards: update arm mps3 an547 board to HWMv2 scheme
7dc2c9db0c soc: use HWMv2 for arm mps3 SoC
c506675b7c boards: update Renesas Starter Kit+ for RZ/T2M board to
           HWMv2 scheme
3abb792073 soc: use HWMv2 for renesas_rzt2m SoC
4f52bc646e cmake: support hw model v2 in arch/Kconfig tree
a712b5005b scripts: extend kconfig compliance to verify board / SoC
           scheme v2
baa55141a1 twister: update twister testplan.py to handle HWMv2
           boards
1f026f70eb boards: extend list_boards.py and update boards CMake
           module
bd854a3af8 cmake: introduce arch and soc cmake modules for hw model
           v2
c9edefa8fd arch: add existing archs to archs.yml for HWMv2 support
61bbfb5ba2 scripts: introduce list_hardware.py for listing of
           architectures and SoCs
a4d1980c35 build: board/ soc: introduce hw model v2 scheme

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Signed-off-by: David Leach <david.leach@nxp.com>
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-02 16:56:33 -05:00
Emil Gydesen
9553347080 Bluetooth: ISO: Add CONFIG_BT_ISO_{RX/TX}
Add 2 new Kconfig promptless options that are shorthand
for whether the ISO configuration can support RX and TX.

This also applies these new options as guards for existing
and missing code pieces.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-02 15:05:39 +01:00
Emil Gydesen
248bee9b17 Bluetooth: BAP: Broadcast Source: Remove unused variable
Remove an unused variable in bt_bap_broadcast_source_reconfig
that causes compiler warnings.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-01 16:04:19 +01:00
Emil Gydesen
8a6c1d9bfa Bluetooth: BAP: Broadcast source: Add LTV validation for LC3 data
When using the LC3 codec, all codec configuration are LTV encoded.
The broadcast source did not properly validate this, and it also
uncovered a bug in the bsim test for broadcast sources.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-01 16:04:19 +01:00
Emil Gydesen
e08301b3df Bluetooth: BAP: Fix missing cfg data in stream->codec_cfg for BIS
The codec configuration data from the BIS in the BASE was not
properly copied to the stream->codec_cfg, and thus it only
contained the subgroup codec configuration values.

This commit fixes that by first copying the subgroup codec
configuration to the stream, and then setting or overwriting
any fields (if they exist).

This requires that each stream have their own codec configuration
struct allocated, so this will slightly increase memory usage.

This also adds verification of the SDU size from the BIGInfo
in the ISO receive callback.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-01 16:04:19 +01:00
Mads Winther-Jensen
7310a42f92 Blutooth: controller: Implement ISO test mode for sync receiver
* Implement LL/IST/SNC/BV-01-C ISO Test Receive
* Refactor data structure for common code between CIS and BIS

Signed-off-by: Mads Winther-Jensen <mdwt@demant.com>
2024-03-01 15:29:36 +01:00
Lyle Zhu
b7b5cf4053 Bluetooth: Host: SDP: Fix endianness issue of tid
The transfer byte order of SDP is big-endian.

The transaction ID(tid) should be big-endian before
sending.

And tid needs to be converted to CPU byte order
after receiving.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-29 11:53:35 +00:00
Emil Gydesen
9d90e65167 Bluetooth: BAP: Shell: Add bcode support for cmd_sync_broadcast
The cmd_sync_broadcast command now also takes an optional broadcast
code, to support syncing with encrypted broadcasts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-28 18:02:27 +00:00
Vinayak Kariappa Chettimada
7bd2804c24 Bluetooth: Controller: Build vendor LLL as library
Build vendor LLL as separate library so that independent
compiler flags can be supplied if required.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-27 16:27:55 -06:00
Aleksander Wasaznik
3eeb8f8d18 Bluetooth: Check buffer length in GATT rsp functions
Add length checks local to the parsing function. This removes the need
for a separate data validation step.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-02-27 17:57:04 +01:00
Piotr Narajowski
43d830082c bluetooth: CSIP: Add API to get service handles
This is needed for upper tester.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2024-02-27 14:55:18 +01:00
Emil Gydesen
689e3216fc Bluetooth: BAP: Add bt_bap_base_subgroup_get_bis_indexes
Add bt_bap_base_subgroup_get_bis_indexes that gets the BIS indexes
of a subgroup. This work very similar to
bt_bap_base_get_bis_indexes, except that it works for subgroups
rather than BASEs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-27 14:46:33 +01:00
Herman Berget
9135de7a66 Bluetooth: hci: Add hw variant definitions for nrf54H/L
Assign new numbers for new soc series and update string
conversion function.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2024-02-27 14:43:07 +01:00
Pavel Vasilyev
4c9ee14572 Bluetooth: Mesh: Allow to suspend mesh from bt_mesh_send_cb callbacks
This commit allows to suspend the mesh stack from `bt_mesh_send_cb`
callbacks by removing the deadlock caused by `k_work_flush` in the
extended advertiser.

In case of the extended advertiser there are 2 cases:
- when the `bt_mesh_adv_disable` is called from any of `bt_mesh_send_cb`
  callbacks which are called from the advertiser work item, or
- when it is called from any other context.

When it is called from `bt_mesh_send_cb` callbacks, since these
callbacks are called from the delayable work which is running on the
system workqueue, the advertiser can check the current context and its
work state. If the function is called from the advertiser work, it can
disable the advertising set straight away because all ble host APIs have
already been called in `adv_start` function. Before sending anything
else, the advertiser checks the `instance` value in `adv_start`
function, which is also reset to NULL in `bt_mesh_adv_disable` call, and
aborts all next advertisements. The `ADV_FLAG_SUSPENDING` tells the
advertiser work to abort processing while `bt_mesh_adv_disable` function
didn't finish stopping advertising set. This can happen if the work has
been already scheduled and the schedler ran it while sleeping inside
the `bt_le_ext_adv_stop` or `bt_le_ext_adv_disable` functions.

When `bt_mesh_adv_disable` is called from any other context or from the
system workqueue but not from the advertiser work, then `k_work_flush`
can be called safely as it won't cause any deadlocks.

The `adv_sent` function is inside the `bt_mesh_adv_disable` function to
schedule the advertiser work (`send_pending_adv`) and abort all pending
advertisements that have been already added to the pool.

In case of the legacy advertiser, if the `bt_mesh_adv_disable` is called
form the advertiser thread (this happens when it is called from
`bt_mesh_send_cb.start` or `bt_mesh_send_cb.end` callbacks), then
`k_thread_join` returns `-EDEADLK`. But the `enabled` flag is set to
false and the thread will abort the current advertisement and the
pending advertisements.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-26 14:34:58 +01:00
Emil Gydesen
4298b0a267 Bluetooth: BAP: Shell: BA fix add_pa_sync command
The command would attempt to parse the BASE and enter the
subgroup information in a NULL pointer.

The BASE copy was also done incorrectly, as it did not
properly take the UUID into account (which should be
moved to a helper function if we expect users to do this).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 11:54:56 +00:00
Emil Gydesen
849dbf40d9 Bluetooth: ISO: Replace UNICAST | BROADCAST with CONN_TX
Replaced checks for
CONFIG_BT_ISO_UNICAST || CONFIG_BT_ISO_BROADCASTER with
CONFIG_BT_CONN_TX, as they are effectively the same.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 11:52:37 +00:00
Emil Gydesen
f4c8020d45 Bluetooth: BAP: Shell: Minor refactor of LC3 encoder
This commit renames a few variables and changes the
type and adds some additional checks.

It moves stream specific data to the shell stream
struct, but still keeps the global values that were used
to initialize the LC3 encoder

The purpose of this is to better allow for a future LC3 decoder
without any clashes in names or the like.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 11:40:50 +00:00
Kyra Lengfeld
83926830cf Bluetooth: Controller: Add nRF54x Tx Power Kconfig
This commit adds tx power config options for nRF54Hx and nrf54Lx
SoCs, as well as the new radio defines.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2024-02-26 11:40:29 +00:00
Agata Figiel
4302cd1e4d Bluetooth: TMAP: Move role definitions from shell/tmap.c to tmap.h
These role definition are also used in bttester, so it could be globally
available.

Signed-off-by: Agata Figiel <agata.figiel@codecoup.pl>
2024-02-26 11:39:41 +00:00
Emil Gydesen
a7ca6e5c17 Bluetooth: Audio: Shell: Add support for setting runtime config data
Using the `bap preset` command it is now possible to set all the
codec configuration data and metadata value at runtime. This will
allow to set specific values for each stream in each direction.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 11:39:13 +00:00
Emil Gydesen
bfe93a3164 Bluetooth: Audio: Shell: Make the default presets non-pointers
Instead of the default presets being pointers, they are changed to
allocated structs so that they can be modified.

This will allow us to modify the config and metadata in a later patch.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 11:39:13 +00:00
Pavel Vasilyev
c601c15863 Bluetooth: Mesh: Remove extra rescheduling and ADV_FLAG_SCHEDULED in adv
This commit removes extra rescheduling in the extended advertiser after
the last advertising has been finished. This commit also removes the
`ADV_FLAG_SCHEDULED` flag as not needed anymore.

This extra rescheduling and the flag were needed to delay the next
advertisement by 20ms. Now, when the delay is removed the advertiser can
pick the next advertisement from the pool and push to the host right
away.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-26 11:37:00 +00:00
Aleksander Wasaznik
433833d9ef Bluetooth: Support BT_RECV_WORKQ_BT with Zephyr LL
This patch allows selecting the combination of `CONFIG_BT_RECV_WORKQ_BT`
and `BT_LL_SW_SPLIT`. The implementation of `bt_recv_prio` is copied
from `hci_raw.c`. This ensures the order of packets is the same as when
the controller's `hci_driver.c` is off-chip and sends HCI over UART.

Without this patch, the Zephyr LL driver will duplicate some events on
behalf of `hci_core`. This duplication is not wanted when
`CONFIG_BT_RECV_WORKQ_BT=y`.

The above mentioned duplication is not sound and is evidenced in logged
warnings, e.g. in `tests/bsim/bluetooth/host/l2cap/stress` with
`CONFIG_BT_RECV_WORKQ_BT=y` logging "no transition".

This patch is a step towards the deprecation of
`CONFIG_BT_RECV_BLOCKING`. `CONFIG_BT_RECV_BLOCKING` is complicated and
tightly coupled to `hci_core`. In the future, removing
`CONFIG_BT_RECV_BLOCKING` will give a cleaner separation between
`hci_core` and the drivers and allow `hci_core` to evolve without
changes spilling out into the drivers.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-02-26 11:36:48 +00:00
Aleksander Wasaznik
dd7caf667c Bluetooth: Host: Set conn->err in prio
The goal is to not access `buf` in the non-prio `hci_disconn_complete`
so that the buffer does not need to be retained.

This commit moves the copy of `conn->err` to the prio handler.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-02-26 11:35:50 +00:00
Vinayak Kariappa Chettimada
f36ddf0423 Bluetooth: Controller: Fix BT_CTLR_TIFS_HW conditional compile
Fix CONFIG_BT_CTLR_TIFS_HW conditional compile by replacing
DPPI_PRESENT with CONFIG_BT_CTLR_TIFS_HW.

HAL_SW_SWITCH_TIMER_CLEAR_PPI can be same as
HAL_RADIO_END_TIME_CAPTURE_PPI, and this is ok as same
bit will be used to disable PPI/DPPI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-26 11:35:39 +00:00
Jonathan Rico
d79b99a979 Bluetooth: conn: call tx_notify from a single exec context
Always execute tx_notify from a single context. For sanity and ease of
debugging / observability.

The previous behavior was calling from BT_RX thread + system workqueue.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-02-26 11:34:49 +00:00
Lyle Zhu
e9a5834944 Bluetooth: Host: Update BR L2CAP channel state
In the function bt_l2cap_chan_set_state, BR
channel is treated as LE Chan.
The BR L2CAP channel state is updated
incorrectly.

Add a function bt_l2cap_br_chan_set_state
for BR L2CAP channel. For BR/EDR channel,
call bt_l2cap_br_chan_set_state directly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-26 11:33:40 +00:00
Lyle Zhu
08f8278666 Bluetooth: Host: Add bt_l2cap_br_chan_del
Add bt_l2cap_br_chan_del for BR/EDR channel.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-26 11:33:40 +00:00
Lyle Zhu
47d0280834 Bluetooth: Host: Add bt_l2cap_br_disconnected
Handle BR/EDR L2CAP disconnection notification
separately.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-26 11:33:40 +00:00
Emil Gydesen
5f7ecf4def Bluetooth: BAP: SD: Fix missing support for API calls in callbacks
In the scan delegator when adding a source, the state was not
marked as active before calling the PA sync callback, which
would prevent applications from requesting PAST in that callback.

This commit also adds and fixes a few log statements.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 12:31:11 +01:00
Lyle Zhu
f5cab9debc Bluetooth: Host: Clang-format host/br.c
Clang-format file host/br.c

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-26 11:50:55 +01:00
Lyle Zhu
b938428d58 Bluetooth: Host: Notify upper layer if the BR ACL is established
In current implementation, the upper is not notified when BR ACL
connection is established.
L2CAP does not know that ACL connection has been established.
All fixed channels will not be notified. Then The SDP server
cannot work properly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-26 11:50:55 +01:00
Emil Gydesen
28276ce982 Bluetooth: CSIP: Fix typo from cm_csip to cmd_csip
The CSIP commands had a typo in the prefix of the shell
functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:28:26 -05:00
Emil Gydesen
25416b86e9 Bluetooth: CSIP: remove print_sirk
The print_sirk function that simply logs the SIRK has been removed,
as the SIRK is now directly accessible to the application via the
get_sirk function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:28:26 -05:00
Emil Gydesen
41a589c5fa Bluetooth: CSIP: Add support for dynamic SIRKs
Add support for dynamically change the SIRK in a CSIS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:28:26 -05:00
Emil Gydesen
e0dbd3fd39 Bluetooth: Audio: Shell: CAP change volume mute command
Adds the change volume mute command to the CAP commander shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:25:26 -05:00
Emil Gydesen
b9360488f7 Bluetooth: CAP: Commander change volume mute procedure
Adds the CAP Commander Change Volume mute procedure.
This procedure changes the volume mute on one or more
CAP Acceptors.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-25 22:25:26 -05:00
Pavel Vasilyev
e30b7a84bc Bluetooth: Mesh: Enable CDP1 by default
CDP1 is mandatory to qualify a mesh device for mesh protocol v1.1.
The dependency on BT_MESH_MODEL_EXTENSIONS is removed because if a node
contains only base models (for example Generic OnOff Server), this API
will consume extra RAM bytes which won't be used.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-25 20:54:11 -05:00
Emil Gydesen
d9ff7eb0ed Bluetooth: GATT: Add missing LESC_MASK for encrypt check
The LE Secure connection (LESC) mask also require encryption,
and some users have been using e.g. BT_GATT_PERM_READ_LESC
without BT_GATT_PERM_READ_ENCRYPT, and then the encryption
check in bt_gatt_check_perm was never properly applied.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-19 20:46:28 +01:00
Emil Gydesen
baaa149f10 Bluetooth: BAP: Fix bad bcast assistant bis sync shift
The shift is currently necessary due to a mismatch of the
specs and the API, but the shift should not be done when
the value is BT_BAP_BIS_SYNC_NO_PREF as that is a special value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-16 19:14:27 +01:00
Emil Gydesen
acd1e891cb Bluetooth: BAP: UC: Fix call to bt_gatt_get_mtu in notify
In the unicast_client_ep_notify we would always call
bt_gatt_get_mtu, regardless of whether data == NULL.

When there is a disconnection, the notify callbacks are
called with data == NULL to indicate a unsubscription.
In the case of the unicast client, this would also trigger
calls to bt_gatt_get_mtu when there is a disconnect, which
in turn would trigger a warning that ATT is not connected.

Postponing the call to bt_gatt_get_mtu fixes this.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-16 19:13:48 +01:00
Aleksander Wasaznik
7471ea87ee Bluetooth: Remove len param of bt_att_create_rsp_pdu
This served no purpose for responces. The minimum MTU is sufficient for
all ATT headers.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-02-16 12:58:00 +01:00
Aleksander Wasaznik
98409830a2 Bluetooth: Correct bt_att_create_rsp_pdu reservation when EATT is enabled
When EATT is enabled, bt_att_create_rsp_pdu used to reserve headroom for
the SDU header even when responding on the UATT bearer.

That subtracted from the room for the ATT payload in the buffers. The
remaining buffer size was insufficient to create a PDU of ATT MTU size,
since the exchanged local MTU is calculated the with the assumption that
the SDU header is not present.

This broke the ATT MTU promise, and e.g. our read response will have two
bytes fewer than promised. This caused a failure in PTS.

The new bt_att_create_rsp_pdu pays attention to the bearer type and only
allocates the SDU header on EATT bearers.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-02-16 12:58:00 +01:00
Emil Gydesen
8ad8878d61 Bluetooth: CAP: Shell: Fix argument issue for unicast_stop
The unicast_stop command takes either "all" or one or more
stream pointers as argument, but the argument handler did
not allow this.

The documentation for the command was also out of date.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-14 19:12:04 +01:00
Emil Gydesen
dee95eb768 Bluetooth: Audio: Shell: Fix context for the audio shell
The context had a bug where if GMAP was enabled, the context
was only BT_AUDIO_CONTEXT_TYPE_GAME.

The context should also (per BAP spec requirement) contain the
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED context.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-14 19:11:55 +01:00
Vinayak Kariappa Chettimada
7d6ca26c4c Bluetooth: Controller: Fix lll ISO stream get by group
Fix LLL ISO stream get by group to return stream context
sorted by CIS offset in ascending order.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-14 19:11:46 +01:00
Ping Wang
5ccd75b49b Bluetooth: Audio: define bt_bap_bass_subgroup struct.
The Broadcast Assistant API should be fully independent of the scan
delegator. Therefore the new struct bt_bap_bass_subgroup has been
defined to avoid a dependency.

Fixes: #68338

Signed-off-by: Ping Wang <pinw@demant.com>
2024-02-14 19:04:01 +01:00
Emil Gydesen
9ec754d9e6 Bluetooth: Host: Add ISO tx check for LOG_WRN in le_init_iso
The warning should only apply for configurations where the
device may actually send ISO data (e.g. not the ISO sync receiver).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-14 08:25:10 +01:00
Emil Gydesen
3e634268d6 Bluetooth: ISO: Introduce bt_iso_chan_send_ts
The bt_iso_chan_send function could take an optional
timestamp by using 0 as an indicator. The issue with
this approach was that a timestamp value of 0 is valid,
and could cause potential issue with syncing streams
in a group.

To fully support transmitting with and without timestamp,
bt_iso_chan_send_ts has been introduced, which is the only
function of the two (bt_iso_chan_send being the other) that
supports timestamps.

A new function, rather than adding a boolean to the existing,
was chosen as it simplifies the individual functions as well
as making it more explicit what the function does.

Since the bt_iso_chan_send function is used by LE audio, both
the BAP and CAP send functions have similarly been updated.
Likewise, all tests and samples have been updated to use the
updated function(s), and BT_ISO_TIMESTAMP_NONE has been
removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-12 13:13:10 +01:00
Emil Gydesen
de296a2d7f Bluetooth: BAP: Fix BASE_SUBGROUP_MAX_COUNT value
The calculation for BASE_SUBGROUP_MAX_COUNT was off by one.
The macro did not consider the non-subgroup parameters of
the BASE that take up space. This effectively modifies
BASE_SUBGROUP_MAX_COUNT to be 24 instead of 25.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-10 16:34:27 +01:00
Pavel Vasilyev
0ea8cef97a Bluetooth: Mesh: Disable randomization on Link Close in RPR server
Disable randomization at the access layer in the Remote Provisioning
server when sending Link Stauts message as a responce on Link Close
message and then sending Link Report message right after it. Because of
the randomization, the report message is sent before the status message
which makes MESH/SR/RPR/PDU/BV-03-C test to fail.

This fixes MESH/SR/RPR/PDU/BV-03-C test.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-09 16:29:12 -06:00
Pavel Vasilyev
44f86b81a3 Bluetooth: Mesh: Disable randomization in DFD model for canceling update
Disable randomization in the access layer when cancelling update in the
distribution server model. This is needed because the server sends 2
messages in a row and the gets reordered by the access layer
randomization feature making DFU/SR/FD/BV-43-C test to fail.

This fixes DFU/SR/FD/BV-43-C test.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-09 16:29:12 -06:00
Jonathan Rico
a066921745 Bluetooth: conn: document obfuscated function: send_buf()
It is unclear from a cursory glance at the code what the caller of
`send_buf(buf)` should do with `buf` based on the returned error codes.

Document when ownership is and isn't transferred to `send_buf()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-02-09 16:27:50 -06:00
Jonathan Rico
18c3571145 Bluetooth: conn: check for disconnected earlier when sending
Verify the connection is active before popping the buffer from the TX
queue.

The current behavior enables a race condition between `create_frag` and
the connection being torn down, as `buf` can be popped from the TX queue
but not destroyed by `bt_conn_process_tx`.

In that case, `buf` will be leaked.

Original analysis and fix proposal by @watsug.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Reported-by: Adam Augustyn<watsug@gmail.com>
2024-02-09 16:27:50 -06:00
Emil Gydesen
7cfc8b3340 Bluetooth: BAP: Reset _prev_seq_num on ISO connection
Once an ISO channel has connected, the sequence number
always starts at 0. This reset was missing in the implementation,
and the _prev_seq_num from a previous connection may have
been kept.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-09 14:39:40 +01:00
Thomas Ebert Hansen
b15452bd08 Bluetooth: controller: Fix Data Length Update
Before a LL_FEATURE_REQ is sent, verify that the Data Length Update
procedure is still supported as it could have been unmasked as the result
of a previously completed Feature Exchange procedure.

Add unit test to verify the case of enqueuing both a
Feature Exchange procedure and Data Length Update procedure, where the
Feature Exchange procedure would result in the unmasking of the Data
Length Update procedure.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2024-02-09 13:46:41 +01:00
Thomas Ebert Hansen
8c412971a9 Bluetooth: controller: Fix PHY Update TX Q
Resume the TX Data Q when a LL_UNKNOWN_RSP is recieved instead of a
LL_PHY_RSP.

Update PHY Update unit test with more coverage of the TX Data Q pause
state.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2024-02-09 13:46:41 +01:00
Alexander Svensen
199487be54 Bluetooth: Host: Send status for terminated directed adv
- Fix bug where status was only sent for legacy adv

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2024-02-08 10:11:34 +00:00
Pavel Vasilyev
9171ee24da Bluetooth: Mesh: Warn if trying to send adv while suspended
This will warn if any of the mesh module will try to send anything while
the stack is suspended. Not clear what to do here as both advertisers
(legacy and ext) behaves differently. The legacy advertiser has a
thread which is stopped after the `bt_mesh_adv_disable` call and any
sent advs after suspending the stack will stay in the pool until the
advertiser is resumed. The extended advertiser will schedule its work,
but then fail because `ext_adv->instance` value is NULL, but will call
`bt_mesh_send_cb.start` with error `-ENODEV`. What to do with these 2
behaviors is unclear at the moment. Ideally none of the mesh stack
modules should call `bt_mesh_adv_send` after the stack was suspended, so
if this warning appears, the faulty module wasn't stopped properly and
this should be fixed. If not to add the adv to the pool, then it kind
of gets lost as the implementation probably expects one
of `bt_mesh_send_cb` callbacks which will never be called. Leaving the
warning until clear customer request comes.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-08 10:11:19 +00:00
Ivan Iushkov
a3cbf8e2ac Bluetooth: fixing null-pointer dereference in l2cap channel destroyer
During local testing with UBSAN enabled, warning was reported:
bluetooth/host/l2cap.c:980:25: runtime error: member access
within null pointer of type 'struct k_work_q'

It turned out that le_chan->rtx_work.queue can be NULL.
Since null-pointer dereference is a UB, additional check
was added to ensure we don't access
`le_chan->rtx_work.queue->thread` when
`le_chan->rtx_work.queue == NULL`

The same changes applied to l2cap_br.c

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-02-08 09:48:02 +00:00
Ivan Iushkov
e8d090011b Bluetooth: fixing UBSAN warnings related to Codec Configuration
During local testing with UBSAN enabled, warning was reported:
bluetooth/host/iso.c:237:2: runtime error: null pointer passed
as argument 2, which is declared to never be null

It turned out that when datapath doesn't contain
codec information, cc_len is 0 and cc is NULL

In order to avoid UB,
now we call memcpy only when cp->codec_config_len > 0

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-02-08 09:48:02 +00:00
Ivan Iushkov
b1e9f86378 Bluetooth: Fixing UBSAN warning in CTE field parsing in adv.c/scan.c
during local testling, UBSAN reported the following warnings:
- bluetooth/host/adv.c:2067:19: runtime error: shift exponent
255 is too large for 32-bit type 'long unsigned int'
- bluetooth/host/scan.c:828:18: runtime error: shift exponent
255 is too large for 32-bit type 'long unsigned int'

It turned out that we can't use BIT() macro directly on
bt_hci_evt_le_per_advertising_report::cte_type field.
According to Core Spec, `cte_type = 0xFF` corresponds
to `No contstant tone extension`.

Added separate function to convert CTE bit field from
HCI format to bt_df_cte_type

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-02-08 09:48:02 +00:00
Pavel Vasilyev
548851ac7a Bluetooth: Mesh: Fix solicitation PDU tx dep on proxy
If `CONFIG_BT_MESH_GATT_SERVER` is disabled or the advertising set
doesn't support proxy adv, the solicitation PDU will not be sent.
However, solicitation PDU transmission doesn't depend on the proxy
feature of the device it sends. Therefore, solicatation PDU should be
sent regradless of `CONFIG_BT_MESH_GATT_SERVER` option and advertiser
tag.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-08 09:04:48 +01:00
Kamil Piszczek
129b73ce26 bluetooth: gatt: remove operation infix from authorization callback API
Removed the "operation" infix from the bt_gatt_authorization_cb
callback structure in the Bluetooth GATT header.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-02-07 15:36:25 +00:00
Emil Gydesen
df3fcc9b1f Bluetooth: CAP and HAP: Shell: Replace - with _ in commands
The dash (-) makes clang-format unhappy, and most other commands
use underscore (_) instead.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-07 15:26:29 +00:00
Pavel Vasilyev
e495876db6 Bluetooth: Mesh: Reset solicitation settings before calling reset cb
Trigger erasing solicitation settings before calling
`bt_mesh_settings_store_pending` and `bt_mesh_prov.reset` callback.
The `bt_mesh_settings_store_pending` flushes every settings that is
pending to be erased. The `bt_mesh_prov.reset` callback must be called
as the last step because a user is free to do anything from this
callback including rebooting or reprovisioning the device.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-07 15:25:18 +00:00
Emil Gydesen
590d3e1114 Bluetooth: BAP: Broadcast source enabling state transition fix
Since we may go from enabling to qos-configured state if the
call to bt_iso_big_create fails, that is a valid transition.
If bt_iso_big_create currently fails, then the source ends in a
state where it cannot be recovered.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-06 09:51:16 +01:00
Emil Gydesen
f4b83415d6 Bluetooth: CAP: Fix uninitialized values in broadcast start
When CONFIG_BT_ISO_TEST_PARAMS is enabled then the
bt_bap_broadcast_source_param in
bt_cap_initiator_broadcast_audio_create had uninitialized values.

A general and future proof solution for this is to simply initialize
the entire struct to 0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-06 09:50:53 +01:00
Emil Gydesen
b9056de5d1 Bluetooth: ISO: Fix duplicate log statements for PDU check
Modifies two log statements so that it is clear whether it
is failing to validate broadcast or unicast PDU sizes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 19:52:21 +00:00
Emil Gydesen
27abc1d944 Bluetooth: BAP: Broadcast assistant shell treat PA sync as bool
Modify the broadcast assistant commands that take the PA sync argument
so that it is treated as a bool. This allows users to use
"true", "on", "1" or "0x01" for true values and "false", "off", "0"
for false values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 12:40:23 -06:00
Troels Nilsson
8acca664d2 Bluetooth: Controller: Fix periodic adv data truncation
Advertising data has to be truncated at a PDU boundary

Similar to earlier fix for extended advertising reports

Found in several EBQ tests, including LL/DDI/SCN/BV-25-C,
LL/DDI/SCN/BV-21-C and LL/DDI/SCN/BV-46-C

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-02-05 18:18:57 +01:00
Lyle Zhu
4e7be1ecaa Bluetooth: Host: set valid SCO packet type
The SCO cannot be created if the eSCO is unsupported.
It is caused by the packet type cannot be set
correctly.

Set valid bitmap for SCO and eSCO packet type in
command "Accept Synchronous Connection Request".

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-05 17:46:49 +01:00
Emil Gydesen
017f59cb66 Bluetooth: BAP: Broadcast sink: Fix bis_sync in update_recv_state_base
In the update_recv_state_base function, we should update the
BASE with any new metadata that we have received (as that may
change while streaming). However, this function did not properly
keep the existing bis_sync values for the
subgroups, causing the bis_sync for all subgroups to be 0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 17:46:31 +01:00
Emil Gydesen
43bc3200fa Bluetooth: BAP: Stop broadcast sink from removing receive state
The receive state may be added by the broadcast sink if not added
by the application, but even in that case when the broadcast sink
is deleted, we should not remove the receive state, as the receive
state may still container information about the PA sync that has a
lifetime not coupled with the broadcast sink.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 17:46:11 +01:00
Emil Gydesen
7643526086 Bluetooth: BAP: Do not send PA term request on local remove
If the receive state is locally removed, then we should not
request permission from the application, as that is implicit
when removing the source locally.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 17:45:45 +01:00
Emil Gydesen
cbc81b2a0f Bluetooth: Audio: Remove LC3 from the assigned numbers defines
The defines from the Bluetooth Audio assigned numbers are not
specific for LC3. This commit removes the LC3 infix and
the reference to LC3 in the documentation for them.

It also cleans up some of the documentation and
names of the enums.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 09:14:44 -06:00
Emil Gydesen
68ed2e019f Bluetooth: VCP: Fix missing guards for AICS and VOCS
Some places VCP accessed AICS and VOCS when it was not supported.
Also modify existing guards to be consistent with new guards.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 13:13:00 +01:00
Emil Gydesen
adb74f0f16 Bluetooth: MICP: Fix missing guards for AICS
Some places MICP accessed AICS when it was not supported.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 13:13:00 +01:00
Emil Gydesen
ab1b43ee1a Bluetooth: VCP/MICP: Fix VOCS and AICS instance counts
The VCP and MICP instances should use their respective
AICS and VOCS Kconfig options, rather than the overall
Kconfig options.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-05 13:13:00 +01:00
Emil Gydesen
065253c173 Bluetooth: CAP: Make unicast stop more similar to unicast start
Modify the parameters for bt_cap_initiator_unicast_audio_stop
so that they are more similar to
bt_cap_initiator_unicast_audio_start.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-04 19:54:18 -06:00
Emil Gydesen
ec549cebd5 Bluetooth: CAP: Make unicast update more similar to unicast start
Modify the parameters for bt_cap_initiator_unicast_audio_update
so that they are more similar to
bt_cap_initiator_unicast_audio_start.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-04 19:54:18 -06:00
Emil Gydesen
f35e9871d5 Bluetooth: CAP: Remove unicast group param from unicast_audio_start
Since we can always lookup the group from the streams, the
group parameter had no purpose.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-04 19:54:18 -06:00
Radoslaw Koppel
8f98b8b574 bluetooth: nordic: lll: Use direct ISR when applicable
This commit updates nordic lll controller to use
IRQ_DIRECT_CONNECT where applicable instead of
using IRQ_CONNECT with ISR_FLAG_DIRECT.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2024-02-02 19:49:36 +01:00
Emil Gydesen
ec41dd9ba6 Bluetooth: Audio: Use BT_GATT_SUBSCRIBE_FLAG_VOLATILE
The LE Audio implementations do not really support bonding yet,
and removing subs on disconnect is the most effective (and correct)
way of ensuring that we do not subscribe more than once when we
re-discover after reconnection.

The broadcast assistant and the media control client does not
support multiple connections as of this commit, so they needed
special treatment. In the case that we do discovery on multiple
ACL connections, it is important that the existing subscriptions
are removed correctly by calling bt_gatt_unsubscribe.

In order to implement this change properly on some of the clients,
thet had no proper connection references or support
for clearing the data on disconnects, they had to be updated
as well.

The csip_notify.sh test has been disabled, as that expected a
notification in the client, but since this commit removes that
(until bonding is properly supported in the clients), then the
test will fail.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-02 09:34:52 -06:00
Emil Gydesen
922ac3c7c1 Bluetooth: Audio: Add missing error checks for calls to bt_gatt_subscribe
Several places the LE Audio clients called bt_gatt_subscribe without
checking the return value, which could cause some issues in the worst
case, and in the best case, cause some unexpected behavior.

Some implementations had a bit more updating to handle the new
behavior.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-02 09:34:52 -06:00
Troels Nilsson
89ce3566c0 Bluetooth: Controller: Fix handling of CTEInfo in le_ext_adv_report()
Handling of CTEInfo being present was missing; Fixes test failure of
LL/DDI/SCN/BV-89-C

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-02-02 09:30:06 -06:00
Lyle Zhu
d7328eac67 Bluetooth: Host: Set user data size for hfp tx pool
The user data size of hfp tx pool is zero.

There is not enough space to put tx_mate.

Use CONFIG_BT_CONN_TX_USER_DATA_SIZE to
set data size of hfp tx pool.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-02-02 14:09:38 +01:00
Vinayak Kariappa Chettimada
10fece0c1e Bluetooth: Controller: Fix PA sync-ed ACL supervision timeout
Fix Periodic Advertising Synchronization leading to
Peripheral ACL connection supervision timeout, due to
direction finding related radio hardware registers being
updated in the implementation that is not built for
direction finding feature support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:49:43 +01:00
Vinayak Kariappa Chettimada
83321eed41 Bluetooth: Controller: Fix coverity issue 340844
Fix coverity issue 340844, Uninitialized pointer read.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:49:30 +01:00
Vinayak Kariappa Chettimada
c5474085db Bluetooth: Controller: Fix coverity issue 340845
Fix coverity issue 340845, Uninitialized pointer read.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:49:19 +01:00
Vinayak Kariappa Chettimada
054dc35542 Bluetooth: Controller: Fix coverity issue 330027
Fix coverity issue 330027, Structurally dead code.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:49:07 +01:00
Vinayak Kariappa Chettimada
f214913e16 Bluetooth: Controller: Fix coverity issue 330043
Fix coverity issue 330043, Unsigned compared against 0.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:48:54 +01:00
Vinayak Kariappa Chettimada
f358243b26 Bluetooth: Controller: Enforce range for BT_CTLR_ADV_AUX_SYNC_OFFSET
Enfore a range for BT_CTLR_ADV_AUX_SYNC_OFFSET such that
it does not take negative integer values.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:48:54 +01:00
Vinayak Kariappa Chettimada
8e5c9c3b8a Bluetooth: Controller: Fix MFIFO_DEFINE to reduce FLASH usage
Fix MFIFO_DEFINE to reduce FLASH usage by moving the pool
outside the struct that is static initialized.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:48:42 +01:00
Vinayak Kariappa Chettimada
550b16a04e Bluetooth: Controller: Fix missing ull_chan_reset call
Fix missing call to ull_chan_reset(), this fixes
uninitialized channel map being used after LL reset.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-02-02 12:43:07 +01:00
Ping Wang
2f138fad5f Bluetooth: Audio: MCC optional procedures actually optional
This change makes the optional procedures in the Media Control Client
optional and configurable through Kconfig.

Signed-off-by: Ping Wang <pinw@demant.com>
2024-02-02 12:42:55 +01:00
Andries Kruithof
38e0e6e555 Bluetooth: audio: BAP: fix Kconfig description
The description for BT_BAP_SCAN_DELEGATOR_BUF_TIMEOUT is a bit misleading.
Rewriting this to be more accurate

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-02-01 13:09:17 -06:00
huajiang zheng
3d9f76b8e5 Bluetooth: Host: add unregister connection callback function
[Description]
tests: shell: Restart bt will register the same connection callback twice.
Callback next node point to itself, when link established callback function
loop infinitely.
[Fix]
Unregister the previous callback to avoid register repeatedly.
[Test]
After bt init/disable times, create connection successfully.

Signed-off-by: huajiang zheng <huajiang.zheng@nxp.com>
2024-02-01 16:05:38 +01:00
Luis Ubieda
efb5d8372d Bluetooth: Host: Added Recycled evt notifying conn object is available
- Which allow listeners to attempt to use the freed connection object to
perform actions as e.g: start connectable advertisements.
- Refactored bt_conn_unref() so it does not access conn struct after
decrementing its reference count.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-02-01 14:31:27 +00:00
Andries Kruithof
3ef1b045ce Bluetooth: audio: fix bug in scan delegator sync
In the scan delegator when modifying the source we only want to
send a sync request to the upper layers if we are not yet synced,
and not also on a state change

Note that without this change the babblesim test for long writes
will fail

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>

Scan del bugfix

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-02-01 14:37:40 +01:00
Andries Kruithof
c5dcc1a4ce Bluetooth: audio: bap: add support for long notifications
Add support for sending long notifications, coming
from a long read, back to the application

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-02-01 14:37:40 +01:00
Andries Kruithof
90a5d02710 Bluetooth: audio: bap: add support for long read
Make sure that buffers are large enough and add
semaphores so that we can do long reads

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-02-01 14:37:40 +01:00
Andries Kruithof
9887ebf471 Bluetooth: audio: bap: long write
Increase the buffer size to allow for long writes

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-02-01 14:37:40 +01:00
Emil Gydesen
e92e4c249d Bluetooth: Audio: Update return value of {cfg,cap}_get_val
The get_val functions will now return -ENODATA in case that
a value isn't found, instead of 0.

This makes them more similar to the meta_get_val functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-01 10:55:31 +01:00
Emil Gydesen
6c403da3cd Bluetooth: Audio: Shell: CAP change volume offset command
Add sthe change volume offset command to the CAP commander shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:35:17 -05:00
Emil Gydesen
4be42784ea Bluetooth: CAP: Commander change volume offset procedure
Adds the CAP Commander Change Volume Offset procedure.
This procedure changes the volume offset on one or more
CAP Acceptors, but not to the same value (unlike the
volume change procedure).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:35:17 -05:00
Emil Gydesen
562166b685 Bluetooth: MICP: Allow for multiple mic_ctrl cb registers
Modify the MICP microphone controller callbacks to support
multiple registers by making it into a linked list.

This allow for multiple applications to get the information
from procedures or notifications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:35:00 -05:00
Emil Gydesen
029afad6c1 Bluetooth: CSIP: Add bt_csip_set_member_unregister
Add support for unregistering a CSIS as the CSIP set member.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:34:27 -05:00
Emil Gydesen
1da84e99aa Bluetooth: MPL: Fix track position in playing and stopped state
In the playing state, we should still increment the track position,
but just avoid notifying it.

If the track is stopped, then we set the track position to 0, which
we should always notify, regardless of whether the current track position
is 0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:34:12 -05:00
Emil Gydesen
01d0f1a566 Bluetooth: PBP: Fix parsing and return issue with bt_pbp_parse_announcement
bt_pbp_parse_announcement was defined as uint8_t return value function,
but returned errno values, so it was modified to return an int instead.
The return values are also now more granular and documented.

The function also triggered a coverity issue with the way that it
parsed the data->data, as it would be marked as tainted. This should
be fixed by using the net_buf_simple API, which also improves on
some other parts of the code.

Finally the meta argument for the function was changed from an
unknown sized buffer, where the caller somehow had to know the
size of the metadata before calling the parsing function, to
an output pointer. This also omits the requirement for the
caller to always copy the metadata, where now it just
gets a pointer to the metadata in the bt_data struct. The application
can now always decide whether to continue to parse the metadata or
to copy it, using the pointer and the return value of the function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 21:33:56 -05:00
Emil Gydesen
13a357b019 Bluetooth: BAP: Update log for unicast iso recv without endpoint
Since we always set up the ISO data path for endpoints in both
directions (due to limitations in the ISO API), we can actually
receive valid (empty) SDUs on a CIS in a direction that has not
been configured.

This is not the ideal solution, but prevents unncessary LOG_ERR.
The ideal solution is to modify the ISO API to provide the
flexibility that BAP needs w.r.t. ISO data paths, but that is
a larger change for later.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 17:58:58 -06:00
Emil Gydesen
8b8569e1da Bluetooth: BAP: Add missing reset of client on disconnected
If we disconnect in the middle of e.g. a discovery, then
client-busy (and other values) were not correctly reset,
which effectively rendered the client useless.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 17:57:28 -06:00
Kristoffer Rist Skøien
ace435d0d1 Bluetooth: Audio: Moved seq_num check
Moved seq_num check to after bt_iso_chan_send.
This prevents WRN prints if ISO send fails.

Signed-off-by: Kristoffer Rist Skøien <kristoffer.skoien@nordicsemi.no>
2024-01-31 15:13:10 -06:00
Vinayak Kariappa Chettimada
2a6169e2fe Bluetooth: Controller: Fix coverity issue 340852
Fix coverity issue 340852, Uninitialized scalar variable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-31 18:21:59 +01:00
Aleksander Wasaznik
9426309dbe Bluetooth: Host: Refactor bt_buf_get_evt
This is purely a syntactical refactor.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-01-31 17:50:35 +01:00
Aleksander Wasaznik
b6a10516b0 Bluetooth: Host: Remove bt_buf_get_cmd_complete
After the previous commit, this function no longer has any users.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-01-31 17:50:35 +01:00
Aleksander Wasaznik
1cb83a81f0 Bluetooth: Host: Remove use of bt_buf_get_cmd_complete
`bt_buf_get_cmd_complete` is broken due to
https://github.com/zephyrproject-rtos/zephyr/issues/64158, and fixing it
would require changing its signature and put even more complexity into
the HCI drivers, as it would require the drivers to perform an even
deeper peek into the event in order to observe the opcode.

Instead of the above, this patch removes the use of
`bt_buf_get_cmd_complete` and adds logic to allow the host to accept
command complete events in normal event buffers.

The above means performing a copy into the destination buffer, which is
the original command buffer. This is a small inefficiency for now, but
we should strive to redesign the host into a streaming architecture as
much as possible and handle events immediately instead of retaining
buffers.

This fixes https://github.com/zephyrproject-rtos/zephyr/issues/64158:
Like all command completed events, the completion event for
`BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS` is now placed in normal event
buffers. The the logic where the host discards this event is already
present. Since it's discarded, it will not interfere with the logic
around `bt_dev.cmd_send`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-01-31 17:50:35 +01:00
Stine Åkredalen
a1b9f0a7d6 Bluetooth: Mesh: fix SRPL always accepting sol pdus with sseq 0
Updated logic in srpl_entry_save.

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
2024-01-31 10:34:06 -06:00
Vinayak Kariappa Chettimada
e3357ef271 Bluetooth: Controller: Minor indentation of RXFIFO_DEFINE
Minor indentation of RXFIFO_DEFINE.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-31 15:52:47 +00:00
Vinayak Kariappa Chettimada
eb5ce8bfe0 Bluetooth: Controller: Fix RXFIFO_DEFINE to reduce FLASH usage
Fix RXFIFO_DEFINE to reduce FLASH usage by moving the pool
outside the struct that is static initialized.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-31 15:52:47 +00:00
Emil Gydesen
b173c21d9c Bluetooth: BAP: client: Add support for source ASEs disconnects
When the CIS of a source ASE disconnects, the server shall put
it into the QoS Configured state, which is not really part of the
state machine for source ASEs, but more like a hidden bonus state
change.

The state machine handler in the unicast client has been updated
to support this state change.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-31 12:05:47 +00:00
Emil Gydesen
515ef17915 Bluetooth: Audio: Change samples and shell to use sinf
Change the samples and shell to use sinf instead of sin,
as that return the expect float data type, instead of
a double.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-30 12:45:26 +01:00
Ping Wang
6dcde57952 Bluetooth: Audio: improve BASS state logging to be more readable.
When debugging it is hard to remember each state value (e.g. 0, 1, 2,
3) means. Therefore, make functions to improve logging for humans.

Fixes #59679

Signed-off-by: Ping Wang <pinw@demant.com>
2024-01-29 13:20:18 +01:00
Ping Wang
c7d1dc3b42 Bluetooth: Audio: Use utf8_lcpy to copy UTF8 strings with termination.
use the function utf8_lcpy to ensure that UTF8 encoded strings are
properly copied and NULL terminated.

Fixes #42128

Signed-off-by: Ping Wang <pinw@demant.com>
2024-01-29 10:28:18 +01:00
Jonathan Rico
2d9b56d713 Bluetooth: L2CAP: remove metadata allocation
The only thing we put in there is the CID and that fits comfortably into
the (at least) 4-byte void pointer `user_data`.

This removes the dependency between `CONFIG_BT_ATT_TX_COUNT` and
`CONFIG_BT_L2CAP_TX_BUF_COUNT` since previously there was still a need
for an L2CAP context for every TX'd buffer.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-29 09:41:23 +01:00
Jonathan Rico
3a4fd5e23d Bluetooth: L2CAP: remove cb/userdata from TX metadata
They were never used.
Only thing to remove is `cid`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-29 09:41:23 +01:00
Jonathan Rico
77d8c2768e Bluetooth: L2CAP: initialize servers slist
Somehow it slipped through the cracks and didn't crash before.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-29 09:41:23 +01:00
Pavel Vasilyev
54c048989d Bluetooth: Mesh: Send provisioning PDUs with randomized delay
This implements the following statement from the section 5.3.3:
Each Generic Provisioning PDU shall be sent after a random delay between
20 and 50 milliseconds.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-29 09:26:22 +01:00
Pavel Vasilyev
fcfc99a21d Bluetooth: Mesh: Add error code for bt_mesh_adv_terminate
Return error code to let an implementation know if the adv was actually
stopped (was scheduled) or not.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-29 09:26:22 +01:00
Pavel Vasilyev
9af051e349 Bluetooth: Mesh: Call bt_mesh_send_cb.end cb by the end of adv
Before this change, the bt_mesh_send_cb.end callback was called when all
references to the adv were removed. If an implementation kept more
references to the adv buffer after calling `bt_mesh_adv_send`, the end
callback would not be called when the advertiser finished advertising
this adv.

With this change, the end callback is always called by the advertiser
when the advertisement is finished regardless of the number of
references. This allows an implementation to keep the adv buffer for the
future use. As an example, pb_adv.c keeps advs for retransmission.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-29 09:26:22 +01:00
Jonathan Rico
d75b44327a Bluetooth: ATT: don't callback if bearer is invalid
If an att buf is destroyed during bearer teardown, we want to avoid
using and passing invalid references to the application.

Double-check that the current bearer, the ATT object and the ACL conn
objects it is attached to are not NULL before proceeding.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-26 11:57:10 -06:00
Vinayak Kariappa Chettimada
87aa53ccae Bluetooth: Controller: Fix BIS Encryption for first subevent PDU empty
Fix radio packet length configuration when first subevent
has empty PDU in the BIG event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-26 09:45:35 +01:00
Vinayak Kariappa Chettimada
4192f8a844 Bluetooth: Controller: Fix ISO Sync Receiver sequential BIS PDU drop
Fix ISO Synchronized Receiver sequential packing BIS PDU
being dropped in the first repetation just after previous
BIS subevents where skipped.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-26 09:45:24 +01:00
Vinayak Kariappa Chettimada
653d285210 Bluetooth: Controller: Fix Broadcast ISO Create Scheduling
Fix Broadcast ISO Create Scheduling to consider reducing
Host requested RTN value. And also use maximum overhead
calculation when Extended Advertising and Periodic
Advertising have not been started before BIG create.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-26 09:45:09 +01:00
Vinayak Kariappa Chettimada
818ae7acb0 Bluetooth: Controller: Fix incorrect HCI ISO Data length check
Fix incorrect HCI ISO data length check for Broadcast ISO
transmissions.

Removed initially added code when preliminary support for
Broadcast ISO was implemented.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-26 09:45:09 +01:00
Emil Gydesen
2b0e39dfa5 Bluetooth: Audio: Add bt_audio_codec unset functions
Add functions to unset, or remove, specific codec
LTV structure from codec_cfgs or codec_caps.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-26 09:43:30 +01:00
Hang Fan
b3d2891e16 Bluetooth: Classic: Add support for class of device
Add `CONFIG_BT_COD` for class of device.

< HCI Command: Write Class of Device (0x03|0x0024) plen 3
        Class: 0x200408
          Major class: Audio/Video (headset, speaker, stereo, video, vcr)
          Minor class: Hands-free Device
          Audio (Speaker, Microphone, Headset)
> HCI Event: Command Complete (0x0e) plen 4
      Write Class of Device (0x03|0x0024) ncmd 1
        Status: Success (0x00)

Signed-off-by: Hang Fan <fanhang8@gmail.com>
2024-01-25 15:09:01 +00:00
Jonathan Rico
6fa5d1e6a5 Bluetooth: L2CAP: fix net buf frags handling
Fix the handling of buffers with fragments. What seems to have been
broken is the metadata reference that was not passed to the next frag in
the chain.

Add a test to regression too.

The main user of this is IPSP.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-24 14:56:16 +01:00
Jonathan Rico
9d5217f68b Bluetooth: L2CAP: call bt_l2cap_send_cb once
Small refactor to improve readability.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-24 14:56:16 +01:00
Vinayak Kariappa Chettimada
ac39ad7249 Bluetooth: Controller: Fix extended scanning assertion
Fix extended scanning assertion after long duration.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-24 10:44:12 +01:00
Vinayak Kariappa Chettimada
585d98e0d8 Bluetooth: Controller: Fix prepare overhead in scheduling ISO
Fix double prepare overhead considered in scheduling
extended, periodic and ISO broadcast radio events when using
LOW LAT variant.

ticks_slot maintained in ticker includes the overhead, the
ticks_slot stored in role/state context exclude the overhead
hence take care to include ticks_slot_overhead when value is
used from context and not when value used from ticker nodes.

Add jitter due to ticker resolution unit between scheduled
radio events. This will allow the synchronizing side too to
not overlap due to ticker resolution related jitter.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-23 14:45:29 +01:00
Vinayak Kariappa Chettimada
4a51f68bcc Bluetooth: Controller: Fix ISO Sync Receiver subevent Rx window
Fix ISO Synchronized Receiver subevent Rx window timing and
PDU address receive timeout to consider the +/- 2us active
clock jitter.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-23 14:45:16 +01:00
Vinayak Kariappa Chettimada
83174ef7dc Bluetooth: Controller: Fix ISO Sync Receiver sequential subevent skip
Fix ISO Synchronized Receiver sequential packing subevent
skip to next BIS subevent, so that radio channel is
correctly calculated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-23 14:45:02 +01:00
Vinayak Kariappa Chettimada
6e51950cd8 Bluetooth: Controller: Use EVENT_OVERHEAD_RESERVE_MAX in Periodic Sync
Use EVENT_OVERHEAD_RESERVE_MAX conditional compile in
Periodic Advertising Sync implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-23 14:44:41 +01:00
Anders Storrø
93a6ee501a Bluetooth: Mesh: Add artificial beacon delay
After removing 20ms in advertiser, all subnetwork beacons are sent as high
dense packet of frames with minimal distance between them. That might
cause collisions if beacon interval on devices will coincide.

This commit adds an artificial delay between each subnet advertsing
beacons.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2024-01-23 10:02:00 +01:00
Vinayak Kariappa Chettimada
4158d9523e Bluetooth: Controller: Fix extended scanning data length assertion
Fix assertion due to LLL scheduling of auxiliary PDU
reception was not considered in the ULL when checking for
accumulated data length exceeding the supported maximum scan
data length. This caused the auxiliary context to be release
while LLL was still active with scheduled PDU reception.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-22 16:55:09 +01:00
Mustafa Homsi
e51c47bf43 Bluetooth: Controller: Fix regression in BT_CTLR_USED_PPI_CHANNELS
Fix regression in BT_CTLR_USED_PPI_CHANNELS introduced
in commit e39d98302d ("Bluetooth: Controller: nRF53:
Cleanup dppi and dppi resources file").

Signed-off-by: Mustafa Homsi <mustafa.homsi@rivieh.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-22 14:31:12 +01:00
Emil Gydesen
aef39f6923 Bluetooth: BAP: Fix issue with setting invalid iso data path
BAP would always set up the ISO data path in both directions,
even for unidirectional CIS. This meant that in the
unconfigured direction, the data path configuration data
would all be 0, which causes issues on some controllers.

The new refactored approach implemented by this commit
will always ensure that the data path is setup correctly,
and that we only set the data path in one direction for
unidirectional CIS. The unset path will use the default
ISO path of HCI and transparant format, which should always
be allowed by a controller.

This is building on the requirement in BAP that all streams in
a unicast group shall be QoS configured at the same time. This
ensures that before any streams in the CIG has been connected,
they have all been configured.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-22 13:09:16 +01:00
Rubin Gerritsen
db58810492 Bluetooth: ISO: Fix CIS peripheral disconnection during setup
When the central aborts the CIS setup during the CIS Creation
procedure after it has accepted the CIS request, the peripheral
will receive the HCI LE CIS Established event with an error code.
It does not receive a disconnection event.
See the message sequence chart in Core_v5.4, Vol 6, Part D,
Section 6.23.

This commit ensures that the perirpheral disconnected callback gets
called for this particular scenario.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-01-22 12:59:38 +01:00
Emil Gydesen
b857ef7f83 Bluetooth: BAP: Add ISO state callbacks
Add callbacks to the stream objects that reflects the
state of the isochronous channel. The connected callback
is called when the isochronous channel is connected, and
similarly the disconnected callback is called when it is
disconnected.

There is a special case for unicast, where if the ACL
disconnects first, then we won't get a ISO disconnect
callback. It should be assumed that the isochronous channel
is no longer valid when the BAP stream enters the idle state,
i.e. when the "released" callback is called.

The purpose of the new callbacks is to provide additional
information to the application. Especially the unicast client
can use this to determine when the stream_start function
can be called again, as there can only ever be 1 outstanding
CIS connection request at a time, but there can be multiple
GATT requests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-22 12:59:11 +01:00
Gerard Marull-Paretas
27f14eb3a8 bluetooth: controller: ll_sw: RV32M1: add missing include
cntr.c accesses some registers defined in fsl_device_registers.h.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-19 15:13:53 +00:00
Kamil Piszczek
6852abf521 bluetooth: gatt: add authorization callback API for gatt operations
Added the GATT authorization callback API that allows the user to
define application-specific authorization logic for GATT operations.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-01-19 16:08:46 +01:00
Jonathan Rico
68316ace22 Bluetooth: L2CAP: remove l2cap_chan_create_seg()
Remove the logic for adding the SDU length when allocating segments. That
section was dead code after the recent patches.

Inline the remainder of the logic into `l2cap_chan_le_send()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-19 16:59:11 +02:00
Pavel Vasilyev
83b7513937 Bluetooth: Mesh: Move beacons Kconfiguration under separate submenu
Collect beacons Kconfiguration under own submenu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
bb75d1f813 Bluetooth: Mesh: Move Solicitation Kconfig options
Move Solicitation Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
343fa6d044 Bluetooth: Mesh: Move OdProxy models Kconfig options
Move OdProxy models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
168af2324d Bluetooth: Mesh: Move PRB models Kconfig options
Move PRB models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
84febe83a9 Bluetooth: Mesh: Move LCD models Kconfig options
Move LCD models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
5156f78386 Bluetooth: Mesh: Move OpAgg models Kconfig options
Move OpAgg models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
5b0a1bb165 Bluetooth: Mesh: Move SAR models Kconfig options
Move SAR models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
f89effbe75 Bluetooth: Mesh: Move RPR models Kconfig options
Move RPR models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
c2299e2120 Bluetooth: Mesh: Move DFU models Kconfig options
Move DFU models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
11986a29d8 Bluetooth: Mesh: Move MBT models Kconfig options
Move MBT models Kconfig options under the models menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
dcdbb4bceb Bluetooth: Mesh: Move CDP 1.1 Kconfig options
Move CDP 1.1 Kconfig options to the access layer menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
b94b9c7759 Bluetooth: Mesh: Move provisioning 1.1 Kconfig options
Move provisioning 1.1 Kconfig options to the provisioning menu.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
6060dfbc7f Bluetooth: Mesh: Move mesh-1.1 transport sar configuration
Move mesh 1.1 transport sar configuration under transport menu

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Pavel Vasilyev
981c79b7ce Bluetooth: Mesh: Drop explicit support for Bluetooth Mesh 1.0.1
Bluetooth Mesh Protocol 1.1 is backward compatible with Bluetooth Mesh
Profile 1.0.1, therefore the stack can still be qualified for 1.0.1 if
needed. But explicit support for both versions requires additional
maintenance efforts and doubles the CI time. To make the stack
qualifiable for 1.0.1, the one needs to remove Private Beacons reception
and compile out SHA256 algorithm support.

What is changed:
- Removed `CONFIG_BT_MESH_V1d1` option.
- Removed `transport_legacy.c` which was using 1.0.1 implementation. The
  new transport layer has new SaR logic that should still be possible to
  qualify for 1.0.1.
- Removed the legacy transport Kconfig options. They are superseded by
  the new transport Kconfig options.
- Tester app: `overlay-mesh-v1d1.conf` is merged into
  `overlay-mesh.conf`.
- Removed BabbleSim tests for 1.0.1.
- Updated documentation.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-19 12:55:40 +01:00
Emil Gydesen
d26ba10640 Bluetooth: GATT: Add missing busy check for auto discover CCC
When using the auto discover CCC, and the function is called
more than once with the same parameters before the previous
discovery has completed, then that may cause issues when we
reset the parameters when we get the response.

This commit adds a small check for the callback function
which is only set to the specified function when the
discovery is in progress. This way we can return an error
if the application calls bt_gatt_subscribe multiple times
before the previous discovery has completed, rather
than asserting.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-18 20:11:08 +01:00
Pavel Vasilyev
7a41a9d864 Bluetooth: Mesh: Fix processing SegAcks to wrong destination
Do not process SegAcks which were not targeted to the node.

They were rejected in the next if statement always, but generated
the annyoing warning "No matching TX context for ack".

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-18 10:55:24 +01:00
Emil Gydesen
490c5e3b20 Bluetooth: Audio: Shell: CAP change volume command
Add sthe change volume command to the CAP commander shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-17 12:00:09 -05:00
Emil Gydesen
6e52f384c8 tests: Bluetooth: CAP commander volume_change unit tests
Adds unit tests for the CAP Commander volume_change
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-17 12:00:09 -05:00
Emil Gydesen
b09ce2fade Bluetooth: CAP: Commander set volume support
Add support for setting volume on one or more CAP
acceptors using the CAP Commander API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-17 12:00:09 -05:00
Emil Gydesen
1faa5a2aa2 Bluetooth: BAP: Add support for transparent coding format
Add support for controlling whether the local controller
should transcode, or whether it will be done by another
module (e.g. the host).

By default when using the macros,
controller transcoding will be disabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-17 11:59:14 -05:00
Emil Gydesen
476e7b3fa3 Bluetooth: Audio: Ensure that read callbacks can handle conn == NULL
The read callbacks may be called with conn == NULL if the device
does a local read of the attributes. This commit ensures that all
the read callbacks can handle the case where conn == NULL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-17 11:58:44 -05:00
Markus Swarowsky
11175c3ad3 tf-m: Change NS include path for TF-M 2.0.0
The place where TF-M places its non-secure api header files has changed
Therefore changing it for for all applications that use it.

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
2024-01-17 16:52:52 +01:00
Morten Priess
056d5a354b Bluetooth: controller: Handle peripheral CIS creation latency
Instead of asserting, handle CIS creation latency for the peripheral by
finding next valid ISO event at which to start the CIG ticker.

Refactored calculations of the cig_offset to separate functions, to be
used also when calculating a new start offset.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2024-01-17 14:44:34 +01:00
Jonathan Rico
81d524d081 Bluetooth: L2CAP: always send from workqueue
Always pull from the channel queue from the system workqueue context.
This simplifies debugging.

This also allows us to remove `sent` from the metadata struct.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-17 14:42:40 +01:00
Jonathan Rico
2dcb91ab46 Bluetooth: L2CAP: extract LE part of bt_l2cap_chan_send
Separate most of the param checking in `bt_l2cap_chan_send()`, with the
logic in `bt_l2cap_dyn_chan_send()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-17 14:42:40 +01:00
Vinayak Kariappa Chettimada
60c0087555 Bluetooth: Controller: Fix ISO Sync Receiver time reservation calc
Fix missing ISO Synchronized Receiver radio event time
reservation that did not calculate for all the subevents.

Introduce BT_CTLR_SYNC_ISO_RESERVE_MAX Kconfig option to
allow using a minimal time reservation if needed to allow
other role to pre-empt ISO Synchronized Receiver in
pre-transmission and control subevents.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-17 14:42:32 +01:00
Bi Jian
06fa287d45 Bluetooth: Audio: Update audio location definitions
The meaning of bit0 in the audio location bitmap will change to
mono audio, so we update the audio location macro and releated
test cases.

Refer to BT SIG ES-22266.

Signed-off-by: Bi Jian <bi_jian@qq.com>
2024-01-16 14:27:40 -05:00
Emil Gydesen
f4cbf403e8 Bluetooth: BAP: Fix uninitialized variable in source_reconfig
The stream_in_subgroup variable in bt_bap_broadcast_source_reconfig
may have been uninitialized.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:37:28 -06:00
Emil Gydesen
bf37784dea Bluetooth: PACS: Fix logical dead paths
In pac_notify and pac_notify_loc coverity found logical dead
paths since if both sink and source notify was disabled,
the functions would still be compiled, but would
never get past the default case.

This is not a real issue as the functions were never called
in that case, but to make coverity happy, and to prevent
any future issues where the functions may be called
incorrectly, the static functions are now fully guarded.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:35:37 -06:00
Emil Gydesen
9fc630d303 Bluetooth: CSIP: Use bt_crypto_aes_cmac instead of own
Instead of reimplementing the aes_cmac function, CSIP
will now use the bt_crypto_aes_cmac function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:33:58 -06:00
Emil Gydesen
64adf0b065 Bluetooth: BAP: Add log of err in bt_bap_stream_detach
We can't really do anything about it if it fails, so we
simply log the value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:32:22 -06:00
Emil Gydesen
f9c116ec73 Bluetooth: CAP: Shell: Fix channel allocation
The channel allocation was incorrect when setting up multiple
streams to a single device, in which case we should apply
individual bits to each stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 09:31:12 -06:00
Jonathan Rico
38c39af4df Bluetooth: L2CAP: Prepend SDU header immediately
Previously it was not always possible to prepend the header.

It was not possible if the application neglected to reserve the space
for headers.  This is bad because it forces a buffer segment allocation
even if the buffer had enough room for the headers. E.g. a payload of 10
bytes in a netbuf of 30 bytes would have been segmented.

We now explicitly reject the buffer if it does not have the headroom.

This allows us to do a nice thing; simplify L2CAP segmentation.

We convert the SDU from the application into a PDU payload, by
prepending the SDU header, i.e. the SDU length in the original buffer.

This PDU payload is ready to be chunked into PDUs without having to keep
track of where in the SDU we are. This has the effect of removing a
bunch of logic in the segmentation machine.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-01-16 11:29:43 +00:00
Aleksandr Khromykh
4e7d64b1b4 Bluetooth: Mesh: enable access responses randomization
Enable by default the access layer responses random delays.
Commit also adapts all mesh models, samples and
babblesim tests to use random delay functionality correctly.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-01-16 11:29:20 +00:00
Emil Gydesen
68f8c8ff29 Bluetooth: Audio: Fix off-by-one error in codec.c:ltv_set_val
The function did not move data correctly when increasing
or decreasing the size of a value that was not the last value
in the LTV array.

Added a few tests to verify the fix, using the CCID list as the
main way of verifying it.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-16 10:00:04 +01:00
Emil Gydesen
400cdcaca4 Bluetooth: BAP: Fix invalid GATT error codes in scan delegator
There was a few places where the scan delegator returned an
errno value instead of a valid GATT error codes when rejecting
write request. These have been modified to send
BT_ATT_ERR_WRITE_REQ_REJECTED to the client instead.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-15 14:07:15 -05:00
Emil Gydesen
e2b271fbc4 Bluetooth: ASCS: Add additional dbg info in state changes
Add additional debug information in some ASCS debug statements,
so it is easier to follow the state when there is a potentional
state change.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-15 13:59:08 -05:00
Piotr Narajowski
13b0052cfa Bluetooth: MPL: Add notification to track change
This adds notifications to do_first_track only when changing group.
Before the change was made, client was never notified about
track change when changing group in Media Player.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2024-01-15 13:57:21 -05:00
Emil Gydesen
a72da864e0 Bluetooth: BAP: Restrict application ASCS response codes
Some of the ASCS response codes should not be used by the
unicast server, as those will be checked and validated by the
stack.

They are kept in the enum, as the enum is also used by the
unicast client.

Besides updating the documentation, this commit also adds
a function to validate the response codes as well as the
combination of response codes and reason/metadata values,
and log a warning if the application does not adhere to the
documented behavior.

A warning is used instead of an error/assert/modification
of the response codes, as there may be unforseen reasons
why an application provide a non-approved response code,
and since it may be spec-valid, we should not fully
prevent it.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-15 13:56:22 -05:00
Emil Gydesen
234b322dc3 Bluetooth: Audio: Fix len check in ltv_set_val
The length check in ltv_set_val did not consider the size of
the length or type fields.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-15 13:55:55 -05:00
Jonathan Rico
75c2aeb8bd Bluetooth: L2CAP: stop stealing buffers from SDU pool
It seems like a nice idea at first, but leads to hard-to-debug
situations for the application.

The previous behavior can be implemented by the app by defining
`alloc_seg` and allocating from the same pool as `buf`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-15 09:58:58 +01:00
Pavel Vasilyev
27b1f4eb7f Bluetooth: Mesh: Fix dereferencing before null pointer check
Don't dereference pointer until it is checked on NULL.

Fixes: #66805
Coverity-CID: 338098

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-12 11:28:59 -06:00
Vinayak Kariappa Chettimada
7f99677aa6 Bluetooth: Controller: Add support for DYNAMIC_INTERRUPTS
Add support for DYNAMIC_INTERRUPTS and ARM specific
DYNAMIC_DIRECT_INTERRUPTS.

Co-authored-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-12 11:16:08 +01:00
Vinayak Kariappa Chettimada
2b30259e9f Bluetooth: Controller: Fix ull_prepare_dequeue for skipped events
Fix ull_prepare_dequeue to not skip events when preempt
does not match the event in the head of the prepare queue.
The head of the prepare queue does not match when
ull_prepare_dequeue has put the head of the queue to the
last of the queue when it is calling lll_resume interface.
This happens when there is already an active event which
needs a preempt timeout to be setup and there is another
non-resume event in the pipeline which now becomes the
head. The fix ensure to restore the order of the events
if a preempt timeout was to be setup.

Currently ull_prepare_dequeue loops through all events
before stopping at the original way the queue was. This is
not efficient and is a scope for improvement in future.

This reverts commit 91781306e9 ("Revert "Bluetooth:
Controller: Fix ull_prepare_dequeue for skipped events"").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-01-12 10:03:07 +01:00
Emil Gydesen
79af154ae7 tests: bsim: Bluetooth: CAP broadcast AC testing
Add testing of the Audio Configurations from the BAP spec using
the CAP API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-11 16:13:00 +00:00
Jonathan Rico
1e6ff5ff05 Bluetooth: L2CAP: separate BR/EDR and LE internal headers
Extract BR/EDR definitions from `l2cap_internal.c` into its own headers:
one for the interface with l2cap.c and one for the rest of the BR/EDR
stack.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-11 10:04:53 +01:00
Jonathan Rico
19da13313d Bluetooth: L2CAP: remove usage of bt_l2cap_send_cb by BR/EDR
Isolates BR/EDR's l2cap use from LE (most of l2cap.c).

Why? Because I'm refactoring l2cap.c and don't want to accidentally
break BR/EDR support, as there are very few tests in CI.

This way, once `bt_l2cap_chan_send` hands control to l2cap_br.c, it will
not call back into l2cap.c, it will instead be a parallel layer going
directly to conn.c.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-11 10:04:53 +01:00
Daniela Andreea Dumitrache
3bfb2e3ab2 Bluetooth: Audio: Add implementation for PBP and dedicated sample apps.
PBP API allows sources to create a Public Broadcast Announcement.
PBP API to parse a Public Broadcast Announcement.

public_broadcast_source application starts extended advertising and
includes a Public Broadcast Announcement. The advertised broadcast
audio stream quality will cycle between high and standard quality.

public_broadcast_sink application scans for broadcast sources and
synchronizes to the first found source which defines a Public Broadcast
Announcement including a High Quality Public Broadcast Audio Stream
configuration.

Add bsim tests for Public Broadcast Profile APIs.

Add shell implementation for Public Broadcast Profile APIs.

Signed-off-by: Daniela Andreea Dumitrache <danielaandreea.dumitrache@nxp.com>
2024-01-09 09:59:23 +01:00
Håvard Reierstad
6c5fc658ef Bluetooth: Mesh: suspend/resume gatt advs
Disables pb gatt- and gatt proxy advs when suspending Mesh, and
enables them again when resuming Mesh.

Adds `bt_mesh_adv_gatt_send` to `bt_mesh_resume` to make sure that
GATT advs start after resumption.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-01-08 13:21:58 -05:00
Håvard Reierstad
9285ea3238 Bluetooth: Mesh: fix proxy srv return value
Previously, `bt_mesh_proxy_gatt_enable` returned the return value from
`k_work_schedule`, which could be a positive (non-error) message.
Now, it only returns negative error codes (else 0).

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-01-08 13:21:58 -05:00
Piotr Pryga
4d0ef142f3 Bluetooth: services: Add HRS notification changed app callback
It is useful for an application to be informed when there is
a subscriber waiting for HRS service notification.
Extend HRS service API and add required code to service implementation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-01-08 15:34:20 +02:00
Jonathan Rico
79e86472c3 Bluetooth: L2CAP: clarify BT_L2CAP_STATUS_OUT
Makes it clearer what that bit means:
If set, the channel has capacity to send at least one PDU.

If unset, the channel ran out of credits and won't be able to send
anything until the peer sends credits back.

Also add debug logs.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-05 14:30:18 +01:00
Jonathan Rico
61f834ee67 Bluetooth: L2CAP: don't use bt_l2cap_send internally
Prevents confusion, as the similarly-named `l2cap_send()` also unrefs the
buffer if it fails to send.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-05 14:30:18 +01:00
Emil Gydesen
87c8b897b3 include: util: Add mem_xor functions
Add functions to do XOR on arrays of memory, with one that
takes arbitrary sizes and one for 32 bits and 128 bits as
those are common sizes for this functionality.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-01-05 09:06:36 +01:00
Erik Brockhoff
5f99c36ca1 Bluetooth: controller: fix procedure collision handling
If an instant based remote procedure 'overtakes' a local ditto
the local procedure will be 'completed' by remote rejection
but collision flag would not get set ensuring that a new local
conflicting procedure cannot be started before the remote is completed.
This can thus lead to invalid local initiation.

Added unittest to cover case

Fix by ensuring collision flag is set also in the above mentioned
scenario.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2024-01-05 09:05:26 +01:00
Mariusz Skamra
b79a3415a9 Bluetooth: audio: has_client: Move bt_has_client structure to header
This moves bt_has_client instance structure to has_internal.h header
file to be able to access to the instance members in tests.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2024-01-02 10:10:15 +01:00
Hang Fan
915f0fd74c Bluetooth: Shell: Fix coverity issue in cmd_adv_data
Fix wrong parameter type to avoid Unsigned compared against 0

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

Signed-off-by: Hang Fan <fanhang8@gmail.com>
2023-12-27 12:36:23 +02:00
Emil Gydesen
547ffdab6e Bluetooth: MICP: Add mic_ctlr_get_by_conn
Add function to get a MICP microphone controller
instance from a connection pointer. This is effectively
the reverse of bt_micp_mic_ctlr_conn_get, and works similar to
bt_vcp_vol_ctlr_get_by_conn.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-22 14:41:17 +00:00
Mariusz Skamra
2bb8855467 Bluetooth: audio: tbs: Add call_alloc/call_free helper functions
This removes duplicated code by adding helper functions to allocate
and free bt_tbs_call objects.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-22 14:41:00 +00:00
Mariusz Skamra
1894fa1979 Bluetooth: audio: tbs: Simplify bt_tbs_set_signal_strength function
Simplify the function flow, by sending the signal strength notification
in one place, the reporting_interval_work handler.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-22 14:41:00 +00:00
Mariusz Skamra
b728ff9ed3 Bluetooth: audio: tbs: Factor out GTBS and TBS common code
This refactors the code to remove code duplicates by creating common
tbs_inst object.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-22 14:41:00 +00:00
Jonas Woerner
2842f206eb Bluetooth: Host: add hci error to errno translation for INVALID_PARAM
now returns -EINVAL if invalid parameters a are supplied

Signed-off-by: Jonas Woerner <github@bolake.de>
2023-12-22 09:52:29 +01:00
Magdalena Kasenberg
e05d964b46 bluetooth: audio: broadcast: Fix missing update of meta_len
The length of the updated metadata was not updated.
Fixes the CAP/INI/BST/BV-13-C test case.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-12-21 17:18:09 +00:00
Aleksander Wasaznik
700f640948 Bluetooth: ATT: Reject read-by-uuid rsp outside range
A bad peer responding to read-by-uuid can return handles outside the
requested range. This confuses the stack. In particular, the "continue"
and "end" logic in the same function relies on this assumption.

This bad peer was a real issue at UPF, and it caused an infinite loop
during discovery.

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

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-21 09:18:14 +01:00
Aleksandr Khromykh
ac4cfe9880 Bluetooth: Mesh: remove 20ms tx delay in adv bearer
The recommendation to have 20ms is fair for two
consecutive messages over a single bearer. When mesh
sends two messages it can be interpreted as two
bearers working in parallel. No need to keep
an artificial 20ms delay for that. Delay was
removed and all related bsim tests were fixed.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-12-19 16:20:36 +01:00
Emil Gydesen
8df987935b Bluetooth: MPL: Add track position notifications during seeking
When seeking the media player should notify clients about the
track position change.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-19 08:51:21 +01:00
Emil Gydesen
cda5e58aa5 Bluetooth: CAP: Commander discovery support
Implement the CAP Commander discovery function.

Adds support for it in the shell.

This includes initial babblesim and unit testing as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-19 08:50:40 +01:00
Erwan Gouriou
54d7793e82 drivers: bluethooth: stm32wba: Add HCI driver for STM32WBA
Add HCI Driver for STM32WBA devices.
Based on B91 HCI driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-12-18 17:31:08 +00:00
Fabio Baltieri
e51a877a90 bluetooth: shell: match cmd_conn_phy_update conditions
The condition for channel-map are CONFIG_BT_CENTRAL ||
CONFIG_BT_BROADCASTER, change the corresponding handler ifdef so that
it's included in the build if CONFIG_BT_BROADCASTER is enabled but
CONFIG_BT_CENTRAL is not.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-18 17:29:02 +00:00
Aaron Ye
d385150bb0 drivers: bluetooth: Add Ambiq HCI driver for Apollo4 Blue Plus.
This commits create the dts binding for Ambiq BT HCI instance.
And create the SPI based common HCI driver for Ambiq Apollox
Blue SoC and the extended soc driver for HCI.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2023-12-18 14:54:53 +01:00
Anders Storrø
f70929a8f1 tests: Bluetooth: Mesh: Add proxy adv coex test.
Adds test that verifies correct Proxy advertisement behavior for
a device where the Proxy adv requirements changes over time,
both for single and multiple subnets.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-12-18 09:29:41 +01:00
Anders Storrø
6c67ab3a63 Bluetooth: Mesh: Refactor proxy adv
Refactors proxy advertising implementation to allow fair sharing of
advertising resources between all subnets.

In the new implementation, each subnet is agnostic to any other subnet
that might have active proxy advertisement work. When proxy
advertisement is triggered, the implementation will first check how
many subnets that has active work. If there are more than one active
subnet, a maximum timeslot will be calculated to ensure that all active
subnets get access to the medium. The implementation will then poll
the next eligible subnet for a proxy advertising request. If the
duration of this request exceeds the maximum timeslot, the duration
for the next advertisement will be set to the maximum value.

If a proxy advertisement for a subnet is interrupted by other
advertising activity, the implementation will now ensure that the
interrupted proxy adv continues from the point where it was
interrupted so that the subnet gets to utilize the entire allocated
timeslot.

This PR also alters the priv_proxy_net_id_multi Bsim test to align
with the refactored proxy advertising scheme.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-12-18 09:29:41 +01:00
Pavel Vasilyev
fe70e50d41 Bluetooth: Mesh: Added support for randomly delaying publications
The section 3.7.3.1 of the mesh specification recommends to delay
a message publication in certain cases:
- at power-up or upon state change for a time between 20 to 500 ms
- for periodic publications for a time between 20 to 50 ms

This change implements this recommendation by adding the
`CONFIG_BT_MESH_DELAYABLE_PUBLICATION` Kconfig option which enables
the randomization code and by adding the `bt_mesh_model_pub.delayable`
bit field which allows each model decide whether the publications
should be delayed for this model or not.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-12-18 09:29:24 +01:00
Jonathan Rico
b83b9bede3 Bluetooth: ATT: call-back on buffer destroy
This is just as arbitrary as what was before, but simpler.

Before this change, the callback were invoked upon receiving the num
complete packets event.
This did not necessarily work with all spec-compliant controllers.

Now the callback is invoked as soon as the lower layer destroys the
buffer. ATT shouldn't care whether L2CAP sends it over RFC1149 or
something else after that point.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-15 17:14:56 +02:00
Jonathan Rico
a05a47573a Bluetooth: ATT: Internalize ATT PDU TX pool
Why?
- metadata is easier to manage as an array + index
  - less error-prone -> less memory-management bugs
- we can. because of the previous refactor
- PDU allocations are more predictable
- ATT buffer size can be optimized by app
- isolates ATT from the rest of the ACL users
  - decouples ATT PDU size from e.g. SMP w/ LESC

Drawbacks:
- higher memory usage
- kconfig change

The higher memory use is only temporary, as this will be followed-up
with more refactors that should bring it back down.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-15 17:14:56 +02:00
Emil Gydesen
62ab25e3f5 Bluetooth: MPL: Make internal functions static
Several internal functions were not static.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-15 14:35:15 +01:00
Emil Gydesen
a8fbab6b1a Bluetooth: MPL: Simplify control point ops
Simplify how control point operations are handled, and
reduce code duplication.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-15 14:35:15 +01:00
Emil Gydesen
984e4213c1 Bluetooth: MPL: Simplify track and group changes
Simplify track and group changes by moving the
notifications into the functions that changes the states.

This removes some code duplication, and makes the code easier
to read, as well, as ensuring that notifications are always
sent.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-15 14:35:15 +01:00
Emil Gydesen
f138f7dd3e Bluetooth: MPL: Add mpl_set_state
Add the static function, mpl_set_state, to help set the playing
state of the media player.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-15 14:35:15 +01:00
Emil Gydesen
9616b3b182 Bluetooth: MPL: Use set_track_position more excessively
The set_track_position handles both correct clamping of the
position, as well as the notification, so use that instead
of setting the value and sending notifications manually.

Also adds a new function, set_relative_track_position,
to help set relative positions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-15 14:35:15 +01:00
Fredrik Danebjer
37e1a116ef bluetooth: shell: Fix stream_start_sine for single stream
Fixed the stream_start_sine function when omitting the all argument.
The verification of the sine checked reversed return value, and was
placed in incorrect order.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-12-15 11:42:26 +00:00
Mariusz Skamra
6e6311ebfb tests: Bluetooth: shell: Use BT_LE_CONN_PARAM_DEFAULT for connection
This basically reverts changes made by
9c8ec58beb.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-15 11:41:34 +00:00
Mariusz Skamra
d2745d6dba tests: Bluetooth: shell: Fix connection reference leak
This fixes regression introduced in recently.
Redundant connection reference is taken twice in connected()
callback. The redunant reference was then not returned, and
as a result we had a leak.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-15 11:41:34 +00:00
Mariusz Skamra
1cb80d3282 Bluetooth: audio: has_client: Use CONTAINER_OF to get client instance
This starts using CONTAINER_OF macro instead of inst_by_conn function
wherever possible. It's better approach as the client instance is
a container for parameters passed to the callbacks.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-14 09:31:59 +01:00
Anders Storrø
25d44a828d Bluetooth: Mesh: Rename prov_dev->provisionee
Renames "prov device" references and options to
"provisionee" to align implementation with Mesh
Protocol specification v1.1, section 5.4.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-12-13 13:57:46 +01:00
Mariusz Skamra
d3d46a6d80 Bluetooth: has: Fix control point error return code
This fixes the return error code for Preset Write operation that shall
be returned when preset is not writable (or disabled via Kconfig like in
this case).

As per HAS_v1.0; 3.2.2.3 Write Preset Name operation
"If the Writable bit in the Properties field of the preset record which
is identified by the Index parameter is set to 0b0, then the server
shall return an ATT_ERROR_RSP PDU to the ATT_WRITE_REQ PDU with
the Error Code parameter set to Write Name Not Allowed."

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-13 09:42:04 +01:00
Xudong Zheng
545a3973a8 bluetooth: bas: remove select SENSOR
Bluetooth battery service does not use sensor.

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2023-12-12 19:10:17 +01:00
Mariusz Skamra
09e376068e Bluetooth: audio: bap_stream: Fix potential NULL pointer dereference
This fixes potential NULL stream pointer dereference.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Mariusz Skamra
025ba06c32 Bluetooth: ascs: Avoid possible unexpected assert
This avoids unexpected assert that may happen when the client tries to
QoS configure ASE that is in state which does not allow to be configured.
In such case the assert shall not be not be triggered, as it's not stack
fauly. The assert check has been moved after the state check, so the ASCS
implementation will just return an error code to the client.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:33:13 +01:00
Mariusz Skamra
ddf172c187 Bluetooth: gatt: Fix automatic resubscription causing CCC removal
This fixes CCC subscriptions that were removed if the automatic
resubscription was aborted by ACL disconnection.
As the client renews subscriptions, there is no point of removing those
if the link is disconnected unexpectedly.
The API user won't be notified about the failure, as the automatic
resubscriptions are implicit, and after reconnection the subscriptions
will be still valid.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-12 15:32:45 +01:00
Mariusz Skamra
af9f526ccd Bluetooth: has: Check writable preset support on preset registration
This fixes issue where API use is able to register writable preset even
if the CONFIG_BT_HAS_PRESET_NAME_DYNAMIC Kconfig option was disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-11 19:26:36 +01:00
Emil Gydesen
9c8ec58beb Bluetooth: GMAP: Add GMAP shell
Add the GMAP shell module with support for running the
various audio configurations in an easy way.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-11 18:30:57 +01:00
Emil Gydesen
7913ebfba3 Bluetooth: GMAP: Add initial implementation of GMAP
Add initial implementation of Gaming Audio Profile (GMAP).

This is a top layer profile in the LE Audio stack,
designed for low latency audio ideal for gaming.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-11 18:30:57 +01:00
Lingao Meng
ffd716b4a2 Bluetooth: Host: iso_data extend bt_buf_data
Explicitly declare that iso_data extends bt_buf_data.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-11 12:50:54 +01:00
Lingao Meng
0ddb6aa82e Bluetooth: Host: Use actual user_data size
Use actual user_data size not default by 8.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-11 12:50:54 +01:00
Emil Gydesen
6158ff03f5 Bluetooth: Shell: Only auto-connect to unconnected devices
The bt connect and bt connect-name commands should only
attempt to connect to connectable devices that we are not
already connected to.

This commit moves the check for BT_GAP_ADV_PROP_CONNECTABLE
as well as checks that we do not already have a connection
to that device with the current ID.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-11 09:54:04 +01:00
Emil Gydesen
01bd94ac4f Bluetooth: Shell: Remove tolower from is_substring
The tolower is not necessary and is what strncasecmp
does anyhow.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-11 09:53:36 +01:00
Joakim Andersson
f390f7d0a1 bluetooth: shell: Use helper function to convert string to int
Use helper function to convert string to int for appearance value.
This makes the code more clear, as the big-endian conversion function
gives the wrong impression about the byte order of advertising data.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2023-12-11 09:51:31 +01:00
Aleksandr Khromykh
d175ac0572 Bluetooth: Mesh: access tx msg randomizer
Commit adds implementation of the specification
recommendations regarding randomization of
responses on the access layer.
3.7.3.1 Transmitting an Access messages

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-12-11 09:50:18 +01:00
Lingao Meng
683098728a Bluetooth: Mesh: Use memslab replace with net_buf_pool
Use memslab more efficiency than net_buf_pool and consume
less ram with flash resource.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-08 20:19:10 +00:00
Pavel Vasilyev
ef1f2d1336 Bluetooth: Mesh: Convert no opcode error to debug log
This error message may confuse when `CONFIG_BT_MESH_ACCESS_LAYER_MSG` is
enabled and all messages are processed by the callback anyway.
This error message also confuses when a node is subscribed to the same
address as it publishes to, which makes it generating the error message
every time it publishes a message.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-12-08 10:25:36 +00:00
Pavel Vasilyev
bcd2aba4d7 Bluetooth: Mesh: Allow custom RPL use mesh settings work
This change allows a custom RPL use pending mechanism and the mesh
settings work to store pending RPL entries. `bt_mesh_rpl_pending_store`
is a public API and should be implemented anyway. The custom RPL
implementation has to trigger settings with the
`BT_MESH_SETTINGS_RPL_PENDING` flag to ask the mesh settings work to
call `bt_mesh_rpl_pending_store`.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-12-08 10:25:36 +00:00
Emil Gydesen
203949c42c Bluetooth: VCP: Allow for multiple vol_ctrl cb registers
Modify the VCP volume controller callbacks to support
multiple registers by making it into a linked list.

This allow for multiple applications to get the information
from procedures or notifications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-08 10:04:31 +00:00
Lingao Meng
786b9a0ad4 Bluetooth: Host: Add const prefix for UUID
Add const prefix for service uuid and char uuid.

Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.

The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-07 16:16:43 +00:00
Emil Gydesen
3fec3964e0 Bluetooth: CAP: Move initiator/commander common code to cap_common
The CAP Initiator and the CAP Commendar share quite a lot of
functionality in terms of discovery and performing set-based
procedures.

The code for handling most of this has been moved to
cap_common.c to avoid duplicating code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-07 16:14:42 +00:00
Jonathan Rico
3e56b12c58 Bluetooth: ATT: don't access l2cap ops struct
It's bad form, especially since in that case, it's always the same function
that is called `bt_att_sent()`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-12-07 10:37:37 +00:00
Emil Gydesen
e496cbe512 Bluetooth: VCP: Vol rend: Add check before notification log
To avoid having "notification scheduled in 0ms" in the log,
check to verify that the delay is not K_NO_WAIT.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-06 17:55:10 +00:00
Mariusz Skamra
78a4b33e5c Bluetooth: audio: pacs: Add bt_pacs_set_available_contexts_for_conn
This adds the function that sets the available contexts value per
connection object so that API user can set different available contexts
per connection.
The lifetime of such overriden value is the same as connection lifetime,
so on reconnection or device reboot all devices return to having the
same available contexts value again.

Fixes: #64968
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-06 17:54:14 +00:00
Mariusz Skamra
014c22c9c0 Bluetooth: audio: pacs: Fix invalid lookup
This fixes client lookup that was done with use of bt_conn_index while
the size of the client array is CONFIG_BT_MAX_PAIRED.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-06 17:54:14 +00:00
Mariusz Skamra
ef362e766a Bluetooth: audio: pacs: Disallow changing supported contexts
Disallow further changes of supported audio contexts characteristic is
the GATT Characteristic Notify Property is not set.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-06 17:54:14 +00:00
Jonathan Rico
ea04fd95f9 Bluetooth: ATT: remove BT_ATT_ENFORCE_FLOW
Enforcing the peer's behavior is not strictly necessary. All the host
should do is make sure it is resilient to a spec-violating peer.

Moreover, a growing number of platforms were disabling the check, as the
spec allows "batching" HCI num complete packets events, stalling ATT RX.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-06 17:53:54 +00:00
Piotr Narajowski
4dad6616f7 bluetooth: audio: Add API to get MCS service ATT handles
This is needed for upper tester.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-12-06 17:52:49 +00:00
Emil Gydesen
38d73a6ccf Bluetooth: VCP: Add bt_vcp_vol_ctlr_get_by_conn
Add function to get a volume controller from a connection
pointer.

This is required for the CAP to get a vol_ctlr pointer
from the provided bt_conn.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-06 17:51:58 +00:00
Emil Gydesen
c9daed9712 Bluetooth: BAP: Refactor bt_bap_base
This removes the fixed size bt_bap_base, which provides
2 improvements:
1) The RAM usage of the broadcast sink has been reduced.
   For the Broadcast Sink sample it is a reduction of 120
   octets, but with much better scaling for supporting
   more or larger BASEs.
2) The functions to parse BASEs now support arbitrary sized
   BASEs, where they were previously restricted by our
   local Kconfig options. This allow us to parse any BASE
   from a remote device, without encounting memory issues.
   We are still memory restricted on the devices we
   actually want to sync to.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-12-06 17:51:47 +00:00
Aleksander Wasaznik
d3a0c769b0 Bluetooth: Shell: Workaround coverity uint comparation
The current code triggers a false positive from the heuristic "Macro
compares unsigned to 0". It's triggered because of a use of `IN_RANGE`
that checks against the extremal values of a enum type.

This patch replaces the use of `IN_RANGE` with an explicit list of the
possible values of the enum.

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

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-12-04 16:37:36 +00:00
Håvard Reierstad
897a1d0d1c Bluetooth: Mesh: suspend/resume advertising
Disables Mesh advertising when suspending, and enables advertising
when resuming Mesh.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-12-04 14:38:13 +01:00
Håvard Reierstad
3be26c4cb9 Bluetooth: Mesh: advertiser: add disable function
Adds a disable function for the extended advertising which stops and
deletes the advertising instances, allowing them to be properly
reinitialized when calling `bt_mesh_adv_enable()` after bluetooth has
been disabled and re-enabled.

For the legacy advertising, the function terminates the advertising
thread. If legacy advertising is used, `bt_mesh_adv_init()` must be
called before `bt_mesh_adv_enable()` to properly resume advertising
after suspension.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-12-04 14:38:13 +01:00
Mariusz Skamra
5174e94c91 Bluetooth: audio: has: Fix coverity issues
This fixes issues discovered by coverity check.

Fixes: #65325
Fixes: #65326
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-01 16:26:03 +01:00
Adam Cavender
ac4f9a6962 Bluetooth: Shell: Fix cmd_chan_map
Allow the channel map to be set when periodic advertising or acting as
an ISO source.

Signed-off-by: Adam Cavender <adam.cavender@nordicsemi.no>
2023-12-01 14:30:52 +01:00
Adam Cavender
ad485866b0 Bluetooth: Host: Fix bt_le_set_chan_map
Allow the channel map to be set when periodic advertising or acting as
an ISO source.

Signed-off-by: Adam Cavender <adam.cavender@nordicsemi.no>
2023-12-01 14:30:52 +01:00
Peter Johanson
be5a341467 bluetooth: Add CPF attribute to BAS battery level.
BAS v1.1, section 3.1.2.1 notes that a CPF should be added if the
device has more that one instance of the Battery Service, so
add one with the `main` description so that apps can add additional
Battery Level services with other descriptions, e.g. `auxiliary`.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2023-12-01 10:58:27 +00:00
Mia Koen
0bcad09392 bluetooth: mesh: Doc fix Bluetooth mesh to Mesh
SIG has changed Bluetooth mesh to Bluetooth Mesh
Updating zephyr docs accordingly
Leaving out old release notes

Signed-off-by: Mia Koen <mia.koen@nordicsemi.no>
2023-12-01 10:56:18 +00:00
Andries Kruithof
c3e2be4314 Bluetooth: audio: host: call the stream disable callback
Even though the ASCS Sink ASE state machine does not enter the disabling
state according to ASCS spec, it still makes sense to do so.

the state transition unit tests are updated to verify calling or not
calling the disable callback, depending on the transition of the state

fixes #63230

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-12-01 10:50:04 +00:00
Magdalena Kasenberg
c94cd30cec bluetooth: bap: Fix shift of requested_bis_sync
The BIS_Sync bitfiled received over the air in Add Source and Modify
Source operations uses BIT(0) for BIS Index 1. Shift it when storing
it to match bis_sync bitfield where BIS Index 1 is at BIT(1).

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-30 12:10:35 +00:00
Magdalena Kasenberg
2094183d81 bluetooth: bap: Fix shift of BIS_Sync parameter of notification
bis_sync contains BIS index bitfield which is shifted by 1 bit relative
to the BIS_Sync parameter of Broadcast Receive State notification.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-30 12:10:35 +00:00
Aleksander Wasaznik
dc834cb217 Bluetooth: l2cap: remove bt_l2cap_chan_send_cb
It has no more users and was an internal API.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-30 10:06:19 +01:00
Aleksander Wasaznik
8a3201c223 Bluetooth: att: Remove att use of bt_l2cap_chan_send_cb
EATT is the only user of `bt_l2cap_chan_send_cb`, and not necessary. We
can maintain the same functionality without it.

Instead of passing and storing the callback into l2cap, we can store it
in a callback queue in the ATT bearer struct.

This will allow us to remove that internal API later, in order to
streamline the l2cap API.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-30 10:06:19 +01:00
Aleksander Wasaznik
535e003a00 Bluetooth: Use CONFIG_BT_CONN_TX_USER_DATA_SIZE
Replace hardcoded value `8` with `CONFIG_BT_CONN_TX_USER_DATA_SIZE`,
that is `8` but is going to change.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-30 10:06:19 +01:00
Armin Brauns
5b1b260f80 bluetooth: add HCI driver parameter to set controller's public address
This allows HCI drivers to expose vendor-specific functions to set the
public address.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-11-29 10:44:25 +01:00
Kyra Lengfeld
77ab683dc6 Bluetooth: Host: Align return lines of bt shell helper function phy2str
As other helper functions were introduced for the LE Power Control
Request Feature (see CONFIG_BT_TRANSMIT_POWER_CONTROL), it was noticed
that the return statements of switch cases should be on the next line
generally. This will align phy2str with the rest in bt.c.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2023-11-29 09:59:39 +01:00
Kyra Lengfeld
2c9af855bc Bluetooth: Host: Add bt shell functions LE Power Control Request Feature
To use LE commands of Le Power Control Request Feature one must utilize
the BT_TRANSMIT_POWER_CONTROL config.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2023-11-29 09:59:39 +01:00
Kyra Lengfeld
93e5cf6e61 Bluetooth: Host: Add LE Power Control Request Procedure APIs
This commits adds the LE API's for the LE Power Control Request Feature
in Zephyr.

The support of feature is provided with the controller-based feature
selection with BT_CTLR_LE_POWER_CONTROL_SUPPORT and is selectable via
BT_TRANSMIT_POWER_CONTROL.

With the new APIs, the applications will:
get improved reading of local and remote tx power
be aware of changes in remote or local tx power

Defined HCI commands in Core Spec v5.4:
7.8.117 LE Enhanced Read Transmit Power Level command:
improvement to existing local tx power reading.
7.8.118 LE Read Remote Transmit Power Level command:
Remote tx power is read through an event (LE Transmit Power Reporting)
7.8.121 LE Set Transmit Power Reporting Enable command:
Enables local or remote tx power reporting to monitor changes in tx power
7.7.65.33 LE Transmit Power Reporting event

Note: to utilize the Feature fully Nordic-LL-only vendor-specific commands
are needed. These will not be added in RTOS zephyr but instead
implemented in a maintainable way in sdk.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2023-11-29 09:59:39 +01:00
Kyra Lengfeld
56a5901955 Bluetooth: Controller: Add Kconfig for LE Power Control Request Feature
Add the controller Kconfig to use in Zephyr.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2023-11-29 09:59:39 +01:00
Troels Nilsson
f0032a369d Bluetooth: L2CAP: Fix leaking tx metadata
Fix l2cap error handling generally not properly disposing of tx buffers for
enhanced channels; Any callbacks have to be called and the
l2cap_tx_meta_data has to be freed

Signed-off-by: Troels Nilsson <trnn@demant.com>
2023-11-28 15:34:51 +01:00
Troels Nilsson
b782b11f16 Bluetooth: L2CAP: l2cap_create_le_sig_pdu() no longer uses buf
The l2cap_create_le_sig_pdu function no longer uses the buf
argument; Remove it from the function

Signed-off-by: Troels Nilsson <trnn@demant.com>
2023-11-28 15:34:51 +01:00
Pavel Vasilyev
161aadd590 Bluetooth: Mesh: Return immediately if labels not supported
This avoid unnecessary triggering of settings work.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-28 14:48:29 +01:00
Pavel Vasilyev
362924a693 Bluetooth: Mesh: Use ATOMIC_DEFINE instead of atomic_t
atomic_*_bit functions work with atomic_t arg as with array, therefore
the atomic variable should be declared using ATOMIC_DEFINE.

Coverity-CID: 333358
Fixes #65588

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-28 14:48:29 +01:00
Mariusz Skamra
b373079275 Bluetooth: audio: ascs: Remove spurious error message
This removes spurious error message printed when CIS has been
disconnected and it was not used by any of the endpoints.
This case is valid and may happen on Connection Timeout when the
controller reports ACL Disconnection first.
When the CIS Disconnection is reported after, the ASE is already in idle
state and the referenece to CIS has been already removed (on ACL
disconnection).

Fixes: #64896
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-11-27 12:16:30 +00:00
Vinayak Kariappa Chettimada
d36e085ecc Bluetooth: Controller: Fix scan aux context leak
Fix scan aux context leak under BT_CTLR_SCAN_UNRESERVED.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-27 12:15:29 +00:00
Vinayak Kariappa Chettimada
d573951f0d Bluetooth: Controller: Revert back early abort of previous prepare
Revert back to implementation that did early abort of
previous prepare when a short prepare is enqueued.

Adds back implementation deleted in
commit 7f388bb70a ("Bluetooth: Controller: Fix short
prepare when many enqueued in pipeline").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-27 12:15:29 +00:00
Vinayak Kariappa Chettimada
b444dc442b Bluetooth: Controller: Minor re-arrange advanced feature Kconfig
Minor refactor of Kconfig order such that the advanced
feature Kconfig is just above the enabling/visible of the
advanced features menu.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-27 12:15:29 +00:00
Vinayak Kariappa Chettimada
ec7bdde22b Bluetooth: Controller: Improve preempt timeout req/ack counting
Improve preempt timeout request and acknowledge counting.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-27 12:15:29 +00:00
Vinayak Kariappa Chettimada
12cefe1027 Bluetooth: Controller: Fix compiler warning when RL_SIZE=1
Fix compiler warning when BT_CTLR_RL_SIZE=1.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-25 08:54:39 -05:00
Vinayak Kariappa Chettimada
6c7c5bd5dd Bluetooth: Controller: Fix uninitialized ad_len_chain variable
Fix uninitialized ad_len_chain variable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-25 08:47:36 -05:00
Vinayak Kariappa Chettimada
ca45155a23 Bluetooth: Controller: Fix NULL pointer dereferencing in Sync ISO
Fix NULL pointer dereferencing when Host supplies an out of
bounds BIG handle.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-25 08:47:00 -05:00
Lukas Streitenberger
10a167f6c1 Bluetooth: TBS: Added missing callState notifications
Changes of call state were not notified. Fixed by calling notify_calls
in respective functions.

Signed-off-by: Lukas Streitenberger <lukas.streitenberger@wsa.com>
2023-11-24 11:39:34 +01:00
Aleksandr Khromykh
3d37549bac Bluetooth: Mesh: allocate mesh max required buffer number
Since sending of public key was moved into system
work (https://github.com/zephyrproject-rtos/zephyr/pull/62331)
it uses the same context as a Host Tx buffer
allocator for gatt sending. Host cannot wait for
free buffer anymore. Mesh requires 4 buffers
to send max size frame(public key) during
provisioning.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-11-24 09:26:37 +01:00
Mariusz Skamra
e1a14bad30 Bluetooth: audio: has: Add non-volatile settings
This adds non-volatile settings for the HAS Server. Those are needed to
restore the client awareness of preset list entries exposed by the
server. Based on the settings, the implementation determines how to
notify the client about the HAS related characteristic value changes.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-11-22 09:51:33 +01:00
Emil Gydesen
1829cf4324 Bluetooth: Audio: Add set functions for codec meta
Add set function for all metadata types for both
codec_cfg and codec_cap.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-21 08:38:29 +00:00
Pavel Vasilyev
07848a4456 Bluetooth: Mesh: Fix integer overflow
Fix potential integer overflow by casting one of operands to int64_t.

Coverity-CID: 329961
Fixes #65356

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-20 09:23:56 +01:00
Pavel Vasilyev
3bc17d1d18 Bluetooth: Mesh: Fix async behavior of Private Beacon Client API
The Private Beacon Client API requires a response argument to allow to
call the API in the asynchronous manner
(https://github.com/zephyrproject-rtos/zephyr/pull/56426).

Because the removal of the EXPERIMENTAL tag for this API was not
released yet, it should be OK to change this API.
The EXPERIMENTAL tag has been removed here:
https://github.com/zephyrproject-rtos/zephyr/pull/64866

Coverity-CID: 330039
Coverity-CID: 330029
Coverity-CID: 329977

Fixes #65336
Fixes #65338
Fixes #65354

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-20 09:23:56 +01:00
Pavel Vasilyev
b15611eb28 Bluetooth: Mesh: Check return value of bt_conn_get_info
Coverity-CID: 323094
Fixes #65366

Coverity-CID: 323081
Fixes #65370

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-20 09:23:56 +01:00
Pavel Vasilyev
6a5d082cc5 Bluetooth: Mesh: Ignore return value of settings_delete
This suppresses warning from Coverity.

Coverity-CID: 330638
Fixes #65330

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-20 09:23:56 +01:00
Lingao Meng
5f1c2f199b Bluetooth: Mesh: Make element as rodata
the reason is that the Mesh Profile clearly stipulates that Mesh nodes
cannot change their own element definitions.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-20 09:22:55 +01:00
Jonathan Rico
dfd7624270 Revert "Bluetooth: att: use a dedicated metadata struct for RSP PDUs"
This reverts commit 14858d96d87d33ebb593d61380f4607e14107287.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-11-17 09:26:08 +01:00
Jonathan Rico
bd9c35b496 Revert "Bluetooth: att: re-use REQ buf for RSP"
This reverts commit aa7954bd4725bbd46e974a03c0d0312b7e9a483f.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-11-17 09:26:08 +01:00
Jonathan Rico
530e845f92 Revert "Bluetooth: att: don't re-use the ATT buffer for confirmations"
This reverts commit 4cd0748a407b118145916393a954231ee11abb1e.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-11-17 09:26:08 +01:00
Aleksander Wasaznik
bf2f065876 Bluetooth: Host: Remove ifdef around sc_indicate
Instead, `sc_indicate` is defined as a no-op when if would previously
not be defined.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-17 09:25:34 +01:00
Lingao Meng
2cd8d40b97 Bluetooth: Mesh: Split Model Structure
Split Model Variables to separate structue.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-16 16:52:14 +01:00
Lingao Meng
ab08f34fd9 Bluetooth: Mesh: Make bt_mesh_model as rodata
Since model struct most of member should not change at run time,
so mark as const will be suitable and safely.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-16 16:52:14 +01:00
Mariusz Skamra
ba61420504 Bluetooth: audio: ascs: Retry ASE state notifications on error
This adds retry logic for ASE state notifications if failed due to
insufficient number of buffers to send ATT PDU. The state transition is
retried after connection interval delay.

Fixes: #64574
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-11-15 10:03:07 +01:00
Lingao Meng
1f4dacad08 Bluetooth: Mesh: Remove relay sets config for adv
Separate queue should also used for lagecy adv, due to
when local queue has adv buf, k_poll will process local queue.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-11-15 10:01:47 +01:00
Vinayak Kariappa Chettimada
09c69731cd Bluetooth: Controller: Reduce RTN for requested Max Transport Latency
Add implementation to reduce CIG's CIS retransmissions so as
to meet the Host requested Maximum Transport Latency.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-14 09:46:02 +01:00
Kamil Piszczek
f6d6742ca1 bluetooth: id: make sharing RPA between adv sets optional
Added a Kconfig option that makes the RPA sharing feature optional. By
default, the Zephyr Bluetooth stack now uses the RPA rotation policy
that was active before the introduction of the RPA sharing functionality
in the following PR:

https://github.com/zephyrproject-rtos/zephyr/pull/55449

The new Kconfig option configures the advertising sets linked with the
same Bluetooth identity to use the same Resolvable Private Address in
a given rotation period. After the RPA timeout, the new RPA is
generated and shared between the advertising sets in the subsequent
rotation period.

When this option is disabled, the generated RPAs of the advertising
sets differ from each other in a given rotation period.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2023-11-14 09:22:51 +01:00
Jordan Yates
e74676223a bluetooth: host: gatt: statically init callback list
Statically initialise the callback list so that subscriptions can be
registered before the call to `bt_enable`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-11-14 09:21:16 +01:00
Pavel Vasilyev
64e1d0c3be bluetooth: mesh: Don't write to const value
`bt_mesh_default_key` is declared as const and thus located in flash.
`bt_mesh_cdb_subnet_key_export` tries to copy to that address which
results in a Bus Fault.

Use separate array for storing net_key.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-11-13 09:51:25 +01:00
Mariusz Skamra
f434198a2b Bluetooth: att: Retry ATT request if security elevation is in progress
If the conn security elevation is already in progress, retry the ATT
request if failed due to security reasons.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-11-13 09:45:20 +01:00
Emil Gydesen
06d5a625a6 Bluetooth: Audio: Add codec cap set functions
Add set functions for codec capability, to set all
assigned number values in the bt_audio_codec_cap
struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-13 09:42:35 +01:00
Emil Gydesen
c35e677d82 Bluetooth: Audio: Split ltv_set_val from codec_cfg_set_val
Add a new function, ltv_set_val, that did most of the
data manipulation from codec_cfg_set_val, so that we can
reuse that code for the codec cap and codec meta
functions as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-13 09:42:35 +01:00
Magdalena Kasenberg
647207c024 bluetooth: leaudio: Fix missing set of BIG_Encryption
In the PTS BASS/SR/CP/BV-19-C test case a client executes Set
Broadcast Code operation of Broadcast Audio Scan Control Point
characteristic with Broadcast_Code set to an invalid value.
After syncing to an ISO stream there is an expected failed attempt
to decrypt the stream data, but the host does not set BIG_Encryption
value to the expected value 0x03 (BT_BAP_BIG_ENC_STATE_BAD_CODE).
Add missing BIG_Encryption state into the failing check.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-10 10:40:40 +01:00
Magdalena Kasenberg
35f326b821 bluetooth: leaudio: Termination of PA at Modify Source
From BASS spec:
If the PA_Sync parameter value written by the client is set to a value
of 0x00 (Do not synchronize to PA) and the server is synchronized to
the PA, the server shall stop synchronization with the PA and shall
write a value of 0x00 (Not synchronized to PA) to the PA_Sync_State
field of the Broadcast Receive State characteristic .

Fixes BASS/SR/CP/BV-12-C test case.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-09 15:32:32 +01:00
Magdalena Kasenberg
a2210bde63 bluetooth: audio: delegator: Use BT_ATT_ERR_WRITE_REQ_REJECTED
If the total length of the opcode and parameter values of Broadcast
Receive State characteristic operation is incorrect, the server shall
respond with an ATT Error Response and the Error Code set to Write
Request Rejected (0xfc), instead of 0x0d
(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN).

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-08 15:10:39 +00:00
Aleksandr Khromykh
c5ee143d77 Bluetooth: Mesh: no more tinycrypt in ble mesh tfm image
PR allows to get rid of tinycrypt objects from
the final binary of the ble mesh apps based on
PSA TFM crypto.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-11-08 15:09:50 +00:00
Kamil Piszczek
29a67338d1 bluetooth: id: fix uninitialized RPA for non-default identities
This change fixes uninitialized RPA values for advertising sets of
non-default Bluetooth identities. The regression has been introduced
in the following commit:

8d6b206064

The follow-up fix for the default Bluetooth identity has been
introduced in a separate commit:

88c20b9cdd

Non-default Bluetooth identities can be loaded from the Settings
subsystem. In this case, RPAs of related advertising sets to these
identities are left uninitialized as the bt_id_create() function
context is not executed. As a result, the RPA is not created for
advertising sets of non-default Bluetooth identities, and the
advertising is started with the 00:00:00:00:00:00 address.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2023-11-08 15:09:22 +00:00
Aleksandr Khromykh
b6f20d67c2 Bluetooth: Mesh: fix On-Demand API usage
On-Demand proxy client API has been changed but
usage of this API in shell test was missed.
Commit fixes this API usage.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-11-08 10:08:36 +01:00
Aleksandr Khromykh
50d17a0d52 Bluetooth: Mesh: split gatt client and solicitation pdu sending
The ability to send the solicitation PDU doesn't
depend on GATT Client role.
Commit makes independent one functionality from
another.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-11-08 10:08:36 +01:00
Ingar Kulbrandstad
e1a5605889 Bluetooth: Mesh: Remove experimental tag
Remove experimental tag for Mesh Protocol v1.1,
Mesh Model v1.1, Mesh DFU v1.0 and Mesh BLOB v1.0
features.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2023-11-07 11:57:17 +01:00
Rubin Gerritsen
8b2dd61eba Bluetooth: HCI: Add bt_hci_get_ver_str()
This new API returns the version string corresponding to a given
HCI version.

The API can be used by applications to print out human-readable
information about the controller being used.

Adding this API removes possible code duplication.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2023-11-07 09:55:05 +01:00
Emil Gydesen
b92ac42677 Bluetooth: CAP: Commander API and skeleton
Adds the CAP Commendar API and skeleton that can
implemented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-07 09:49:41 +01:00
Magdalena Kasenberg
1747c33796 bluetooth: audio: delegator: Notify state after updating BIG_Encryption
If the server has synchronized to the PA and detected that the BIS is
encrypted, the server writes a value of 0x01 (Broadcast_Code
required) to the BIG_Encryption field of the Broadcast Receive State
characteristic to request a client to provide a Broadcast_Code.
In PTS BASS/SR/CP/BV-14-C test case the PTS (client) expects that the
new value of the Broadcast Receive State characteristicstate will be
notified, so the PTS could sent Set Broadcast_Code operation to the
server.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2023-11-06 12:32:23 +01:00
Troels Nilsson
3c9d952820 Bluetooth: Controller: Fix failing LL/DDI/SCN/BV-88-C
Fixes failing EBQ test LL/DDI/SCN/BV-88-C Extended Scanning,
Active, Properly Ignore RFU Fields

Several minor modifications made to le_ext_adv_report() to
properly ignore any invalid fields present in the received PDUs

Signed-off-by: Troels Nilsson <trnn@demant.com>
2023-11-06 10:10:47 +01:00
Andries Kruithof
2a34ecf858 Bluetooth: shell: host: add missing conditional compile
There was a conditional compile misssing for the
BT_PER_ADV_SYNC_TRANSFER_SENDER, potentially leading
to build failures

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-11-06 10:10:07 +01:00
Benjamin Lucke
1b34884d81 Bluetooth: TBS: Fixed return call_index 0 after overflow
Fixed range of call_index 1 to 255, since 0 is reserved for outgoing calls.

Signed-off-by: Benjamin Lucke <git@lucke.tech>
2023-11-03 09:55:22 +01:00
Carles Cufi
9cf07bbdb5 bluetooth: Rename rpmsg HCI driver and sample to ipc
The existing driver and sample:

- drivers/bluetooth/hci/rpmsg
- samples/bluetooth/hci_rpmsg

are no longer correctly named, since they now use the IPC subsystem to
send and receive data. The IPC subsystem can use RPMsg as a transport,
but that is one of several selectable backends.

I initially wanted to deprecated both the BT_RPMSG Kconfig option as
well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However,
this proved to be undoable in the case of the Kconfig option. This is
because it's a choice option, and those have special behavior. In
particular, the only practical way to deprecate would've been to keep
the old Kconfig option outside the choice (much like it's done in this
commit) but then also add a 'depends on !BT_RPMSG' on each of the
remaining choice symbols *except* on the new BT_HCI_IPC one. This, however,
only works correctly for .conf files. If a board instead sets the
default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig
tree parsing would fail, because it'd try to set it to a value
(BT_RPMSG) that is no longer part of the choice.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-11-02 08:32:20 +02:00
Benjamin Lucke
9c323d685b Bluetooth: BAP: Shell: Fixed some bap shell cmds
Added missing initialization for cmd_stream_qos and cmd_sync_broadcast.

Signed-off-by: Benjamin Lucke <git@lucke.tech>
2023-10-30 14:57:33 -05:00
Alberto Escolar Piedras
08f6532b67 Bluetooth: Controller: Fix corruption during BIG_CHANNEL_MAP_IND
radio_pkt_big_ctrl_get() returns a statically allocated
buffer of type pdu_big_ctrl, but the callers expect a
buffer where a whole PDU for a BIG control packet can fit
(not just space for the payload),
and use it as such, overflowing this statically
allocated buffer, and smashing other variables after.

Let's fix it by allocating a buffer of the correct size
to fit a BIG control PDU.

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

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-30 18:36:39 +01:00
Alberto Escolar Piedras
55c59e041e Bluetooth: Controller: Avoid division by 0 with BT_CTLR_THROUGHPUT
With very fast HCI interfaces (for ex. in the simulated nrf5340)
the tx_rate calculation can do a division by 0
(if to packets are enqueued in the same 32KHz clock period).
Let's avoid it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-30 10:49:51 +01:00
Andries Kruithof
8c1513c837 Bluetooth: shell: make behaviour of iso cmd same as bt cmd
When no parameters are given to the 'bt' command it prints
the help message. The 'iso' command responds with 'missing
subcommand'. This commit updates the behaviour of the iso
command so that it behaves the same as the bt command, i.e.
prints a help message

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-27 10:53:25 +02:00
Emil Gydesen
6aea1864c1 Bluetooth: ISO: Minor fixes for ISO shell
If CONFIG_BT_ISO_TEST_PARAMS=y then the CIG and BIG
create params was not properly initialized.

Modified the TX for BIS and CIS to be more similar

Added a timeout on the buffer to avoid any potentional
deadlocks.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-26 09:48:54 +02:00
Emil Gydesen
34058146a5 Bluetooth: BAP: Shell: Remove unused variable stream_frame_duration_us
The variable was unsused and caused compiler warnings.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-25 17:36:22 +02:00
Anders Storrø
d4037ce6a1 Bluetooth: Mesh: Correct pack of net idx hb_status
Ensures correct packing of net idx in Heartbeat Publication Status
messages on the Configuration Server.

Reference to net idx packing format: MshPRTv1.1 section 4.3.1.1

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:22 +02:00
Anders Storrø
05774c5d76 Bluetooth: Mesh: Fix unpacking of hb_pub status
Fixes incorrect unpacking of Heartbeat Publication status
messages on the Configuration client.

Reference to packing format: MshPRTv1.1 section 4.3.2.63

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:22 +02:00
Anders Storrø
46d9c97991 Bluetooth: Mesh: HB pub status for unassigned addr
Fixes issue where Heartbeat Publication Status message sends
garbage data when destination field is set to the unassigned address.

MshPRTv1.1, section 4.4.1.2.15:
"When the Destination field is set to the unassigned address, the values
of the CountLog, PeriodLog, TTL, and Features fields shall be set to
0x00 and NetKeyIndex field shall be set to 0x0000."

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:22 +02:00
Anders Storrø
c51bb9c13b Bluetooth: Mesh: Update spec ref 1.0.1->1.1
Updates Bluetooth mesh specification references:

- Change "Profile" to "Protocol" since the main specification has
changed its name.
- Update/align formating of specification references. This will
make it easier to find spec references in the future.
- Change some section references to point to the correct section of the
newest version of the specification (v1.1).

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-25 14:50:14 +02:00
Vinayak Kariappa Chettimada
f64d123a3d Bluetooth: Controller: Fix missing ext adv terminate event
Fix missing Extended Advertising terminate event and
advertising scheduling not being stopped.

Under race conditions, auxiliary event is aborted without
the generation  of done extra event which is suppose to
stop the scheduling when max events count is used.

The fix now generates the done extra event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-24 15:12:18 +02:00
Vinayak Kariappa Chettimada
05c85ddbcf Bluetooth: Controller: Fix periodic advertising sync window
Fix periodic advertising sync window calculation to include
the scheduling resolution margin, i.e. be double as with
the event jitter value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-24 15:12:18 +02:00
Omkar Kulkarni
3de98643ed Bluetooth: Mesh: FU Server should not update internal state on error
According to conditions in the DFU spec section 6.1.3.7 (Sending a
Firmware Update Status message) and in 'Idempotency' part of section
6.1.3.4 (Receiving a Firmware Update Start message), the FU Server
should not update internal state when 'Wrong Phase' error condition
is triggered.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2023-10-24 09:05:59 +02:00
Andries Kruithof
e3d6aac5c0 Bluetooth: ISO: use IN_RANGE for CIG create parameters
Use IN_RANGE instead of explicitly checking that a value is
in between two other values

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-23 15:22:10 +02:00
Andries Kruithof
8b3b8cf2ad Bluetooth: ISO: extend API for setting SDU interval
The BT Core Spec v5.4 allows separate SDU_Interval to
be set on C_To_P and P_To_C directions,
but this is not possible with the existing interface.

This PR splits the interval parameter in the call to
bt_iso_sig_create into one for C_To_P
and one for P_To_C

It also splits the latency parameter into one for
C_To_P and one for P_To_C

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>

Bluetooth: ISO: update UI for extended API

The API for setting the SDU interval and latency have been updated.
This PR also updates the setting of these by the user in the shell
and the iso_connected_benchmark sample

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-23 15:22:10 +02:00
Aleksander Wasaznik
9f42c92e26 Bluetooth: Host: Fix GATT Long Read for EATT
When EATT is established, the value returned from `bt_att_get_mtu` is
not useful to determine the ATT_MTU that applies to a ATT response. This
is because `bt_att_get_mtu` may return the value for a different bearer
than the request is serviced on.

To fix this, the params struct for the GATT read operation is given a
new field that will record the ATT_MTU that applies to this ATT
operation. This value is then used to determine if the GATT long read
operation is concluded.

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

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-10-23 11:01:21 +02:00