Commit graph

22,555 commits

Author SHA1 Message Date
Cristian Bulacu
c341838502 net: ip: route: Add support to search mcast route by iface
This commit adds the possibility to check for a multicast route on a
given interface

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-10-31 20:01:55 -04:00
Tomasz Chyrowicz
1b50f08ee9 mgmt: Handle slot version equality
If slots have equal version, but a secondary slot is the active one, the
next boot will switch to the primary slot.
Expose this through SMP commands by marking the primary slot as pending.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-10-31 22:41:16 +02:00
Jukka Rissanen
60f83dca7d net: Do not access possibly freed net_pkt
As the net_pkt might have already been sent by net_if_try_send_data()
function, the pkt might already contain garbage data. So do not try
to access if after that send call but remember the used iface and family
and use them to update the statistics.

The issue was seen with qemu_x86_64 and qemu_cortex_a53 when CONFIG_SMP
was enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-31 22:41:07 +02:00
Lyle Zhu
d95358e934 Bluetooth: Classic: L2CAP: Reset rx.cid when channel is deleted
rootcause: The dynamic L2CAP channel rx.cid is not reset, it
will be intercepted by the judgment condition of the fixed channel,
directly using the last alloced cid may cause cid conflict.

Co-authored-by: zhenwei fang <fangzhenwei@bytedance.com>
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-31 10:34:04 -04:00
Jukka Rissanen
73315dd73d net: shell: stats: Fix undefined function call
If CONFIG_NET_STATISTICS_PER_INTERFACE is not set, then the
net_shell_print_statistics_all() function was not found and
the compilation was failing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-31 10:33:47 -04:00
Szymon Janc
973934c1e9 Bluetooth: Host: Fix crash on bt_disable() with limited advertising
When limited advertising is enabled there is pending deleyable work
for timing it out. If in such case struct bt_le_ext_adv is cleared by
memset system will crash on next tick.

Fix this by ensuring work is cancelled before clearing struct
bt_le_ext_adv. Using bt_le_ext_adv_foreach() ensures that this will
be correctly handled with and without extended advertising enabled.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-10-30 18:37:07 -04:00
William Tambe
611f381ed9 xtensa: properly compute irq number
This is a miss from:
abeccfec28 xtensa: support for more than 32 interrupts

Signed-off-by: William Tambe <williamt@cadence.com>
2025-10-30 18:36:41 -04:00
Tomasz Leman
45bfe066c7 ipc: intel_adsp_host_ipc: clear tx_ack_pending on PM resume
Fix IPC driver becoming non-operational after power management resume
due to stale tx_ack_pending state from before suspend.

After the IPC service backend refactor (commit cf7e2e63c1), the
intel_adsp_ipc_data structure contains function pointers for
suspend/resume handlers. This prevents using `memset` to clear the
entire structure during initialization, which was previously done in
intel_adsp_ipc_init.

Without clearing tx_ack_pending on resume, if the device enters D3 state
while still waiting for an IPC acknowledgment (e.g., from a previous
test iteration), the driver remains stuck in the waiting state after
resume. This prevents sending any new IPC messages, including the
FW_READY notification after D3 exit.

The fix explicitly clears tx_ack_pending during PM_DEVICE_ACTION_RESUME
to ensure the driver starts in a clean operational state after resume,
regardless of the state before suspend.

Fixes regression introduced in commit cf7e2e63c1

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2025-10-29 20:18:41 +02:00
Simon Walz
fd780ae34e net: lwm2m: fix missing name entries for time-serialized resource instances
The LwM2M SENML JSON/CBOR decoder expects a name entry for every
time-serialized record. While this was already the case for resources,
resource instances were missing their corresponding name entries. This
change ensures consistency by adding name entries for resource instances
as well.

Signed-off-by: Simon Walz <simon.walz@autosen.com>
2025-10-29 20:18:30 +02:00
Jamie McCrae
20be667f16 mgmt: mcumgr: grp: settings_mgmt: Part revert settings save change
Partially reverts commit 7d2fb6c013,
it was originally thought that this commit added a method of saving
one specific key using the value that the device already has set,
but has been found to actually save the value that the user has
provided, bypassing the current value that the device has, which is
not compliant with the settings mgmt protocol, therefore remove
this change and it will need to be reworked in future to function
properly by saving one specific value from the device's current
configuration, not a user-specified value

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-29 20:18:20 +02:00
Chaitanya Tata
05899583fd ipc: icmsg: Increase default stack size
For nRF71 Wi-Fi a higher stack size is needed.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-10-29 13:48:33 +02:00
Jukka Rissanen
a02414a9bc net: zperf: Use %zd when printing size_t variable
Wrong printf format was using for size_t variable which caused
compiler warning and a failure.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-29 13:47:21 +02:00
Lyle Zhu
354a63f401 bluetooth: classic: HFP_AG: Fix early SCO connection req sending
When creating the audio connection, the SCO connection request will be
sent before the response "OK" to AT command "AT+BCS" is issued.

It causes the issue that the HFP HF cannot response the SCO connection
request with the correct codec. Then the SCO connection cannot be
established properly.

Put all processing into the same context, thus avoiding non-sequential
execution caused by the different priorities of different threads.

Add a flag `BT_HFP_AG_AT_PROCESS` to flag the AT command is being
processed.

When the flag `BT_HFP_AG_AT_PROCESS` is set, put the pending
executions into temp list `tx_submit_pending`. After the AT response
`OK` or `ERROR` has been sent, move the pending executions from
`tx_submit_pending` to `tx_pending`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-29 11:44:52 +02:00
Anas Nashif
303af992e5 style: fix 'if (' usage in cmake files
Replace with 'if(' and 'else(' per the cmake style guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-29 11:44:13 +02:00
Cristian Bulacu
ecb5db6c92 samples: net: openthread: border_router: Fix packet forwarding bug
This commit fixes an issue introduced in #97531. Multicast routes added
by application are now set to have a prefix length of 16 bits instead of
128. This will allow multicast routing to all IPv6 addresses from those
groups.

For the OpenThread multicast listener callback, route length will be set
to 128 bits, as a MLD event is expected when an address is subscribed.
Route lookup has been removed since one will always be found as the
application registers multicast routes with same scope, but with a
smaller prefix length.

Fixed issue regarding packet forwarding and BBR state. Previously, code
was covering only the case wehn BBR was secondary and packet was
received from backbone interface. A secondary BBR should not forward a
multicast packet from OT interface to backbone interface and vice versa.

Improved unicast forwarding function to return from the beginning if the
packet has a multicast destination.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-10-29 10:32:42 +02:00
Rob Barnes
5ce408b647 kernel: assert if k_current_get is called pre-kernel
k_current_get is not valid pre-kernel. It will return an invalid dummy
thread or invalid memory. The invalid memory case can occur when
CURRENT_THREAD_USE_TLS is enabled.

Assert in k_current_get when called pre-kernel so offending code may be
identified.

k_is_pre_kernel is moved up in kernel.h to avoid needing a prototype for
k_is_pre_kernel.

Signed-off-by: Rob Barnes <robbarnes@google.com>
2025-10-28 11:52:34 +02:00
Jakub Rzeszutko
3ae4dfe490 shell: fix deadlock in the bypass function
Previously, the bypass() function was called while the shell mutex
was still held, preventing the use of shell APIs (e.g. shell_print())
inside the bypass context.

This change unlocks the shell mutex before invoking bypass() and
locks it again afterwards, restoring proper shell context handling
and preventing potential deadlocks.

Issue fixed by: roni1234321

Fixes #97722

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2025-10-28 11:51:18 +02:00
Pan Gao
40256a919d net: l2: wifi: Fix btwt_setup command parameter count
command btwt_setup maximum support max 12 optional parameters.

Signed-off-by: Pan Gao <pan.gao@nxp.com>
2025-10-28 11:50:02 +02:00
Chris Friedt
b6d45e1def testsuite: coverage: use correct path to fnmatch.h
The minimal libc does not include `fnmatch.h` in its default search path.

This causes an issue when running coverage in CI as shown here.
https://github.com/zephyrproject-rtos/zephyr/actions/runs/18839500380/\
job/53748166725

That would technically be fixed with #97855 as well.

Testing Done:
```
west twister -c -p qemu_x86/atom -s kernel.pending.minimallibc --coverage\
 --coverage-tool gcovr
```

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-10-28 11:47:31 +02:00
Vinayak Kariappa Chettimada
533ef58157 Bluetooth: Controller: Fix use-after-release in lll_scan/lll_scan_aux
Fix use-after-release in lll_scan/lll_scan_aux when using
mayfly_enqueue to defer execution of the offset calculation
using ull_sched_mfy_after_cen_offset_get().

Apply suggestion from @Copilot

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-27 16:18:48 -04:00
Alberto Escolar Piedras
8fb6cb7537 tracing: ctf: Fix arguments for socket tracing functions (again)
Zephyr's socklen_t was changed in
c546c1cad1
to be uint32_t instea of size_t.
Let's fix accordingly the prototypes which expect it.

Note this was already fixed in
37ff1b254f
But it was reverted in
d849ab1263

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-27 16:14:50 -04:00
Jukka Rissanen
ec3bcd3930 net: tcp: Close all connections when interface goes down
If the network interface goes down, close all TCP connections
that are bound to that interface. The reasoning here is that we
need a way to remove IP address from the interface and it might
not be possible if there is a TCP socket that is bound to that address.
If the interface comes back on, we might get the same IP address in
which case the socket closure was not really needed but it is not
possible to know in advance.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-27 07:32:28 -04:00
Jukka Rissanen
1f5c285279 net: tcp: Allow immediate connection tear down
If the network interface goes down, then we do not have any time
to tear down TCP connection gracefully because there is no more
a connection to send data to. In this case the TCP connection is
forcefully closed without going into FIN_WAIT_1 state.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-27 07:32:28 -04:00
Lars Segerlund
fc813d9556 Bluetooth: Controller: Handle overlapping CIG and ACL
If the CIG and ACL overlap each other when the CIS is starting
zephyr will assert on negative time, so fit this special case.

Signed-off-by: Lars Segerlund <lrsu@demant.com>
2025-10-27 10:59:38 +02:00
Pavel Vasilyev
1a4f113d14 bluetooth: mesh: adv_ext: Fix scheduling with multiple relay adv sets
When multiple relay adv sets are used, the bt_mesh_adv_send function
calls bt_mesh_adv_relay_ready which should distribute relayed
advertisements across all relay adv sets.

Until the submitted relay adv set work is started, the ADV_FLAG_ACTIVE
is not set. Therefore, next call to bt_mesh_adv_send will try to
re-submit the same relay adv set work, instead of picking up another
relay set which is actually free and ready to send an advertisement.

This commit adds a check that checks if the adv set work is already
pending to be executed. And if so, schedule_send returns false to make
bt_mesh_adv_relay_ready pick next relay adv set.

This shouldn't brake advertising because once adv set is done
transmitting advertisment, it will pick up a next one.

The ADV_FLAG_PROXY check is added to do re-submit for adv set which was
used for proxy advertisement since we need to prioritize mesh messages
over proxy advertisements when those are running on the same adv set.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-10-27 10:59:23 +02:00
Lingao Meng
bed07a5ebf tests: bluetooth: audio: fix bsim timing
move extending advertising start after periodic adv.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2025-10-27 10:59:23 +02:00
Lingao Meng
d59cd2e368 Bluetooth: Host: Fix Periodic Advertising random address update
update random address when periodic adv enabled.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2025-10-27 10:59:23 +02:00
Lingao Meng
f902f2ab0d Bluetooth: Host: Fix unnecessary random address update
The `bt_le_ext_adv_update_param` will set new random address when option
not select `BT_LE_ADV_OPT_USE_IDENTITY`, But `bt_le_ext_adv_start` will
also set random address again.

This will be affect bluetooth mesh, after this change, will ensure address
only change once for every advertising.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2025-10-27 10:59:23 +02:00
Emil Gydesen
02d0e96bf1 Bluetooth: BAP: Add bt_bap_unicast_client_unregister_cb
Add bt_bap_unicast_client_unregister_cb to unregister BAP
unicast client callbacks. This is required for unittests
to clean up between runs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-25 15:59:40 +03:00
Anas Nashif
d849ab1263 tracing: fix various style issues
run clang-format and fix various checkpatch issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
fc4db3dd1d tracing: ctf: do not use signal as an argument
Violates coding guideline rule 21.2

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
21e44ea8d4 tracing: systemview: add tracing for mail boxes
Add missing hooks for mail boxes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
a6dee79282 tracing: systemview: add tracing for events
Add missing hooks for events.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
59a3fe86d3 tracing: systemview: add tracing for stacks
Add missing hooks for stack objects.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
539308f336 tracing: systemview: add tracing for message queues
Add missing hooks for message queues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
63582601f2 tracing: ctf: add event support
Add hooks for events.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
61dd33445e tracing: ctf: add mbox support
Add hooks for mail boxes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
1823d4cf18 tracing: ctf: thread extended
Add more thread related tracing functions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
906db71942 tracing: ctf: add poll
Add hooks for poll object.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
ba453c1337 tracing: ctf: add work queues
Add hooks for work queues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
e23d663b85 tracing: ctf: add condition variables
Add hooks for condition variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
26fa18ef2d tracing: ctf: add tracing for message queues
Add hooks for message queues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
9e99699167 tracing: ctf: add tracing for memory slabs
Add hooks for memory slabs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
7b1e72474c tracing: ctf: add missing return value for mutex_unlock
Add missing return for mutex_unlock.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Anas Nashif
afef4b6a17 tracing: add semihosting backend
Using semihosting on supported architectures (arm, xtensa, riscv) it now
possible to generate tracing giles easily and without being restricted
by size.
Using qemu for example, it is now possible to generate the tracing file
simply by running:

 west build -p -b mps2/an385 tests/kernel/msgq/msgq_api/ \
 	-t run --snippet semihost-tracing

This will generate a tracing file in the build/ directory which can be
viewed with babeltrace.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-25 15:59:19 +03:00
Yong Cong Sin
e8a4b9e303 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-25 10:46:27 +03:00
Valerio Setti
fa911df90c modules: mbedtls: rename MBEDTLS_DTLS
Align Kconfig name to the Mbed TLS build symbol.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-24 13:27:59 -04:00
Valerio Setti
f960db846c modules: mbedtls: rename MBEDTLS_TLS_VERSION_1_2
Align Kconfig name to the Mbed TLS build symbol.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-24 13:27:59 -04:00
Valerio Setti
e1117f18fc modules: mbedtls: rename MBEDTLS_MD
Align Kconfig name to the Mbed TLS build symbol.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-24 13:27:59 -04:00
Alain Volmat
e7ae828f70 usb: usbd_uvc: add frame_based support (currently only H264)
The frame_based descriptors differ from the frame descriptors
in that there is no dwMaxVideoFrameBufferSize field.
In order to do that, add a new uvc_frame_based_discrete_descriptor
structure to be used to fill in proper information into the
frame descriptor. In addition to that, a new format descriptor
is also added for frame based transfer.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-24 13:25:34 -04:00