Commit graph

24,075 commits

Author SHA1 Message Date
Johann Fischer
620b7fe02f usb: host: usbip: fix actual_length in USBIP_RET_SUBMIT handling
actual_length needs to be set also for the OUT transfers. Assume that
requested length was transferred when there are no errors.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-11-14 10:25:05 +02:00
Johann Fischer
b84b6d9e0a usb: host: usbip: check pool's buffer size USBIP_CMD_SUBMIT
Check that the pool's buffer size is large enough for the data in the
submit command.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-11-14 10:25:05 +02:00
Johan Hedberg
445431c779 Bluetooth: Classic: AVRCP: Fix Clang/LLVM build failures
Having variable declarations after labels causes build failures with
Clang/LLVM:

subsys/bluetooth/host/classic/avrcp.c:1269:2: error: label followed by a
declaration is a C23 extension [-Werror,-Wc23-extensions]
 1269 |         uint8_t failed_evt = 0;
      |         ^

/subsys/bluetooth/host/classic/avrcp.c:3809:3: error: label followed by a
declaration is a C23 extension [-Werror,-Wc23-extensions]
 3809 |              uint64_t identifier = sys_get_be64(data->identifier);
      |              ^

Fix these by moving the declarations to the top of the function in the
first case and add braces for the second.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-11-14 10:24:38 +02:00
Julien Vermillard
4e54e9a806 net: lwm2m: get cache free slots
Add function to query LwM2M cache free slots on a given path.

Signed-off-by: Julien Vermillard <julien@clunkymachines.com>
2025-11-14 09:20:59 +01:00
Zhaoxiang Jin
2194069d8d cpu_freq: Validate P-states in devicetree in build time
Validate P-states in devicetree in build time. If no
P-states are defined, a build error will be raised.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-11-13 20:46:01 -05:00
Zhaoxiang Jin
26f773fb72 cpu_freq: Add fallback mechanism for on-demand policy
In current on_demand policy, if it doesn't find a P-state
with a threshold lower than the current load, it will fail
to switch state. For example, if load went from 100% -> 0%
suddenly as the chip would get stuck in a "turbo mode"
meanwhile its load is low.

This commit add fallback mechanism for on-demand policy,
that is if no P-state matches (i.e., the load is below all
thresholds), the policy will fall back to the P-state with
the lowest load_threshold (typically the lowest performance
state).

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-11-13 20:46:01 -05:00
Lyle Zhu
03e062219a Bluetooth: Classic: shell: hfp: Add command last_number
Add the command `last_number` to set the last dialed phone number.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-13 20:45:50 -05:00
Lyle Zhu
97b4373d9b Bluetooth: Classic: HFP_AG: Add callback redial to get number
If a phone was made during the previous SLC, AG cannot properly
process the redial request sent by HF after reconnecting.

Add a callback `redial` to get the last dial number from the upper
layer when `AT+BLDN` command is received.

If the callback is not provided or the error is returned after the
callback returned, send error response to the HF.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-11-13 20:45:50 -05:00
Dev Joshi
080734ce0f tracing: rtio: Add tracing hooks for rtio
This commit adds tracing support/hooks for rtio subsystem. It was
requested in #76972.

Signed-off-by: Dev Joshi <devbhave@qti.qualcomm.com>
2025-11-13 20:45:24 -05:00
Triveni Danda
b4e2cd139b net: l2: wifi: Handle domain match and suffix match parameters
Add support to handle domain match and suffix match parameters
for proper server certification validation.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-11-13 20:42:52 -05:00
Seppo Takalo
9acbcadfda modem: cmux: Define encoding and decoding functions for commands
Instead of relying non-standard compiler behavior, define
encode and decode functions for all CMUX command structures.

Final command is encoded into a shared buffer, because it is
always copied directly to TX ringbuffer.

Added also functions to validate commands.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-11-13 20:41:17 -05:00
Alexandre Boeglin
23a92a6ec8 usb: device_next: cdc_acm: Trigger TX on configuration enable
When CDC ACM instance gets enabled and there is some data in TX FIFO,
the TX FIFO work will not be triggered if no UART API is used. And if TX
FIFO was full before CDC ACM instance get enabled, TX work will never be
triggered. To fix it TX FIFO should always be drained when CDC ACM gets
enabled.

Signed-off-by: Alexandre Boeglin <alexandre.boeglin@qorvo.com>
2025-11-13 20:39:13 -05:00
Cla Mattia Galliard
6044262f42 log: output: log thread priority
When logging thread names also log their priorities.

Signed-off-by: Cla Mattia Galliard <clamattia@gmail.com>
2025-11-13 20:37:31 -05:00
Omkar Kulkarni
22e37982cb Bluetooth: Mesh: Make net msg cache netkey aware
Improve the network message cache to be aware of network keys to
prevent false duplicate detection across different subnets. This
ensures that messages with the same source address and sequence
number but from different network keys are not incorrectly
identified as duplicates, as it can happen in certain cases.
See ES-26350.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2025-11-13 20:36:24 -05:00
Make Shi
aca9ae2814 Bluetooth: AVRCP: Implement full support vendor-dependent commands
Add full support for all remaining AVRCP vendor-dependent PDUs on both
Controller (CT) and Target (TG), including APIs, callbacks, and shell
commands for testing.

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-11-13 20:35:28 -05:00
Make Shi
8572ec9cf3 Bluetooth: AVRCP: Add Player app Settings vendor-dependent commands
Implement support for AVRCP Player app Settings PDUs on both CT/TG
- Added APIs for sending and handling commands like LIST_ATTRS,
   LIST_VALS, GET_CURR_VAL, SET_VAL, and related text/inform PDUs.
- Added callbacks for TG request handling and CT response processing.
- Add shell commands for Player app Settings commands testing.

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-11-13 20:35:28 -05:00
Make Shi
c0c5a25158 Bluetooth: AVRCP: Add support for notification events
This patch adds AVRCP notification event handling for both CT and
TG roles. Also add Shell command support for testing notification
registration and responses.

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-11-13 20:35:28 -05:00
Make Shi
7008f0eaf3 bluetooth: avrcp: Add vendor-dependent with fragmentation support
This patch introduces support for AVRCP vendor-dependent commands and
responses, including full handling of fragmented messages.

- Adds fragmentation and reassembly logic for AVRCP vendor-dependent
- Introduces TX queue management using delayed work for TG
- Adds support for GetCapabilities PDUs
- Add new Kconfig for vendor-dependent with fragmentation support

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-11-13 20:35:28 -05:00
Make Shi
f06e977de3 Bluetooth: AVCTP: Remove redundant length check in avctp_tx_processor
Remove unnecessary checking for net_buf_tailroom(buf) < chunk_size
before sending data in avctp_tx_processor.

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-11-13 20:35:28 -05:00
Jamie McCrae
6963092375 lorawan: Move invalid requirement of 2KiB system workqueue
The LoRaWAN subsystem does not require 2KiB of system workqueue,
testing on nrf54l15 flpr (RISCV) CPU (with custom cryptography code)
shows it uses about 700 bytes of the system workqueue, therefore it
is assumed that the real requirement for 2KiB is the software
cryptography features, not the LoRaWAN stack itself, and the
cryptography parts of LoRaWAN can be replaced with alternatives
that do not need this high of a memory requirement, so the
requirement has been moved to the specific Kconfig for software
cryptography instead

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-11-13 23:21:49 +02:00
Ibrahim Abdalkader
a310e57942 llext: Fix ARMv8-M MPU memory region alignment
ARMv8-M and newer ARC MPUs use base/limit addressing with 32-byte
granularity and do not require power-of-two sizing. Only ARMv7-M
and older ARC MPUs have this restriction.

Check CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT (set for ARMv7-M,
older ARC) instead of CONFIG_ARM_MPU to avoid wasting memory on
ARMv8-M systems.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-11-13 23:21:27 +02:00
Cristian Bulacu
4520215968 net: l2: openthread: border_router: Delete multicast route by iface
This commit makes use of #98464 and deletes a multicast route by
specified interface.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-11-13 23:21:04 +02:00
Cristian Bulacu
5b8b5df90e openthread: platform: udp: init udp fds before external net connection
When OpenThread iface is brought up `ot ifconfig up` there are several
modules that will attempt to open a platform socket and perform bind
and bind to netif operation.
Since now, `sockfd_upd` structure was initialized after the backbone
interface announced connectivity, but this implies that OpenThread
interface will always be brought up only after this event, which is not
true, or imposed.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-11-13 23:19:38 +02:00
Jordan Yates
07a791448a llext: add helper symbol for default groups
Add a symbol that controls whether the default set of LLEXT groups are
exported from the application.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-13 23:19:19 +02:00
Jordan Yates
6582969aa9 device: transition device exports to group symbols
Transition the Zephyr device exports to the new group symbol
abstraction.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-13 23:19:19 +02:00
Jordan Yates
17611885b2 llext: optional libc symbol exports
Make the export of standard library symbols optional.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-13 23:19:19 +02:00
Jordan Yates
5e5ac8e078 llext: optional syscall symbol exports
Make the export of syscall symbols optional.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-13 23:19:19 +02:00
Jordan Yates
5561d8d302 llext: symbol: group exported symbols
Group exported symbols together by subsystem/library. Groups can then
be enabled or disabled together through the existance of a Kconfig
symbol named `CONFIG_LLEXT_EXPORT_SYMBOL_GROUP_{GROUP_NAME}`.

All symbols declared with the standard `EXPORT_SYMBOL` and
`EXPORT_SYMBOL_NAMED` macros fall into the `DEFAULT` group.

Signed-off-by: Jordan Yates <jordan@embeint.com>

DEFAULT

DEFAULT
2025-11-13 23:19:19 +02:00
Seppo Takalo
c309869305 net: l2: ppp: Allow PPP to transtition ESTABLISH->DEAD
When remote peer have closed the PPP link normally, the
PPP stack on Zephyr side switches back to ESTABLISH phase
to be ready for next handshake.

When calling net_if_down() on the interface, it should not
try to initiate LCP link termination, but instead go directly
to DEAD phase.

See https://datatracker.ietf.org/doc/html/rfc1661#section-3.2

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-11-13 23:17:10 +02:00
Fabio Baltieri
00966b857e input: keymap: add a MATRIX_CODE macro
Add a MATRIX_CODE macro to extract the key code from a key value created
in DT with MATRIX_KEY. This can be handy for code other than input_keymap.c

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-11-13 23:16:52 +02:00
Luca Burelli
56c3fd8744 fs: ext2: (trivial) only enable logging config when ext2 is enabled
Avoid polluting every build that includes this Kconfig with EXT2
logging config unless the ext2 filesystem is actually enabled.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-11-13 23:14:44 +02:00
Szymon Janc
d53a1659ef Bluetooth: ISO: Move iso dereference after assertion
Make sure assertion is true before dereferencing chan->iso. In extreme
case compiler could skip assert check (asume it is always false) if address
was already dereferenced.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-11-13 23:14:34 +02:00
Albort Xue
3781f6bf9f pm: device_runtime: fix PD_CLAIMED flag logic in ISR_SAFE context
Fix the power domain claiming condition which was inverted, causing
domains to be claimed when they were already claimed instead of when
they weren't. Add null check for power domain before accessing its
properties to prevent potential null pointer dereference. Also ensure
the PD_CLAIMED flag is properly cleared when putting the power domain.

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2025-11-13 23:13:57 +02:00
Valerio Setti
032339e5fa random: add description for CONFIG_CSPRNG_ENABLED
Add a short description for CONFIG_CSPRNG_ENABLED to explain its purpose.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-13 23:12:29 +02:00
Valerio Setti
ce4319a2fe random: introduce CONFIG_CSPRNG_NEEDED
Its goal is to use it as the "connection point" between what the hardware
support and what the application needs. All the application/module/subsys
need to do is to set this new Kconfig and then check the "return" value
on CONFIG_CSPRNG_ENABLED: if the latter is set then the entropy driver was
enabled; if not something is preventing the driver from being used.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-13 23:12:29 +02:00
Valerio Setti
2cb58f2332 random: improve description of CONFIG_ENTROPY_NODE_ENABLED
Replace the current description with a new one which better clarifies the
scope of this Kconfig.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-13 23:12:29 +02:00
Valerio Setti
f95e815a1a random: rename CSPRNG_AVAILABLE to ENTROPY_NODE_ENABLED
The initial goal of CONFIG_CSPRNG_AVAILABLE was to declare that there was
an entropy node declared in the DT so that if CONFIG_ENTROPY_GENERATOR
was enabled, then the corresponding driver could be enabled.
This works in most of the cases, but not all. A counter example is the
"entropy_bt_hci" driver which is only enabled if CONFIG_BT_HCI_HOST is also
enabled. This means that in a build where the BT stack is not enabled
that driver won't be enabled even if the DT node is still present.

An example of this are the nrf5340[dk|bsim] boards.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-13 23:12:29 +02:00
Jukka Rissanen
820cd34dbb net: Replace Posix eventfd by zvfs_eventfd API
No need to use Posix eventfd API in core network code as zvfs_eventfd
is compatible with it and we can now avoid using Posix headers
unnecessarily.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-11-13 23:12:04 +02:00
Jiafei Pan
313d12f272 usb: fix build warning for printing format
Use zu% format for size_t type.
Use d% format for int type.
Use u% format for uint32_t type.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
2025-11-13 23:11:09 +02:00
Yong Cong Sin
6847421188 shell: backends: select RING_BUFFER_LARGE when necessary
Depending on the ring buffer configuration, users may encounter
the "size too big" assertion in runtime. Let's enable the
RING_BUFFER_LARGE when we know that it is required.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2025-11-13 23:10:37 +02:00
Bjarki Arge Andreasen
2f99ebe9b0 shell: backends: uart: implement pm_device_runtime
The UART device used by the backend needs to be gotten before use,
and put after. In limited cases, device drivers call
pm_device_runtime_get() as part of the call to uart_rx_enable(),
this is not the case for polling, nor interrupt driven API calls
for most if not all drivers, nor is that expected.

Implement pm_device_runtime calls in shell uart backend similar to
the logging uart backend to support all uart drivers in all
configurations.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-11-13 23:10:27 +02:00
Jukka Rissanen
2c0cf4ac3f net: midi2: Do not use poll from posix
As midi2 is provided by networking subsystem it should not
depend on any features provided by Posix. Convert Posix poll
API calls to zsock poll ones. There is no functionality changes,
only naming changes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-11-13 23:09:47 +02:00
Robert Lubos
77d461c4c0 net: tcp: Reduce the log level for active close
The log level was elevated by mistake as a leftover from debugging,
should remain DBG.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-13 15:34:20 +02:00
Ofir Shemesh
b933bf5e08 net: dhcpv4: fix incorrect RFC2131 section reference to 4.4.1
Corrected the RFC2131 section reference in DHCPv4 comments and help text.
The random delay before sending the initial DHCPDISCOVER message is
defined in Section 4.4.1 of RFC2131, not in 4.1.1 as previously stated.

Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
2025-11-13 12:01:31 +02:00
Robert Lubos
9e6256e853 net: iface: Prevent iface/TCP mutexes deadlock
In rare occasions iface and TCP mutexes could cause a deadlock. As
notifying the interface readiness takes place just before the iface
mutex is released, it should be not harm to release it just before the
TCP is notified about interface going down to avoid the deadlock.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 19:00:20 -05:00
Robert Lubos
ba6387fcd6 net: tcp: Close the connection unconditionally on forced close
The current approach was buggy, for example the TCP context could be
unrefed twice in case of forced close. Or in case of a race, when the
application closed the socket first, the TCP context wouldn't be
dereferenced at all.

Calling the tcp_conn_close() unconditionally in case of forced close
solves all those issues.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 19:00:20 -05:00
Robert Lubos
7fe33a5d5a net: tcp: Fix error reporting on listening socket on iface down
A listening TCP context has no active connection therefore it has no a
second ref from the TCP stack. Thereby, when shutting down connections
when interface goes down, net_tcp_put() should not be called on a
listening socket to release the ref on the TCP stack behalf.

Instead, report the error via the registered accept_cb callback no
notify the application about the error, which should then close the
socket and release the associated TCP context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 19:00:20 -05:00
Robert Lubos
3e537db71e net: lwm2m: Fix SenML CBOR resource instance encoding
Consecutive resource instance name should be encoded regardless of
whether timestamp is present or not.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 12:57:30 +02:00
Troels Nilsson
22fe7680f8 Bluetooth: Controller: Various fixes for CIS termination handling
Handling of CIS termination had several issues, most notably:

- it depended on allocating a termination node from the general rx
  node pool, causing asserts if the pool was exhausted
- CIS established events was not always generated when required,
  potentially causing CIS Centrals to get stuck without being able
  to create any new CISes
- Cancelling a CIS Create procedure only worked correctly if the
  CIS Create was currently active and happened to belong to the
  same CIS
- CIG state handling often (always?) assumed a CIG with only one CIS

ll_conn_iso_stream now has a dedicated termination node, same as
ll_conn and ll_sync_iso_set

LLCP statemachine for Cis Create procedure has been reworked to ensure
a notification node for CIS Established is available as early as possible.
In addition, it should now always be sent when needed

Introduced ull_central_iso_all_cises_terminated() to check if all CISes
in a CIG has been terminated (or not created yet) - which is now
used for updating the CIG state

ull_cp_cc_cancel() now takes the CIS to cancel as an argument so
it doesn't end up canceling an entirely different CIS Create procedure;
In addition it now works for queued procedures as well

Flushing a (central) CIS Create procedure in LLCP will now properly
generate a CIS Established event (with an error)

Signed-off-by: Troels Nilsson <trnn@demant.com>
2025-11-08 10:22:00 +02:00
Eric Ocasio
0d6e4040f5 pmci: mctp: Fix MCTP USB packet buffer deallocation pointer issue
Explicitly set rx_pkt pointer to NULL after free'ing it.

Fixes zephyrproject-rtos/zephyr#98688

Signed-off-by: Eric Ocasio <eric.ocasio@nxp.com>
2025-11-07 21:25:29 +02:00