Commit graph

21541 commits

Author SHA1 Message Date
Robert Lubos
a09fd8e97f net: if: Clear neighbor cache when removing IPv6 addr with active DAD
DAD creates an entry in the neighbor cache for the queried (own)
address. In case the address is removed from the interface while DAD is
still incomplete, we need to remove the corresponding cache entry (just
like in case of DAD timeout) to avoid stale entries in the cache.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-19 18:48:52 +01:00
Benjamin Cabé
cc3fd97db0 net: ipv6: use inclusive terminology in net_ipv6_pe_filter_cb_t
Minor fix to use inclusive terminology for the is_blacklist flag.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-02-19 18:48:15 +01:00
Nick Brook
d0d3dd476b mgmt/mcumgr: Add error logs for all error cases
Errors were logged for some cases in zephyr_img_mgmt.c, but not all.
This commit adds error logs for all error cases.

Signed-off-by: Nick Brook <nrbrook@gmail.com>
2025-02-19 14:49:37 +00:00
Pavel Vasilyev
9757ffa5fa bluetooth: host: smp: fix deadlock when public key generation fails
When `bt_le_oob_get_local` or `bt_le_ext_adv_oob_get_local` is called
and SMP is enabled, `bt_smp_le_oob_generate_sc_data` is called to
generate a Random Number and a Confirmation Value needed for OOB data.
These values are based on the device's public key.

The public key is generated only once when `bt_smp_init` is called.
If public key generation fails, the callback passed to `bt_pub_key_get`
is called with `pkey` set to NULL. The `bt_smp_pkey_ready` callback
gets called, but it doesn't release the `sc_local_pkey_ready` semaphore
thus leaving `bt_smp_le_oob_generate_sc_data` wait for semaphore with
`K_FOREVER`.

This commit replaces the semaphore with a conditional variable and
requests a public key again if the key is NULL thus solving 2 issues:
- handling the case where the callback was triggered notifying about the
  completion of the public key request, but the key was not generated,
- handling the case where multiple threads trying to acquire the same
  sempahore.

The timeout is used instead of K_FOREVER to avoid cases when callback
has never been triggered.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-02-18 18:44:23 +01:00
Robert Lubos
7ccf870670 net: coap_client: Stop all socket activities when cancelling requests
Calling coap_client_cancel_requests() clears the internal request
context only for active requests (i. e. not replied yet). However,
if there are any pending request context monitoring ACK duplicates,
those would still make the corresponding client socket being monitored
by poll(). In result, when application closes the socket, the polling
thread will throw POLLNVAL error for the socket.

Fix this, by resetting all request contexts unconditionally. The request
callback will only be called for the active requests.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-18 13:31:15 +01:00
Lyle Zhu
3f81e81598 Bluetooth: AVDTP: Fix memory leak issue
In function `avdtp_send`, there is case that if the session->req is not
NULL, then the buf will be lost.

Release the allocated buffer by buffer allocated function when the buf
is failed to send.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-02-18 13:30:53 +01:00
Luis Ubieda
2ce2794987 rtio: workq: Select Early P4WQ threads init
Otherwise the RTIO Workqueue is not functional for devices during init.

An example of this issue is devices using SPI transfers with default
spi_rtio.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-02-18 05:32:58 +01:00
Emil Gydesen
1280f432f4 Bluetooth: ASCS: Missing cleanup of stream for idle state
When the stream enters the idle state, some values were not
properly reset (e.g. the stream->ep).

Use the bt_bap_stream_detach function to clean up the stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-17 21:16:10 +01:00
Vinayak Kariappa Chettimada
dcdd330895 Bluetooth: Controller: Fix redundant reset of sync aux association
Remove redundant reset of LLL sync aux context association.

Related to commit 3263729020 ("Bluetooth: Controller: Fix
assertion terminating Periodic Sync").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-02-17 15:47:36 +00:00
Vinayak Kariappa Chettimada
49642efa41 Bluetooth: Controller: Fix regression in scan aux release
Fix regression in scan aux release now that aux context is
retrieved from the node rx when supporting multiple chain
reception.

Relates to commit a8065926ac ("Bluetooth: Controller: Fix
to release aux context stored in node rx").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-02-17 15:47:36 +00:00
Aleksandr Khromykh
acc752fce4 Bluetooth: Mesh: remove weak attribute and rename functions
Commit removes weak attribute and renames some functions
in crypto_psa.c since there is no centralized distribution
of the PSA key ID in bsim tests and no necessity to
reimplement native mesh approach.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-02-17 08:09:28 +01:00
Emil Gydesen
94d5d59be7 Bluetooth: AICS: Fix check for BT_AICS_INPUT_TYPE
The check did not take the highest value into account.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-15 07:23:37 +01:00
Krzysztof Chruściński
d23e12ac45 logging: backends: rtt: Do not enable when shell logging is used
Typically, when shell logging backend is used user wants to get
logs on shell instances so do not enable raw RTT log backend in
that case. When raw backend is enabled then initial logs go to
RTT backend and they are not visible on shell which starts later
as it requires additional thread.

It can be assumed that when RTT backend is used it will be
explicitly enabled by the user.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-02-14 19:40:23 +00:00
Rex Chen
a296b4968b net: wifi: L2 shell cmd 11v BTM query support embedded supplicant
Remove the CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM macro in L2 shell level
to make 11v BTM query support embedded supplicant.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2025-02-14 19:40:09 +00:00
Emil Gydesen
907261b619 Bluetooth: BAP: Remove GATT_CACHING req for unicast server
The unicast server does not need GATT caching and it was likely
incorrectly added earlier as a dependency.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-14 19:15:57 +00:00
Emil Gydesen
9eaf232b57 Bluetooth: BAP: Fix notifications for scan delegator
Instead of providing NULL for bt_gatt_notify_uuid we
iterate on the connection objects and ensure that we
properly truncate the notification based on each
connection's GATT MTU.

This ensures that we send the right size for all
connections.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-14 19:15:42 +00:00
Emil Gydesen
7bcd1e78de Bluetooth: Audio: Add common bt_audio_get_max_ntf_size
Add a common function to get the maximum notification
size, instead of having multiple implementations of this.
Ideally this function should be moved to the GATT API,
but for now just implement it for LE audio and then move to
GATT later.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-14 19:15:42 +00:00
Emil Gydesen
317cc9d52e Bluetooth: CCP: Add missing documentation for CCP discover
Added missing documentation for
bt_ccp_call_control_client_discover.

Added missing handling of -ENOTCONN in the function as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-14 19:15:31 +00:00
Lyle Zhu
50a3a6ec7c Bluetooth: SDP: Check if frame len is consistent with attr list count
The total attributes list bytes count is only used to check the tail
room of response buffer. And the remaining frame length is used to
copy data from receiving buffer.

It does not check whether the remaining frame length is consistent with
the total attributes list bytes count.

Add the checking to make sure the attributes list is complete. And it
is used to make sure the response buffer can be accessed safety.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-02-14 19:15:02 +00:00
Zihao Gao
53bba45281 Bluetooth: AVRCP: implementation for passthrough commands
This patch alllows to send passthough command from CT to TG.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-02-14 17:13:23 +01:00
alperen sener
3fdb81cd1f bluetooth: mesh: Correct callback check mesh blob client
xfer_progress_complete should be checked instead of end callback

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2025-02-14 17:10:39 +01:00
Robert Lubos
02c153c8b1 net: ipv6: Fix Neighbor Advertisement processing w/o TLLA option
According to RFC 4861, ch. 7.2.5:

 "If the Override flag is set, or the supplied link-layer address
  is the same as that in the cache, or no Target Link-Layer Address
  option was supplied, the received advertisement MUST update the
  Neighbor Cache entry as follows

  ...

  If the Solicited flag is set, the state of the entry MUST be
  set to REACHABLE"

This indicates that Target Link-Layer Address option does not need to be
present in the received solicited Neighbor Advertisement to confirm
reachability. Therefore remove `tllao_offset` variable check from the
if condition responsible for updating cache entry. No further changes in
the logic are required because if TLLA option is missing,
`lladdr_changed` will be set to false, so no LL address will be updated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-14 17:10:07 +01:00
Robert Lubos
8cd213e846 net: ipv6: Send Neighbor Solicitations in PROBE state as unicast
According to RFC 4861, ch. 7.3.3:

 "Upon entering the PROBE state, a node sends a unicast Neighbor
  Solicitation message to the neighbor using the cached link-layer
  address."

Zephyr's implementation was not compliant with behavior, as instead of
sending a unicast probe for reachability confirmation, it was sending a
multicast packet instead. This commit fixes it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-14 17:10:07 +01:00
Robert Lubos
fce53922ef net: ipv6: Fix neighbor registration based on received RA message
When Router Advertisement with Source Link-Layer Address option is
received, host should register a new neighbor marked as STALE
(RFC 4861, ch. 6.3.4). This behavior was broken however, because
we always added a new neighbor in INCOMPLETE state before processing
SLLA option. In result, the entry was not updated to the STALE state,
and a redundant Neighbor Solicitation was sent.

Fix this by moving the code responsible for adding neighbor in
INCOMPLETE state after options processing, and only as a fallback
behavior if the SLLA option was not present.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-14 17:10:07 +01:00
Thomas Deppe
dcbcbe824d Bluetooth: Host: Add host support for Advertising Coding Selection
Extends the API for Advertising Coding Selection.

The API is extended to set the Advertising Coding Selection
(Host Support) bit. With this feature, the primary and
secondary PHY can now explicitly report S=2 or S=8 coding
in the extended advertising report. Previously, the report
only indicated LE Coded regardless of whether S=2 or S=8
data coding was used. The API now sets the host support bit
and ensures that the advertising PHY coding scheme is
conveyed to the application via the scan callback.

The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION,
and requires a controller that selects
CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.

Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>
2025-02-14 17:08:23 +01:00
Christopher Clingerman
db9dccdc8a shell: rtt: increase bypass buffer size
If the RTT shell backend is selected and the "down" buffer size
has been selected, the shell bypass functionality should instead
use the buffer size specified by the configuration.

Signed-off-by: Christopher Clingerman <christopher.clingerman@sensorfy.ai>
2025-02-14 17:07:52 +01:00
Emil Gydesen
fe6f63f92d Bluetooth: PACS: Add missing break in switch for sup ctx get
Add a missing break in supported_context_get, as it was not
intended to fallthrough to BT_AUDIO_DIR_SOURCE or default.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-14 17:05:47 +01:00
Luca Burelli
c188dee334 llext-edk: add support for Zstd and Zip formats
This patch adds support for Zstd and Zip formats to the EDK generation
process. The user can now choose between XZ, Zstd, and Zip compression
and output formats for the EDK file.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-02-14 13:35:43 +01:00
Luca Burelli
d043a21426 llext-edk: add Kconfig option to enable EDK generation
Add a new Kconfig option to make the generation of an Extension
Development Kit (EDK) for the LLEXT subsystem optional. This
allows to cleanly separate EDK-related configuration and build
steps from the rest of the Zeprhyr build system.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-02-14 13:35:43 +01:00
Dominik Kilian
84a215aff8 ipc_service: icmsg: Add "unbound" functionality
In some cases, CPUs that may need to reset or
temporary stop communication. This commit adds "unbound"
functionality that provides a callback to IPC service user
when connection was interrupted for some reason, e.g.
expected or unexpected CPU reset, closing the
endpoint. The "unbound" callback is optional to implement
by endpoints. This commit implements it in the ICMsg
backend.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
2025-02-14 13:34:49 +01:00
Helge Juul
b7bbfbf1f2 net: dns: Log with debug level instead of error level when recv fails
This condition can happen if there is MDNS activity on the network that is
either not according to specifications or not supported by Zephyr.

Lowering the log level from ERR to DBG, since this does not indicate an
error in the Zephyr application.

Signed-off-by: Helge Juul <helge@fastmail.com>
2025-02-14 10:48:06 +01:00
Utsav Munendra
10c6b34800 portability: cmsis: Support static CMSIS-RTOSv2 control blocks
Do not use memory slabs for the control blocks when
the application provides the memory for it. This
implements manual user-defined allocation memory
management support in CMSIS-RTOSv2 API.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-02-14 03:13:35 +01:00
Utsav Munendra
ed2e557d4c portability: cmsis: CMSIS-RTOSv2 thread port to track dynamic cb
No functionality change, in preparation for allowing
threads with user provided stack and control block.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-02-14 03:13:35 +01:00
Utsav Munendra
11eb0ce4db portability: cmsis: Rename cmsis wrapper types
Namespace this types with `cmsis_rtos` instead of `cv2`

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-02-14 03:13:35 +01:00
Utsav Munendra
13ef44200e portability: cmsis: Move cmsis wrapper types to public header
This enables the cmsis wrapper types to be declared
statically and then passed along to CMSIS-RTOSv2 APIs,
enabling static allocation of RTOS control blocks
in the subsequent commits.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-02-14 03:13:35 +01:00
Utsav Munendra
6d490e9cf0 portability: cmsis: Run clang-format on CMSIS-RTOSv2
clang-format -i subsys/portability/cmsis_rtos_v2/*.h
clang-format -i subsys/portability/cmsis_rtos_v2/*.c

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-02-14 03:13:35 +01:00
Tomi Fontanilles
0c368e85b1 secure_storage: add a global registry header file for PSA key IDs
We need to make sure that within Zephyr different users of the PSA APIs
don't interfere with each other because of using the same numerical IDs
for persistent assets.

This takes care of the PSA key IDs when using persistent keys through
the PSA Crypto API.
See the comments in `<zephyr/psa/key_ids.h>` for more information.

This removes the recently-introduced Kconfig options that allowed changing
the base IDs subsystems were using for their persistent keys.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-02-13 20:22:09 +01:00
Kamil Piszczek
7c828bd232 bluetooth: dis: add Kconfig for disabling optional characteristics
Added new Kconfig option set that allows the user to control the
presence of the following optional characteristics:

- Manufacturer Name String
- Model Number String

Depreacted the old configuration that can be deleted in the future
Zephyr releases.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2025-02-13 16:46:12 +01:00
Jamie McCrae
13ac8fe1f5 mgmt: mcumgr: smp: Fix custom payload size
Fixes an issue when using custom payloads where the size was still
using the zcbor buffer instead of the size of the network buffer

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-13 16:44:06 +01:00
Luca Burelli
44c7a1401e llext: add ELF inspection APIs
Add APIs to inspect the contents of an ELF file loaded as an extension.
This is useful for applications that need to access the contents of the
extension in a more fine-grained way than the existing LLEXT APIs.

Use of these APIs requires the 'keep_elf_data' option to be provided via
struct llext_load_param to the 'llext_load()' call.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-02-13 16:43:29 +01:00
Luca Burelli
325d6b7d7f llext: add option to keep section data after llext_load
This is required for the functions that inspect the ELF file to work
properly. The user must then call llext_free_inspection_data() before
calling llext_unload() to free the memory left allocated in the loader
and extension memory.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-02-13 16:43:29 +01:00
Carlo Kirchmeier
ae96ccc3d7 fs: enable custom mount points for fatfs
Introduce two new kconfig options in order
to be able to define custom named fatfs
mount points. If activated replace the static
FF_VOLUME_STRS approach with the runtime
generated VolumeStr array containing those
mount points.

Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
2025-02-13 16:41:34 +01:00
Riadh Ghaddab
ef4e8dd5c3 settings: ZMS: add a backend for ZMS (Zephyr Memory Storage)
This adds the initial backend support for the ZMS storage system.

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2025-02-13 16:40:41 +01:00
Make Shi
f8ebbb3fef Bluetooth: AVCTP: Implement the functionality of avctp_l2cap_accept
- Implement the functionality of avctp_l2cap_accept to accept an L2CAP
  connection for the AVCTP protocol.

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-02-13 12:16:30 +01:00
TOKITA Hiroshi
04eba1d392 fb: cfb: Remove unused config
CHARACTER_FRAMEBUFFER_SHELL_DRIVER_NAME is not used.
Remove it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-02-13 12:14:52 +01:00
Tom Hughes
bddaff1d1b ztest: ztest_mock: Fix typo
"data provided don't match" should be
"data provided doesn't match"

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-13 01:13:56 +01:00
Marek Pieta
c7f3ad6307 bluetooth: host: Allow for ECDH operations through system workq
Change allows performing ECDH operations through system workq. This is
done to allow reducing memory consumption by disabling the long workq on
small SoCs.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2025-02-12 20:26:28 +01:00
Robert Lubos
05ac5497d5 net: dhcpv6: Add support for DNS Recursive Name Server option
Implement support for DNS Recursive Name option and use obtained
information to configure DNS resolver.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-12 20:19:26 +01:00
Ingar Kulbrandstad
45f233ba61 Bluetooth: Mesh: Remove experimental TF-M PSA
Remove the experimental flag from BT_MESH_USES_TFM_PSA.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2025-02-12 20:18:16 +01:00
Robert Lubos
d0e5696a0e net: dhcp: Avoid source port validation in replies
There's nothing in RFC 2131 or RFC 8415 that would mandate the DHCP
server to reply with a source port set to the IANA assigned one, and
some servers seem to send responses with some arbitrary source port set.

Therefore, make Zephyr's DHCP client implementation more permissive,
accepting packets with a source port set to a different port than the
IANA assigned server port.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-12 16:03:57 +01:00