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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
Add missing notification clearing for the GTBS instance
in the disconnected callback.
Fixes#104568
Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
If the client removes its subscription to any of the TBS
characteristics at any time, the pending appropriate flags
are now being cleared.
Fixeszephyrproject-rtos/zephyr#104511
Signed-off-by: Hanliang Xu <leonxu2004@outlook.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add core implementation for zbus communication between domains using
pluggable backend transports.
Signed-off-by: Trond F. Christiansen <trond.christiansen@nordicsemi.no>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>