Commit graph

22,555 commits

Author SHA1 Message Date
Alain Volmat
0e3de8e3ca usb: uvc: use struct uvc_frame_descriptor in most of function parameters
This commit prepares introduction of the UVC Frame Based support by
using the struct uvc_frame_descriptor as parameter of most of the UVC
functions. struct uvc_frame_descriptor contains the common fields for
all supported frame type and then depending on the DescriptorSubtype
the pointer is casted in the correct struct definition.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-24 13:25:34 -04:00
Pieter De Gendt
d43b48daf5 net: l2: wifi: mgmt: Fix auto-connect with multiple saved credentials
Using the Wi-Fi credentials system, we need to stop connecting with stored
credentials once a connection has been successful.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-24 13:19:21 -04:00
Vinayak Kariappa Chettimada
4428c1a868 Bluetooth: Controller: nRF54Lx: Enable Controller Privacy Support
Enable Controller Privacy support for nRF54Lx as default.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-24 08:50:49 -07:00
Vinayak Kariappa Chettimada
6d79d52118 Bluetooth: Controller: nRF54Lx: Add Controller Privacy Support
Add Controller Privacy support for nRF54Lx by porting to
use NRF_AAR00 h/w peripheral.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-24 08:50:49 -07:00
Kai Cheng
038523c63b Bluetooth: Conn: add connection type helper functions
Introduce dedicated helper functions for connection type checking:
- bt_conn_is_br() for BR/EDR connections
- bt_conn_is_le() for LE connections
- bt_conn_is_iso() for ISO connections
- bt_conn_is_sco() for SCO connections

Replace direct conn->type comparisons with these new helper functions
throughout the connection management code. This improves code readability,
maintainability, and provides proper configuration checks for each
connection type.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2025-10-24 11:34:41 +02:00
Lyle Zhu
74e94fd8e9 Bluetooth: SDP: Optimize functions bt_sdp_get_XXX()
Use a combination of multiple helper functions to implement the
functionality of existing interfaces starting with `bt_sdp_get_`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-24 11:34:32 +02:00
Lyle Zhu
922da6cc4d Bluetooth: classic: shell: Support attribute parsing helper
Update the command `sdp-find` to support attribute parsing helper.
If the argument count is 1, the general SDP discovery will be used
to discover the protocol `L2CAP`.

In the SDP record discovered callback, call attribute parsing helper
functions to parse the SDP record and SDP attributes. And print all
parsed attribute values.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-24 11:34:32 +02:00
Lyle Zhu
7f04884eab Bluetooth: SDP: Add helper functions to parse discovered record
The current implementation does not support multiple attributes with
the same attribute identifier in a discovered SDP record.

Add function `bt_sdp_record_parse()` to parse the received SDP record.

Add function `bt_sdp_has_attr()` to check if the specified attribute
identifier has been discovered.

Add function `bt_sdp_get_attr()` to get the attribute of specified
attribute identifier.

Add function `bt_sdp_attr_value_parse()` to parse the attribute value.

Add function `bt_sdp_attr_has_uuid()` to check if the attribute
contains the specified UUID.

Add function `bt_sdp_attr_read()` to read the value of the attribute.

Add function `bt_sdp_attr_addl_proto_parse()` to parse the protocol
descriptor from the additional protocol descriptor list.

Add function `bt_sdp_attr_addl_proto_count()` to get the protocol
descriptor count of the additional protocol descriptor list.

Add function `bt_sdp_attr_addl_proto_read()` to read the attribute
value from the additional protocol descriptor list for specific index
and UUID.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-24 11:34:32 +02:00
Lyle Zhu
8365ed718e Bluetooth: Classic: SDP: Add protocol identifier codes
Add all protocol identifier codes defined in Assigned Numbers
specification.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-24 11:34:32 +02:00
Patryk Duda
a1a91262c4 testsuite: Do not specify dump method if hardware coverage is not set
After #94079, CONFIG_COVERAGE_DUMP is enabled even if CONFIG_COVERAGE is
not set. As a result CONFIG_ZTEST_NO_YIELD is disabled which has some
implications on other tests.

Coverage dump method is necessary only if coverage is collected on
hardware, which is enabled by CONFIG_COVERAGE_GCOV. Let's specify
default dump method, only if CONFIG_COVERAGE_GCOV is set.

Fixes: #94079
Signed-off-by: Patryk Duda <patrykd@google.com>
2025-10-23 15:53:10 -04:00
Jordan Yates
0d86ebb83b llext: load: memcpy section header
When loading from `.elf` files, it is not guaranteed that section
headers are word aligned with the `.elf` file. Attempting to perform
a direct assignment results in the compiler assuming the input pointer
is aligned, resulting in usage faults if the assumption is broken.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-23 18:04:34 +02:00
Ricardo Cañuelo Navarro
61e177f521 Bluetooth: Host: remove unnecessary assignment in bt_conn_unref()
This local pointer assignment does nothing and readers may get a wrong
interpretation of the intention of the function.

Signed-off-by: Ricardo Cañuelo Navarro <rcn@igalia.com>
2025-10-23 18:04:18 +02:00
Valerio Setti
9c13bfd5d7 net: ip: ipv6: replace legacy crypto with PSA API
Zephyr's long term goal for crypto support is to use only PSA API. This
commit replaces usages of MD with proper PSA API for HMAC.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-23 18:02:56 +02:00
Valerio Setti
00eee1ad78 jwt: deprecate CONFIG_JWT_SIGN_RSA_LEGACY
With the long term goal to transition all crypto support toward PSA API,
this commit deprecates CONFIG_JWT_SIGN_RSA_LEGACY.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-23 18:02:37 +02:00
Vinayak Kariappa Chettimada
d737e285e5 Bluetooth: Controller: Add code comments related to short prepare
Add code comments explaining the handling of short prepare
that can be enqueued out of order and present in use of FIFO
for prepare pipeline.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-23 17:56:05 +02:00
Emil Gydesen
f487439fbc Bluetooth: ISO: Fix issue with CIG being terminated
In the case of a CIG having multiple CIS, and all CIS has been
requested to being disconnected (i.e. they all enter the
BT_ISO_STATE_DISCONNECTING state), then when the first disconnect
complete is handled in bt_iso_chan_disconnected, then the
cig->state was prematurely set to BT_ISO_CIG_STATE_INACTIVE.
This meant that if the application called bt_iso_cig_terminate
when the 2nd CIS entered bt_iso_chan_disconnected and called
chan->ops->disconnected(chan, reason) then the CIG would be
removed. When the CIS then entered bt_iso_cleanup_acl, it
would access removed data from cleanup_cig.

Change bt_iso_chan_disconnected to not allow the termination
of the CIG until all CIS have entered the BT_ISO_STATE_DISCONNECTED
state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-23 17:51:18 +02:00
Mark Wang
3c4b4e1ae2 usb: device_next: msc: do not copy SCSI data
Support only power-of-two disk sector sizes to enable significant
throughput improvements:
  * SCSI data zero-copy
  * allow queuing multi-packet transfers

Previously large SCSI buffers did not improve performance. With this
change, larger SCSI buffer allows scheduling bigger USB transfers which
reduces overhead.

Co-authored-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-23 17:47:23 +02:00
Josuah Demangeon
74e147e886 usb: device_next: uvc: remove application decisions from the UVC class
The UVC class was deciding itself which formats were sent to the host.
Remove this logic out of the UVC class and introduce uvc_add_format() to
give the application the freedom of which format to list.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-10-23 17:47:12 +02:00
Josuah Demangeon
9771105768 usb: device_next: uvc: use fmt->size instead of computing it every time
Make use of the recently merged fmt->size to know the maximum size of the
frame to be allocated, which works for both compressed and uncompressed
video.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-10-23 17:47:12 +02:00
Josuah Demangeon
bd1f72b0ba usb: device_next: uvc: propagate descriptor error to the application
When running out of descriptor, return an error instead of ignoring it.
The application need to make sure to adjust the Kconfig macros to have
enough descriptors for all formats to add.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-10-23 17:47:12 +02:00
Vinayak Kariappa Chettimada
29cf367568 samples: Bluetooth: hci_ipc: Enable HCI vendor-specific h/w error event
Enable HCI vendor-specific h/w error event generation in
samples and tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-23 11:43:10 +03:00
Vinayak Kariappa Chettimada
5db80f0d57 Bluetooth: Controller: Reduce assertion check code size
Reduce Controller assertion check code size for ARM Cortex-M
CPUs by using the undefined instruction exception.

`arm-none-eabi-addr2line` commandline can be used to get the
source file and line number.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-23 11:43:10 +03:00
Vinayak Kariappa Chettimada
796c0002f8 Bluetooth: Controller: Introduce LL_ASSERT_DBG/ERR
Introduce development and fatal assertion classification
in the Controller implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-23 11:43:10 +03:00
Vinayak Kariappa Chettimada
625f3052f5 Bluetooth: Controller: nRF54L: Fix PPIB interface include cond compile
Fix trivial PPIB interface include conditional compile.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-23 11:41:25 +03:00
Jordan Yates
51b424e2f0 tests: modem: ppp: test custom ACCM's
Test the wrapping functions with custom asynchronous command character
maps.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-23 08:02:28 +02:00
Jordan Yates
4494b42372 modem: ppp: use peer control character map
Use the peers asychronous control character map to only escape
characters that need to be, instead of always escaping bytes 0 to 31.

For data packets with values randomly distributed, this results in 11%
fewer bytes needing to be transmitted over the link, if no bytes need to
be escaped (256+2)/(256+2+32).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-23 08:02:28 +02:00
Jordan Yates
fbb84c7c0c net: l2: ppp: lcp: accept ASYNC_CTRL_CHAR_MAP option
Accept the `ASYNC_CTRL_CHAR_MAP` option in configuration messages from
the peer. The map is reset to the default value each time the interface
comes up.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-23 08:02:28 +02:00
Jordan Yates
13d35288bd net: l2: ppp: expose the peer ACCM
Expose the currently configured value for the PPP peers Asynchronous
Control Character Map through a public function.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-23 08:02:28 +02:00
Michael Zimmermann
4b2cbe8d4d net: mqtt_sn: fix returning address from zsock_recvfrom
The fix in 1264a923f3 was incomplete, because
it doesn't initialize the variable. To quote from opengroup [1]:
address_len
    Either a null pointer, if address is a null pointer, or a pointer to a
    socklen_t object which on input specifies the length of the supplied
    sockaddr structure, and on output specifies the length of the stored
    address.

This caused the returned address to be incomplete, because it got truncated
depending on what addrlen_local got initialized with implicitly. This broke
talking to discovered MQTT-SN gateways.

I intend to implement integration tests for the MQTT-SN UDP transport to
prevent such issues in future, but that will be done in a separate PR.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-10-22 18:05:41 -04:00
Kai Cheng
1de17dcf0a Bluetooth: shell: add sniff mode control command
Add shell command for testing BR/EDR power mode control. Supports
entering sniff mode with configurable parameters (min/max interval,
attempt, timeout) and exiting back to active mode. Provides real-time
feedback on mode change requests and status.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2025-10-22 18:34:33 +03:00
Kai Cheng
e2f962137f Bluetooth: Classic: add mode change notification for sniff mode
Implement mode change event handling and callback notification for
BR/EDR power mode transitions. Adds br_mode_changed callback to
notify applications when connection switches between active and
sniff modes. Handles HCI mode change events and propagates mode
and interval information to registered callbacks.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2025-10-22 18:34:33 +03:00
Kai Cheng
84abd9351f Bluetooth: Classic: add power mode control for sniff mode
Implement BR/EDR power mode control with sniff mode functionality.
Adds APIs bt_conn_br_enter_sniff_mode() and bt_conn_br_exit_sniff_mode()
to manage power saving modes. Includes parameter validation and HCI
command handling for sniff mode configuration with min/max intervals,
attempt count, and timeout parameters.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2025-10-22 18:34:33 +03:00
Cla Mattia Galliard
80d00b5ec1 net: tc-mapping: Fix SKIP_FOR_HIGH_PRIO
Adjust the way the SKIP option worked. Before this patch, a constant
priority offset was considered "high priority" this had the effect, that
the threads assigned to work on the priority were effectively usesless.
To fix it, consider this immediate handling as a pseudo-queue and compute
the tc-thead-mapping based on the effective count (+1 if skipping is
enabled). This makes it so that all threads are usefull and the
high-priority skip-path is considered as a pseudo tc-thread.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
2025-10-22 18:33:43 +03:00
Cla Mattia Galliard
27effdb727 net: tc_mapping: Use preprocessor
Avoid token pasting and use preprocessor more for additional flexibility.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
2025-10-22 18:33:43 +03:00
Cristian Bulacu
5cd223bc4b net: l2: openthread: openthread_border_router: Update address events
This commit refactored IPV6 and IPV4 address events. Events have been
defined independently for each installed callback.
Previously, IPV6 address event was not triggered due to a mix of IPV4
and IPV6 flags.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-10-22 18:32:49 +03:00
Fin Maaß
c821bf3493 mgmt: hawkbit: exclude DIRECT_XIP
DIRECT_XIP requires different images based on
the slot where there it is saved, in hawkbit we
currently have no way of telling the server that or
chosing a image to download based on it, so
make sure it is not used.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-10-22 18:32:16 +03:00
Benjamin Cabé
9d061156f2 Revert "shell: modules: devmem: support 64-bit read & write"
This reverts commit 5149463f79
which causes issue for ARC64 architectures in main

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-10-22 18:31:56 +03:00
Håvard Reierstad
b6252b57aa Bluetooth: Host: shell: Don't use BT_FIXED_PASSKEY
Updates the bt shell API to use the new Kconfig option
BT_APP_PASSKEY instead of BT_FIXED_PASSKEY as this is being
deprecated.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-10-22 16:01:08 +03:00
Håvard Reierstad
82cfb5a056 Bluetooth: Host: Deprecate BT_FIXED_PASSKEY
The BT_FIXED_PASSKEY Kconfig option is being deprecated, and is replaced
by BT_APP_PASSKEY. The reason for the deprecation is an upcoming
errata, ES-24489, which mandates that a new passkey shall be generated
for each pairing procedure.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-10-22 16:01:08 +03:00
Håvard Reierstad
6c64054d6e Bluetooth: Host: Add BT_APP_PASSKEY Kconfig option
Adds the BT_APP_PASSKEY Kconfig, which allows the application to provide
passkeys for pairing using the new `app_passkey()` callback.
This is an alternative to BT_FIXED_PASSKEY, which will be deprecated in
a later commit.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-10-22 16:01:08 +03:00
Emil Gydesen
fad9f4d612 Bluetooth: BAP: BASE: Split bt_bap_base_get_base_from_ad
Split the subgroup validation from
bt_bap_base_get_base_from_ad into a new function
base_pull_subgroup to make the function simpler and
make Sonarcloud happy.

The new function, base_pull_subgroup, is also used
in the bt_bap_base_foreach_subgroup to reduce
code duplication.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-22 16:00:17 +03:00
Valerio Setti
f779adf8e0 mgmt: mcumgr: remove usage of legacy Mbed TLS crypto for hash
The long-term goal of Zephyr is to rely exclusively on PSA Crypto API for
crypto support. At the same time Mbed TLS is going to remove legacy crypto
support starting from the next relase (v4.0).

Therefore this commit removes usage of legacy Mbed TLS crypto in favor
of PSA Crypto API. Mbed TLS will still be used in case of a build where
TF-M is not enabled.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-22 15:58:51 +03:00
Johan Hedberg
0fd8af97fb Bluetooth: Host: Make use of common array helper macros
There's a bunch of convenience macros in sys/util.h that are intended to
help out with translating array indices and determining if an element is
part of an array or not. Use those instead of custom code.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-10-22 15:54:48 +03:00
Yong Cong Sin
5149463f79 shell: modules: devmem: support 64-bit read & write
Add support for 64-bit devmem operations for 64-bit devices.

Signed-off-by: Sergii Vystoropskyi <vistorop@meta.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2025-10-22 09:03:55 +02:00
Anas Nashif
24e094ef5e lib: move cpu_load into lib/os
Move cpu_load to lib/os, as this functionality on its own does not
justify being a subsystem on its own.

Fixes #95498

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-22 09:02:38 +02:00
Robert Lubos
f7e51d7b5c net: sockets: tls: Remove leftover todo comment
Logs were added, but the todo comment about this was overlooked,
remove it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-21 22:51:49 +03:00
Eric Ocasio
196a1da504 pmci: mctp: samples: Add support for MCTP over USB.
Adds support for the USB device binding for MCTP. Binding created based on
the DMTF specification for USB Transport Binding. The overall design of
this binding follows the existing UART and I2C+GPIO bindings that already
exist in Zephyr.

Signed-off-by: Eric Ocasio <eric.ocasio@nxp.com>
2025-10-21 12:25:56 -04:00
Alberto Escolar Piedras
499aa995f6 net: lib: shell: dns: Fix field precission specifier type
Explicitly cast down the string width to int, as otherwise it is
size_t which may have a bigger size.

Avoids the following build error:

subsys/net/lib/shell/dns.c:496:67: error: field precision specifier
‘.*’ expects argument of type ‘int’, but argument 4 has type ‘size_t’
{aka ‘long unsigned int’}

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-21 12:21:37 -04:00
Cla Mattia Galliard
f3b6d77ad4 net: shell: filter: Update table
Adjust table to print newly available information.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
2025-10-21 17:25:56 +03:00
Cla Mattia Galliard
4e3024b110 net: tc: allow to spread threads by more then 1 priority level
Allow to spread tc threads by more then one priority level and cleanup the
computation of the priority.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
2025-10-21 17:25:56 +03:00