Commit graph

24,075 commits

Author SHA1 Message Date
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
Cla Mattia Galliard
8d38e720a4 net: pkt_filter: Filters to modify priority to incoming packets
To enable quality-of-service (QoS) applications, allow filters to modify
the priority of an incoming packet. This allows that processing can be
done on tc-queue-threads with different priorities.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
2025-10-21 17:25:56 +03:00
Matheus Marques
816489e321 mgmt: hawkbit: Add options to not confirm or erase at init
Current implementation forces confirmation of current boot image and
second slot erase at hawkbit_init() and it is impossible to communicate
with hawkBit server without running it. This makes impossible to notify
update failures to server (#71750)

Add option HAWKBIT_CONFIRM_IMG_ON_INIT to allow disabling the auto image
confirmation and HAWKBIT_ERASE_SECOND_SLOT_ON_CONFIRM to select if the
second partition slot shall be erased or not.

Disable those to handle of these behaviors on application code.

Signed-off-by: Matheus Marques <code@matheusmbar.com>
2025-10-21 17:23:45 +03:00
Jukka Rissanen
dbe59a5faf net: sockets: tls: Add ZVFS_OPEN_ADD_SIZE_TLS to count TLS sockets
Make sure that the CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS will
reflect the number of required file descriptors in the system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-21 17:22:03 +03:00
Jukka Rissanen
bc44a27b26 net: context: Make sure to allocate enough sockets
The number of net_context now determines the minimum amount
of network sockets that are to be allocated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-21 17:22:03 +03:00
Jukka Rissanen
1cfdf7c8d1 lib: Introduce a way to set minimum file descriptors count
Instead of user trying to figure out what is the amount of file /
socket descriptors in the system, let the various subsystems etc.
specify their need using a Kconfig option. The build system will
then add these smaller values together and set a suitable file
descriptor count in the system.

This works the same way as the heap size calculation introduced
in commit 3fbf12487c

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-21 17:22:03 +03:00
Lyle Zhu
99f26b02bd Bluetooth: Classic: HF: Fix invalid query current calls list issue
The current calls list should not be queried if the SLC is not
connected. Or the error `-ENOTCONN` will be returned by function
`hf_query_current_calls()`.

Check the connection status of HF before submitting a delay-able
worker. Only the SLC is established, submit the delay-able worker.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-21 11:42:28 +03:00
Lyle Zhu
c8a38806d2 Bluetooth: classic: shell: Add command query_calls for HFP HF
Add the command `query_calls` to query the current calls list.

The received current calls list will be printed in callback
`hf_query_call()`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-21 11:42:28 +03:00
Lyle Zhu
e55bea247b Bluetooth: Classic: HFP_HF: Support users to query current call list
Add the function `bt_hfp_hf_query_list_of_current_calls()` to support
users to query current call list.

Add the callback `bt_hfp_hf_cb::query_call` to notify the received
current calls.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-21 11:42:28 +03:00
Ludvig Jordet
cc8ac6bdee Bluetooth: Mesh: Filter duplicates in brg subnets list
This commit adds functionality to filter out duplicate entries in the
Bridged Subnets List message.

This is done by iterating through the part of the table we have already
processed, to check if this is the first time we see a given key pair or
not.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-10-21 11:40:39 +03:00
Johann Fischer
bca0ce0870 usb: device_next: hid: allow to set polling period at runtime
Allow to set input or output report polling period at runtime.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-10-20 19:19:00 -04:00
Johann Fischer
c62575e7bf usb: device_next: fail on initialization if no HID device is registered
Do not register the device when the class instance has already been
initialised. Fail on initialization if no HID device is registered.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-10-20 19:19:00 -04:00
Seppo Takalo
1f996d07b8 modem: cmux: Implement Modem Status Command
Implement Modem Status Command(MSC) and a per DLC flow
control by using it.

Send flow control signals when our input buffer don't fit
full frame anymore.
Stop TX if we have received from controls on MSC.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-20 19:16:10 -04:00
Jordan Yates
cc5757cbf0 modem: cmux: debug message on DLCI open/close
Add simple debug messages when a DLCI command opening or closing a
channel is sent.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-20 11:28:33 -04:00
Mark Wang
5c62e60d6c bluetooth: avdtp: fix the pointer check
should check codec_info_element not *codec_info_element.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-20 11:27:55 -04:00
Robert Lubos
139ebb3128 net: sockets: tls: Validate credentials when registering on a socket
So far the TLS/DTLS credentials would only be validated upon first use,
i. e. when TLS/DTLS handshake was initiated. This could lead to some
confusion, especially when trying to understand the reason of the
handshake failure, as it wasn't clear whether the handshake failed due
to peer sending bad certificate or due to local configuration issues.

This commit attempts to improve this, by pre-validating the credentials
as soon as they are configured on a socket with TLS_SEC_TAG_LIST socket
option. That way, in case bad credentials are configured on a socket, or
more commonly, mbed TLS is misconfigured to handle certain credential
type, it will be caught early during socket configuration, instead of
during the handshake.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-20 11:26:26 -04:00
Valerio Setti
db7bafbcdb mgmt: updatehub: simplify code
Following the removal of legacy crypto support the code could be further
simplified so this commit accomplish to this part.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-20 11:26:13 -04:00
Valerio Setti
b2dd3b4ba9 mgmt: updatehub: remove legacy Mbed TLS crypto support
The long-term Zephyr's goal is rely only on PSA Crypto API for crypto
support in Zephyr and at the same time Mbed TLS will remove this support
from the next release.

Therefore this commit removes usage of legacy crypto hash support from
updatehub.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-20 11:26:13 -04:00
Jesper Puge Nielsen
7387473d9e logging: rtt: Add binary dictionary logging
A previous commit (84163d3) changed the RTT backend from outputting a
binary stream to a hex encoded stream when dictionary logging is
enabled.

This commit adds a Kconfig option to keep the binary format, which is
required for live_log_parser.py, and also for log_parser.py when the
--hex argument is not used.

Signed-off-by: Jesper Puge Nielsen <jpni@demant.com>
2025-10-20 11:24:31 -04:00
Robert Lubos
98e0ddecc0 net: lib: sntp: Fix transmit timestamp
Fix the transmit timestamp value sent in SNTP queries:

 * Use sys clock as a time source instead of the uptime,
 * As NTP epoch is different from Unix epoch (starts in 1900), adjust
   the seconds value with appropriate offset,
 * Finally, adjust the fraction calculation to the nanoseconds value
   from struct timespec. Do the math in 64-bit to avoid overflows and do
   the division at the end for more accurate results.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-20 11:58:59 +02:00
Cheng Chang
f5dd765e88 bluetooth: shell: a2dp: fix warning when enable sink or source only
add #if defined() to control unused codes.

Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
2025-10-20 11:57:53 +02:00
Lyle Zhu
cf7ab6985f Bluetooth: Classic: HFP: Fix fixed MTU issue
The MTU of HFP HF or AG is fixed value. It cannot be configured.

Fix the issue to make the MTU of RFCOMM is consistency with the MTU
of L2CAP.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-20 11:57:26 +02:00
Seppo Takalo
a9bc72a22a modem: cmux: Send disconnect event only after responding to CLD
If we immediately send disconnected event when CLD is received,
we might close the UART pipe before the response is actually send.

Also, shutdown_handler should not retry indefinitely.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-20 11:55:43 +02:00
Seppo Takalo
822a501828 modem: cmux: Handle CLD response
Instead of dropping all responses, handle the CLD.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-20 11:55:43 +02:00
Aleksander Wasaznik
27b56955d6 Bluetooth: Host: Invoke tx callbacks when channel is deleted
When bt_l2cap_send_pdu() succeeds, it transfers buffer ownership to the
stack, which must eventually invoke the provided callback. This contract
is honored in all paths where transmission becomes impossible:

- Normal transmission: callback invoked with err=0 after HCI Number of
  Completed Packets event (tx_notify_process)
- Send errors (after tx allocated): callback invoked with err=-ESHUTDOWN
  via conn_tx_destroy
- Send errors (before tx allocated): callback invoked with the specific
  error code in send_buf error_return path
- Connection disconnect: callbacks invoked with err=-ESHUTDOWN via
  process_unack_tx -> conn_tx_destroy for all PDUs in tx_pending

However, when a channel is deleted (l2cap_chan_del), PDUs remaining in
the tx_queue are dropped without invoking their callbacks, violating the
ownership contract.

Fix this by extracting and invoking any non-NULL callbacks from the
closure stored in buf->user_data before releasing the buffers. The
callback is invoked with err=-ESHUTDOWN, making this path analogous to
process_unack_tx: both drain queues of unsent PDUs when transmission
becomes impossible due to external events (channel deletion vs connection
disconnect). The only difference is the buffer lifecycle stage - in
l2cap_chan_del, PDUs are still in tx_queue (closure in buf->user_data),
while in process_unack_tx, they've progressed to tx_pending (callback in
bt_conn_tx struct).

Note: conn_tx_destroy() cannot be used here because no bt_conn_tx struct
has been allocated yet - the closure is still in buf->user_data.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2025-10-20 11:54:42 +02:00
Aleksander Wasaznik
70dd38a9b4 Bluetooth: Host: Add documentation for L2CAP tx buffer callbacks
Document the ownership contract and callback semantics for L2CAP
transmission buffers:

- Extend tx_queue documentation in bt_l2cap_le_chan to explain SDU/PDU
  storage, callback handling, and transmission order semantics
- Document bt_l2cap_create_frag responsibilities regarding callback
  invocation after HCI Number of Completed Packets or on disconnect
- Document bt_l2cap_send_pdu callback contract: invoked exactly once
  after transmission completes or with -ESHUTDOWN on disconnect

These documentation additions clarify the requirements for proper
buffer lifecycle management and callback invocation throughout the
L2CAP transmission path.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2025-10-20 11:54:42 +02:00
Felix Kolbe
689a0277f0 net: coap: Correct parameter constness in func signature
fix(coap_link_format): Correct parameter constness in func signature

For function coap_link_format:coap_well_known_core_get_len()
the request parameter is declared to be a pointer-to-const,
but the const is missing for one of the two function definitions,
that are chosen via CONFIG_COAP_WELL_KNOWN_BLOCK_WISE.

With this fix the code also compiles when enabling
CONFIG_COAP_WELL_KNOWN_BLOCK_WISE.

Signed-off-by: Felix Kolbe <felix.kolbe@gmail.com>
2025-10-20 11:52:39 +02:00
Valerio Setti
4ecb6d3cf7 storage: flash_map: deprecate legacy Mbed TLS crypto
The long-term goal of the Zephyr project is to rely exclusively on PSA
Crypto API for the crypto support. In parallel Mbed TLS is going to remove
legacy crypto support from the next (4.0) release.

Therefore this commit deprecates CONFIG_FLASH_AREA_CHECK_INTEGRITY_MBEDTLS
and it also updates the migration guide document about this change.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-19 20:50:48 -04:00
Pisit Sawangvonganan
563af6f596 modbus: serial: use gpio_is_ready_dt() for GPIO readiness check
Simplify code by using gpio_dt_spec pointer-based API

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-10-17 21:03:27 -04:00
Pisit Sawangvonganan
b202835160 modbus: serial: use gpio_pin_set_dt() for de/re pin control
Just simplifies the code by using the `gpio_dt_spec` directly instead.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-10-17 21:03:27 -04:00
Riadh Ghaddab
a5f0c965c5 zms: fix init if a faulty bit is detected in the next free location
For devices that need an erase before a write, ZMS do not verify that
the next available location in the open sector is filled with the
erase_value.
Fix this by adding a check at init.

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2025-10-17 21:02:20 -04:00