The C/R bit in the address field should be handled as explained
in 5.2.1.2 in the spec (3GPP TS 127.010).
To detect if the frame is a command or a response,
we need to know who was the initiator of the CMUX channel.
> Initiator is the station that take the initiative to initialize
> the multiplexer (i.e. sends the SABM command at DLCI 0 )
See the table from given section of the specification.
Also, on UIH frames 5.4.3.1 says
> The frames sent by the initiating station have the C/R bit set to 1
> and those sent by the responding station have the C/R bit set to 0.
NOTE: This is different than a C/R bit in the Type field.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The shell history initialization function doesn't work in if the shell
instance hasn't been created through the shell macro. This removes the
function to avoid confusion.
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
The ring_buffer API was not ideal for this use case, as it is designed for
concurrent access, which is not needed here. The new implementation using
k_heap is more readable and easier to maintain.
There is a slight penalty in memory usage & effectiveness due to the
overhead of k_heap, but since this isn't a production-critical path, the
trade-off is acceptable.
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
Keep a separate buffer for each request context instead of having a
single common buffer for the entire client context. This allows to
simplify the retransmission logic, as parallel requests will no longer
overwrite the buffer for each other. That way, we can simply retransmit
the packet w/o a need to recreate it, and thus reach to the payload
pointer or callback.
This removes the requirement to keep the payload pointer, provided to
asynchronous coap_client_req() call, valid throughout the exchange
lifetime for simple cases (i.e. no block transfer used). In case of
block transfer, this is unavoidable and needs to be documented.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Use buffers instead of pointers for path and extra options provided in
the struct coap_client_request, so that the library keeps a copy of the
path/options instead of pointers. That way, the library can still work
correctly in case of retransmissions or block transfer in case when the
original path or options were automatic variables that went out of
context.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Define CMUX_HEADER_SIZE macro that is 6 or 7 bytes depending on
MTU.
Remove the previous CMUX_FRAME_SIZE_MAX that was a bit misleading
as it meant only the header size without data and was fixed to 7 bytes.
Redefine new macros CMUX_FRAME_SIZE_MAX and CMUX_FRAME_SIZE_MIN which
are actually frame sizes with data included.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Revert a change that broke the stable API function shell_set_bypass.
This reverts commit 6b876dba1ba61b659b1b2d4c3ccd0ac41bd56027.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
fs_open and fs_opendir rely on the structures in the first param
being intialized. (The init functions are documented with the type
declarations.) This simple documentation change mentions this need
to initialize (and emphasizes it). (Users of similar APIs such as
POSIX open and opendir do not expect this initialization need.)
Fixes#97205
Signed-off-by: Paul Hepworth <paulh@vpitech.com>
Extend the save command to allow passing name/val pair to save a
subtree or individual setting to persistent storage.
Resolves zephyrproject-rtos#90407
Co-authored-by: Jamie <40387179+nordicjm@users.noreply.github.com>
Signed-off-by: Rami Saad <rami.saad@morgansolar.com>
Lfs provide lfs_fs_gc function for some time now.
Function allow offloading of expensive block allocation scan.
Introduce lfs_fs_gc via api call fc_gc.
Signed-off-by: Maciej Zagrabski <mzi@trackunit.com>
Split the structure `struct bt_obex` into two parts.
Part 1 `struct bt_obex`, it is the common part and shared by all OBEX
sessions which share the same one transport.
Part 2 `struct bt_obex_server` and `struct bt_obex_client`. The
`struct bt_obex_server` is used to manage the OBEX session of server
role. The `struct bt_obex_client` is used to manage the OBEX session
of client role.
Add function `bt_obex_server_register()` to register the OBEX server
with specific uuid.
Add function `bt_obex_server_unregister()` to unregister the OBEX
server.
Add function `bt_obex_make_uuid()` to make UUID.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Deprecate the bt_ctlr_set_public_addr function.
It is unused in the tree, and there is a vendor specific HCI
command that can be used for the same purpose.
The function does not have any tests and is basically
unmaintained.
Additionally it is the only function in the public
controller API, and removing it would allow us to
remove that part completely as unused.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Automatic advertiser resumption is deprecated since Zephyr 4.0 [1].
To maintain the behavior during the deprecation period, internal
transitional symbols were introduced to replace the deprecated ones
in the implementation:
- _BT_LE_ADV_OPT_CONNECTABLE: same option bit
as BT_LE_ADV_OPT_CONNECTABLE (deprecated)
- _BT_LE_ADV_CONN_ONE_TIME: same option bit
as BT_LE_ADV_CONN_ONE_TIME (deprecated)
The only option for connectable advertising is now BT_LE_ADV_OPT_CONN,
whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME.
We can assume _BT_LE_ADV_CONN_ONE_TIME is true for connectable
advertisers, and meaningless for non-connectable advertisers.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Automatic advertiser resumption is deprecated since Zephyr 4.0 [1].
To maintain the behavior during the deprecation period, internal
transitional symbols were introduced to replace the deprecated ones
in the implementation:
- _BT_LE_ADV_OPT_CONNECTABLE: same option bit
as BT_LE_ADV_OPT_CONNECTABLE (deprecated)
- _BT_LE_ADV_CONN_ONE_TIME: same option bit
as BT_LE_ADV_CONN_ONE_TIME (deprecated)
The only option for connectable advertising is now BT_LE_ADV_OPT_CONN,
whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME.
We can substitute BT_LE_ADV_OPT_CONN for _BT_LE_ADV_OPT_CONNECTABLE
when testing if an advertising set is connectable.
Note: to fix a ClangFormat warning raised by check_compliance.py,
this commit also includes a formatting change next to the lines
actually edited (subsys/bluetooth/host/id.c:810).
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Automatic advertising resumption is source of errors [1],
and deprecated since Zephyr 4.0 [2].
Samples and tests no longer cover this feature.
Deprecated public symbols include:
- advertising options BT_LE_ADV_OPT_CONNECTABLE
and BT_LE_ADV_OPT_ONE_TIME
- advertising parameters BT_LE_ADV_CONN
and BT_LE_ADV_CONN_ONE_TIME
Withdrawing this API (options and parameters) makes the code paths
to automatic advertiser resumption unreachable.
[1] Bluetooth: Advertising resume functionality is broken #72567
[2] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
Allow passing some context to the shell bypass callback function by
providing a void pointer user data argument.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Receiver drivers now need to set the format's size to expose it to
the application.
Application should base on the format size to allocate buffers. The
caps' min/max_line_count (which are needed only for HWs that cannot
support the whole image frame) can hence be dropped.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
In commit 5e83d222b6, all bit masking
operations in audio/midi.h were modified to use BIT_MASK(n) instead of
literal hexadecimal constants. However, masking a number with a BIT_MASK
promotes it to an unsigned long (while UMPs are packets of uint32_t aka
unsigned on most platforms). This results in annoying warnings from LOG_*
calls, such as:
warning: format '%lX' expects argument of type 'long unsigned int',
but argument 4 has type 'uint32_t' {aka 'unsigned int'}
There is no point in making these long integers, so let's revert the
bit masks as they were before, with literal hexadecimal values.
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
Anything appearing after the @endcond tag is, well, not part of the
conditional block anymore. This fixes "INTERNAL_HIDDEN" text appearing
at odd polaces in the generated documentation.
Fixeszephyrproject-rtos/zephyr#94862
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add size field to the video_format structure which needs to be set by the
driver and exposed to the application.
For uncompressed formats, this is the size of the raw data buffer in
bytes, which could be the whole raw image or a portion of the raw image
in cases the receiver / dma supports it.
For compressed formats, this is the estimated maximum number of bytes
required to hold a complete compressed frame.
Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
Use the privileged stack when starting K_USER threads in arch_new_thread().
Threads entering user mode with k_thread_user_mode_enter() keep their
existing flow. To support both cases, z_arm_userspace_enter() now takes an
internal ABI flag (sp_is_priv) indicating whether PSP already points to
the privileged stack.
Also fix calculation of the privileged stack top: use priv_stack_end
directly instead of priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE, which
failed to account for guard/FPU offsets applied to priv_stack_start.
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
Introduce new macros to define bitfields for RISC-V Physical Memory
Protection (PMP) attributes, specifically for specifying Read, Write,
and Execute permissions for IO memory regions in device tree bindings.
The following macros are added:
- ATTR_RISCV_TYPE_IO_R: Read access
- ATTR_RISCV_TYPE_IO_W: Write access
- ATTR_RISCV_TYPE_IO_X: Execute access
Corresponding macros for device tree usage are also added:
- DT_MEM_RISCV_TYPE_IO_R
- DT_MEM_RISCV_TYPE_IO_W
- DT_MEM_RISCV_TYPE_IO_X
These macros allow device tree source files to precisely describe the
intended access permissions for memory-mapped IO regions, enhancing
the system's memory protection configuration.
Signed-off-by: Firas Sammoura <fsammoura@google.com>
Nothing in the tracing/tracing.h header file requires the explicit
inclusion of kernel.h.
Fixes#95123
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Add the `__deprecated_version` macro to print version
information when deprecation warnings are triggered.
Signed-off-by: James Roy <rruuaanng@outlook.com>
Add the `__deprecated_version` macro to print version
information when deprecation warnings are triggered.
Signed-off-by: James Roy <rruuaanng@outlook.com>
This commit updates the adc_raw_to_millivolts function to use 64-bit
arithmetic. It is necessary when the intermediate result is higher
than the maximum value of uint32_t. It also adds a range check to
ensure the conversion result does not exceed the limits of int32_t,
providing an assertion message for out-of-range values.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Adds two new CPU frequency scaling policy APIs:
cpu_freq_policy_reset()
cpu_freq_policy_pstate_set()
These new APIs allow the policy to better control and isolate relevant
logic from the rest of the subsystem.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Adds explicit restrictions on the use of both
cpu_freq_policy_select_pstate() and cpu_freq_pstate_set()
for use with SMP systems.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
The arrays used for M-mode Physical Memory Protection (PMP),
specifically for the stack guard feature (CONFIG_PMP_STACK_GUARD),
were previously sized using the hardcoded PMP_M_MODE_SLOTS macro,
defined as 8. This affected arrays in both the _thread_arch
struct (m_mode_pmpaddr_regs, m_mode_pmpcfg_regs) and local
variables within the z_riscv_pmp_stackguard_disable function.
This commit changes the array sizing to use the Kconfig option
CONFIG_PMP_SLOTS. This option reflects the total number of PMP
slots available and configured for the target hardware.
Using CONFIG_PMP_SLOTS ensures these arrays are dimensioned
according to the system's actual capabilities, providing better
flexibility and correctness over a fixed size.
The PMP_M_MODE_SLOTS macro definition has been removed from
thread.h as it is no longer used.
Signed-off-by: Firas Sammoura <fsammoura@google.com>
Add an optional payload callback field to the coap_client_request
structure, allowing the application to provide blocks of payload
interactively during the resource upload, instead of having to provide
entire payload in a single contigunous memory space.
If registered, the CoAP client library will call the payload callback
whenever a new PUT/POST message is being generated (note this is also
true for retransmissions) instead of using the payload pointer/length.
If the payload callback is NULL, then the library operates as usual.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This change introduces stm32l5xx clock definitions and separates
it from L4xx series. This change comes because of CCIPR missmatch
of SAI between L4xx and L5xx series.
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
Add Clock Control driver support for Renesas RZ/A3UL, V2L
Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Some parts of this file use tabs as indentation,
and some use spaces as indentation. This commit
unifies the indentation.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
Added driver and bindings for the coresight nrf submodule.
add integrated it for the nrf54h20.
The coresight subsystem is a combination of ARM Coresight peripherals
that get configured together to achieve a simplified configuration based
on a desired operating mode.
This also replaces the previous handling in the nrf54h20 soc.c which was
powering the subsystem up but not configuring it.
Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>
Pinctrl needs to set the needed drive and direction of the pins. Also
this later allows automatically setting the clock bit for the traceclk
pin.
Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>
Moved the nrf_etr driver from the drive/misc folder into the recently
established driver/debug folder where it is a better fit. Moved the
associated files such as bindings and headers accordingly as well.
Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>