Commit graph zephyr/subsys
Author SHA1 Message Date
Jukka Rissanen
cb2a94c56a net: quic: Add STOP_SENDING support
Add support for STOP_SENDING frame. This is sent to tell
peer to stop sending data to the stream.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
340b01b13e net: quic: Add STREAMS_BLOCKED handling
The STREAMS_BLOCKED handling was missing functionality to
send MAX_STREAMS back to peer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
db59cf8e2a tests: net: quic: Add tests to send longer packets
Try to send 8kb buffer multiple times, make sure that there
are dropped packets and verify that all the data is received
correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
753d0163e2 net: quic: Add support for loss detection and congestion control
The loss detection and congestion control are described in RFC 9002.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
0e2014fdb1 net: shell: quic: Add Quic statistics support
Show Quic statistics if enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
03543f9696 net: quic: Add statistics support
Collect Quic statistics if network statistics is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
910f5dad8b net: quic: shell: Add Quic shell support
Add commands to net-shell to view Quic connections information.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
ad05142895 tests: net: quic: Add tests
Initial tests for QUIC.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Jukka Rissanen
49b4ac35d3 net: quic: Initial commit
QUIC is described in RFC 9000. It is UDP based transport
used for example in HTTP/3.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-04-21 17:48:04 +01:00
Johan Hedberg
23099b621b Bluetooth: Host: Fix type of bt_dev.random_addr
There's no need for bt_dev.random_addr to be a bt_addr_le_t, since the type
is always implicitly random. Change it to bt_addr_t and make the necessary
updates to the host code as well as host unit tests.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-04-21 17:45:36 +01:00
Johan Hedberg
e27274e39c Bluetooth: Host: Take advantage of bt_addr_le_copy_addr()
Use the new bt_addr_le_copy_addr() helper where appropriate.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-04-21 17:45:36 +01:00
Jedrzej Czykier
2ad8645dac tracing: relax TRACING_BACKEND_UART dependency to SERIAL
Currently, TRACING_BACKEND_UART depends on UART_CONSOLE. This is overly
restrictive because the UART tracing backend relies entirely on the
generic UART driver APIs and does not utilize console subsystem.

Signed-off-by: Jedrzej Czykier <jczykier@antmicro.com>
2026-04-21 10:19:05 +01:00
Måns Ansgariusson
7fe09638c4 random: psa: Remove initialization check from sys_csrand_get()
This commit removes the initialization check on every sys_csrand_get() and
the lazy initialization of the psa crypto on the first call to
sys_csrand_get().

The psa initialization is assumed to be performed prior to the first
call to sys_csrand_get().

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-04-20 17:53:09 -05:00
Alberto Escolar Piedras
5a328a1411 Bluetooth: Controller: nordic: ifdef EVDMA code on better macro
Ifdef the AAR/CCM/ECB DMA related code based on the HAL macro which tells
if the new EVDMA is present in the device, instead of particular devices,
so we do not need to ifdef on several devices as new devices are added

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-04-20 13:22:50 +02:00
Jamie McCrae
9da5c07615 mgmt: mcumgr: grp: img_mgmt: Fix non-progressive swap offset erase
Fixes not erasing the first sector when using swap using offset mode

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-04-20 13:22:14 +02:00
Philipp Steiner
a7cdc70c64 net: fix PTP TX timestamping on native_tap and AF_PACKET
native_tap only queued TX timestamp callbacks for gPTP packets, which
left PTP SO_TIMESTAMPING socket traffic without TX timestamps.

Add host-clock packet timestamp updates in native_tap TX/RX paths, queue
TX timestamp callbacks when net_pkt_is_tx_timestamping() is set (while
preserving gPTP behavior without double-queueing), and propagate
SO_TIMESTAMPING TX/RX flags for AF_PACKET packets in net_context.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-20 13:22:07 +02:00
Philipp Steiner
35dec1cd90 net: shell: add net ptp status and per-port diagnostics command
Add a new `net ptp` shell command to inspect PTP runtime state from
the Zephyr shell.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-20 13:22:07 +02:00
Philipp Steiner
d5b4078389 net: ptp: add IEEE 802.3 transport support
Add Layer-2 (EtherType 0x88F7) transport support and the PTP stack
updates needed for L2 operation.

Use recvmsg() RX timestamping on IEEE 802.3 sockets and fall back to
recvfrom() when ancillary timestamp data is unavailable, retrying
recvmsg() later so L2 reception keeps working across runtime and driver
limitations. Register Delay_Req TX timestamp handling for both UDP and
L2 paths and suppress expected UDP parse warnings while L2 is enabled.

Also wake the PTP worker when pollfd or state-decision changes require
it, and clear pending Sync, Delay_Req, and foreign clock state when a
port is disabled so stale state is not carried across reopen or link
transitions.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-20 13:22:07 +02:00
Philipp Steiner
43f5bc142f net: if: avoid deadlock in TX timestamp callback dispatch
Timestamp callbacks can unregister themselves or other callbacks while
net_if_call_timestamp_cb() is iterating the callback list. That path
runs under the timestamp callback lock, so immediate unregister can
re-enter the same lock and stall the TX timestamp thread.

Handle unregister requests from the dispatch thread by marking callbacks
inactive, skip inactive entries during iteration, and prune them after
dispatch completes.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-20 13:22:07 +02:00
Philipp Steiner
01fe77b2ec net: sockets: fix inet recvmsg ancillary buffer accounting
Use NET_CMSG_SPACE() when checking ancillary buffer capacity and
account for aligned cmsg storage in msg_controllen.

This keeps recvmsg() control-data handling consistent with cmsghdr
layout and avoids under-reporting consumed control-buffer space.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-20 13:22:07 +02:00
Philipp Steiner
e7ec73aa3c net: sockets: packet: add recvmsg timestamping support
Implement AF_PACKET recvmsg() support and deliver ancillary
SO_TIMESTAMPING data to packet socket users.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-20 13:22:07 +02:00
Philipp Steiner
c9bb31e67a net: ptp: fix foreign master handling and BTCA tie-break
Store the first foreign Announce and compare it against the previous entry.
Fix the BTCA receiver-port tie-break to avoid false role decisions.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-04-20 13:22:07 +02:00
Kai Cheng
145bd3702c Bluetooth: UUID: add assertion and snprintk error handling
Re-add __ASSERT_NO_MSG in bt_uuid_to_uuid() for invalid UUID types.
This was removed in commit 9906fdb to work around a pre-existing ASCS
memcpy bug that has since been fixed.

Add return value checking for all snprintk() calls in bt_uuid_to_str()
per Zephyr coding guidelines. Since the function returns void and uuid.c
has no logging, __ASSERT_NO_MSG is used to catch encoding errors in
debug builds while preserving the existing silent-truncation behavior.

Follow-up from: https://github.com/zephyrproject-rtos/zephyr/pull/103817

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-20 11:44:17 +02:00
Andre Viegas
d22c0d5243 Bluetooth: Host: Fix AoD 2US CTE type validation
The valid_conn_cte_tx_params() function checked BT_DF_CTE_TYPE_AOD_1US
twice instead of checking both BT_DF_CTE_TYPE_AOD_1US and
BT_DF_CTE_TYPE_AOD_2US. This allowed AoD 2US to bypass the antenna
switch pattern validation in the host.

The controller also validates these parameters, so the impact is
limited to a missing defense-in-depth check in the host layer.

Signed-off-by: Andre Viegas <andreviegas@piscodeluz.org>
Assisted-by: Claude:claude-opus-4.6 ForgeQL
2026-04-20 11:43:33 +02:00
Carlo Caione
3b6e080ea1 lorawan: native: add EU868 region support
Add the EU868 region implementation for the native LoRaWAN backend.

Gate regions not yet implemented in the native backend behind depends on
!LORA_MODULE_BACKEND_NATIVE so they cannot be selected.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-20 11:43:15 +02:00
Carlo Caione
90f259cd05 lorawan: native: add native LoRaWAN backend
Add a native LoRaWAN 1.0.x Class A implementation that talks directly to
the LoRa radio driver, replacing the Semtech loramac-node dependency.

The backend provides:
 - OTAA join (Join Request / Join Accept)
 - Unconfirmed and confirmed uplinks with Class A downlink reception
 - AES-128 cryptography via PSA Crypto (CMAC for MIC, ECB for payload
   and join-accept encryption)
 - Region operations interface for channel plans, datarate tables,
   RX window parameters, and duty cycle enforcement
 - Asynchronous engine thread that serializes MAC operations
 - Full downlink dispatch with deferred callbacks on the system
   workqueue to avoid deadlocking the engine thread

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-20 11:43:15 +02:00
Lauren Murphy
24b75db466 llext: add CONFIG_LLEXT_CUSTOM_HEAP_PLACEMENT
Enclose default LLEXT heap section placements with
!CONFIG_LLEXT_CUSTOM_HEAP_PLACEMENT. Users who want to
write a custom linker script can include files like
snippets-noinit.ld, common-noinit.ld or the SOC linker
scripts without including the default LLEXT heap
section placements.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2026-04-18 12:37:46 -04:00
Nikhil Namjoshi
d2aec6ab1e net: tcp: Validate TCP header before connection search in tcp_recv
Moved the TCP header validation in tcp_recv() before the connection
lookup to prevent processing malformed packets and improve efficiency.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-18 12:37:34 -04:00
Nikhil Namjoshi
77aa045b19 net: tcp: Invert invalid condition check in tcp_input
Inverted the condition in tcp_input() to correctly process
valid packets and drop invalid ones.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-18 12:37:17 -04:00
Lauren Murphy
9b4fb20000 llext: relax memblk block size restriction
Reduce scope of restriction that
CONFIG_LLEXT_HEAP_MEMBLK_BLOCK_SIZE be a multiple
of LLEXT_PAGE_SIZE to apply only when CONFIG_MMU
or CONFIG_MPU are enabled.

Referring to llext_copy_region in llext_mem.c, we
see that allocations only need to be sized / aligned
to LLEXT_PAGE_SIZE when MMU or MPU is enabled.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2026-04-17 15:52:39 -05:00
Jordan Yates
a29c14aeec net: conn_mgr: binding configuration check
Add an optional function to connectivity bindings that communicates
whether the binding has the configuration it needs in order to attempt
a connection. This is then used by the connectivity API for
non-persistent interfaces to determine whether it makes sense for the
interface to be powered up.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-17 15:52:09 -05:00
David Boullie
ba3984a658 net: ieee802154: move ieee802154_frame.h to common location
Move header for IEEE 802.15.4-2020 constants from subsystem
location to common for usage by 15.4 radio device drivers.

Signed-off-by: David Boullie <David.Boullie@silabs.com>
2026-04-17 15:51:19 -05:00
Jakub Rzeszutko
79cf685dfe shell: prevent deadlock from non-yieldable context
shell_vfprintf can block on k_event_wait when the TX ring buffer is full.
Calling it from a non-yieldable context (ISR, spinlock, pre-kernel)
causes a deadlock.

Add a k_can_yield() check in shell_vfprintf as both an assert for debug
builds and a runtime guard that silently drops the output when called
from a context that cannot yield, preventing the deadlock regardless
of whether asserts are enabled.

Fixes: #103954

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2026-04-17 16:42:54 +01:00
Alberto Escolar Piedras
ecd9f0a347 Bluetooth: Controller: ecb: Remove two ifdefs for simulation
For a busy wait needed only for simulation we can use the Z_SPIN_DELAY
macro which is more compact and does nothing in real targets.

For the ecb test, we do not need to treat simulated HW differently than
real HW.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-04-17 16:42:23 +01:00
Kapil Bhatt
31866086a5 net: wifi: Set frequency default value as zero for P2P Connect
For P2P connect set frequency default value as 0.
Let wpa_supplicant choose channel. User can override with -f option.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-04-17 16:42:16 +01:00
Håvard Reierstad
2c6c80ddf6 bluetooth: host: Re-key SC config on identity resolution
When a client subscribes to Service Changed CCC before bonding
and privacy is enabled, the SC config is initially stored under
the peer's RPA. On reconnection with a new RPA, sc_restore()
looks up the config by identity address and fails to find it,
so the SC indication is never delivered.

Re-key the SC config entry from the RPA to the resolved identity
address in bt_gatt_identity_resolved(), matching the existing
re-keying logic for CCC and CF configs in the same callback.

If a separate entry already exists under the identity address,
merge the attribute handle ranges and remove the duplicate.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Co-authored-by: Einar Thorsrud <einar.thorsrud@nordicsemi.no>
2026-04-17 15:57:35 +02:00
Håvard Reierstad
814b824c88 bluetooth: host: Add assert to gatt update_range
Adds an assert to the `update_range` function in gatt.c to verify
that the start handle is not larger than the end handle.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2026-04-17 15:57:35 +02:00
Emil Gydesen
57816adfa7 Bluetooth: BAP: Broadcast sink MIC failure behavior
Modify the behavior of update_recv_state_big_cleared to follow
what the current BASS test specification and PTS expects to pass
test cases related to bad broadcast codes. There are open
errata for this behavior to properly define it, but until then
we should follow what the qualification tests expect.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 15:55:18 +02:00
Krzysztof Chruściński
4a3cf66c07 drivers: debug: coresight_nrf: Re-enable early logging
At some point CONFIG_LOG_FRONTEND_STMESP_EARLY_BUF_SIZE default value
was set to 0 on cpuapp. It meant that log entries which happend before
STM and Coresight initialization were lost. Add buffer which is used
to store those logs.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-17 13:43:51 +02:00
Maochen Wang
8cb5ac07f4 net: l2: wifi: reject invalid PSK/SAE password length in AP mode
Add input validation for PSK and SAE password length in wifi_ap_enable().
Invalid lengths could trigger driver-side assertions during AP startup.
Return -EINVAL when parameters are out of range instead of letting the
AP enable flow proceed.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2026-04-17 12:37:30 +01:00
Lyle Zhu
cf7693a826 bluetooth: classic: hfp_hf: Fix out-of-bounds access in indicator index
Add validation to ensure the indicator index is within the valid range
of the ind_table array before accessing it in cind_handle_values().

Without this check, an out-of-bounds index could lead to buffer overrun
when the index is used to access hf->ind_table array elements later in
the function.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-17 12:37:24 +01:00
Emil Gydesen
a1d1fefa9d Bluetooth: CSIP: Fix bad atomic check in add_bonded_addr
To ensure correctness and to avoid any race conditions,
atomic_test_and_set_bit should be use instead of a atomic_test_bit
followed by an atomic_set_bit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 12:36:30 +01:00
Emil Gydesen
9e48895e00 Bluetooth: CSIP: Add bonded addr to all svc_insts
add_bonded_addr_to_client_list returned after adding the address of
`info->addr` once, which mean that only the first svc_inst got updated

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 12:36:30 +01:00
Marek Pieta
e8e596dcf1 bluetooth: host: Improve bt_keys loading from settings
Before config flags were introduced to `bt_keys`, the `keys_set`
allowed loading previously stored keys after disabling support for
Bluetooth LE legacy pairing or signing during DFU (only beginning of the
settings record was used after the DFU).

Introducing version field prevents from loading keys in this scenario.
Settings records that contain extra data are not migrated to the new
format during the settings load operation and eventually are cleared.

Change allows to automatically migrate `bt_keys` stored with extra data
to the new format in the most common scenario where both legacy pairing
and signing support are disabled. This allows to still properly load and
use the keys.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2026-04-17 12:35:06 +01:00
Lyle Zhu
803c19fc91 bluetooth: host: l2cap_br: improve buffer allocation error handling
Improve error handling for L2CAP BR/EDR signaling buffer allocation
failures by introducing a fallback mechanism and proper cleanup paths.

Add l2cap_br_create_pdu() helper function that attempts to allocate
from the specified pool with a timeout, and falls back to the default
pool if allocation fails. This prevents system hangs when the BR/EDR
signaling buffer pool is exhausted.

Update all bt_l2cap_create_pdu() call sites to use the new helper with
appropriate timeouts (K_FOREVER for requests, specific timeouts for
responses). Add error handling to properly disconnect channels or clean
up resources when buffer allocation fails.

Introduce l2cap_br_chan_disconn() helper to centralize channel
disconnection logic, ensuring proper cleanup when disconnect requests
cannot be sent.

Change br_sig_pool user data size from hardcoded 8 bytes to
CONFIG_BT_CONN_TX_USER_DATA_SIZE for consistency with other buffer
pools.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2026-04-17 10:36:40 +02:00
Roman Leonov
a0dee7ddad usb: host: shell: add usbh device list_dd command
Added:
- usbh shell command to dump descriptors

Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-04-17 10:34:50 +02:00
Emil Gydesen
8e3c6279ce Bluetooth: ISO: Log all values from established events
When an ISO channel is established, we now log all the
information we receive from the controller for that
specific channel.

This can be useful in debugging and determining certain
behaviors.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-17 10:34:15 +02:00
Alberto Escolar Piedras
3258d42abe Bluetooth: Controller: nRF54Lx: Use hal to set interrupt mask
The HAL has now a function to set the each GRTC group interrupt mask
Let's use it, fixing this old FIXME.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-04-16 11:41:49 -05:00
Emil Gydesen
ce33df667f Bluetooth: CAP: Fix issue with aborting CAP commander procs
Fixed issue where an aborted CAP commander procedure would
never get past bt_cap_common_proc_all_handled and thus never
call the callback with an error, e.g. if the remote CAP
Acceptor rejects a request.

The fix required a significant refactor of the broadcast
part of the CAP commander, as it was fundamentally flawed.
The biggest change is that the implementation now uses both
the receive state notification as well as the write responses
to determine completeneess. Additionally, it also handles
notifications not initiated from our write requests, i.e.
it is now more similar to an event based procedure rather
than a linear one. This also means that when the callbacks
for the start and stop procedures are now called, we have
receive the events (notifications) from the remote CAP
acceptors that they are actually synced (or not synced) to
the broadcasts.

Since the broadcast reception start and stop now waits
for the receive state to be updated, a change in the
Handover implementation was also done.

To test the solution 2 new test cases were added,
and the existing tests were modified to allow for the
new expected behavior.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-04-16 11:37:24 -05:00
Arthur Gay
f1dfc3744b net: http_client: Handle body of 5xx reponses
In the http client, the body of 5xx was skipped, leading to a parse error
in the http parser when it reaches the body.

Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
2026-04-16 14:47:07 +02:00