Commit graph zephyr/subsys
Author SHA1 Message Date
Jukka Rissanen
598806fe26 net: wireguard: Add DiffServ DSCP values
As described in https://www.wireguard.com/protocol/
set DSCP to AF41 for handshake messages. The transport data
DSCP is set to 0.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
a239800f1a net: wireguard: Add initial implementation
Wireguard is a VPN implementation. See https://www.wireguard.com/
for details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Emil Gydesen
ec15acb69c Bluetooth: BAP: Add callback and subscribe of supported ctxs
The supported contexts were read but never provided to the
upper layers. Additionally if the supported contexts are
notifible we also subscribe to it.

This commit also fixed some other various things related
to the change to supported contexts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 12:33:18 -05:00
Fabio Baltieri
d0067a18c9 shell: add missing dependency for KERNEL_THREAD_SHELL_UNWIND
The option needs a dependency to THREAD_MONITOR, fix a build breakage
with, for example:

west build -p -b nrf52dk/nrf52832 samples/subsys/shell/shell_module -- \
-DCONFIG_EXTRA_EXCEPTION_INFO=y -DCONFIG_THREAD_MONITOR=n

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-03-23 12:32:52 -05:00
Chaitanya Tata
449ad67f19 net: l2: wifi: Add band info to set channel
With 6GHz band, channel numbers are not unique anymore, channel 1 can
mean both 2.4GHz or 6GHz, so, take the band info as the argument from
the user.

Keep auto-detection for backwards compatibility sake.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
2026-03-23 12:32:25 -05:00
Josuah Demangeon
8d7bb597fc usb: uvc: use uvc_device_ in API and add _enable()/_shutdown()
Use a different API call to complete the function rather than
relying on USB .init() to terminate the configuration.
This allows to set the endpoint descriptors before usbd_init()
is called.

Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
2026-03-23 12:31:57 -05:00
Tomasz Leman
465f488b6a logging: mtrace: Enable thread ID prefix support
Add support for the LOG_OUTPUT_FLAG_THREAD flag in the ADSP mtrace
backend's format_flags() function. When CONFIG_LOG_THREAD_ID_PREFIX is
enabled, this allows log messages to display the thread name or ID as a
prefix.

This enables displaying information about running threads and their
priorities, which can be useful debug information for analyzing system
behavior and thread execution patterns.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2026-03-23 12:31:00 -05:00
Tomasz Leman
4f7a485af7 logging: mtrace: Enable core ID prefix support
Add support for the LOG_OUTPUT_FLAG_CORE flag in the ADSP mtrace
backend's format_flags() function. When CONFIG_LOG_CORE_ID_PREFIX is
enabled, this allows log messages to display the originating CPU core ID
as a prefix.

This is particularly useful in multicore ADSP systems where deferred
logging may format messages on a different core than where they were
created. The core ID prefix helps identify which core generated each log
message.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2026-03-23 12:31:00 -05:00
Tomasz Leman
e254a97cf1 logging: add CONFIG_LOG_CORE_ID_PREFIX for multicore systems
Add support for displaying the CPU core ID that generated each log
message. This is particularly useful for debugging multicore embedded
systems where identifying the originating core is critical.

Key implementation details:
- Add CONFIG_LOG_CORE_ID_PREFIX Kconfig option (depends on SMP or
  MP_MAX_NUM_CPUS > 1)
- Capture arch_proc_id() at log message creation time to ensure the
  correct core ID is recorded, even when log processing happens on a
  different core
- Add core_id field to log_msg_hdr structure
- Add LOG_OUTPUT_FLAG_CORE flag (BIT 9)
- Display format: "[core %d]" prefix in log output
- Add log_msg_get_core_id() accessor function

The core ID is captured when the log message is created (not when
formatted), which is essential for deferred logging where the processing
thread may run on a different core than the one that generated the log.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2026-03-23 12:31:00 -05:00
Tony Han
587c212277 subsys/mgmt: declare PROCESSOR_NAME for arm926ej-s
Add the declaration of PROCESSOR_NAME for arm926ej-s CPU.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-03-23 12:27:55 -05:00
Andrzej Głąbek
db6409f473 sd: mmc: Respect host limits when changing bus frequency
Take into account the maximum frequency indicated in host capabilities
when changing the bus frequency, to avoid failing calls to sdhc_set_io()
when an MMC device is capable of working with higher frequencies than
the host can handle.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2026-03-23 10:40:22 -04:00
Emil Gydesen
0962ac8759 Bluetooth: TBS: Make originate consistent between local and remote
If we get a remote request to originate a call via a control
point write, we lookup a TBS instance based on the URI.
However for the local API function bt_tbs_originate we did
not, so the same operation, if the target bearer was GTBS,
had different behavior depending on whether it was locally or
remotely invoked.

This commit makes the two behave the same.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 10:40:11 -04:00
Szymon Janc
49edc839d2 bluetooth: host: Allow to tune L2CAP RTX timer value
This allows to tune L2CAP RTX timer value for L2CAP connection
requests. Allowed range is 1-60 seconds while defaults to 40.
Since this is mainly useful for BI (behavior invalid) qualification
tests allows to tune it only if BT_TESTING is selected.

This is required for running L2CAP/COS/CED/BI-29-C qualification
test in reasonable time since it requires 255 iterations of
failed (timed out) connection requests.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-03-23 10:37:57 -04:00
Szymon Janc
8617f73e16 bluetooth: host: Fix typo in Kconfig.l2cap description
This is for L2CAP options.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-03-23 10:37:57 -04:00
Maximilian Zimmermann
69e2ab8152 Bluetooth: TBS: clear pending GTBS notifications on disconnect
Add missing notification clearing for the GTBS instance
in the disconnected callback.

Fixes #104568

Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
2026-03-23 08:56:23 -04:00
Hanliang Xu
baaf8fb0b4 Bluetooth: TBS: Clear pending notifications on unsub
If the client removes its subscription to any of the TBS
characteristics at any time, the pending appropriate flags
are now being cleared.

Fixes zephyrproject-rtos/zephyr#104511

Signed-off-by: Hanliang Xu <leonxu2004@outlook.com>
2026-03-23 08:56:14 -04:00
Emil Gydesen
4cf2cc054d Bluetooth: BAP: Dont attempt disconnect on detach
This removes dead code. Since bt_bap_stream_detach sets
stream->ep = NULL then the call to bt_bap_stream_iso_chan_get
will always return NULL since stream->ep is NULL, and thus
the call to bt_bap_stream_disconnect would always be a no-op.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:56:05 -04:00
Emil Gydesen
2b198cf2cc Bluetooth: Audio: Make "foreach" functions consistent
Modify foreach functions in LE Audio to follow the same pattern:
Return true to continue iterating.
Return false to stop iterating.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:53:33 -04:00
Emil Gydesen
c9a0257e8f Bluetooth: Host: Replace CHECKIF with if
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:49:13 -04:00
Emil Gydesen
735f101c95 Bluetooth: Mesh: Remove checks in bt_rand
Remove the NULL and 0-length checks in bt_rand, as they
are probably not necessary.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:49:02 -04:00
Emil Gydesen
8070ee277b Bluetooth: Mesh: Replace CHECKIF with if
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:49:02 -04:00
Savo Saicic
e7038cb864 net: lwm2m: add IPSO Magnetometer object support
Add support for the IPSO Magnetometer object version 1.0 (Object ID
3314) which allows an LwM2M server to read magnetic field values from
a 1-3 axis magnetometer.

The object is enabled in tests/net/all/prj.conf to ensure it is
built as part of the CI all-in networking build.

Signed-off-by: Savo Saicic <savo.saicic@gmail.com>
2026-03-23 08:48:35 -04:00
Emil Gydesen
60f8fac0dd Bluetooth: Classic: Replace CHECKIF with if
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 10:25:36 +01:00
Pisit Sawangvonganan
2ea93f9e10 bluetooth: fix typo
Use a code spell-checking tool to detect and fix spelling errors in
the files under `subsys/bluetooth`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-23 10:25:26 +01:00
Emil Gydesen
e35cc4e6cd Bluetooth: CCP: Make CCP server thread safe
Guard any calls that accesses the bearer with a mutex

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 10:15:25 +01:00
Joel Holdsworth
a737213c98 tests: Add basic test-set for OpenRISC architecture port
The OpenRISC 1000 architecture can be tested through the qemu_or1k emulated
SoC and board. Because this emulated device has minimal external hardware
by default, this patch enables a minimal suite of tests covering core
kernel features for the CPU architecture.

When running the test suite, OpenRISC was found to require additional stack
space to prevent an overflow. Therefore, a minimal additional amount of
storage: 128-bytes, was added that was found in practice to allow tests to
complete.

Note that Qemu version 9.2.0 or newer is required so as to include the
following commit:

    commit 3eb43aeb164f1f83c97ff693c7d464b49755110c
    Author: Joel Holdsworth <jholdsworth@nvidia.com>
    Date:   Fri Jun 7 15:29:33 2024 -0700

        hw/openrisc: Fixed undercounting of TTCR in continuous mode

This fixes a bug in the implementation of the emulated OpenRISC Tick Timer
which prevents the Zephyr OpenRISC port from task-scheduling properly.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2026-03-21 07:50:57 -05:00
Joel Holdsworth
56b486eee9 debug: thread_info: Store thread stack pointer offset for OpenRISC
In OpenRISC 1000, the stack pointer is stored in the r1 register. This
patch stores the offset of this value within in the thread structure into
the thread info offsets.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2026-03-21 07:50:57 -05:00
Nicholas Cadieux
cf8197b7d1 usbc: tcpc: fix memory corruption in vconn_en and vconn_discharge callbacks
The vconn_en and vconn_discharge callbacks were invoked with the TCPC
device as the first argument. Application callbacks then called
usbc_get_dpm_data(dev) with the TCPC device, causing dev->data (which
is struct tcpc_data *) to be misinterpreted as struct usbc_port_data *.
This resulted in dpm_data->vconn_pol being written to an incorrect
memory offset, silently corrupting TCPC driver state.

Fix by adding a const struct device *usbc_dev parameter to
tcpc_vconn_control_cb_t and tcpc_vconn_discharge_cb_t, and propagating
it through set_vconn_cb and set_vconn_discharge_cb in the driver API.

Signed-off-by: Nicholas Cadieux <ncadieux@qti.qualcomm.com>
2026-03-21 00:48:09 +00:00
Nicholas Cadieux
d920c1689f usb: usb_c: tc: fix usbc_tc init race condition
Introduces a new TC_STARTUP_STATE to handle the initialization phase of
the Type-C state machine.

Previously, the state machine was initialized to TC_DISABLED_STATE during
POST_KERNEL initialization. This state inherits from
TC_CC_OPEN_SUPER_STATE, which executes tcpc_set_vconn(false). Since
VCONN callbacks are typically registered in main() (which runs after
POST_KERNEL), this resulted in an error log and the statemachine
unexpectedly transitioning to TC_ERROR_RECOVERY_STATE.

The new TC_STARTUP_STATE has no parent state and performs no hardware
operations. The state machine now transitions:
1. Boot (POST_KERNEL): Initialize to TC_STARTUP_STATE.
2. Start (MAIN): When usbc_start() runs the thread, tc_init() transitions
   to TC_DISABLED_STATE (ensuring VCONN/VBUS off with valid callbacks).
3. Run: Immediately transitions to TC_ERROR_RECOVERY_STATE to begin
   protocol operation.

Signed-off-by: Nicholas Cadieux <ncadieux@qti.qualcomm.com>
2026-03-21 00:48:09 +00:00
Nicholas Cadieux
9990ffa1d6 usb: usb_c: add Dual Role Power (DRP) support
Introduces DRP support to the USB-C subsystem, enabling dynamic
support for both Source and Sink power roles. Unattached devices
toggle between Source (Rp) and Sink (Rd) CC advertisements based
on the configured DRP period (tDRP) and duty cycle (dcSRC.DRP).
Once an attach is detected, the device enters the appropriate
Attached.SRC or Attached.SNK usbc_tc state and starts the
corresponding usbc_pe state machine to negotiate a power contract.

Signed-off-by: Nicholas Cadieux <ncadieux@qti.qualcomm.com>
2026-03-21 00:48:09 +00:00
Trond F. Christiansen
fe101944ce zbus: add IPC backend for zbus proxy agent
Implement IPC backend for ZBus proxy agent, enabling
message forwarding between domains over IPC endpoints.

Signed-off-by: Trond F. Christiansen <trond.christiansen@nordicsemi.no>
2026-03-21 00:47:22 +00:00
Trond F. Christiansen
759225db08 zbus: add multidomain proxy agent core
Add core implementation for zbus communication between domains using
pluggable backend transports.

Signed-off-by: Trond F. Christiansen <trond.christiansen@nordicsemi.no>
2026-03-21 00:47:22 +00:00
Tomasz Moń
1525950cd6 usb: device_next: remove udc_buf_get_all()
Function udc_buf_get_all() was intended to be a helper to remove all
requests from endpoint FIFO. While for just freeing all queue the
it may be argued that there may be some doubtful simplicity argument,
merging multiple submitted transfers into one is just enforcing
unnecessary complexity on class implementations.

At general level, every submitted (enqueued) request should get
corresponding completion (request callback) call. UDC drivers were
violating this sensible behavior when dequeuing (cancelling) requests by
merging all submitted requests into one.

Remove udc_buf_get_all() and replace all uses with simple loops. For
most classes (that submit just one request for an endpoint at a time)
this has no functional difference. For classes that implement double
buffering this simplifies completion handling.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2026-03-21 00:47:16 +00:00
Aiden Hu
d820b0bd6a usb: host: uvc: implement USB host UVC class with video API
Add a USB Video Class (UVC) host class implementation that enables
Zephyr-based systems to act as USB hosts for standard UVC cameras.
This allows applications to capture video streams from USB cameras
using the standard Zephyr video API.

The implementation follows the UVC specification for device enumeration,
format negotiation, and stream control. It handles the complexity of UVC
descriptor parsing, bandwidth management, and isochronous transfer
scheduling, presenting a clean video device interface to applications.

Support for common camera controls such as brightness, contrast,
exposure, focus, and zoom allows applications to adjust camera settings
at runtime. Dynamic format and frame rate changes are also supported,
making it suitable for various use cases from simple video capture to
more advanced computer vision applications.

Signed-off-by: Aiden Hu <weiwei.hu@nxp.com>
2026-03-21 00:46:16 +00:00
Aiden Hu
ee9c2221ee usb: uvc: add UVC_MAX_CTRL_SIZE macro
This macro is used for the data size of uvc control.

Signed-off-by: Aiden Hu <weiwei.hu@nxp.com>
2026-03-21 00:46:16 +00:00
TOKITA Hiroshi
216a41c88c fb: cfb: Improve handling of missing characters in font
Characters not present in the font were replaced with a space character.
This is changed to draw **tofu** instead.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-03-21 00:45:53 +00:00
Robert Lubos
b9ad6b17c7 net: sockets: Check for overflows in recvmsg/sendmsg syscalls
When calling zsock_recvmsg()/zsock_sendmsg() system calls, check if
provided msg->msg_iovlen is valid, i.e. does not cause size_t overflow
when calculating memory needed for msg->msg_iov vector.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-20 12:38:00 -05:00
Håvard Reierstad
850f5006dc Bluetooth: Shell: Fix vendor gatt read size
When reading the value of the vendor attribute, strlen was used instead
of sizeof, causing a unpredictable read size. This commit changes the
implementation to use sizeof instead.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2026-03-20 12:37:11 -05:00
Valerio Setti
44d35422aa secure_storage: adapt build system for TF-PSA-Crypto
Minor changes that are required in order to move from Mbed TLS 3.6.5
to TF-PSA-Crypto 1.x:

- "psa_crypto_driver_wrappers.h" has been relocated
- some extra include folders are required because they are directly
  included from "psa_crypto_driver_wrappers.h" but not exported from
  "mbedTLS" library since they are meant to remain private.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-03-20 12:32:52 -05:00
Valerio Setti
e9b5feb797 net: lib: sockets: tls: do not specify random function to be used
Both PK and TLS now rely on PSA generate random to get random data
so end users (i.e. sockets_tls in this case) don't need to manually
specify this anymore.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-03-20 12:32:52 -05:00
Krzysztof Chruściński
99336e5d24 ipc: ipc_service: icbmsg: Return error on too early open
If open is called before the backend is initilize then bounding
will stuck as works scheduled to the workqueue in the open function
are never executed. Return error if open is called too early, before
device initialization.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-03-20 20:43:13 +09:00
Titouan Christophe
6e1a9e6c52 bluetooth: host: monitor: fix build with 64b log timestamps
If CONFIG_LOG_TIMESTAMP_64BIT is enabled, then the call to
log_set_timestamp_func in the Bluetooth monitor is type-invalid,
which may fail to build with -Werror.

To avoid this type inconsistency let's use the type `log_timestamp_t`,
which accounts for the correct size, depending on selected config.

Even though the monitoring protocol only seems to support 32b timestamps,
the rest of the module is already based on 64b timestamps, so the
truncation is only done when encoding the timestamp for transmission
to the host in encode_hdr()

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
2026-03-20 18:19:35 +09:00
Jordan Yates
1559515215 rtio: workq: set workqueue names
Set unique names for the RTIO workqueue threads. If
`CONFIG_RTIO_WORKQ_THREADS_POOL` goes over 9, the numbers repeat. This
is not expected to occur in practice since the two defaults for this
config are `1` and `2`, and fully handling it is not worth the code
complexity.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-03-20 18:17:21 +09:00
Alberto Escolar Piedras
c6a4721474 Bluetooth: Controller: nRF5x: Trivial maintainability issue fixes
Fix a few trivial complains from Sonar Cloud in these files
* Methods should not be empty c:S1186
https://sonarcloud.io/organizations/zephyrproject-rtos/rules?open=c%3AS1186&rule_key=c%3AS1186
* "default" clauses should be first or last c:S4524
https://sonarcloud.io/organizations/zephyrproject-rtos/rules?open=c%3AS4524&rule_key=c%3AS4524

This commit introduced no functional changes.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-03-19 17:16:11 -05:00
Lauren Murphy
d77e760189 llext: nits in doc, kconfig, testcase
Fixes a couple nits in the docs, Kconfig and testcase.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2026-03-19 17:12:57 -05:00
Måns Ansgariusson
5388837a81 testsuite: benchmark framework
Currently, ztest is primarily focused on unit testing. This commit
introduces a framework designed specifically for performance analysis.

Key features:
- Standardized API: ZBENCH_SUITE and ZBENCH macros.
- Low overhead: Uses Welford's online algorithm for statistics
  to keep memory footprint minimal.
- Hardware agnostic: Built on top of <zephyr/timing/timing.h>.
- Clear output: Provides formatted console tables of results.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-03-19 17:07:52 -05:00
Emil Gydesen
bc37305998 Bluetooth: ASCS: Hotfix for failing ASCS unittests
The way that ASCS registers and unregisters for the ASCS
unittests does not work properly with UUIDs and local variables.

Hotfix is to use a `static` backup instead of a stack-allocated
backup. A proper fix will be provided later.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-19 14:56:35 -05:00
Fin Maaß
af0f6394e0 net: l2: ethernet: simplify use of net_if_get_device()
when using net_if_get_device() save the pointer
and use the pointer again.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-19 14:56:23 -05:00
Pieter De Gendt
9a75818c6d net: lib: sntp: Make sockaddr const for sntp_ctx
Both sntp_init and sntp_init_async shouldn't modify the socket address
passed.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-19 17:02:11 +01:00
Arthur Gay
099d0e0590 shell: websocket: Fix client disconnection handling
Don't rely solely on disconnect events to determine writability, since
the socket can drop at any time. A send() to a closed socket fails and
the resulting error reaches the shell thread, where a failing __ASSERT
causes a crash.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2026-03-19 17:02:00 +01:00