Add initial support for the Cortex-M85 Core which is an implementation
of the Armv8.1-M mainline architecture.
The support is based on the Cortex-M55 support that already exists in
Zephyr.
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
`bt_le_ext_adv_start` does not modify the `param` argument, which can
therefore be marked as `const`. This allows the struct to exist purely
in ROM.
Signed-off-by: Jordan Yates <jordan@embeint.com>
OpenThread interfaces were not considered when default interface name
is assigned, so they ended up with a generic "netX" name. Since it
useful to have an option to identify interface easily by name, assign an
unique "threadX" name for OpenThread interfaces, just like it's done for
other interface types.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The cmux module does not properly cancel all work when it is
released from its modem pipe. Releasing CMUX must cancel all
work as the pipe is no longer available, as it is set to NULL.
If work remains which tries to transmit something to the now
released pipe, a NULL dereference occurs.
This exact issue occurs if a DLCI channel is trying to open
after the modem pipe has been released, as the CMUX component
will send an open request at a fixed interval.
The expected behavior is for the open request to be cancelled,
and further open requests to be prevented until cmux is again
attached to a pipe.
Lastly, added a check to ensure that the pipe is indeed released
when calling attach, to ensure all work is indeed stopped before
modifying the pipe and buffers.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Mask the DNS_CLASS_FLUSH value when checking if the DNS_CLASS_IN
is set when unpacking a query.
Fixes#74829
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If the CIG only contains C to P CISes, then we should allow
setting the P to C interval and latency to 0, and vice versa.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Coverity reported that a formula used to calculate the next expected
block in case the block size from the request differs our own block size
has a bug. The expression used to calculate the block size diff would
evaluate to an unsigned integer, giving (wrongly) enormous results in
case block size from the request is smaller than the Zephyr's default.
It turns out however, that this formula is no longer needed at all.
Since commit d3081e2f30, Zephyr's LwM2M
implementation will no longer negotiate the block size in case of write
operation, but simply comply with the block size included in the
request. This means that calculating the diff makes no longer sense and
can be safely removed - the next expected block number should be simply
increased by 1.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case packet read fails for any reason, there's no point proceeding or
printing the byte, just break the loop in such case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
vec->iov_len is of type size_t, so the comparison was always true.
Additionally, doing the memcpy() when iov_len was 0 did not really make
sense, so do it only when the actual length is larger than 0.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
For each of the fdtable.h functions listed below, convert the
z_ prefixed semi-private functions to use the zvfs_ prefix.
ZVFS stands for Zephyr Virtual File System and
is intended to be a common library used by the C library,
POSIX API, Networking, Filesystem, and other areas.
There are already a few functions in fdtable.h that use the
zvfs_ prefix, so this change is mostly about unifying them in
a way that uses a suitable prefix ("namespace") so that it can
be considered a public API.
- z_alloc_fd
- z_fdtable_call_ioctl
- z_finalize_fd
- z_finalize_typed_fd
- z_free_fd
- z_get_fd_obj
- z_get_fd_obj_and_vtable
- z_get_obj_lock_and_cond
- z_reserve_fd
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
In practice this allocation is very unlikely to fail, however being
consistent with checking for a failure keeps Coverity happy.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Partial conditional compilation within tcpv4/6_init_isn() caused
errors in coverity, as hash variable seemed to be used w/o
initialization.
As those functions are not really used at all if
CONFIG_NET_TCP_ISN_RFC6528 is disabled, we can just conditionally
compile entire functions to avoid confusion.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The function llext_section_by_name() is used only in one place, and it
expects the caller to have the section headers cache available. This
cache is freed after the ELF file is loaded, so the function is not
usable in the context where it is called.
Remove the function and replace the call with a direct search in the
ELF file section headers array, as was done before 08eb314c35.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Currently, the code uses the section name to identify the target section
of a relocation. This is not reliable, as the section name is not
guaranteed to be in a specific format. Instead, use the sh_info field of
the relocation section header to identify the target section.
This is a tricky change, as it requires a workaround for the Xtensa
port, whose code path diverges here into the `link_plt` function and
ultimately different arch-specific code. Avoiding this divergence
will require additional refactorings.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The optimization in llext_load() to avoid using the generic path for
sections that are cached in memory was broken for two reasons:
- it was comparing an ELF section index to LLEXT_MEM_BSS, which is a
llext_mem enum, and
- it was using the wrong section address for the cached sections since
the "merged sections" feature was introduced in 709b2e44bf.
This patch fixes both issues using the new llext_loaded_sect_ptr()
helper function.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The recent changes to the loader code merged related sections together,
making sure the merged sections are self-coherent. This, however, did
not take into account that the original ELF sections are now a _subset_
of the merged section - and might not start from the beginning of the
merged section.
This patch converts the `sect_map` member of `struct llext_loader` to a
structure with two fields:
- mem_idx: the memory area index where the ELF section is mapped
- offset: the offset of the ELF section inside the memory area
The offset is calculated after all sections are merged and the final
groups are defined. This will allow the loader to correctly calculate
the address of symbols and relocations in the merged sections.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This patch sets the default value for LLEXT_STORAGE_WRITABLE to 'y' on
the Xtensa architecture. This is necessary because it does not currently
support the read-only mode for the LLEXT storage.
Make sure the default reflects this instead of asking the user to
manually set it.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the `subsys/net/ip` directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the subsys/bluetooth/(common, crypto, service, shell).
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the subsys/bluetooth/mesh directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the subsys/bluetooth/host directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the subsys/bluetooth/controller directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the subsys/bluetooth/audio directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This commit fixes compilation warnings that are present when compiling
with CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY as can be seen in this
compiler log:
"""
In file included from /zephyr-sdk-0.16.1/arm-zephyr-eabi/picolibc/
include/string.h:215,
from /zephyr/subsys/bluetooth/host/smp.c:15:
In function '__memcpy_ichk',
inlined from 'sc_send_public_key' at /zephyr/subsys/bluetooth/host/
smp.c:3006:2:
/zephyr-sdk-0.16.1/arm-zephyr-eabi/picolibc/include/ssp/string.h:83:1:
warning: argument 2 null where non-null expected [-Wnonnull]
83 | __ssp_bos_icheck3_restrict(memcpy, void *, const void *)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/zephyr-sdk-0.16.1/arm-zephyr-eabi/picolibc/include/ssp/string.h:83:1:
note: in a call to built-in function '__builtin_memcpy'
/zephyr/subsys/bluetooth/host/smp.c: In function 'smp_public_key':
/zephyr/subsys/bluetooth/host/smp.c:4214:21: warning: argument 2
null where non-null expected [-Wnonnull]
4214 | memcmp(smp->pkey, sc_public_key, BT_PUB_KEY_COORD_LEN) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/zephyr-sdk-0.16.1/arm-zephyr-eabi/picolibc/include/string.h:62:10: note:
in a call to function 'memcmp' declared 'nonnull'
62 | int memcmp (const void *, const void *, size_t);
| ^~~~~~
"""
The warning is caused by the potential use of NULL "sc_public_key"
global pointer that is not assigned a value in "smp_init()" if
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY is enabled. This commit
conditionally changes the behavior of function "smp_public_key()"
if CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY is activated to simply return
and not use the "sc_public_key" variable. Other functions that are not
called anymore by "smp_public_key()" are also conditionally
deactivated when CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY is enabled
Signed-off-by: Sebastian Panceac <sebastian.panceac@ext.grandcentrix.net>
Add a note about the thread priority requirements in the help string of
the Kconfig option enabling net_mgmt sockets.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Modified to check the length of the remaining data in buffer
before processing the next report. The length check is missing
in the cont routine.
Signed-off-by: Eunkyu Lee <mochaccino.00.00@gmail.com>
Check whether the received frame is complete by
comparing the length of the received data with
the frame data.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Fix Bluetooth initialization problem caused by PR#72090
for at least ST boards that are using BlueNRG BLE modules.
For more information, please refer to issue #74528.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
The minimum length for the network interface buffer is 2 so that we
can have terminating null there.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The network interface name that is copied to if_req struct might
be missing terminating null.
Fixes#74795
Coverity-CID: 368797
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The zsock_close() is not needed as the fd is always <0 so
the close is never called.
Fixes#74791
Coverity-CID: 366273
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Tests showed that mDNS responder needs slightly more stack on certain
platforms, hence increase the default for such case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A few issues were identified with DNS_SD segment buffers, making it work
"by chance" (depending on memory layout):
- size check in dns_sd_query_extract() did not take NULL termination
into account, and in result could overflow provided buffer
- the proto_buf in send_sd_response() can either be used to parse
protocol or domain, depending on number of segments in the query.
It should therefore be large enough to hold either.
- Similarily, instance_buf should be able to hold
DNS_SD_INSTANCE_MAX_SIZE, not DNS_SD_SERVICE_MAX_SIZE.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Commit renames deprecated key refresh field.
It still has to exist to allow backward compatibility
with previous versions when data are restored from
the persistent memory.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
The family variable was not initialized and could potentially
be left like that. This could only affect error printout.
Fixes#74796
Coverity-CID: 368799
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
`cmd(buf)` depends on this since it uses `net_buf_id`, which would alias
multiple pools.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Explicitly ignore the return value of net_pkt_read_u8() as the
net_pkt is validated before being queued for transmit within
modem_ppp_ppp_api_send()
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
This file uses strnlen() but the C library
is not require to expose its prototype unless
_POSIX_C_SOURCE is defined.
So let's define it to avoid an implicit function
declaration warning.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Commit add extension of configuration server by large
composition data server.
Mesh Protocol v1.1 specification
4.4.21.1
The Large Composition Data Server is a main model
that extends the Configuration Server model.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Commit add extension of configuration server by private
beacon server.
Mesh Protocol v1.1 specification
4.4.11.1
The Mesh Private Beacon Server model is a main model
that extends the Configuration Server model.
Configuration server and private beacon server shall always
exist together since they have bound states.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>