Commit graph

24,075 commits

Author SHA1 Message Date
Emil Gydesen
d74f5d7d23 Bluetooth: Audio: depend on UTF8
Add a dependency for UTF8 for LE Audio. Since (nearly?) all
string in LE Audio are UTF8 and that the stack wants to be
able to check and validate strings coming both from remove
deviecs and from the application, it will depend on the utf8
API that is guarded by CONFIG_UTF8.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-01-20 13:20:52 +00:00
Jamie McCrae
13bcf52b29 soc: arm: mps2: Fix SoC Kconfig naming
Fixes the Kconfig name of this so that it matches the value from
soc.yml, this has not been deprecated because this SoC is a virtual
SoC used only with the boards in zephyr meaning it should not cause
any breakage of out-of-tree boards

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-20 13:20:45 +00:00
Jamie McCrae
bf5460b661 soc: arm: musca: Fix SoC Kconfig naming
Fixes the Kconfig name of this so that it matches the value from
soc.yml, this has not been deprecated because this SoC is a virtual
SoC used only with the 2 boards in zephyr meaning it should not
cause any breakage of out-of-tree boards

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-20 13:20:45 +00:00
Kyra Lengfeld
4ae5f63aa9 Bluetooth: Host: Give option to disable TX processor thread
It is not recommended to disable the tx processor thread as otherwise
deadlocks may occur, but it has been observed that some boards and
configurations may have too little RAM to accommodate the TX processor
thread stack.
As such BT_TX_PROCESSOR_THREAD gets a prompt.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2026-01-20 13:20:04 +00:00
Flavio Ceolin
15d6ab8ae8 pm: device: Acknowledge unused variable
action_cb is not used in pm_device_driver_deinit is
not used when CONFIG_PM_DEVICE is enabled.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-01-20 13:17:37 +00:00
Flavio Ceolin
96c44c540b pm: device_runtime: Fix possible inconsistent state
In pm_device_runtime_get, when resume fails after the domain as claimed,
the flag PM_DEVICE_FLAG_PD_CLAIMED is not cleared (but the domain is
released). This leaves this flag in a consistent state and in a further
resume this device won't resume its domain leading to bigger problems.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2026-01-20 13:17:37 +00:00
Gaetan Perrot
44e0c38c63 net: coap: coap_client: make coap_client_schedule_poll void
coap_client_schedule_poll() never reports errors and always returns
0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-19 18:48:26 -06:00
Aleksandr Khromykh
bf261206bb bluetooth: mesh: remove secure sorage for tfm crypto provider
Commit removes selection secure storage for tfm
crypto provider. The secure storage is under
the secure image management. Non-secure image
is not required in the secure storage subsystem.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-19 15:24:22 +01:00
Gaetan Perrot
287d6e9ddd net: mqtt_sn: make process_advertise void
process_advertise() never reports errors and always returns 0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-19 15:13:05 +01:00
Gaetan Perrot
32e3057009 net: mqtt_sn: make process_search void
process_search() never reports errors and always returns 0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-19 15:13:05 +01:00
Can Wang
40931508ca Bluetooth: OBEX: fix incorrect error code in obex_transport_disconn
The function obex_transport_disconn() was always returning -EINVAL
regardless of the actual error code returned by the transport
disconnect operation.

Fix this by returning the actual error code from the transport
disconnect call instead of the hardcoded -EINVAL value.

Signed-off-by: Can Wang <can.wang@nxp.com>
2026-01-19 15:08:42 +01:00
Can Wang
3138be0b08 Bluetooth: OBEX: allow zero-length body in End-of-Body header
According to OBEX Version 1.5, section 2.2.9, it is legal to send a
zero-length End-of-Body header when object body data is generated on
the fly and the end cannot be anticipated.

Update parameter validation in bt_obex_add_header_body_or_end_body()
and bt_obex_add_header_end_body() to allow NULL body pointer when
length is zero, while still rejecting NULL body with non-zero length.

This enables proper support for zero-length End-of-Body headers as
specified in the OBEX specification.

Signed-off-by: Can Wang <can.wang@nxp.com>
2026-01-19 15:08:42 +01:00
Can Wang
85446aafd7 Bluetooth: OBEX: add bt_obex_has_app_param helper function
Add a new helper function bt_obex_has_app_param() to check whether
a specific application parameter tag exists in the OBEX buffer.

The function uses the existing bt_obex_get_header_app_param() to
retrieve the application parameters, then parses them using
bt_obex_tlv_parse() with a callback to search for the specified tag ID.

This simplifies checking for the presence of application parameters
without needing to manually parse the TLV structure.

Signed-off-by: Can Wang <can.wang@nxp.com>
2026-01-19 15:08:42 +01:00
Antoni Duda
28a9b43459 bluetooth: host: Allow unregistering per adv sync cbs
Introduce bt_le_per_adv_sync_cb_unregister to allow
unregistering of the periodic sync callbacks.

Signed-off-by: Antoni Duda <antoni.duda@programmer.net>
2026-01-19 12:17:53 +01:00
Gaetan Perrot
47ae7f4a50 pmci: mctp: mctp_i3c_controller: remove dead code in controller start
mctp_i3c_controller_start() contains a conditional check on a return
code that is never updated, making the error handling path
unreachable.

Remove the dead code to avoid misleading logic and make the current
controller startup behavior explicit.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-19 10:10:18 +01:00
Gaetan Perrot
9f39f80e72 sensing: sensor_mgmt: make set_sensor_state void
set_sensor_state() never reports errors and always returns 0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-19 10:08:21 +01:00
Gaetan Perrot
363387890d sensing: sensor_mgmt: make init_sensor void
init_sensor() never reports errors and always returns 0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-19 10:08:21 +01:00
Can Wang
b723880279 Bluetooth: Classic: OBEX: adjust MOPL handling when exceeding MTU
When MOPL exceeds MTU, adjust it to match MTU instead of sending the
error code. This handles the common case where mainstream mobile
operating systems (iPhone and Android) negotiate
MOPL values greater than the RFCOMM or L2CAP MTU.

Signed-off-by: Can Wang <can.wang@nxp.com>
2026-01-19 10:07:52 +01:00
Robert Lubos
602b91039a net: core: Queue loopback packets instead of processing directly
Instead of processing loopback packets from the TX thread directly,
queue them for further processing by RX thread (if possible), just as
regular packets. It's now possible as the information regarding the
packet is a loopback one or not is stored directly in the net_pkt
structure.

This allows to avoid unexpected stack consumption increases if packets
are sent for loopback destinations.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-16 18:07:57 +01:00
Gatien Chevallier
624e018a5f nvmem: Add OTP API support
OTP drivers are the interface to One Time Programmable memory, which
is NVMEM. Add the interface with the OTP API to the NVMEM one.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
2026-01-16 11:42:50 +00:00
Carlo Caione
d6dce1ca51 lorawan: rename region Kconfig symbols to be backend-agnostic
Move and rename the region Kconfig symbols from LORAMAC_REGION_* to
LORAWAN_REGION_* to make them backend-agnostic.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-01-16 11:41:01 +00:00
Carlo Caione
5eab8eb693 lorawan: move emulator to separate backend directory
Move the LoRaWAN emulator from the loramac-node backend directory to its
own directory because the emulator currently still depends on loramac-node
for some types and functions.

Once these dependencies are removed in a follow-up, the emulator can become
a fully standalone backend.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-01-16 11:41:01 +00:00
Carlo Caione
0a45c8dc70 lorawan: make NVM header documentation backend-agnostic
Remove loramac-node specific references (LORAMAC_NVM_NOTIFY_FLAG_*)
from the NVM interface documentation, making it suitable for any
LoRaWAN backend implementation.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-01-16 11:41:01 +00:00
Carlo Caione
429d98f80d lorawan: move loramac-node backend to subdirectory
Refactor the LoRaWAN subsystem to support multiple backends by moving
the loramac-node specific implementation into a dedicated subdirectory.

This change prepares the subsystem for adding lora-basics-modem support
as an alternative backend.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-01-16 11:41:01 +00:00
Gaetan Perrot
bb214df802 ipc: ipc_service: ipc_static_vrings: make vq_teardown void
vq_teardown() never reports errors and always returns 0.
The error check at the call site is therefore dead code.

Make the function void and drop the unused error handling.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-16 11:39:51 +00:00
Ibrahim Abdalkader
dca4136f5e llext: Keep constant data in flash.
This patch adds a new Kconfig option that allows read-only data sections
without relocations to be mapped directly (remain in flash) instead of
being copied to RAM during extension loading. This helps extensions that
have large constant data, such as certificates, lookup tables etc.. to
save saving significant RAM, especially with MPU is enabled.

This feature requires the extension to place rodata sections without
relocations in LLEXT_RODATA_NO_RELOC section.

Note that we chose to disable this optimization when MMU or USERSPACE is
enabled because the NO_RELOC section may not be aligned to the MPU/MMU
requirements on some architectures. If we leave it in place, llext will
attempt to create an MPU region for it using a misaligned address, and
if we allow it to be copied to RAM, it defeats the purpose of this feature.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2026-01-15 16:40:29 +00:00
Qiang Zhao
203c92980d net: shell: fix qbv command documentation and help text
Fix inconsistencies in the QBV (IEEE 802.1Qbv Time-Aware Shaper) shell
command documentation and help messages:

1. Add missing "net qbv" command documentation to net_shell.rst
2. Correct command examples in help text - add missing "net" prefix
   to "qbv set_gc" commands
3. Fix command usage descriptions for set_config and set_gc to match
   actual command names

This ensures users see correct command syntax in both documentation
and interactive help.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2026-01-15 11:09:22 +00:00
Gaetan Perrot
9217ce54c6 Bluetooth: VCP: avoid NULL dereference
Avoid calling vcp_vol_ctlr_discover_complete() with a NULL
controller pointer when lookup fails during AICS discovery.

The vcp_vol_ctlr_discover_complete() helper dereferences the
controller unconditionally, which could otherwise lead to a NULL
pointer dereference.

Fix by returning early if the controller lookup fails.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-15 11:06:01 +00:00
Gaetan Perrot
01e3a54f20 Bluetooth: MICP: avoid NULL dereference
Avoid calling micp_mic_ctlr_discover_complete() with a NULL
controller pointer when lookup fails during AICS discovery.

The micp_mic_ctlr_discover_complete() helper dereferences the
controller unconditionally, which could otherwise lead to a NULL
pointer dereference.

Fix by returning early if the controller lookup fails.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-15 11:06:01 +00:00
Robert Lubos
6d51407803 net: tcp: Fix possible assertion when peer advertises zero window
If peer lowered its receive window and advertised zero-window length,
TCP stack would pause the retransmission timer until non-empty window is
advertised again. This however could trigger an assertion, that verified
that the retransmission timer is running whenever there is data to
transmit. Add an exception to the assertion for the zero-window case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-14 13:05:55 -06:00
Andreas Huber
c611a16ecd net: ipv4: Add missing broadcast check in address conflict detection
As described in RFC5227 ch. 2.1.1 ARP Probes are broadcasted.
ARP requests not being broadcasted should not be detected as
ARP Probes.

Signed-off-by: Andreas Huber <andreas.huber@sautergroup.com>
2026-01-14 09:23:48 -06:00
Jukka Rissanen
74931644b5 net: tcp: Add NULL check when receiving SYN
Make sure that if the connection is closed but we still received
a SYN packet, we do not try to access already closed connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-01-14 09:22:38 -06:00
Tim Knodel
471060a354 logging: formatting: Add support for domain names
The domain name was always set to NULL. This adds a Kconfig
that will enable setting the domain name and sets the domain
name if the config is enabled.

Signed-off-by: Tim Knodel <tbk@google.com>
2026-01-14 09:18:52 -06:00
Samuel Kleiser
0fbbba2dc0 mcumgr: fs_mgmt: forward return values from fs_close
A new error code FS_MGMT_ERR_FILE_CLOSE_FAILED is returned when
closing a file fails. This is done on write or close operations - read
operations remain unchecked.

Signed-off-by: Samuel Kleiser <s.kleiser@vega.com>
2026-01-14 09:18:10 -06:00
Gaetan Perrot
646e93d294 net: coap: coap_client: fix request validation order in coap_client_req
Avoid accessing request fields before validating input arguments in
coap_client_req().

The request path length is now checked only after validating the
request pointer, preventing a potential NULL pointer dereference.

No functional change intended.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-14 09:57:03 +01:00
Firas Sammoura
6834cd5dae mem_mgmt: add mem_attr_get_region_index_by_name()
Add a new API to look up a memory region's index using its DeviceTree
node name. This allows callers to identify specific regions within the
internal regions array.

Includes unit tests for successful lookups and error handling for
non-existent names.

Signed-off-by: Firas Sammoura <fsammoura@google.com>
2026-01-14 09:56:53 +01:00
Gaetan Perrot
3755392579 sensing: sensor_mgmt: fix potential NULL dereferences
Ensure pointers are validated before dereferencing them in
set_arbitrate_interval() and set_interval().

This avoids accessing sensor or connection fields prior to
validation and makes the code safe even when assertions are
disabled.

No functional change intended.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-14 09:55:53 +01:00
Valerio Setti
c5dd4c7a0b net: lib: shell: make header file inclusion conditional
Include "websocket/websocket_internal.h" only when CONFIG_WEBSOCKET_CLIENT
is also enabled.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-13 17:28:29 +01:00
Valerio Setti
63cfa56bbb net: lib: http: http_server: replace usage of legacy Mbed TLS crypto
Use PSA Crypto API for SHA-1 computation instead of legacy Mbed TLS crypto.
The latter is going to be removed soon.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-13 17:28:29 +01:00
Valerio Setti
f331614bac net: lib: websocket: remove usage of legacy Mbed TLS crypto
Remove optional use of legacy Mbed TLS crypto in favor of the already
existing PSA Crypto API alternative. This is required in order to jump
to the next version of Mbed TLS (i.e. 4.0) where all this legacy crypto
support is no more available.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-01-13 17:28:29 +01:00
Andreas Huber
bb9616c0cd net: arp: Choose IP corresponding to the same network
If we have more than one IP on an interface we should choose the IP
corresponding to the same network as the target IP.

Signed-off-by: Andreas Huber <andreas.huber@sautergroup.com>
2026-01-13 17:28:16 +01:00
Ibrahim Abdalkader
00bf0915d6 llext: Skip MPU region alignment if userspace is disabled.
llext aligns and rounds up memory regions to satisfy MPU requirements,
which can waste significant memory by relocating read-only regions,
with power-of-two alignment on some architectures. However, these
MPU-aligned regions are never actually used by the MPU unless
userspace (CONFIG_USERSPACE) is enabled.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2026-01-13 17:26:30 +01:00
Fin Maaß
2b6e2874c4 net: shell: explicitly check for NULL
explicitly check for NULL

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-13 13:36:20 +01:00
Fin Maaß
67c6ec66b5 net: shell: set constant array index directly
set constant array index directly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-13 13:36:20 +01:00
Fin Maaß
06d257d41b net: shell: follow rule 78
Follow coding guidelines rule 78:

A full expression containing an increment (++) or decrement (–) operator
should have no other potential side effects other than that caused by the
increment or decrement operator

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-13 13:36:20 +01:00
Robert Lubos
1a2d9f7b8f net: sockets: Report an unrelying errors from accept()
If the underlying listening TCP context reported an error, it's no
longer usable, therefore accept() call for such a socket should report
an error as well, otherwise it may block indefinitely.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-13 13:33:49 +01:00
Robert Lubos
913fae5169 net: tcp: Make sure TCP context is dereferenced only once on network down
In case network interface goes down, all underlying TCP contexts are
being dereferenced, however they are not released until application
dereferences them as well (i.e. closed the socket). If the application
does not do so however timely, and network interface goes down again,
the TCP context would still be present on the active contexts list and
could've been dereferenced for the second time.

Fix this by checking the context state before dereferencing it on the
stack behalf. Non-listening TCP context are being set to CLOSED state
upon dereferencing.  For the listening contexts, the TCP context has
only one ref from the application side, so use the `accept_cb` pointer
value as an indicator that the accept callback, indicating an error,
has already been called for the context.

Additionally, add a mutex lock when releasing listening context on
network down even, to avoid potential races with yet unprocessed
incoming packets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-13 13:33:49 +01:00
Sam Friedman
8ba115c2c5 net: coap_client: remove unused parameter in static function
75ef6392 removed the only call to coap_client_init_request() where
reconstruct==true. All remaining calls have reconstruct==false.
This commit removes the parameter.

Signed-off-by: Sam Friedman <sam@golioth.io>
2026-01-13 13:33:35 +01:00
Mathieu Choplain
239fab93bc kconfig: treewide: use auto-generated Kconfig compatible macro variables
Replace some manually-defined DT_COMPAT_<> Kconfig macro variables with
their automatically generated counterparts. In most cases, this is
straightforward as the manually defined macro is named identically to the
one generated by the build system.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-13 13:30:54 +01:00
Kapil Bhatt
85b8e880aa net: wifi: Add P2P power save shell command support
Add shell command support for P2P power save.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-01-13 13:30:23 +01:00