Commit graph

22128 commits

Author SHA1 Message Date
Jukka Rissanen
255253b108 net: ipv6: Add packet queueing while waiting NA
If we do not know the neighbor link address, we need to send
neighbor solicitation message to net. While waiting neighbor
advertisement, there might be other packets that we want to
send to that neighbor. Queue those packets so that all of them
can be sent when NA message is received.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-07-28 08:53:19 -04:00
Cheng Kai
cf61573ce9 Bluetooth: L2CAP: add br l2cap unregister interface
It needs to do l2cap unregister operation from app

Signed-off-by: Cheng Kai <chengkai@xiaomi.com>
2025-07-28 08:52:01 -04:00
Sean Madigan
3adae8bd9a bluetooth: host: Add support for extended feature set feature
This commit adds support for the extended feature set
feature. This includes:
- hci boilerplate
- kconfigs, including one for a max local feature page
- reading remote features is done by a command and callback
- this is not linked into the auto feature request on
connection as this procedure can take quite a few connection
events, and we do not want to delay the user
- added the commands to the bt shell

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2025-07-28 08:48:30 -04:00
Sean Madigan
cddea431eb bluetooth: host: hci_core: allow both orders of version and feature events
Previously, the version complete event had to come after
the remote feature complete event for the notify_remote_info
function to be called.

This becomes less practical when adding the read all remote
features complete event, as this can take some time. Meaning
the order of events is not predictable.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2025-07-28 08:48:30 -04:00
Gang Li
84d4592373 net: l2: wifi: add wifi config command
- Added "wifi config" command.
- Add OKC parameter to "wifi config" command.
  Set okc to 1 to enable opportunistic key caching.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2025-07-28 08:46:37 -04:00
Vinayak Kariappa Chettimada
5b1c209498 Bluetooth: Controller: Add missing atomic_get call
Add missing atomic_get call to access atomic value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-28 08:45:59 -04:00
Vinayak Kariappa Chettimada
0a2934d1d2 Bluetooth: Controller: Fix assertion in ull_conn on HCI Reset
Fix assertion in ull_conn under race between connection
termination and processing of HCI Reset command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-28 08:45:47 -04:00
Vinayak Kariappa Chettimada
e1541cc712 Bluetooth: Controller: Fix ULL Tx Ack index corruption under race
Fix ULL Tx Ack FIFO's first index being advanced beyond a
recorded ack_last value in a node_rx when under race.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-28 08:45:33 -04:00
Robert Lubos
d93c5d6072 net: tcp: Fix handling of keep-alive probes
Keep-alive probes have seq number set to SND.NXT - 1 and may or may not
contain an octet of data. The latter case was not handled properly
therefore add a special case when validating seq number to response to
keep-alive probes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-28 08:44:41 -04:00
Fengming Ye
6e079f3ed6 net: wifi: fix 11k cannot be set before connection
Support the case that 11k parameter can be set before wifi connection.
This field should not be cleared by connection.
Neighbor report will be cleared before start_roaming.
So wifi_connect don't need to clear 11k params.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2025-07-28 08:39:39 -04:00
Victor Brzeski
c0e1268d9f usb: device_next: hid: Fix endpoint address getters
This commit resolves a bug where the USB Endpoint
provided by the HID driver was incorrect when in
High Speed mode.

Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>
2025-07-27 17:57:05 -04:00
Anas Nashif
a096b34835 tracing: ctf: trace k_sleep()
Trace sleep events in CTF:

[19:00:00.181375400] (+0.000044700) k_sleep_enter: ...
..
[19:00:00.290203800] (+0.000031500) k_sleep_exit: ...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-25 23:29:14 +02:00
Ajay Parida
c70b3504bb net: l2: wifi: Configure BSS max idle period
Support to configure BSS max idle period at runtime.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Triveni Danda
3f037430b6 net: l2: wifi: Refactor certificates processing code into common file
Refactor certificate processing code to eliminate duplication and
enable reuse across modules that require enterprise support.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Kapil Bhatt
fbd34dac0f wifi: Fix fractional part of Tx rate by converting to float
The Tx rate was previously stored as an integer, which caused loss of
precision for rates like 8.6 Mbps or 34.4 Mbps due to integer division.
The change will update data type to float.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Jeremy Bettis
aab1dc6858 shell: Restore uninit_cb that was lost in #93154
The sh->ctx->uninit_cb needs to be set before posting the
SHELL_SIGNAL_KILL to the event, like the k_poll based code did prior to

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2025-07-25 17:02:31 +01:00
Aleksandr Khromykh
c02ec1f645 bluetooth: mesh: remove persisted psa key if mesh does not own it
Commit adds destruction of the persisted in PSA ITS key if
mesh does not own it (zero bit in the bitmap of persisted keys).

This is not standard mesh behavior, but might happen
if something happens between removing key data in mesh and
in the crypto library (for example power off in bettwen).

Previously, mesh wasn't able to import key with gotten stuck
key id. The current fix reproduces more robust behavior.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-07-25 08:17:24 -04:00
Alexander Paschoaletto
8c03410af0 tracing: msgq: adding dedicated tracing for k_msgq_put_front
This commit adds the tracing macros and functions related
specifically to the k_msgq_put_front API.

Signed-off-by: Alexander Paschoaletto <axelpinheiro@gmail.com>
2025-07-25 08:16:58 -04:00
Omkar Kulkarni
602fd0d889 Bluetooth: Mesh: Blob Server considers friendship
Fix Max Chunk reporting during Block_Information_Get:
If friendship is established, then max possible chunk size for transfer
is reported according to friend's queue size.

ChunkSize = (FndQ sz * Bytes per seg (12)) - Opcode(1) - Chunk_Num (2)-
            8 byte MIC (max)
	  = (FndQ sz * 12) - 11

This allows all segments of Chunk_Transfer messages to fit in a friend
queue. If this is not done, friend queue keeps overflowing
systematically causing unstable PULL_MODE transfers.

Fix Chunk requests:
Adapt number of requested chunks according to current friend queue size.
If friend queue is too small, at least 1 chunk is requested.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2025-07-25 08:14:26 -04:00
Tom Burdick
be4c3804de rtio: Fix syscall verify misra-c:2004 12.4 issue
MISRA-C says the right hand of a logical and should not contain side
effect operations. Instead nest the branches to get the same logic
without the MISRA-C rule breakage.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-07-25 08:09:41 -04:00
Lorenz Clijnen
be38568577 net: openthread: Fix build with CONFIG_OPENTHREAD_INTERFACE_EARLY_UP
When building with CONFIG_OPENTHREAD_INTERFACE_EARLY_UP enabled,
`is_up` is undefined (since 596844a).

Signed-off-by: Lorenz Clijnen <github@lorc.be>
Signed-off-by: Lorenz Clijnen <l.clijnen@edna.eu>
2025-07-24 17:01:59 +01:00
Robert Lubos
1e77663c87 net: lwm2m: Optimize value attributes verification
As lwm2m_notify_observer_path() now reads attributes for the updated
resource, value_conditions_satisfied() does not need to read the
attributes again, it can just reuse the already available data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 17:01:07 +01:00
Robert Lubos
b633f3a9de net: lwm2m: Verify pmin for updated resource on notify check
When updating a resource, the LwM2M library verified pmin attribute on
all resources/objects in the observer path list and chose the smallest
value. While this make sense for determining the lower-boundary for the
next notification time, it could lead to unnecessary notifications being
generated too early if the updated resource had a higher pmin value
configured on it.

Therefore, when checking notification criteria for an updated resource,
check the pmin value for that resource path and if set and higher than
the lowest pmin value evaluated for the observer list, use it instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 17:01:07 +01:00
Bjarki Arge Andreasen
825dea6832 shell: exchange k_mutex for k_sem
The mutex is being used as a simple binary semaphore. It is not
recursed so we don't need to track thread ownership nor lock count.

Exchange the mutex for a binary semaphore to save resources and
speed up shell.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-24 17:00:07 +01:00
Josuah Demangeon
366c64eca0 usb: uvc: respect setup->wLength in responses
Due to the alignment and granularity requirements of memory allocation,
setup->wLength is shorter than the allocated buffer size.
This lead to responses larger than what the host requested, which it
rejected. Fix it by using the minimum between the allocated size, the
struct size, and the wLength requested.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-07-24 16:58:20 +01:00
Josuah Demangeon
ed9327dec2 usb: uvc: allow the host to use short probe/commit messages
Some OSes like MacOS use shorter UVC 1.1 probe/commit messages even when
UVC 1.5 is supported, without bUsage, bBitDepthLuma, bmSettings,
bMaxNumberOfRefFramesPlus1, bmRateControlModes bmLayoutPerStream.
Accept messages of arbitrary size to safely be processed, ignoring all
missing fields, improving standard compliance.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-07-24 16:58:20 +01:00
Robert Lubos
6bfeb4fe45 net: lwm2m: senml_cbor: Verify data len before calling memcpy
Check if there actually is data to copy before calling memcpy() to
prevent potentially calling memcpy() with NULL value pointer.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
779d8521a8 net: lwm2m: oma_tlv: Fix UBSAN warnings about signed integers
* Simplify the logic of the get_number() function to address the corner
  cases reported by UBSAN regarding byte-swapping signed integer values.

  The existing logic was actually only valid for little-endian systems,
  as it expected that the bytes written from the packet buffer will be
  stored at the beginning of the int64_t memory, plus the actual
  byte-swapping with signed integer casts inside was hard to follow.
  Switch to a plain uint8_t buffer for integer readout, and use
  dedicated system function to convert the big-endian data in the buffer
  into unsigned integer in the system endianness, followed by the final
  cast to a signed value.

* Add explicit cast to uint32_t in put_objlnk() to prevent warning about
  not-fitting integer after byte shift, and update the result type to
  uint32_t as well.

* Switch to buffer with sys_put_be16/32/64 when writing integers due to
  similar warnings about byte-swapping signed values.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
a09fae571e net: lwm2m: plain_text: Check for int64_t overflow when parsing integer
Verify if the integer value being parsed does not overflow int64_t type
and report an error in such cases.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
d9395d8502 net: lwm2m: json: Check for int64_t overflow when parsing integer
Verify if the integer value being parsed does not overflow int64_t type
and report an error in such cases.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
c1aa7f57c2 net: lwm2m: registry: Validate value pointer before use
Check if value pointer is not NULL before passing it to memcmp() inside
lwm2m_engine_set(). As the function actually expects that the value
pointer can be NULL in case resource value is cleared (there is a test
case for such behavior), validate that len value is actually 0 if NULL
value is provided, to avoid unexpected behavior in other parts of the
function.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Cristian Bulacu
f020633603 net: l2: openthread: Initial Border Router support.
Added initial border router code sample.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-07-24 16:56:42 +01:00
Cristian Bulacu
b0bcb68171 net: ip: Kconfig: Re-enable routing support between interfaces support
As packets need to be forwarded between Wi-Fi/Eth interface and
OpenThread interface, routing support has to be re-enabled and
configurable through prj.conf file.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-07-24 16:56:42 +01:00
Anas Nashif
fec22fd85b crypto: remove deprecated tinycrypt
Remove tinycrypt, it was deprecated in 4.0.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-24 02:48:32 -04:00
Joakim Andersson
0fde156b9c fs: shell: Fix FS shell using fixed storage_partition name instead of DT
Fix FS shell using fixed 'storage_partition' nodelabel instead of
accessing the DT defined partition from the zephyr,fstab,littlefs
node partition property.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2025-07-24 02:48:22 -04:00
Van Petrosyan
692a9ae372 modem: pipelink: silence warning in modem_pipelink_is_connected
Initialize local variable `connected` to false to suppress the GCC warning.

Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
2025-07-24 02:45:22 -04:00
Bjarki Arge Andreasen
638bf6b03d modem: cmux: Decouple modem cmux and cellular driver
The modem modules cmux module is currently directly coupled to the
presence of specific modems, rather than being selected by drivers
for whatever hardware wants to request the default MTU of 127 bytes.

This commit the makes the device drivers (for now, modem_cellular)
select the symbol, thus decoupling the modem modules from the
presence of any specific device.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-23 17:31:22 +01:00
Jakub Michalski
77834f2069 fs: implement zephyr fs api for virtiofs
This commit implements zephyr filesystem operations for virtiofs

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2025-07-23 12:20:22 -04:00
Jakub Michalski
02b18136e2 fs: add virtiofs operations
This commit adds virtiofs functions implementing fuse operations required
to enable zephyr filesystem support

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
2025-07-23 12:20:22 -04:00
Jakub Michalski
b28483a3fe fs: add fuse primitives
This commit adds fuse structures, requests and functions to fill them

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
2025-07-23 12:20:22 -04:00
Guennadi Liakhovetski
c99605126c llext: only invalidate instruction cache where needed
When preparing LLEXT ELF sections only invalidate instruction cache
of executable sections. Also skip the step on platforms, managing
cache at the application level.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2025-07-23 09:32:34 +02:00
Bjarki Arge Andreasen
a39285b720 shell: exchange k_poll for k_event
The shell subsystem currently uses k_poll for signalling. However,
k_poll is only used for simple event signals, results are not used.

Replacing the k_poll with k_event greatly simplifies the code, and
saves 4 struct k_poll_signal and 4 struct k_poll_event (one of which
was entirely unused) while costing a single struct k_event, for
every shell instance. It also allows us to not select POLL,
as we are using the simpler EVENTS instead.

A quick test build of the shell test suite on an nrf54l15 produces
the following build info:

using EVENTS:

           FLASH:       71592 B      1428 KB      4.90%
             RAM:        9872 B       188 KB      5.13%
        IDT_LIST:          0 GB        32 KB      0.00%

using POLL

           FLASH:       75524 B      1428 KB      5.16%
             RAM:       11224 B       188 KB      5.83%
        IDT_LIST:          0 GB        32 KB      0.00%

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-22 19:34:02 -04:00
Robert Lubos
d3ba674a51 net: lwm2m: Handle RESET replies for separate response
Separate CON responses do no have a reply callback registered (as no
response is expected), however are still registered for retransmission
on the pending list. Therefore, we not only need to check for empty
ACKs for such case but for RESET packets as well. However, this cannot
be done before "reply" processing, as some of the reply handlers
(notifications namely) check for RESET replies.

Therefore, add a final check for the RESET response after the existing
"reply" logic. In such case, just remove the pending response packet
from the retransmission queue, and release resources.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-22 19:30:40 -04:00
Robert Lubos
cf28b5aa65 net: lwm2m: Clear acknowledged flag before sending separate response
When using a separate response mechanism in LwM2M client, the
acknowledged flag is used to notify the engine that the request has been
acknowledged already with an empty ack and a separate CON response
should be sent. The same flag however is used by the retransmission
mechanism, to check if the CON request sent by the client has been
acknowledged by the peer.

As separate responses use the flag both ways, it has to be cleared
before sending the separate CON reply. Otherwise, the retransmission
logic assumes the reply has already been acknowledged and skips the
retransmission.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-22 19:30:40 -04:00
Vinayak Kariappa Chettimada
ede31d39f0 Bluetooth: Controller: Fix assertion using BT_CTLR_LOW_LAT_ULL_DONE
BT_CTLR_LOW_LAT_ULL_DONE is used to reduce CPU usage in LLL
context by delegating the done event dequeue to ULL_HIGH
context.

Building a HCI Controller with BT_CTLR_LOW_LAT_ULL_DONE had
assertion when used with BlueZ stack.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-21 13:04:44 -04:00
Vinayak Kariappa Chettimada
cebaad33b1 Bluetooth: Controller: Fix missing ticker force reset on being lazy
Fix missing ticker force reset when the ticker expiry was
skipped or rescheduled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-21 13:04:36 -04:00
Vinayak Kariappa Chettimada
0ad4d86354 Bluetooth: Controller: Fix flash sync start from starving connection
Fix flash sync start from repeatedly forcing connection
event be skipped. Space new flash operation to be placed
in the past so that it does not force itself on to an
overlapping connection event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-21 13:04:36 -04:00
Guennadi Liakhovetski
226747a1c8 gdb: fix compilation failures
Compilation fails with an "index outside of array bounds" error:

In function 'find_memory_region',
    inlined from 'gdb_mem_can_read' at \
zephyr/subsys/debug/gdbstub/gdbstub.c:93:7:
zephyr/subsys/debug/gdbstub/gdbstub.c:65:21: warning: array subscript \
idx is outside array bounds of 'const struct gdb_mem_region[0]' \
[-Warray-bounds]
   65 |                 r = &gdb_mem_region_array[idx];
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
zephyr/subsys/debug/gdbstub/gdbstub.c: In function 'gdb_mem_can_read':
zephyr/subsys/debug/gdbstub/gdbstub.c:42:36: note: while referencing \
'gdb_mem_region_array'
   42 | __weak const struct gdb_mem_region gdb_mem_region_array[0];
      |

Use a single element array to fix the problem.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2025-07-21 13:03:30 -04:00
Luis Ubieda
a000acf85b gnss: rtk: Add basic integration
Incorporate the basic RTK API as well as a basic client integration
(serial) as a way to receive and publish the RTK data.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-07-21 09:19:14 -04:00
Anas Nashif
e6cfbda666 latmon: guard kconfigs to avoid leaks
Guard all kconfig options to avoid kconfig leakage when latmon is not
enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-21 07:51:07 -04:00