Commit graph

21541 commits

Author SHA1 Message Date
Kyra Lengfeld
0f4fde3769 Bluetooth: Mesh: add API to set chunk send interval
This commit adds a KConfig option and an API to set the interval in
which chunks get send, in milliseconds.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2024-09-12 14:50:25 +02:00
Adam Wojasinski
74b562569e llext: Add RELA sections processing for AARCH64
Allow to process `RELA` sections on aarch64 platform.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-09-12 14:48:55 +02:00
Adam Wojasinski
eb51529ab3 llext: Introduce AARCH64 relocation support
Adds support for all relocation type produced by GCC
on AARCH64 platform using partial linking (-r flag) or
shared link (-fpic and -shared flag).

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-09-12 14:48:55 +02:00
Adam Wojasinski
2ff71727f1 llext: Fix use of macro for relocation symbol index from r_info
Replace use of 32-bit architecture macro to macro arch agnostic that
is resolved in compilation.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-09-12 14:48:55 +02:00
Emil Gydesen
771a3d7509 Bluetooth: CSIP: Set Coordinator: Replace bools with atomic
Replace boolean flags with atomic.
This also properly add guards for the multi-device procedures
and reduce the number of places where the busy flag is set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-12 14:48:47 +02:00
Emil Gydesen
3029916786 Bluetooth: MICP: Replace busy bool with atomic
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the MICP client implementation.

This also adds a missing check for the discovery procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-12 14:48:40 +02:00
Emil Gydesen
42602e6465 Bluetooth: TBS: Replace busy bool with atomic
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the implementation.

The discovery procedure is also now properly guarded with it
so that in case that any procedure is currently in progress
for the specific connection, then a new discovery procedure
cannot happen until all other procedures are finished.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-12 14:48:23 +02:00
Fin Maaß
b32a44aa7e net: config: sntp: add periodic resync option
this adds the option to have the clock periodically resynced with
the time from the sntp server, instead of just syncing at startup.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-09-12 14:48:07 +02:00
Magdalena Pastula
5de1c092b7 ipc: align icbmsg to no-multithreading
Modify ICBMSG so that it could be used in no-multithreading
appliactions.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-09-12 10:03:05 +02:00
Vinayak Kariappa Chettimada
9eb35c4e24 Bluetooth: Controller: Rework FAKE_ENTROPY_NATIVE_POSIX text
Rework comment text for FAKE_ENTROPY_NATIVE_POSIX used as
entropy driver for the Controller on BOARD_NRF54L15BSIM.

Relates to commit 34b6b3d9eb ("Bluetooth: Controller:
Support FAKE_ENTROPY_NATIVE_POSIX").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-09-12 10:02:48 +02:00
Valerio Setti
7fadfeec7c mbedtls: do not set PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC
Mbed TLS automatically sets PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC
whenever "_IMPORT || _EXPORT || _GENERATE || _DERIVE" operations
are set. Therefore we just set the proper actions where required.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-09-12 10:02:40 +02:00
Nicolas Pitre
4fd3bf2060 demand_paging: add a semihosting based backing store for on-demand sections
This is especially handy for tests and validation using QEMU.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-11 20:18:51 -04:00
Nicolas Pitre
3e0feab245 arm64: demand_paging: add the k_mem_paging_eviction_accessed() call
Needed for the LRU eviction algorithm to be effective.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-09-11 20:18:51 -04:00
Emil Gydesen
5e34127e4b Bluetooth: MCC: Replace busy bool with atomic
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the MCC implementation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-11 14:00:16 -04:00
Emil Gydesen
c012ece33e Bluetooth: GMAP: Replace busy bool with atomic
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the GMAP client implementation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-11 14:00:09 -04:00
Luca Burelli
e6b32ab681 llext: hotfix: fix function pointer logging
Some function pointers were being passed via `%p` to LOG_DBG, and this
was causing the following issues in SOF CI with the `sparse` checker:

   subsys/llext/llext.c: error: arithmetics on pointers to functions
   subsys/llext/llext.c: error: incompatible types for operation (+)

This patch fixes the issue by casting the function pointers to void*.
Also fix a misleading error message in `llext_get_fn_table()`.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-09-11 13:59:02 -04:00
Fredrik Danebjer
c9da274eb2 Bluetooth: ascs: Add dynamic ASE registration
Added option to set the ASE count through the bap API, making ASE
configuration runtime available. The upper limit of ASEs are still
bound by the Kconfig options set for ASEs.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2024-09-11 07:41:12 -04:00
Pisit Sawangvonganan
ead0dfc889 style: subsys: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-11 07:40:35 -04:00
Jukka Rissanen
1f627e3a1b net: mdns_responder: Set socket of service for statistics purposes
If the dispatcher is muxing the connection i.e., so there are two
services for the same port, then mark service socket descriptor
of the service with the socket number so that "net sockets" shell
command can show a proper value for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-11 07:40:07 -04:00
Jukka Rissanen
caf9fd345f net: dns: Add per socket user data for the dispatcher
The socket services API has a limitation where the user data is shared
between file descriptors described in the same service.

This can cause problem in DNS dispatcher where each listened socket
needs to have their own dispatcher struct set as user data so that we
can map between dispatcher context and socket. Solve this by always
have a dispatcher table as user data, and then have the actual mapping
done via the dispatcher table when receiving data to the dispatcher socket.

Fixes #78146

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-11 07:40:07 -04:00
Jukka Rissanen
dcb71a754f net: http_server: Enable v4-to-v6 mapping by default
Fixing the regression caused by 3949873886 ("Allow service to be
created with NULL host"). If the host parameter is null when creating
the HTTP service, the IPv6 socket is created by default. This can cause
issues if both IPv4 and IPv6 are enabled, like in HTTP server sample,
and the HTTP client connection is done by IPv4.
To fix this, we need to enable IPv4-to-IPv6 mapping in order to allow
IPv6 socket to serve a IPv4 connection. Allow also user to override this
if needed.

Fixes #78112

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-10 21:51:54 -04:00
Jukka Rissanen
61c135e531 net: if: Fix rejoining IPv6 multicast group
The code was checking IPv4 address instead of IPv6.
Print also IPv6 address when rejoining the group.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-10 21:51:39 -04:00
Tomasz Moń
de8710bf46 usb: device_next: uac2: Handle speed properties
Generate full and high speed descriptors based on UAC2 instance
properties. Fail the build if an instance does not have speed properties
or if the instance with given speed property exceeds the bandwidth
available at the selected speed.

Remove obsolete no longer used macros to determine offsets inside
complete UAC2 descriptors blob. Only speed-specific descriptors arrays
are supported.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-09-10 14:41:32 +01:00
Yong Cong Sin
ff2cbf9445 debug: symtab: add shell command
Implement shell commands to access the symbol table.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-10 11:43:55 +02:00
Robert Lubos
e6f942f238 net: lwm2m: Fix enabler version reporting during bootstrap discovery
LwM2M 1.1 specification mentions that the enabler version format was
specified wrongly in LwM2M 1.0 specification, and servers only "may"
accept the old format, which no longer seems to be the case for Leshan.

The URI reference ("</>;") before the enabler version is now mandatory,
if it's missing the bootstrap discovery fails with Leshan. Another
problem are quotes around the enabler version, which seems to be
conditionally accepted only for LwM2M version 1.0. Therefore, keep the
quotes only for that version, to prevent any potential issues with other
servers.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-09-10 11:43:18 +02:00
Jonathan Rico
01354c0045 Bluetooth: conn: move auto-init procedures to system workqueue
`conn_auto_initiate()` starts a bunch of controller procedures (read: HCI
commands) that are fired off right after connection establishment.

Right now, it's called from the RX context, which is the same context where
resources (cmd & acl buffers) are freed. This not ideal.

But the procedures are all async, so it should be fine to schedule this
function on the system workqueue, where we have less risk of deadlocks.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-09-09 18:41:45 -04:00
Riadh Ghaddab
12a437c4c9 pm: policy: change the policy event handling
Some events needs to be handled with a very low latency constraint.
If the system is in deep sleep, exit latency from this low level state
exceeds sometimes the maximum latency constraint of these events.

Before suspending the system, select which events is happening sooner,
kernel events or normal events.
CPU will be up just before the next event occurs taking into account the
exit latency of the current power state

Change also the policy event API to take as argument absolute time in HW
cycles instead of time in us

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2024-09-09 13:56:04 -04:00
Pisit Sawangvonganan
d207edb1cf shell: rename shell_xxx_impl wrapper functions to shell_fprintf_xxx
Since the `_impl` naming convention is intended for internal use only,
renaming these functions to the `shell_fprintf_xxx` variant is
more suitable for calls outside the module:
- `shell_info_impl` to `shell_fprintf_info`
- `shell_print_impl` to `shell_fprintf_normal`
- `shell_warn_impl` to `shell_fprintf_warn`
- `shell_error_impl` to `shell_fprintf_error`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-09 13:55:31 -04:00
Emil Gydesen
79fa6b3f54 Bluetooth: ISO: Update includes for ISO files
Updates the includes for ISO file so that it conforms to
IWYU (include what you use).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-09 13:55:20 -04:00
Lyle Zhu
8113ff7e9c bluetooth: AVDTP: Check buffer len before pulling data
Check the remaining buffer length is not less than
required data length before pulling data from the
buffer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-09-09 13:54:56 -04:00
Martin Koehler
22a615b3e6 usb: cdc_acm: Fix tx false data drop logging
cdc_acm_fifo_fill() logged warnings about dropped data
when they in fact just couldn't be sent (due to connection
of filled buffer). Not being able to send (all) data is
a valid behaviour and data isn't dropped. Return value
shows how many data was accepted (which can be zero).

Logging will now instead only inform data can't be sent
due to the respective issue (connection not ready/ buffer full).

Signed-off-by: Martin Koehler <koehler@metratec.com>
2024-09-09 15:24:37 +03:00
Johan Hedberg
131a11e61e Bluetooth: Host: Add decoding for Bluetooth HCI version 6.0
Add decoding for version 6.0, now that the new core specification has been
released.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-09-09 15:23:25 +03:00
Johan Hedberg
ceedf72c51 Bluetooth: shell: Use common HCI version decode function
There's a generally available bt_hci_get_ver_str() function, so use that
instead of defining our own.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-09-09 15:23:25 +03:00
Jukka Rissanen
da97542a6e net: dhcpv6: Do not wait forever when allocating net_pkt
As the allocation is run in system workqueue context, it can
cause problems if waiting forever when allocating net_pkt.

Fixes #77935

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-09 09:28:21 +02:00
Jukka Rissanen
254e757539 net: dhcpv4: Do not wait forever when allocating net_pkt
As the allocation is run in system workqueue context, it can
cause problems if waiting forever when allocating net_pkt.

Fixes #77935

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-09 09:28:21 +02:00
Henrik Brix Andersen
159f7dbbb1 lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.

Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-09-07 11:19:05 -05:00
Henrik Brix Andersen
ced80b13bf lib: net_buf: move the network buffer implementation to lib
Move the net_buf implementation from the networking subsystem to a library
as they have no dependency on the networking subsystem.

Network buffers are used in subsystems outside of networking
(e.g. Bluetooth, USB).

Fixes: #36374

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-09-07 11:19:05 -05:00
Jukka Rissanen
36137bc8cc net: vlan: Fix RX debug print
The interface index and tag prints were swapped.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-06 18:01:15 -04:00
Jukka Rissanen
25301ace0e net: virtual: Pass status to caller when starting/stopping interface
When virtual interface is being started or stopped so when the
interface is brought up or down, check the return code and pass
it to net_if_up() or net_if_down() calls.
This helps to avoid printing success status even if the interface
up/down failed at the virtual interface level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-06 18:01:15 -04:00
Jukka Rissanen
6986b1ef71 net: bridge: Overhaul the code to use virtual interfaces
The legacy bridging code prevented normal IP traffic to the
bridged Ethernet interfaces. This is not intuitive and differs
how bridging setup works in Linux. This commit changes that and
creates a separate virtual interface that is doing the actual
bridging. This enables the bridged Ethernet interfaces to work
normally and provide IP connectivity.

How this works in practice:

* User needs to enable CONFIG_NET_ETHERNET_BRIDGE
* User needs to have a device with more than one Ethernet
  interface
* After booting, the net-shell or program API can be used
  to add interfaces to the bridge like this.
     net bridge addif 1 3 2
  where the 1 is the bridge interface index and
  2 and 3 are the Ethernet interface indices.
* The bridging is then finally enabled / started when the
  bridge interface 1 is taken up
     net iface up 1
* If bridged interfaces are removed from the bridge (minimum
  of two interfaces are needed there), then the bridging is
  disabled automatically. The bridge interface stays up in
  this case and can be taken down manually.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-06 18:01:15 -04:00
Krzysztof Chruściński
adcb13d293 logging: log_frontend_stmesp: Add support for standalone mode
Add support for standalone mode where data written to STMESP is
decoded on chip to a human-readable strings.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
5b26b21bad logging: Add demultiplexer for log_frontend_stmesp
Add module which demultiplexes stream of log message which are
encoded into STPv2 stream by log_frontend_stmesp. There are 3 types of
messages that can be present in the stream:
- Log message (starts with DMTS32, followed by Dx and closed by FLAG)
- Tracepoint (FLAGTS or DMTS32)
- STM HW event (DMTS8 on 0x80 master and 0x00 channel)

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
89ef8a097b logging: Add Coresight STMESP dictionary-based frontend
Add frontend which is using Coresight STMESP for dictionary based
logging.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
0fdf13c85c logging: Move frontends to the dedicated directory
As there are more frontends coming in the future move existing
frontend to the dedicated directory (like backends).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
fc162f74c0 debug: mipi_stp_decoder: Align naming to 2.4 standard
Align naming to STP v2.4. Changing Master to Major.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Krzysztof Chruściński
dd38a2ccde logging: Fix string stripping Kconfig option dependency
Change to depend on LOG_DICTIONARY_DB which is broader than
LOG_DICTIONARY_SUPPORT which is set only when log_output
supports dictionary mode. However, it is possible that
log_output is not used when dictionary mode is used. Database
generation is always enabled when dictionary mode is used.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Adam Kondraciuk
be523ad396 arch: arm: cortex_m: pm_s2ram: Minor typo fix
Fix typo in `PM_S2RAM_CUSTOM_MARKING` description.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-09-06 11:29:06 -04:00
Matt Rodgers
0c8bdbc45d net: lib: http_server: allow application to access request headers
Allow application to register certain HTTP request headers to be stored
by the server. These stored headers can then be accessed from a dynamic
resource callback.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-09-06 11:27:37 -04:00
Luca Burelli
af302cd5fe llext: add bringup, teardown, and bootstrap APIs
llext_bringup() and llext_teardown() are intended to be used to call the
extension's own initialization and cleanup functions, respectively. They
are meant to be called by the developer after loading an extension and
before unloading it. The list of function pointers to be called is
obtained via the new llext_get_fn_table() syscall, so that they are
compatible with user mode.

llext_bootstrap() is intended to be used as the entry point for a thread
created to run an extension, in either user or kernel contexts. It will
call the extension's own initialization functions and then an additional
entry point in the same context (if desired). The same function can also
be called directly in the main thread, if only initialization is
required.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-09-06 11:27:15 -04:00
Luca Burelli
04d7e4f490 llext: add support for ELF init/fini arrays
Load the .preinit_array, .init_array and .fini_array sections in ELF
files. These sections are arrays of function pointers that are filled by
the compiler with the addresses of functions that need to be called at
startup or termination by the loader, such as C++ constructors and
destructors.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-09-06 11:27:15 -04:00