actual_length needs to be set also for the OUT transfers. Assume that
requested length was transferred when there are no errors.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Having variable declarations after labels causes build failures with
Clang/LLVM:
subsys/bluetooth/host/classic/avrcp.c:1269:2: error: label followed by a
declaration is a C23 extension [-Werror,-Wc23-extensions]
1269 | uint8_t failed_evt = 0;
| ^
/subsys/bluetooth/host/classic/avrcp.c:3809:3: error: label followed by a
declaration is a C23 extension [-Werror,-Wc23-extensions]
3809 | uint64_t identifier = sys_get_be64(data->identifier);
| ^
Fix these by moving the declarations to the top of the function in the
first case and add braces for the second.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Validate P-states in devicetree in build time. If no
P-states are defined, a build error will be raised.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
In current on_demand policy, if it doesn't find a P-state
with a threshold lower than the current load, it will fail
to switch state. For example, if load went from 100% -> 0%
suddenly as the chip would get stuck in a "turbo mode"
meanwhile its load is low.
This commit add fallback mechanism for on-demand policy,
that is if no P-state matches (i.e., the load is below all
thresholds), the policy will fall back to the P-state with
the lowest load_threshold (typically the lowest performance
state).
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
If a phone was made during the previous SLC, AG cannot properly
process the redial request sent by HF after reconnecting.
Add a callback `redial` to get the last dial number from the upper
layer when `AT+BLDN` command is received.
If the callback is not provided or the error is returned after the
callback returned, send error response to the HF.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add support to handle domain match and suffix match parameters
for proper server certification validation.
Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
Instead of relying non-standard compiler behavior, define
encode and decode functions for all CMUX command structures.
Final command is encoded into a shared buffer, because it is
always copied directly to TX ringbuffer.
Added also functions to validate commands.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When CDC ACM instance gets enabled and there is some data in TX FIFO,
the TX FIFO work will not be triggered if no UART API is used. And if TX
FIFO was full before CDC ACM instance get enabled, TX work will never be
triggered. To fix it TX FIFO should always be drained when CDC ACM gets
enabled.
Signed-off-by: Alexandre Boeglin <alexandre.boeglin@qorvo.com>
Improve the network message cache to be aware of network keys to
prevent false duplicate detection across different subnets. This
ensures that messages with the same source address and sequence
number but from different network keys are not incorrectly
identified as duplicates, as it can happen in certain cases.
See ES-26350.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Add full support for all remaining AVRCP vendor-dependent PDUs on both
Controller (CT) and Target (TG), including APIs, callbacks, and shell
commands for testing.
Signed-off-by: Make Shi <make.shi@nxp.com>
Implement support for AVRCP Player app Settings PDUs on both CT/TG
- Added APIs for sending and handling commands like LIST_ATTRS,
LIST_VALS, GET_CURR_VAL, SET_VAL, and related text/inform PDUs.
- Added callbacks for TG request handling and CT response processing.
- Add shell commands for Player app Settings commands testing.
Signed-off-by: Make Shi <make.shi@nxp.com>
This patch adds AVRCP notification event handling for both CT and
TG roles. Also add Shell command support for testing notification
registration and responses.
Signed-off-by: Make Shi <make.shi@nxp.com>
This patch introduces support for AVRCP vendor-dependent commands and
responses, including full handling of fragmented messages.
- Adds fragmentation and reassembly logic for AVRCP vendor-dependent
- Introduces TX queue management using delayed work for TG
- Adds support for GetCapabilities PDUs
- Add new Kconfig for vendor-dependent with fragmentation support
Signed-off-by: Make Shi <make.shi@nxp.com>
Remove unnecessary checking for net_buf_tailroom(buf) < chunk_size
before sending data in avctp_tx_processor.
Signed-off-by: Make Shi <make.shi@nxp.com>
The LoRaWAN subsystem does not require 2KiB of system workqueue,
testing on nrf54l15 flpr (RISCV) CPU (with custom cryptography code)
shows it uses about 700 bytes of the system workqueue, therefore it
is assumed that the real requirement for 2KiB is the software
cryptography features, not the LoRaWAN stack itself, and the
cryptography parts of LoRaWAN can be replaced with alternatives
that do not need this high of a memory requirement, so the
requirement has been moved to the specific Kconfig for software
cryptography instead
Signed-off-by: Jamie McCrae <spam@helper3000.net>
ARMv8-M and newer ARC MPUs use base/limit addressing with 32-byte
granularity and do not require power-of-two sizing. Only ARMv7-M
and older ARC MPUs have this restriction.
Check CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT (set for ARMv7-M,
older ARC) instead of CONFIG_ARM_MPU to avoid wasting memory on
ARMv8-M systems.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
When OpenThread iface is brought up `ot ifconfig up` there are several
modules that will attempt to open a platform socket and perform bind
and bind to netif operation.
Since now, `sockfd_upd` structure was initialized after the backbone
interface announced connectivity, but this implies that OpenThread
interface will always be brought up only after this event, which is not
true, or imposed.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
Group exported symbols together by subsystem/library. Groups can then
be enabled or disabled together through the existance of a Kconfig
symbol named `CONFIG_LLEXT_EXPORT_SYMBOL_GROUP_{GROUP_NAME}`.
All symbols declared with the standard `EXPORT_SYMBOL` and
`EXPORT_SYMBOL_NAMED` macros fall into the `DEFAULT` group.
Signed-off-by: Jordan Yates <jordan@embeint.com>
DEFAULT
DEFAULT
When remote peer have closed the PPP link normally, the
PPP stack on Zephyr side switches back to ESTABLISH phase
to be ready for next handshake.
When calling net_if_down() on the interface, it should not
try to initiate LCP link termination, but instead go directly
to DEAD phase.
See https://datatracker.ietf.org/doc/html/rfc1661#section-3.2
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Add a MATRIX_CODE macro to extract the key code from a key value created
in DT with MATRIX_KEY. This can be handy for code other than input_keymap.c
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Avoid polluting every build that includes this Kconfig with EXT2
logging config unless the ext2 filesystem is actually enabled.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Make sure assertion is true before dereferencing chan->iso. In extreme
case compiler could skip assert check (asume it is always false) if address
was already dereferenced.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Fix the power domain claiming condition which was inverted, causing
domains to be claimed when they were already claimed instead of when
they weren't. Add null check for power domain before accessing its
properties to prevent potential null pointer dereference. Also ensure
the PD_CLAIMED flag is properly cleared when putting the power domain.
Signed-off-by: Albort Xue <yao.xue@nxp.com>
Its goal is to use it as the "connection point" between what the hardware
support and what the application needs. All the application/module/subsys
need to do is to set this new Kconfig and then check the "return" value
on CONFIG_CSPRNG_ENABLED: if the latter is set then the entropy driver was
enabled; if not something is preventing the driver from being used.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
The initial goal of CONFIG_CSPRNG_AVAILABLE was to declare that there was
an entropy node declared in the DT so that if CONFIG_ENTROPY_GENERATOR
was enabled, then the corresponding driver could be enabled.
This works in most of the cases, but not all. A counter example is the
"entropy_bt_hci" driver which is only enabled if CONFIG_BT_HCI_HOST is also
enabled. This means that in a build where the BT stack is not enabled
that driver won't be enabled even if the DT node is still present.
An example of this are the nrf5340[dk|bsim] boards.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
No need to use Posix eventfd API in core network code as zvfs_eventfd
is compatible with it and we can now avoid using Posix headers
unnecessarily.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use zu% format for size_t type.
Use d% format for int type.
Use u% format for uint32_t type.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Signed-off-by: Jony Zhang <jony.zhang@nxp.com>
Depending on the ring buffer configuration, users may encounter
the "size too big" assertion in runtime. Let's enable the
RING_BUFFER_LARGE when we know that it is required.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The UART device used by the backend needs to be gotten before use,
and put after. In limited cases, device drivers call
pm_device_runtime_get() as part of the call to uart_rx_enable(),
this is not the case for polling, nor interrupt driven API calls
for most if not all drivers, nor is that expected.
Implement pm_device_runtime calls in shell uart backend similar to
the logging uart backend to support all uart drivers in all
configurations.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
As midi2 is provided by networking subsystem it should not
depend on any features provided by Posix. Convert Posix poll
API calls to zsock poll ones. There is no functionality changes,
only naming changes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Corrected the RFC2131 section reference in DHCPv4 comments and help text.
The random delay before sending the initial DHCPDISCOVER message is
defined in Section 4.4.1 of RFC2131, not in 4.1.1 as previously stated.
Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
In rare occasions iface and TCP mutexes could cause a deadlock. As
notifying the interface readiness takes place just before the iface
mutex is released, it should be not harm to release it just before the
TCP is notified about interface going down to avoid the deadlock.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The current approach was buggy, for example the TCP context could be
unrefed twice in case of forced close. Or in case of a race, when the
application closed the socket first, the TCP context wouldn't be
dereferenced at all.
Calling the tcp_conn_close() unconditionally in case of forced close
solves all those issues.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A listening TCP context has no active connection therefore it has no a
second ref from the TCP stack. Thereby, when shutting down connections
when interface goes down, net_tcp_put() should not be called on a
listening socket to release the ref on the TCP stack behalf.
Instead, report the error via the registered accept_cb callback no
notify the application about the error, which should then close the
socket and release the associated TCP context.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Consecutive resource instance name should be encoded regardless of
whether timestamp is present or not.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Handling of CIS termination had several issues, most notably:
- it depended on allocating a termination node from the general rx
node pool, causing asserts if the pool was exhausted
- CIS established events was not always generated when required,
potentially causing CIS Centrals to get stuck without being able
to create any new CISes
- Cancelling a CIS Create procedure only worked correctly if the
CIS Create was currently active and happened to belong to the
same CIS
- CIG state handling often (always?) assumed a CIG with only one CIS
ll_conn_iso_stream now has a dedicated termination node, same as
ll_conn and ll_sync_iso_set
LLCP statemachine for Cis Create procedure has been reworked to ensure
a notification node for CIS Established is available as early as possible.
In addition, it should now always be sent when needed
Introduced ull_central_iso_all_cises_terminated() to check if all CISes
in a CIG has been terminated (or not created yet) - which is now
used for updating the CIG state
ull_cp_cc_cancel() now takes the CIS to cancel as an argument so
it doesn't end up canceling an entirely different CIS Create procedure;
In addition it now works for queued procedures as well
Flushing a (central) CIS Create procedure in LLCP will now properly
generate a CIS Established event (with an error)
Signed-off-by: Troels Nilsson <trnn@demant.com>