In addition to storing the interface pointers, also store the pointers
for the interface association. Also add comments to the other fields
of the structs to adapt to a new CI check.
Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
Add API wrappers around the function pointers in struct usbh_class_api,
while also documenting the USB host class internal API.
Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
Rename variable 'ret' to 'err' in cmd_send_media() to align with
Zephyr coding conventions for error return values.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
- Name derived from Zephyr cyclictest
- Inspired by Linux realtime test program cyclictest
- Measure latency of interrupt service routine as well as thread with the
help of the timer interrupt, of which the programmed point of time is
known.
- Zyclictest thread is running in background while individual application
under test can be running in foreground.
- The interval can be set up with optional argument -i. It should be at
least double of expected worst case thread latency to get valid output.
If this is not met the measurement needs to be repeated.
- The priority can also be set up. It should be the priority of the
application which should run on the final product.
- The maximum size of the histogram is hard coded to 200 so far.
- After stopping measurement the maximum latency, number of errors /
overflows and the histogram itself is printed.
- Histogram is printed in a form which is easy to be used by plotting
programs like GNUplot or Python matplotlib.
- Example: One wants to know what is the expected maximum latency of a
cooperative task with priority of -10.
$ zyclictest start -i 400 -p -10
$ # start your application test cases
$ zyclictest stop
Count: 547329
IRQ Thread
Max-Latency: 21 27
Errors: 0 0
Overflow: 0 0
Histogram:
...
23 0 547306
24 0 2
25 0 5
26 0 5
27 0 2
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Add pressure policy to cpu_freq subsystem. The
pressure policy evaluates system load by accumulating
the priorities of runnable threads to inform P-state
transitions.
As more threads of higher priorities queue as ready
in the scheduluer, the system pressure increases
and the policy may decide to choose a more aggressive
P-state.
Signed-off-by: Sean Kyer <sean.actor@gmail.com>
Enchance the cpu_freq subsystem to remember the latest
pstate and skip calling the pstate_set function if
the next pstate is the same as the last.
Signed-off-by: Sean Kyer <sean.actor@gmail.com>
Add shell command for testing BR/EDR inquiry scan parameters update.
Supports default parameter set and custom parameters via interval/
window/type arguments for inquiry scan configuration.
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
Implement BR/EDR inquiry scan parameters update functionality with
new API bt_br_inquiry_scan_update_param(). Adds support for setting
inquiry scan interval, window and type via HCI commands. Includes
default parameter set for standard inquiry scanning.
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
Implement BR/EDR page scan parameters update functionality with new
API bt_br_page_scan_update_param(). Adds support for setting page scan
interval, window and type (standard/interlaced) via HCI commands.
Includes predefined parameter sets for different Bluetooth versions
and use cases.
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
This commit implements Class of Device (COD) test shell
functionality for Classic Bluetooth, supporting both
setting and retrieving COD from the controller.
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
This commit implements Class of Device (COD) functionality for
Classic Bluetooth, supporting both setting and retrieving COD
from the controller by bt_br_write_cod and bt_br_read_cod.
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
Allow applications to respond to HTTP OPTIONS requests (e.g. CORS pre-
flight) by routing OPTIONS through the same dynamic handler path
as GET/DELETE.
This enables OPTIONS handling for both HTTP/1.1 and HTTP/2.
Signed-off-by: Robert Eichinger <robert.eichinger@bshg.com>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
assigned true/false values, not 1/0.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
When building with CONFIG_NO_OPTIMIZATIONS the compiler will not
optimize create_answer() based on the caller, and will try to call
ipv4/6 code even if not built.
Let's add an extra check in the if before those possibly unavailable
calls to ensure those branches are dropped in this case.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Extend the Wi-Fi shell connect command to allow passing an SAE
password separately from PSK. Previously, the shell stored all
passwords in the PSK field, preventing proper use of SAE credentials
required for WPA3 connections.
This change adds a dedicated option to populate the SAE password
field so that SAE authentication paths can be exercised correctly
from the shell.
Signed-off-by: Somil Gupta <somil24559@iiitd.ac.in>
As per Zephyr coding guideline #59, "operands shall not be of an
inappropriate essential type". This makes sure boolean variables are
initialized and used with proper essential type (true/false).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Fixes macros that broke after changes were merged which started
using the unit address of partition nodes. This also fixes the
test to ensure devices not starting at 0x0 are properly checked
which previously would silently be unknown
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add helpers for sending all the data in a buffer. This is
only useful for stream sockets like TCP.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
CoAP .well-known/core handling routine assumed that the "user_data"
pointer in struct coap_resource will be set to a valid struct
coap_core_metadata pointer, or left NULL. This approach is error
prone (application cannot use "user_data" field freely) and renders the
"user_data" field useless for other cases.
Therefore, introduce a separate "metadata" pointer within the struct
coap_resource specifically to configure the resource-related metadata,
and leave "user_data" for the applications to use freely.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
If fs_stat() is done on a mount point treat
it like it is a directory, instead of leaving it to
the implementation of the filesystem.
The fatfs for example will fail.
That is also the reason `fs cd` from the fs shell
fails, when trying it on a mountpoint with fatfs.
This also makes the behavior of fs_stat() similar to the one
of fs_readdir(). Especially as both functions use the
`struct fs_dirent` to return the informations.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The sensing subsystem currently calls fetch and get from a timer ISR
context. A TODO had been previously added to move this to the runtime
thread context, which has been done in this fix.
Signed-off-by: Brandon Edmonds <bedmonds91@gmail.com>
Adds sys_mem_blocks as an alternative implementation
for the heap. Users have reported that k_heap allocating
additional bytes for bookkeeping data when allocating e.g.
a LLEXT_PAGE for an extension region causes them to skip
an entire page for the next allocation. This also causes
problems RE: MPU slot usage. sys_mem_blocks stores bookkeeping
data outside of the memory it allocates from and does not
have this issue.
Note that sys_mem_blocks is only used to allocate extension
regions. Metadata is still stored in a k_heap.
Note also that tracking data for sys_mem_blocks must be stored
per extension, as unlike k_heap it can't deallocate with just
a pointer to the memory.
Further limitations:
* sys_mem_blocks is statically allocated, so this option
cannot be used with CONFIG_LLEXT_HEAP_DYNAMIC
* A minimum of 1 block must be allocated per region
regardless of size.
* If using the MPU / MMU where small allocations are
rounded up to LLEXT_PAGE regardless, this penalty
is not quite as noticeable.
* sys_mem_blocks does not support aligned allocations. However,
by selecting a sufficiently large power of 2 for the
block size and aligning the backing buffer to the block size,
any allocation will be automatically aligned for the block size
and smaller powers of 2. For LLEXT, this means users must select
a block size equal to or a multiple of the largest
requested region alignment of regions going on the heap
* If your MPU selects CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT,
large regions may cause unreasonably large maximum requested
region alignments
* Block size must also be equal to or a multiple of
LLEXT_PAGE_SIZE so each allocation is LLEXT page aligned
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Adds a Kconfig option to select LLEXT heap implementation.
Another choice, sys_mem_blocks, will be introduced in the
following commit.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Set the FCS option to BT_L2CAP_BR_FCS_16BIT for enhanced retransmission
mode in both L2CAP accept and connect paths to work around an
interoperability issue with iPhone devices.
The issue occurs when connecting to iPhone for PBAP or MAP profiles,
where the iPhone expects the 'No FCS' option to be applied but does
not include the 'No FCS' option in its L2CAP_CONFIGURATION_REQ packet.
Forcing 16-bit FCS ensures proper configuration negotiation.
Changes include:
- Set rx.fcs to BT_L2CAP_BR_FCS_16BIT in goep_l2cap_accept()
- Set rx.fcs to BT_L2CAP_BR_FCS_16BIT in
bt_goep_transport_l2cap_connect()
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When a fatal error occurs before the kernel is fully initialized
(e.g., during early boot), the ztest fatal error handler would call
k_current_get() which now contains an assertion that fails if called
pre-kernel (added in commit 5ce408b647 ("kernel: assert if
k_current_get is called pre-kernel")). This assertion failure
triggers another panic, creating an infinite recursion that floods
the console with nonsensical values.
Check k_is_pre_kernel() to decide which method to use: _current
directly when pre-kernel (to avoid the k_current_get assertion), or
k_current_get() otherwise for proper userspace and TLS support.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Move state retrieval before error handling to ensure it's always
available for subsequent checks. Add a check to prevent executing
the callback when the AG connection is in a disconnected state.
This prevents potential use-after-free or invalid state access when
the callback is invoked after the AG has been disconnected, improving
the robustness of the notification work handler.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
log_backend_net supports both tcp and udp. If no tcp support is
compiled in, line_out will return an invalid number of consumed
bytes (-EINVAL). This patch removes the is_tcp flag if tcp support
is not compiled in and moves the error check into init_net.
Signed-off-by: Paul Wedeck <paulwedeck@gmail.com>
filter automount durring build.
Also add the automaticly enabled Kconfig option
CONFIG_FS_LITTLEFS_FSTAB_AUTOMOUNT, similar
to the fat fs and ext2 fs.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
If automount is enabled in the devicetree for
a fatfs, then enable the Kconfig option by default.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Sender address and address length were not set in recvfrom() when called
for TCP socket. Fix this by reusing the code used to set source address
on accept().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The return value greater than 0 from `i3c_target_tx_write()`
indicates the number of bytes written. This patch fixes
the incorrect check.
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
settings_zms_dst() and settings_zms_src() never reports errors and
always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Setting the prompt to the empty string allows it to be hidden. This is the
intent of the shell command 'shell prompt off'. However, in the most recent
change to the prompt handling, this functionality was lost. Presumably,
the check for 'prompt_length == 0' was to avoid a NULL prompt. However,
NULL is already checked for. Remove the zero-length check and restore the
ability to set the prompt to the empty string.
Signed-off-by: Ryan Smith <elryno@elryno.com>
Increasing FD count in the system for the network stack (native sockets)
only makes sense if native network stack is enabled. Otherwise, just
make it 0. This makes a difference for example when socket offloading is
used and the offloaded implementation makes its own reservation.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The bypass mode in shell.c transfers data in a loop and doesn't need
a large buffer. The previous code conditionally used
CONFIG_SEGGER_RTT_BUFFER_SIZE_DOWN which unnecessarily tied the bypass
buffer size to RTT configuration and could increase stack usage when
RTT buffer is configured larger.
This adds CONFIG_SHELL_BYPASS_READ_BUF_SIZE with a default of 16 bytes,
which is sufficient for the iterative read loop. A build-time assert
ensures the buffer doesn't exceed SHELL_STACK_SIZE.
Fixes: db9dccdc8a
Signed-off-by: Karel Blavka <karel.blavka@hardwario.com>
This commits splits the border router services initialization by
separating the ipv6 related services from ipv4 ones.
As there are cases in which a DHCPv4 server is not present in the
network setup, there is no reason to wait for an IPV4 address before
starting the border router. In this case, only IPV6 functionalities
would be exposed.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
The length is an input parameter, which tells the kernel how big the
storage is. Depending on the socket implementation in use, not setting this
properly can (and should) fail depending on the value of the stack
variable.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
5f5db5bf3c added support for IPV6_MULTICAST_HOPS by adding both IPv4 and
IPv6 variants in place where they are used. This made the code a bit
complicated, though. This commit introduces helper functions to solve this.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
There's a method to enable RX (`mctp_uart_start_rx`), but not one to
stop it. This patch adds `mctp_uart_stop_rx` to do so.
It will be handy at least for tests, as it allows two MCTP endpoints to
share a single UART device - as long as only one has RX enabled - and
"ping-pong" messages between them.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Arm the first OUT transfer when class is enabled
so the host's first write can complete.
On disable, cancel worker, drain FIFO, reset RX parser,
and unblock tx_lock if disconnect occurs mid-transfer.
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>