Commit graph

22,555 commits

Author SHA1 Message Date
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
Pavel Vasilyev
a360ff7cc3 bluetooth: mesh: Fix build without settings under asan
When Mesh is built without CONFIG_BT_SETTINGS and with CONFIG_ASAN
(and CONFIG_NO_OPTIMIZATION), the call to bt_mesh_settings_set is not
optimized out. Since settings.c isn’t compiled when CONFIG_BT_SETTINGS
is disabled, the linker reports an undefined reference.

Guard the call with !IS_ENABLED(CONFIG_BT_SETTINGS) so the call and the
subsequent code is compiled out when settings are disabled.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-10-17 17:03:06 +03:00
Jeppe Odgaard
25d5c73b0a net: config: sntp: optionally set rtc
Set RTC when an SNTP response is received if enabled via Kconfig option.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-10-17 17:02:55 +03:00
Jeppe Odgaard
57a5b86b7f debug: thread_analyzer: replace #if IS_ENABLED
Use of IS_ENABLED in a #if statement is discouraged. Replace with #ifdef.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-10-17 17:01:30 +03:00
Jamie McCrae
a44efd9a95 mgmt: mcumgr: transport: udp: Add support for DTLS
Adds support for using DTLS for the transport

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-17 18:28:08 +09:00
Valerio Setti
019e26aecf bluetooth: mesh: use new Kconfig CONFIG_PSA_CRYPTO
Remove previous Kconfig choices CONFIG_BT_MESH_USES_MBEDTLS_PSA and
CONFIG_BT_MESH_USES_TFM_PSA and use CONFIG_PSA_CRYPTO instead.
This commit also updates test code accordingly.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Valerio Setti
1bc2db575f modules: mbedtls: add new helper Kconfig symbol PSA_CRYPTO
The goal of new Kconfig PSA_CRYPTO_PROVIDER is to automatically enable
any of the PSA Crypto API provider available for the platform without
having the user to manually pick the proper one. This provider can be
either TF-M, if that's enabled in the build, or Mbed TLS otherwise.

PSA_CRYPTO_PROVIDER simplifies also modules/subsystem Kconfigs removing
blocks as:
	select MBEDTLS if !BUILD_WITH_TFM
	select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM

Kconfig PSA_CRYPTO_PROVIDER_CUSTOM is also added to allow the end user
to add a custom implementation of PSA Crypto API instead of TF-M or
Mbed TLS ones.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Pieter De Gendt
1da7a115cc net: l2: wifi: shell: Add bgscan command
Add a shell command to configure the background scanning.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-17 11:15:37 +02:00
Pieter De Gendt
93c4dbd2e0 modules: hostap: Support bgscan
Add configuration options for background scanning (bgscan) in
wpa_supplicant.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-17 11:15:37 +02:00
Seppo Takalo
2cfd92410e modem: cmux: Combine state and event
Refactor internal event bits to use state enum values
and define set_state() and wait_state() so we don't need
two set of variables to maintain.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-16 22:40:21 -04:00
Qiang Zhao
56098d60b4 drivers: dsa_nxp_imx_netc: add Qbv capability
add Qbv capability for dsa_nxp_imx_netc

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Qiang Zhao
d4928e8419 net: shell: Add Qbv shell
Added Qbv shell subcommand to net command.
Supported enable, set_config, set_time and get_info functions.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Qiang Zhao
16d6c46a0f net: ethernet: add NET_QBV Kconfig
Add NET_QBV in Kconfig, Qbv is Enhancements for Scheduled Traffic (EST),
one feature of TSN. The PTP clock provides the time reference for Qbv

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Qiang Zhao
a12c664b53 net: dsa: add set/get_config support
Supported set/get_config API.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Dan Kalowsky
27afe41b10 debug: thread_analyzer: add thread analyzer option to reset frame
Use THREAD_ANALYZER_LONG_FRAME_PER_INTERVAL config to reset
longest frame value to zero after printing so that longest frame
now represents longest frame for the most recent interval.  The
longest overall frame is often at startup and this modification
allows one to observe subsequent long frames.

Signed-off-by: Jay Lawlor <jlawlor@amperecomputing.com>
Signed-off-by: Dan Kalowsky <dkalowsky@amperecomputing.com>
2025-10-16 22:33:22 -04:00
Tomasz Chyrowicz
3ae8a43667 storage: Allow to use subpartitions in flash_map
Allow to use both partition and subpartition names when suing the
flash_map API.
That way it is possible to introduce a hierarchy within DTS in a
backward compatible way.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-10-16 15:06:12 -04:00
Tim Pambor
99fd6d4f4e ztest: Add validation of zassert strings
Add __printf_like attribute to ztest assertion functions
zassert, zassume, zexpect to validate format strings and arguments
at compile time.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-10-16 15:05:07 -04:00
Mark Wang
a713aedb53 bluetooth: a2dp: check the reject response's error code
If the reject response's error codes is success, change as FORMAT ERROR.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-16 17:16:53 +03:00
Mark Wang
60c7ec6915 bluetooth: a2dp: set req->status as 0
create internal bt_a2dp_init_req and bt_a2dp_init_ctrl_req to init `req`,
then the `req->status` will not be forgotten to be cleared as 0.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-16 17:16:53 +03:00
Mark Wang
c994c9e02e bluetooth: a2dp set right endpoint state for start and abort cmd
If the start cmd fail, need set back as OPEN state.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-16 17:16:53 +03:00
Lyle Zhu
40bba4057f Bluetooth: Classic: HFP_HF: Fix AT+CLCC can not be sent issue
Due to the flag `BT_HFP_HF_FLAG_CLCC_PENDING` is set when receiving
the +CIEV or +CIND notification, the command `AT+CLCC` will be
pending due to the flag is not cleared.

Add a flag `BT_HFP_HF_FLAG_INITIATING` to indicate the HF
initialization is ongoing.

Add a flag `BT_HFP_HF_FLAG_QUERY_CALLS` to indicate the current calls
list needs to be queried.

Set the flag `BT_HFP_HF_FLAG_INITIATING` at the beginning of the HF
initialization. Set the flag `BT_HFP_HF_FLAG_QUERY_CALLS` instead of
setting the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if the current calls
list needs to be queried and the flag `BT_HFP_HF_FLAG_INITIATING` is
set.

After the HF initialization is done, query list of the current calls
by calling the function `hf_query_current_calls()` if the flag
`BT_HFP_HF_FLAG_QUERY_CALLS` is set.

Set the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if it is not set in the
function `hf_query_current_calls()`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-16 17:15:51 +03:00