To simplify LLEXT loader parameter extension pass the whole
struct llext_load_param to final consumers instead of extracting
individual fields from it in the caller function.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
It's more common in the LLEXT code base to call elf_sym_t instances
"sym" and not "sym_tbl." Convert llext_link_plt() to follow this
convention.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Make llext_loaded_sect_ptr() a proper function to be able to call it
from platform LLEXT code.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The http_client_req() function's timeout parameter is allowed
to be SYS_FOREVER_MS. However, K_MSEC() does not convert this
to a proper k_timeout_t, so sys_timepoint_calc() ends up
returning 0, which is causes immediate timeouts.
Check for this case specifically and force value passed to
sys_timepoint_calc() to be correct.
Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
Currently we can assume that flpr and ppr cores are always owned by
cpuapp. In that case, cpuapp (which processes ETR buffer content) has
access to the memory where logging strings from ppr and flpr are
located. Those strings do not need to be appended to the message
which is written to the STM (in case of standalone configuration).
This approach reduced logging time, e.g. logging a message with
one argument takes 1.8us on cpuapp and 6.3us on cpurad.
This setting applies only to the case when cpuapp is the owner
of those co-oprocessors and shall be updated if that becomes
configurable but currently there are no means to detect core
owner.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Because timing of the pause/resume for peripheral/sync is based on
central/broadcaster active clock, the sleep-clock jitter shall not be
added.
Signed-off-by: Morten Priess <mtpr@oticon.com>
- Add next pointer to node_rx_iso_meta for pre-transmission linked
list (does not increase memory usage as union is larger).
- Fix broadcaster not setting PTC with test configuration
- Refactor stopping of sync ISO tickers to separate function
Signed-off-by: Morten Priess <mtpr@oticon.com>
Share pause/resume functionality by moving resume ticker handling to
ull_iso. Rename interface function to ull_conn_iso_resume_ticker_start,
and provide handles instead of instance pointer.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Adds a new command that will return information on slots
themselves, listing the slot sizes, without any internal
information about the slot data. Will also return the maximum size
of an image for a set of slots if built using sysbuild.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Remove unused nRF21 FEM SPI CSN control as the Zephyr
Controller does not implementation SPI control for Tx/Rx
nor for Tx gain settings.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added support for dynamic registration and unregistration of the
Broadcast Audio Scan Service (BASS) within the scan delegator.
This enables both scan delegator and BASS to be registered or
unregistered dynamically at runtime.
Signed-off-by: Babak Arisian <bbaa@demant.com>
Fixes an issue with structure which was previously raised in a
comment, and adds a new bool to the structure to enable this
restructure to work
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit makes sure we continue to wait for extra confirmations even
after the request is done so we can handle duplicate confirmations if any.
Detailed description:
rfc7252#section-4.5 specifies that:
"The recipient SHOULD acknowledge each duplicate copy of a
Confirmable message".
So if, for example, the client sends to a multicast destination address,
the server will get multiple requests and will confirm all of them.
Without this commit, the client will set the request to done after
receiving the first answer.
From here the request object will be marked as free and the duplicate
acknowledgements will stay buffered in the network stack.
Once the client tries to send a new request, it will unbuffer those
duplicate acknowledgements but now the request object is unallocated
so the client won't be able to handle those acknowledgements as duplicates.
It will instead treat it as an unexpected ACK.
To work around this issue, rfc7252#section-4.8.2 states that:
"EXCHANGE_LIFETIME is the time from starting to send a Confirmable
message to the time when an acknowledgement is no longer expected,
i.e., message-layer information about the message exchange can be
purged."
Keeping the request object allocated for EXCHANGE_LIFETIME ensures that
duplicate acknowledgements can be handled accordingly.
This commit adds a basic implementation of what is stated in the RFC.
EXCHANGE_LIFETIME has been arbitrarily set to 3 * ACK_TIMEOUT which
seems more reasonable than the 247 seconds stated in the RFC.
Signed-off-by: Francois Gervais <francoisgervais@gmail.com>
This commit makes the device tree configuration decide
which link layer is compiled in. We do this to avoid
hard-to-understand linker errors referencing device tree nodes.
The following configuration creates a difficult to parse
linker error:
* BT_LL_CHOICE contains multiple entries, BT_LL_SW_SPLIT
is selected.
* Each BT_LL_CHOICE has its own unique device tree node with its
own "compatible".
* Only one of the link layer device tree nodes has status "okay",
but not the one corresponding to BT_LL_SW_SPLIT.
The linker error indicates that code using the HCI driver fails
to link with the controller. This because the HCI driver device
tree node references the link layer selected in devicetree which
is not compiled in.
By adding a dependendency to the device tree node, this can no longer
happen. Instead, if BT_LL_SW_SPLIT is now selected in a configuration
file, a Kconfig warning will be issued:
```
warning: The choice symbol BT_LL_SW_SPLIT
(defined at subsys/bluetooth/controller/Kconfig:129) was
selected (set =y), but BT_LL_SOFTDEVICE (defined at
/home/ruge/ncs/nrf/subsys/bluetooth/controller/Kconfig:11)
ended up as the choice selection.
```
This should be easier to understand than:
```
...(hci_core.c.obj):(.data.bt_dev+0x16c):
undefined reference to `__device_dts_ord_132'
```
After this commit we should consider getting rid of link layer
selection from Kconfig completely as the link layer is in practice
selected through device tree.
Unit tests have been updated to satisfy the dts dependency.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Resetting the connect semaphore from tcp_conn_unref() prevents the
ref/unref mechanism from being used freely when needed. Therefore, move
the code responsible for resetting pending connection to
tcp_conn_close() (called only when the connection is being closed on
behalf of the TCP stack, for instance due to RST being received) and to
net_tcp_put() (connection closed on behalf of the application).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
It is possible that TCP connect() will fail if for example network
interface does not have IP address set. In this case we close
the connection during net_tcp_connect() but do not set the return
code properly. This looks in the application like the connection
succeeded even if it was not.
As the tcp_in() call in net_tcp_connect() might close the connection,
we just take extra ref count while calling tcp_in(). Otherwise we
might access already freed connection.
Before the fix:
net_tcp_connect: context: 0x80757c0, local: 0.0.0.0, remote: 192.0.2.2
net_tcp_connect: conn: 0x8087320 src: 0.0.0.0, dst: 192.0.2.2
tcp_in: [LISTEN Seq=1604170158 Ack=0]
tcp_conn_close_debug: conn: 0x8087320 closed by TCP stack (tcp_in():3626)
tcp_conn_close_debug: LISTEN->CLOSED
tcp_conn_unref: conn: 0x8087320, ref_count=1
net_tcp_connect: conn: 0x8087320, ret=0
After the fix:
net_tcp_connect: context: 0x80757c0, local: 0.0.0.0, remote: 192.0.2.2
net_tcp_connect: conn: 0x8087320 src: 0.0.0.0, dst: 192.0.2.2
tcp_conn_ref: conn: 0x8087320, ref_count: 2
tcp_in: [LISTEN Seq=1604170158 Ack=0]
tcp_conn_close_debug: conn: 0x8087320 closed by TCP stack (tcp_in():3626)
tcp_conn_close_debug: LISTEN->CLOSED
tcp_conn_unref: conn: 0x8087320, ref_count=2
net_tcp: tcp_conn_unref: conn: 0x8087320, ref_count=1
net_tcp: net_tcp_connect: conn: 0x8087320, ret=-128
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support in this IPC backends for POSIX arch targets in general,
and ensure the nrf5340bsim defines the buffer which will be used.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Provide a new function for initializing the Rx side,
so users do not need to initialize the pointers by hand
if they did not use PBUF_DEFINE().
Let's also rename pbuf_init() to pbuf_tx_init() to clearly
signify the previous function was only meant to be used
by the Tx side.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
ssize_t is not part of the C library ISO standard subset, and as such
one cannot expect a C library to expose the type by default.
Some libraries like glibc do not expose this type in general, and
trying to build using them results in build errors.
There is 3 possible options:
1. Continue using ssize_t and:
1.a define _POSIX_C_SOURCE before including any header
1.b include sys/types.h directly (A bit uglier)
3. Not use ssize_t, and instead rely on ISO standard types
Let's just go with 1.a assuming we want to keep using this type,
as that is the correct way of getting this type defined.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The IPv6 branch of net_tcp_endpoint_copy() was accidentally made
conditional on CONFIG_NET_IPV4 rather than CONFIG_NET_IPV6.
Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
The CSIP spec states that the procedures shall only be done
on bonded devices, so a check for that was added.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Evaluate CONFIG_LINKER_ITERABLE_SUBALIGN in CMake instead of in the
linker script.
It cannot be assumed that a linker generator implementation is
pre-processed and therefore Kconfig settings cannot be used in those
but must be evaluated in CMake.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
If DNS statistics is enabled in Kconfig, then start to collect it.
This is useful in order to see how many DNS requests/responses
received or sent, and also see the amount of dropped DNS packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This change adds a new configuration option, LLEXT_EXPORT_DEVICES, which
enables exporting all devices defined in the device tree to llext
extensions. When enabled, all devices are made available to extensions
via the standard DT_ / DEVICE_* macros.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This change adds bt_le_cs prefix to public CS API as well as
adding le_cs prefix to CS related bt_conn callbacks. This is
to ensure consistency within CS API while maintaining the
separation between the Bluetooth LE and Classic features.
Signed-off-by: Burak Gorduk <burak.gorduk@nordicsemi.no>
Adds following HCI support for CS configuration:
- LE CS Create Config command
- LE CS Remove Config command
- LE CS Config Complete event
Two callbacks have been added to notify the application
when a new CS configuration is created or an existing
CS configuration is removed.
Signed-off-by: Burak Gorduk <burak.gorduk@nordicsemi.no>
Added a timeout for active scans (instead of using the host's scan
timeout) in the shell by submitting a k_work that stops the scan
after a specified period.
Fixes#78659
Signed-off-by: Babak Arisian <bbaa@demant.com>
Channel sounding frequently produces very large events, so the default
of 68 bytes can lead to buffer overruns / memory corruption.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
In the handler of SMP_Pairing rsp, the encryption key
flag is cleared incorrectly.
It causes the LE LTK cannot be derived.
Do not modify the encryption key flag to fix the
issue.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The size_t type may vary from machines. Current snprintk code was
causing below build issue on arm64.
error: format '%x' expects argument of type 'unsigned int', but argument
4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=].
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
This adds a timestamp format mode, that includes the date, which is
usefull, when using realtime for the logging timestamp.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
this way CONFIG_LOG_OUTPUT_FORMAT_CUSTOM_TIMESTAMP
only uses the custom timestamps for
logs that are not send via syslog.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The TBS and GTBS instances can now be dynamically registered
and unregistered, which fits better for the use cases of TBS
where specific bearers can come and go depending on the
features of the device.
For example if a SIM card is inserted, then a device can
register a TBS for the provider and remove it again if the
SIM card is removed.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Moves around the shell files so that they are placed nearer
to the features they expose access to.
A few changes as possible has been made.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In order to reduce confusion regarding interface count
the respective warning was adjusted to better reflect
the actual state of the system.
Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
Make sure we check the checksum offloading capabilities correctly
for VLAN interfaces. Use the real Ethernet interface when doing the
check.
Fixes#78724
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Added the SMP service and characteristic UUIDs to the smp_bt module
header and used those definitions.
Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
The bt_gatt_attr_read function did not properly handle cases
where value is NULL and/or value_len is 0, or bad mixes of the
two.
The important part is here is that we do not perform the pointer
arithmetic on NULL and/or call memcpy with a NULL src with a
non-0 length.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
User can set CONFIG_NET_SHELL_SHOW_DISABLED_COMMANDS=n to prevent
unused net-shell commands from showing. This can save flash as
the disabled commands will not be shown in net-shell listing.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
It is useful to know the currect status of DHCPv6 client when
printing the interface information.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow "net virtual" command to attach or detach virtual
interfaces. This is useful for device management.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add missing NULL check for public API function, so that the
function will return -EINVAL rather than crashing.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>