It shouldn't be needed to enable native networking to be able to
add/delete IP addresses on network interfaces.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
IPv4 Kconfig options which only affect native IPv4 stack should be
dependent on NET_NATIVE_IPV4, similarly as it's done for IPv6.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fixes wrongly returning an SMP version 2 error code as an SMP
version 1 error code instead of adding it as an error
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Allows enabling the bootloader info functionality without MCUboot
being enabled, so that other bootloaders can add hooks with their
own responses
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
After introduction of struct http_response_ctx, the dynamic resource
data buffer is no longer needed for transferring data between the
application callback and the server. It is therefore removed to avoid
unnecessary copying of data.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Add tests covering new method of providing a response for dynamic
resources.
Tests cover the application sending response codes and headers,
overriding "default" headers, and sending various combinations of
headers and body data. Each case is tested for HTTP1 & HTTP2, both POST
and GET methods.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Allow the application to send headers and response codes from a dynamic
resource callback by filling out a response context structure.
This also allows simple requests to be completed in a single execution
of the callback, by setting the final_chunk flag.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Running IPv6 on STM32H743 using eth_stm32_hal I had to extend
the timeout between the attempts to send Router Solicitation packets
from 1 second to 2 seconds. Else it looked liked the packet never
got sent (checked using tcpdump).
Signed-off-by: Stefan Petersen <spe@ciellt.se>
Added helper functions to set and get assisted listening
stream values for codec capabilities and codec configs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The QoS preference defined by ASCS has some specified
limits and values that we should enforce.
Given the current API we cannot return an error to the
unicast server if it supplies invalid values, so we have
to resort to a LOG_ERR.
For the unicast client we treat invalid QoS preferences
similar to other invalid data in the notifications.
This also adds additional documentation in the
bt_audio_codec_qos_pref struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This fixes a bug where the shell will reject setting available
context to 0x0. This has now been moved to only affect supported
context instead.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
In the case that a broadcast sync fails for any reason, we need to
set the BIS_Sync value for all subgroups to 0xFFFFFFFF
(BT_BAP_BIS_SYNC_FAILED) as per the BAP spec.
This commit adds a new define for this and modifies
both the scan delegator and broadcast sink to support this.
The change is validated by a modification to the broadcast
assistant test that verifies that the value is set in the
case of an invalid broadcast code (which indicates a
failed BIG sync).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the string formatter according to the type of the
variables that it is printing to eliminate compilation
warnings.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This adds the bits to call into architecture code to dump
the privileged stack for user threads.
The weak implementation is simply there as a stub until
all architectures have implemented the associated function.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Demultiplexer was not ready to handle case when log message was
incomplete which was followed by other log messages. Such scenario
could occur if there was a fault that happen during logging of
a message. In that case incomplete message was followed by valid
messages (fault report) and this fault report was not handled
because processing was blocked waiting for completion of a
message which preceeded fault report.
Since it is expected that some messages may be incomplete a
garbage collection mechanism is added. When start of a message is
received timestamp is logged and list of incomplete messages
is checked for 'old' messages which persist in incomplete state
for long. When message timeouts it is closed and marked as
invalid. It unblocks processing of following messages.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
write_data function which was writing to STMESP data registers was
starting by writing words and tail was written using byte access.
However, RISCV core does not support unaligned access and on Cortex-M33
even if supported it is faster to do aligned access. Reworked
write_data to start first by writing data using byte or half word
access until data pointer is word aligned, then word access is used
and finally tail is written using byte or half word access.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
bt_aics_client_free_instance_get can be called from multiple threads
and as such the atomic_test_and_set_bit should be used instead
of a atomic_test_bit followed by a atomic_set_bit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
For code clarity, this commit adjusts the use of `return` statements
in functions with a void return type as follows:
- Transform `return foo();` into separate statements:
`foo();`
`return;`
- Remove unnecessary `return` statements when
they don't affect control flow.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
For code clarity, unified switch-case usage in `dhcpv6_enter_state` to
use `break` instead of `return`.
Typically, a `break` is used in switch-case statements unless an early
return is necessary, in which case `return` is appropriate.
In this scenario, the `break` statement is the more suitable choice.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Replace the busy boolean flag with an atomic value.
This also modifies the order of how this value is
controlled to avoid any race conditions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Currently, dfu_suspended() sets the phase SUSPENDED
directly in the structure, bypassing the dfd_phase_set() function.
This prevents the phase change callback in the bt_mesh_dfd_srv_cb
structure from receiving the SUSPENDED event.
Signed-off-by: Emilio Aguila Escalante <emilio.aguila@hotmail.com>
Ensure that the output certificates directory is created, where
generated certificates will be placed. This fixes a build error seen
when using `make` to build samples/net/wifi for the rd_rw612_bga board,
where the output directory for generated certificates did not exist at
build time.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The L2 function `ieee802154_decipher_data_frame()` relied on upper layer
LL address fields which breaks encapsulation.
Also fixes a bug introduced in another fix that went overboard (#53734).
Fixes: #78490
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Found a few variable declarations that were not yet moved to the top of
the function/block. Doing this before actually fixing #78490 so that the
fix becomes more readable.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
MICP requires support for the bondable mode for both
the MICP microphone device and MICP microphone controller.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
BAP mandates support for bondable mode for all central and
peripheral roles.
Due to Kconfig circular dependencies, some additional
Kconfig changes had to be made.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removed the experimental status from the BT_GATT_AUTHORIZATION_CUSTOM
Kconfig option used in the Bluetooth Host GATT layer. This feature
has been present in Zephyr for almost a year without any issue reports
or API modifications.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Adds HCI support for:
- LE CS Read Remote Supported Capabilities
- LE CS Read Remote FAE Table
Callbacks have been added to the conn object to allow upper layers to
make use of the cache commands, with which it will be possible to store
this information and provide it again in the case of a disconnect
and reconnect to the same device.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
When an incoming PAN ID does not match or when an error occurs while
sending association requests, then locks were not properly released.
Fixes: #78495
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Added new Kconfigs for defining permission level of GATT
characteristics that are part of the Bluetooth SMP service in the
MCUmgr subsys.
Removed the CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN as the new Kconfig
options are mutually exclusive and need to be groupa as the Kconfig
choice option.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Removed the experimental status from the BT_BONDABLE_PER_CONNECTION
Kconfig option used in the Bluetooth Host SMP layer. This feature
has been present in Zephyr for over a year without any issue reports
or API modifications.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Add the "kernel_shell.h" header which is required but missing,
causing build error.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
In case peer goes down or we disconnect from the network during the
TLS handshake, the TLS socket may block indefinitely during
connect()/accept(), waiting for data from the peer. This should be
avoided, hence use the preconfigured timeout for the TLS handshake,
same as we use for TCP-level handshake.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add the missing #ifndef CONFIG_ZTEST_SHUFFLE in ztest.c file.
This fixes multiple definitions of NUM_ITER_PER_SUITE
and NUM_ITER_PER_TEST.
Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
Parts related to the thread runtime stats are somewhat
standalone, refactor it out instead of having two #ifdef
and two places.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Split the `kernel_service.c` into multiple subcommand files,
each file would register with the main `kernel` cmd based on
the dependencies in Kconfig/CMakeLists.txt.
This greatly reduces the number of precompiler directives.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Deadloop happens when CONFIG_NET_ROUTING and VLAN are enabled.
In function net_ipv6_prepare_for_send(), pkt->iface will be
updated with net_pkt_set_iface(pkt, iface) in 2 scenarios:
1. ip_hdr->dst is onlink
2. check_route or nbr_lookup
VLAN is virtual-iface which attaches to a physical-iface. Each
time a packet being sent to a VLAN port will invoke twice of
the net_send_data(). The 1st time, pkt->iface is set to virtual
iface and the 2nd time to physical iface.
However in above 2 scenarios, at the 2nd time of calling the
net_send_data(), the pkt-iface will be changed back to virtual
iface. The system runs into a deadloop. This can be proved by
enabling CONFIG_NET_ROUTING with the VLAN sample.
The main purpose for net_ipv6_prepare_for_send() is to set the
right ll_dst address. If the ll_dst address is already set, then
no need to go through it again. If the packet has done with the
forwarding and set the ll_dst, then no need to check_route again.
And, the pkt->iface will not be changed back to virtual iface.
Fixes: #77402
Signed-off-by: Shrek Wang <shrek.wang@nxp.com>
Increased variable to the mandatory amount of commands, since the
comment of SHELL_SUBCMD_ADD states
"Number of mandatory arguments including command name"
but net suspend takes the interface number to suspend
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Replace several bools in volume controller 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>
Rename the volume flag field from the generic "flags"
to "vol_flags" as the generic "flags" will be used for
other values in a future commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
We don't own the thread that calls the final `bt_conn_unref()`. The
users might not be aware that they are re-using that poor thread's
stack.
Putting it on the system workqueue gives a predictable stack size and
thread priority for the invocation of the recycled handlers.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Why is it ok to use the sync pool?
Because command complete/status is processed in prio: that means on the
same stack as the `bt_recv()` call from the driver.
Why does it fix the issue?
Because the complete/status event goes into a pool that is guaranteed to
have one free buffer any time `bt_recv()` is not executing.
Since the driver is the one calling bt_recv(), it (hopefully) will
finish one `bt_recv()` before starting another one.
Fixes#78223
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>