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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add support for use of FAKE_ENTROPY_NATIVE_POSIX as entropy
driver for the Controller on BOARD_NRF54L15BSIM.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This patch extends LLEXT shell commands with support for loading
LLEXT from a filesystem. Use of the command requires absolute path
to the llext file.
Example use:
`llext load_llext hello_world /lfs/hello_world.llext`
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Introducing `llext_prepare()` and `llext_finalize()` APIs
that are invoked and the beginning and the end of the `llext_load()`
function.
The purpose of these functions is to bring possibility of initializing
loader before it is used and uninitialize or clean up when
it is no longer needed. Both functions are optional.
The buffer loader has been aligned to methods introduced in the patch.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
By default, normal memory is set readable+writable and not executable.
Adjust those permissions according to each region:
LLEXT_MEM_TEXT --> K_MEM_PERM_EXEC
LLEXT_MEM_DATA, LLEXT_MEM_BSS --> K_MEM_PERM_RW
LLEXT_MEM_RODATA --> K_MEM_PERM_RO aka 0
This must be done only at the end of an LLEXT load operation as memory
needs to remain RW for reloc processing, etc.
And while at it, flush/invalidate the cache accordingly.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Changed NET_CONFIG_CLOCK_SNTP_INIT depends on to require
POSIX_TIMERS instead of the deprecated POSIX_CLOCK
Signed-off-by: Luca Arato <luca.arato@secomind.com>
Without this it is not possible to serve both IPv6 and IPv4
connections if service host is NULL.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow NULL host parameter when creating HTTP service. This means
that the socket is created without specifying binding address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add to_str functions for context, parental rating, active state,
codec cap freq, codec cap frame duration,
codec cap channel count and location.
The remaining values are just numeric values and does not
need a to_str function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function took the uri as a `char *` but is in fact
not a null terminated string so change the type to uint8_t *.
Add a check fro uri_len == 0 before doing uri_len - 1
Changed the found check to just check the first octet rather
than the more costly strlen.
Fixed the type of the iterator
Add a break in the loop as we only need to find one ":"
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
do a cold reboot by default if no option is provided
for `kernel reboot`, instead of requiring to
type `kernel reboot cold`.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Fix scan_update() implementation for missing flags clear
that prevented starting scanning after previous attempt to
start failed due to parameters being rejected by the
Controller.
Example, attempting to start coded PHY scanning with a
Controller implementation that does not support it can fail,
but attempting again without coded PHY scanning should
succeed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The TBS client callbacks are just informative so we
provide the information to multiple listeners.
To support this for the long strings, the function
handle_string_long_read was refactored.
This also allows for multiple users of the TBS client.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When the encrypt state was changed via
bt_bap_scan_delegator_mod_src then we didn't set the bad
broadcast code correctly.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function had marked the type as char *, but it was in fact
not a string but rather a uint8_t array.
Marked the type properly and added a cast when using it with
bt_tbs_remote_incoming.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The CAP commander used bt_audio_valid_ltv which required
BT_BAP_STREAM to be enabled, but the CAP Commander does not
need BT_BAP_STREAM to be enabled.
Moved the function to audio.c which is always compiled for
the CAP Commander, thus removing the requirement for
BT_BAP_STREAM and the accompanying bt_bap_stream.c file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The UTF8 implementions for both client and server
both use the utf8 API which require CONFIG_UTF8.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function had marked the type as char *, but it was in fact
not a string but rather a uint8_t array.
Marked the type properly and added a cast when using it with
strings.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the CAP stream callbacks so that the application
callbacks are called before the CAP initiator.
This allows the application to abort/cancel a procedure
before we send out any future request.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Ensure that leading zeros are present in the milliseconds field,
otherwise a milliseconds count of 35 will appear as x.35, i.e. 350
milliseconds. With this fix, it will appear as x.035.
Signed-off-by: Jordan Yates <jordan@embeint.com>
This patch adds bindesc support for the build version values for the
kernel and application - BUILD_VERSION and APP_BUILD_VERSION.
The kernel's BUILD_VERSION can be overridden at build time.
Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
Remove `const` qualifiers on fields in structures that are only created
or instantiated as `const`.
This if primarily for consistency, in the same way that `struct device`
fields and `device->config` struct fields are not additionally marked as
`const`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
There is asignment from size_t variable to uint8_t variable in
nvs_al_size function that can trigger static analysis error.
The problem is fixed by changing the variable to size_t type
instead of uint8_t.
Signed-off-by: Andrej Trnkóci <andrej.trnkoci@nxp.com>
A bug was introduced when fb17d0e365 introduced host presence detection.
Panic_mode flag was added which indicates that RTT should work in
synchronous, blocking mode but it was not set when backend was switched
to panic mode.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Replace several bools in bt_aics_client with an atomic value.
Update how these values are modified so that we can better
prevent race conditions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds missing checks for get_capabilities method not being NULL.
Fixes crash with netusb and possibly other drivers.
Signed-off-by: Maciej Panek <panekmaciej@outlook.com>