Add a dependency for UTF8 for LE Audio. Since (nearly?) all
string in LE Audio are UTF8 and that the stack wants to be
able to check and validate strings coming both from remove
deviecs and from the application, it will depend on the utf8
API that is guarded by CONFIG_UTF8.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixes the Kconfig name of this so that it matches the value from
soc.yml, this has not been deprecated because this SoC is a virtual
SoC used only with the boards in zephyr meaning it should not cause
any breakage of out-of-tree boards
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes the Kconfig name of this so that it matches the value from
soc.yml, this has not been deprecated because this SoC is a virtual
SoC used only with the 2 boards in zephyr meaning it should not
cause any breakage of out-of-tree boards
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
It is not recommended to disable the tx processor thread as otherwise
deadlocks may occur, but it has been observed that some boards and
configurations may have too little RAM to accommodate the TX processor
thread stack.
As such BT_TX_PROCESSOR_THREAD gets a prompt.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
In pm_device_runtime_get, when resume fails after the domain as claimed,
the flag PM_DEVICE_FLAG_PD_CLAIMED is not cleared (but the domain is
released). This leaves this flag in a consistent state and in a further
resume this device won't resume its domain leading to bigger problems.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
coap_client_schedule_poll() never reports errors and always returns
0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Commit removes selection secure storage for tfm
crypto provider. The secure storage is under
the secure image management. Non-secure image
is not required in the secure storage subsystem.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
process_advertise() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
process_search() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The function obex_transport_disconn() was always returning -EINVAL
regardless of the actual error code returned by the transport
disconnect operation.
Fix this by returning the actual error code from the transport
disconnect call instead of the hardcoded -EINVAL value.
Signed-off-by: Can Wang <can.wang@nxp.com>
According to OBEX Version 1.5, section 2.2.9, it is legal to send a
zero-length End-of-Body header when object body data is generated on
the fly and the end cannot be anticipated.
Update parameter validation in bt_obex_add_header_body_or_end_body()
and bt_obex_add_header_end_body() to allow NULL body pointer when
length is zero, while still rejecting NULL body with non-zero length.
This enables proper support for zero-length End-of-Body headers as
specified in the OBEX specification.
Signed-off-by: Can Wang <can.wang@nxp.com>
Add a new helper function bt_obex_has_app_param() to check whether
a specific application parameter tag exists in the OBEX buffer.
The function uses the existing bt_obex_get_header_app_param() to
retrieve the application parameters, then parses them using
bt_obex_tlv_parse() with a callback to search for the specified tag ID.
This simplifies checking for the presence of application parameters
without needing to manually parse the TLV structure.
Signed-off-by: Can Wang <can.wang@nxp.com>
Introduce bt_le_per_adv_sync_cb_unregister to allow
unregistering of the periodic sync callbacks.
Signed-off-by: Antoni Duda <antoni.duda@programmer.net>
mctp_i3c_controller_start() contains a conditional check on a return
code that is never updated, making the error handling path
unreachable.
Remove the dead code to avoid misleading logic and make the current
controller startup behavior explicit.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
set_sensor_state() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
init_sensor() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
When MOPL exceeds MTU, adjust it to match MTU instead of sending the
error code. This handles the common case where mainstream mobile
operating systems (iPhone and Android) negotiate
MOPL values greater than the RFCOMM or L2CAP MTU.
Signed-off-by: Can Wang <can.wang@nxp.com>
Instead of processing loopback packets from the TX thread directly,
queue them for further processing by RX thread (if possible), just as
regular packets. It's now possible as the information regarding the
packet is a loopback one or not is stored directly in the net_pkt
structure.
This allows to avoid unexpected stack consumption increases if packets
are sent for loopback destinations.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
OTP drivers are the interface to One Time Programmable memory, which
is NVMEM. Add the interface with the OTP API to the NVMEM one.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Move and rename the region Kconfig symbols from LORAMAC_REGION_* to
LORAWAN_REGION_* to make them backend-agnostic.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Move the LoRaWAN emulator from the loramac-node backend directory to its
own directory because the emulator currently still depends on loramac-node
for some types and functions.
Once these dependencies are removed in a follow-up, the emulator can become
a fully standalone backend.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Remove loramac-node specific references (LORAMAC_NVM_NOTIFY_FLAG_*)
from the NVM interface documentation, making it suitable for any
LoRaWAN backend implementation.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Refactor the LoRaWAN subsystem to support multiple backends by moving
the loramac-node specific implementation into a dedicated subdirectory.
This change prepares the subsystem for adding lora-basics-modem support
as an alternative backend.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
vq_teardown() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
This patch adds a new Kconfig option that allows read-only data sections
without relocations to be mapped directly (remain in flash) instead of
being copied to RAM during extension loading. This helps extensions that
have large constant data, such as certificates, lookup tables etc.. to
save saving significant RAM, especially with MPU is enabled.
This feature requires the extension to place rodata sections without
relocations in LLEXT_RODATA_NO_RELOC section.
Note that we chose to disable this optimization when MMU or USERSPACE is
enabled because the NO_RELOC section may not be aligned to the MPU/MMU
requirements on some architectures. If we leave it in place, llext will
attempt to create an MPU region for it using a misaligned address, and
if we allow it to be copied to RAM, it defeats the purpose of this feature.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
Fix inconsistencies in the QBV (IEEE 802.1Qbv Time-Aware Shaper) shell
command documentation and help messages:
1. Add missing "net qbv" command documentation to net_shell.rst
2. Correct command examples in help text - add missing "net" prefix
to "qbv set_gc" commands
3. Fix command usage descriptions for set_config and set_gc to match
actual command names
This ensures users see correct command syntax in both documentation
and interactive help.
Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Avoid calling vcp_vol_ctlr_discover_complete() with a NULL
controller pointer when lookup fails during AICS discovery.
The vcp_vol_ctlr_discover_complete() helper dereferences the
controller unconditionally, which could otherwise lead to a NULL
pointer dereference.
Fix by returning early if the controller lookup fails.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Avoid calling micp_mic_ctlr_discover_complete() with a NULL
controller pointer when lookup fails during AICS discovery.
The micp_mic_ctlr_discover_complete() helper dereferences the
controller unconditionally, which could otherwise lead to a NULL
pointer dereference.
Fix by returning early if the controller lookup fails.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
If peer lowered its receive window and advertised zero-window length,
TCP stack would pause the retransmission timer until non-empty window is
advertised again. This however could trigger an assertion, that verified
that the retransmission timer is running whenever there is data to
transmit. Add an exception to the assertion for the zero-window case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As described in RFC5227 ch. 2.1.1 ARP Probes are broadcasted.
ARP requests not being broadcasted should not be detected as
ARP Probes.
Signed-off-by: Andreas Huber <andreas.huber@sautergroup.com>
Make sure that if the connection is closed but we still received
a SYN packet, we do not try to access already closed connection.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The domain name was always set to NULL. This adds a Kconfig
that will enable setting the domain name and sets the domain
name if the config is enabled.
Signed-off-by: Tim Knodel <tbk@google.com>
A new error code FS_MGMT_ERR_FILE_CLOSE_FAILED is returned when
closing a file fails. This is done on write or close operations - read
operations remain unchecked.
Signed-off-by: Samuel Kleiser <s.kleiser@vega.com>
Avoid accessing request fields before validating input arguments in
coap_client_req().
The request path length is now checked only after validating the
request pointer, preventing a potential NULL pointer dereference.
No functional change intended.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Add a new API to look up a memory region's index using its DeviceTree
node name. This allows callers to identify specific regions within the
internal regions array.
Includes unit tests for successful lookups and error handling for
non-existent names.
Signed-off-by: Firas Sammoura <fsammoura@google.com>
Ensure pointers are validated before dereferencing them in
set_arbitrate_interval() and set_interval().
This avoids accessing sensor or connection fields prior to
validation and makes the code safe even when assertions are
disabled.
No functional change intended.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Use PSA Crypto API for SHA-1 computation instead of legacy Mbed TLS crypto.
The latter is going to be removed soon.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Remove optional use of legacy Mbed TLS crypto in favor of the already
existing PSA Crypto API alternative. This is required in order to jump
to the next version of Mbed TLS (i.e. 4.0) where all this legacy crypto
support is no more available.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
If we have more than one IP on an interface we should choose the IP
corresponding to the same network as the target IP.
Signed-off-by: Andreas Huber <andreas.huber@sautergroup.com>
llext aligns and rounds up memory regions to satisfy MPU requirements,
which can waste significant memory by relocating read-only regions,
with power-of-two alignment on some architectures. However, these
MPU-aligned regions are never actually used by the MPU unless
userspace (CONFIG_USERSPACE) is enabled.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
Follow coding guidelines rule 78:
A full expression containing an increment (++) or decrement (–) operator
should have no other potential side effects other than that caused by the
increment or decrement operator
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
If the underlying listening TCP context reported an error, it's no
longer usable, therefore accept() call for such a socket should report
an error as well, otherwise it may block indefinitely.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case network interface goes down, all underlying TCP contexts are
being dereferenced, however they are not released until application
dereferences them as well (i.e. closed the socket). If the application
does not do so however timely, and network interface goes down again,
the TCP context would still be present on the active contexts list and
could've been dereferenced for the second time.
Fix this by checking the context state before dereferencing it on the
stack behalf. Non-listening TCP context are being set to CLOSED state
upon dereferencing. For the listening contexts, the TCP context has
only one ref from the application side, so use the `accept_cb` pointer
value as an indicator that the accept callback, indicating an error,
has already been called for the context.
Additionally, add a mutex lock when releasing listening context on
network down even, to avoid potential races with yet unprocessed
incoming packets.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
75ef6392 removed the only call to coap_client_init_request() where
reconstruct==true. All remaining calls have reconstruct==false.
This commit removes the parameter.
Signed-off-by: Sam Friedman <sam@golioth.io>
Replace some manually-defined DT_COMPAT_<> Kconfig macro variables with
their automatically generated counterparts. In most cases, this is
straightforward as the manually defined macro is named identically to the
one generated by the build system.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>