sizeof(struct bt_le_cs_write_cached_remote_fae_table) = 74,
so the default value (65) was already too small in some cases.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
With BT_SETTINGS enabled, there doesn't seem to (anymore?) be any
substantial overhead in stack consumption:
0x200020b8 BT RX WQ
options: 0x0, priority: -8 timeout: -9223372036854775808
state: pending, entry: 0x5ba69
stack size 2240, unused 1072, usage 1168 / 2240 (52 %)
Let's just remove the conditional default and fall back to the
non-conditional one which is 1200.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Make sure iso_interval_us is in a multiple of 1.25 ms instead of directly
assigning it the value of SDU interval
Fixes EBQ failures in LL/CIS/CEN/BV-36-C and LL/CIS/CEN/BV-37-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
According to TCP Spec. RFC793, ACK flag should be always set
after sequences of both sides are sync-ed except for RST seg-
ment. It is not necessary to send FIN only packet in the
test case, using FIN | ACK instead.
Similarly, change the tcp_out(conn, FIN | ACK) in CLOSE_WAIT.
Signed-off-by: Shrek Wang <inet_eman@outlook.com>
pm_state_get() is used to get a PM state that can be forced.
Disabled states (not included in automatic state selection) can
also be forced thus they should be included in search inside
pm_state_get().
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The abs() function only takes an int as input - use llabs() instead
Fixes EBQ failure in LL/CON/PER/BV-105-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
Move OpenThread-related code from
zephyr/subsys/net/l2/openthread/openthread.c to
zephyr/modules/openthread/platform/openthread.c.
The primary goal of this refactor is to enable the use
of OpenThread as an independent module, without the necessity
of Zephyr's networking layer.
This change is particularly beneficial for simple applications
that have their own implementation of the IEEE802.15.4 driver
and do not require a networking layer. These applications can
now disable Zephyr's L2 and IEEE802.15.4 shim layers and
directly use the OpenThread module, saving valuable kilobytes
of memory.
In this approach if the CONFIG_NET_L2_OPENTHREAD
Kconfig option is set, Zephyr's L2 and IEEE802.15.4 layers
will be used, and everything will function as before.
The main difference is the Zephyr's L2 layer now uses
the OpenThread module, no longer implementing it.
While most of the functions in include/net/openthread.h
have been deprecated, they are still available for use to
maintain backwards compatibility.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Add Asynchronous UART implementation, which does not drop data
when automatic hardware-flow-control is set in the device tree.
With automatic hardware flow control, the CTS pin will be
automatically deactivated when there are no more asynchronous
UART RX buffers available. After buffer space becomes available,
and UART RX is restarted, the CTS pin will be activated.
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
Doing another init of the log_backend_net in
the net config init could lead to the
server, set during runtime, being overwritten
by the Kconfig default.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
When async UART is used & DCache is enabled, some SoCs, like STM32H7,
require UART buffers to be placed in nocache memory to avoid cache
coherence issues.
Fixes issue 87795
Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
The commit '3b29b9fa3b (tests: logging: restore userspace testing,
2025-04-18)' set CONFIG_LOG_PRINTK=n which brakes the build on the
platform 'ip_k66f'.
Without CONFIG_LOG_PRINTK=n (dependency from CONFIG_USERSPACE=y) some
tests in 'tests/subsys/logging/log_core_additional/logging.log_user'
would not build.
Remove this dependency so that LOG_PRINTK can also be used from user
space, which is possible since '77925656ab (logging: Fix runtime
message creation in user-mode thread, 2025-04-18)' and reset
CONFIG_LOG_PRINTK=y.
Fixes: #89067
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
Prevent possible overflow in is_in_flash_area_bounds while
validating offset and length of an operation.
Fixes#89349
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
In case HTTP client read out more data from a socket that it processed
it will indicate there is leftover data in the receive buffer available.
Make use of it at the websocket level, so that no data is lost. As we
reuse the same receive buffer in this case, it's only needed to update
the count variable to indicate how many bytes are available.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The HTTP client would read data from a socket up to the size of the
receiving buffer, however it may not process them all. This is usually
only the case if protocol switching takes place, where the data read may
belong to another protocol. Therefore we need a way to notify the caller
about any potential data that is already present in the buffer and needs
to be processed.
Introduce an new data_len member in struct http_request to provide the
information about the data already available in the receive buffer. If,
after HTTP response processing, the value is non-zero, the data will be
available in the beginning of the user provided receive buffer.
To make this possible however, we need to track how many bytes were
actually processed by the http_parser, therefore the code will no longer
ignore the http_parser_execute() return value. To simplify processing,
it's also been changed how the receive buffer is used. Instead of using
it in a ring-buffer-like way, the offset variable will track how many
bytes are available in the buffer, and in the rare occasions when not
all data from the buffer was processed by the HTTP parser, we'll
memmomve the remaining data to the beginning of the buffer.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The "BT RX pri" and "BT RX" are too easily confused with host-side threads,
e.g. the host RX thread is called "BT RX WQ". Add "CTLR" to the Controller
side thread names to make it clear that they're managed by the controller.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add trigger_irq() function support for RX
This function will set corresponding IR bit to 1 on RX ICU to
trigger interrupt
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Current clock synchronization was always stepping clock. This was
causing large offset, and discontiguous ptp hardware clock time.
For TSN hardware, discontiguous ptp hardware clock time was not
able to be used for other TSN protocols.
This patch is to convert to frequency adjustment with a basic
PI control algorithm.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
No window widening was applied to conn_offset_us causing the initial
ticker_cb to get called slightly too late
Apply window_widening_periodic_us to conn_offset_us, since this is the
worst-case window widening (win_offset is not allowed to be larger than
a connection interval) and is applied in the LLL window size already
Fixes EBQ failure in LL/TIM/PER/BV-02-C
Signed-off-by: Troels Nilsson <trnn@demant.com>
GCC and Clang support the undefined behavior sanitizer in any
configuration, the only restriction is that if you want to get nice
messages printed, then you need the ubsan library routines which are only
present for posix architecture or when using picolibc.
This patch adds three new compiler properties:
* sanitizer_undefined. Enables the undefined behavior sanitizer.
* sanitizer_undefined_library. Calls ubsan library routines on fault.
* sanitizer_undefined_trap. Invokes __builtin_trap() on fault.
Overhead for using the trapping sanitizer is fairly low and should be
considered for use in CI once all of the undefined behavior faults in
Zephyr are fixed.
Signed-off-by: Keith Packard <keithp@keithp.com>
warning: format '%d' expects argument of type 'int', but argument 3 has
type 'size_t' {aka 'long unsigned int'} [-Wformat=]
Change the printf modifier to %zd for size_t variable will resolve the
warning.
Signed-off-by: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com>
Make it so LLEXT allocates a memory region equal or greater
to the minimum size supported by the MPU, to ensure no region
overlap.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Instead of using individual SoC kconfigs to determine whether
to enable the Xtensa simulator logging backend, simply use
CONFIG_SIMULATOR_XTENSA.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The bt_csip_set_member_get_sirk function is superseded by
bt_csip_set_member_get_info and uses of it has been replaced.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Updates the includes in a a few files to
avoid including unused header files and include the
ones that are used.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Updates the includes in a a few files to
avoid including unused header files and include the
ones that are used.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There was a semaphore in hci_core which was given to early when
receiving the BT_HCI_EVT_NUM_COMPLETED_PACKETS message from the
controller. This would sometimes cause an assert to happen in
function hci_num_completed_packets, where there would arise a
mismatch in the bookkept count, and actually stored nodes. More
concretely, due to premature semaphore giveing, the tx_pending node
would be have been removed in another context before it could be
fetched and moved to complete list in this function.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
Default binding should take place before we actually make use of the
local address when registering packet socket "connection".
Also, instead of hard coding the protocol for default binding to
ETH_P_ALL, use the protocol that the socket was created with.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In order to be able to receive packets on unbound packet sockets (which
should collect packet from all interfaces in such case), it's needed to
register receive callback at the socket layer as soon as the socket is
created.
In additional to that, the default binding for packet sockets need to be
revisited. Packet socket should not be bound to the default interface,
as this way the socket would only be receiving packets from that
particular interface. Instead, leave the interface unspecified in such
case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Allow to update the local address on a registered connection when
rebinding.
This is needed for packet sockets, as by default packet socket
will be bound to "any" interface (interface index 0), and interface
index is part of the local address registered for packet socket.
In order to be able to explicitly bind to a specific interface later, it
needs to be possible to update the local address registered for the
connection, as we need to update the interface index, which is used
by net_conn_packet_input() for packet filtering.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When the L2CAP channel connection is in none basic mode, the
`seg_recv` cannot work properly if the configuration
`CONFIG_BT_L2CAP_SEG_RECV` is enabled. And the L2CAP channel
connection will be broken incorrectly.
Check whether the received data len exceeds the SDU length if the
`SAR` is `BT_L2CAP_CONTROL_SAR_END` or `BT_L2CAP_CONTROL_SAR_CONTI`.
And check whether the SDU length is valid if the `SAR` is
`BT_L2CAP_CONTROL_SAR_UNSEG` or `BT_L2CAP_CONTROL_SAR_START`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The cap_initiator_broadcast_to_bap_broadcast_param function
did not properly relay the ISO test parameters from the CAP
parameters to the BAP parameters.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some in-the-wild devices use SDU interval of 0 when BN == 0; This
is not allowed by BT Core Spec v6.0, but is not specifically
mentioned in v5.4 and earlier. To allow connecting a CIS to these
devices, relax the check on SDU interval
Note: LL/CIS/PER/BI-07-C only checks rejection of invalid SDU interval
with BN > 0, so it still passes with this change
Signed-off-by: Troels Nilsson <trnn@demant.com>
SQE items with this OP will take the specified amount of time
(asynchronously) before completing. This allows to serve as an
asynchronous delay in between SQE items (e.g: A sensor measurement
requested, which requires 50-ms before having the result available).
Signed-off-by: Luis Ubieda <luisf@croxel.com>
keep_alive_timer_restart() only works in ESTABLISHED state. In
tcp_in() SYN_SENT and SYN_RECEIVED state, it won't work by calling
this function. So remove the call in that 2 states while adding it
in the bottom after changing the conn->state to ESTABLISHED.
Signed-off-by: Shrek Wang <inet_eman@outlook.com>
The response L2CAP_COMMAND_REJECT_RSP(BT_L2CAP_REJ_NOT_UNDERSTOOD)
should be replied if the received L2CAP command is a invalid L2CAP
signaling command packets with extra data in the Information Payload.
Send L2CAP_COMMAND_REJECT_RSP(BT_L2CAP_REJ_NOT_UNDERSTOOD) if it a
small L2CAP signaling PDU or it has short length.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Slightly increase the default maximum size for zperf uploads to support
1kB of data payload together with the 40 bytes UDP client header.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add support for uploading custom data, instead of a static packet of
'z'. This can be used for more accurate profiling of uplink throughput
for a given application. For example, reading data from flash, or
application level encryption.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The timestamp in the UDP header is expected to be a Unix timestamp, not
an application uptime. Add the option to specify the Unix time at
function entry so that the reported timestamps are accurate.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The minimum packet size is the combination of the datagram and client
headers, not just the datagram header.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Prevent the modulo operation causing a division by zero error by falling
back to the minimal ACK timeout value if the random factor is 1.0. Also
fall back to the same value if the random factor is erroneously smaller
than 1.0. Additionally make the upper bound of the random range
reachable.
Signed-off-by: Adrian Friedli <adrian.friedli@husqvarnagroup.com>
The bt_recv() and bt_recv_prio() APIs don't exist anymore, so remove any
references to them from the Kconfig help texts.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The parameter length for this command was missing the additional
length from the arrayed parameters.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>