This removes spurious error message printed when CIS has been
disconnected and it was not used by any of the endpoints.
This case is valid and may happen on Connection Timeout when the
controller reports ACL Disconnection first.
When the CIS Disconnection is reported after, the ASE is already in idle
state and the referenece to CIS has been already removed (on ACL
disconnection).
Fixes: #64896
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Revert back to implementation that did early abort of
previous prepare when a short prepare is enqueued.
Adds back implementation deleted in
commit 7f388bb70a ("Bluetooth: Controller: Fix short
prepare when many enqueued in pipeline").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Minor refactor of Kconfig order such that the advanced
feature Kconfig is just above the enabling/visible of the
advanced features menu.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The original SHI module only has one output FIFO buffer. It costs a lot
when the driver has to send/change the protocol control code because it
must fill out all 128 bytes of output FIFO. In npcx4, we introduce
another output buffer in 1-byte depth. These two buffers can switch back
and forth during the transaction. We can use the single-byte buffer
to send the control code and the 128-byte FIFO to send the data payload.
It helps improve the SHI driver's efficiency.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Implement the pm_policy lock to prevent the chip enters the deep slepp
mode while shi transaction is ongoing.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Changes of call state were not notified. Fixed by calling notify_calls
in respective functions.
Signed-off-by: Lukas Streitenberger <lukas.streitenberger@wsa.com>
Since sending of public key was moved into system
work (https://github.com/zephyrproject-rtos/zephyr/pull/62331)
it uses the same context as a Host Tx buffer
allocator for gatt sending. Host cannot wait for
free buffer anymore. Mesh requires 4 buffers
to send max size frame(public key) during
provisioning.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Logging shall not use character pointers with %p because in
certain configurations it may lead to memory faults. A compile
time detection is added. If faulty usage is detected then
message is replaced with error message which indicates which
message failed and what shall be done (casting to a pointer
of different type).
Validation is enabled only for configurations which remove
strings from binary as otherwise it may impact CI execution
time.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
By making short inputs optional, the user can bypass short-events all
together if necessary (e.g. custom button-press listener).
Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
This moves including of demand_paging.h out of kernel/mm.h,
so that users of demand paging APIs must include the header
explicitly. Since the main user is kernel itself, we can be
more discipline about header inclusion.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Initially, the command/reply ID byte was not part of the data length
macros. But later, when it was changed to include it, the buffer length
checks was not adjusted. Due to this, we were not using the last byte in
the buffer. Fix this issue by correcting the condition.
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
Commit c7fec71193 ("mgmt/osdp: Add length checks for commands and
replies") attempted to remove code duplication by adding a macro to perform
a length check. At the time, a CI linter did not like macros with control
flow so the code was switched to a method which called __ASSERT() on this
condition.
The __ASSERT() macro is a nop if CONFIG_ASSERT=n (which is the default) and
causes the buffer access to be unguarded which may lead to OOB accesses.
This patch fixes the issue by reintroducing the if check.
Fixes: c7fec71193.
Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
Zbus uses mutexes internally that are available
only when MULTITHREADING is enabled so add
it to fix the following error:
/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/
12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/
zbus/libsubsys__zbus.a(zbus.c.obj): in function `k_mutex_init':
/builds/zephyr/mcuboot/zephyr/include/generated/syscalls/kernel.h:969:
undefined reference to `z_impl_k_mutex_init'
Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
Improved the updates to the name ID metadata (NVS_NAMECNT_ID) item
in the Settings NVS backend implementation. The improvements should
make the implementation more robust in handling edge cases such as:
power downs, resets or a case in which the storage partition is
full. In the last case, the NVS backend could return an ENOSPC error
in the context of the settings_delete API. This change also fixes
this issue.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
When a client uses wildcard subscription and a new message is
published to the matching topic for the first time, the gateway
sends REGISTER message to the client, containing the exact
topic name and a new topic ID.
This change fixes adding these topic ID and name to the internal
topics list.
Signed-off-by: Alexander Vasiliev <alexander.vasiliev@siemens.com>
Add a function to MQTT-SN library API to get topic name by ID
from the internal topics list.
Signed-off-by: Alexander Vasiliev <alexander.vasiliev@siemens.com>
This adds non-volatile settings for the HAS Server. Those are needed to
restore the client awareness of preset list entries exposed by the
server. Based on the settings, the implementation determines how to
notify the client about the HAS related characteristic value changes.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Added igmpv3 support based on the already existing structure for igmpv2.
The already existing api is not modified to prevent breaking exisiting
applications.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
Added igmpv3 checksum function to make it possible to calculate the
checksum of a complete igmpv3 pkt at once.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
Fix the CMakeLists of the tls_credentials and sockets folders
to link/interface to the net library instead of the zephyr library.
This fixes issues where some files are not found in the link interface
when compiling the sources in this folder.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Make sure we send the entire packet buffer before bumping the packet
counter, send() does not guarantee that all of the requested data will
be sent at once with STREAM socket.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case underlying socket reported error while waiting for TX, the
errno value was not set accordingly. This commit fixes this.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Otherwise, if the application was for example blocked on poll() pending
POLLOUT, it won't be notified.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Rework how data is queued for the TCP connections:
* net_context no longer allocates net_pkt for TCP connections. This
was not only inefficient (net_context has no knowledge of the TX
window size), but also error-prone in certain configuration (for
example when IP fragmentation was enabled, net_context may attempt
to allocate enormous packet, instead of let the data be fragmented
for the TCP stream.
* Instead, implement already defined `net_tcp_queue()` API, which
takes raw buffer and length. This allows to take TX window into
account and also better manage the allocated net_buf's (like for
example avoid allocation if there's still room in the buffer). In
result, the TCP stack will not only no longer exceed the TX window,
but also prevent empty gaps in allocated net_buf's, which should
lead to less out-of-mem issues with the stack.
* As net_pkt-based `net_tcp_queue_data()` is no longer in use, it was
removed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add new function to allocate additional buffers for net_pkt, w/o any
additional preconditions/checks. Just allocate what was requested.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The UART flush is not relevant for the async UART implementation.
UART drivers should handle this internally.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Use single ring buffer and protect it with a spinlock as it is
shared between backend and UART thread (ISR). This is simpler
than the double ring buffer setup.
The receive idle timeout has also been made configurable
instead of being a hardcoded value.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The current implementation only waits for the RX disabled event
to determine if the UART is closed. It should wait for all RX
buffers to be released, and the TX to be done as well.
We now also call uart_tx_abort() when closing the pipe.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
RSRQ is the ratio between send and received signal strength and usually
understood/expected to be represented as a ratio in dB and as such always
has a negative range. So to allow RSRQ to be represented correctly the
resource must allow negative values, but currently it's limited to unsigned
8bit integers.
Signed-off-by: Henning Fleddermann <henning.fleddermann@grandcentrix.net>
BINDESC can be used with any POSIX arch based target,
not just native_posix.
Fix the kconfig filter and the sample yaml filter.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Possible NULL pointer dereferences where discovered by static
code analysis, they are addressed in this commit.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Network interface numbering starts from 1, therefore when accessing
help/index array, the interface index should not be used directly, but
rather decremented by 1, to avoid out-of-bound access on those arrays.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Make sure that the error message does not overflow the transmit buffer
when copying the error message string.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
There's not really much to do when the transmission of the error reply
fails, but we can at least log the failure.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The result of string to float conversion in LwM2M shell write command
was not verified, which could result in incorrect data being written to
the resource.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fix potential integer overflow by casting one of operands to int64_t.
Coverity-CID: 329961
Fixes#65356
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The Private Beacon Client API requires a response argument to allow to
call the API in the asynchronous manner
(https://github.com/zephyrproject-rtos/zephyr/pull/56426).
Because the removal of the EXPERIMENTAL tag for this API was not
released yet, it should be OK to change this API.
The EXPERIMENTAL tag has been removed here:
https://github.com/zephyrproject-rtos/zephyr/pull/64866
Coverity-CID: 330039
Coverity-CID: 330029
Coverity-CID: 329977
Fixes#65336Fixes#65338Fixes#65354
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>