In current implementation, if the response total data length is more
than the receiving buffer size, the request cannot be completed
properly.
Improve the SDP client with the following changes,
o Notify the received completed SDP records if the case occurs, and
then start the continuing SDP discovery,
o Stop the SDP discovery if the hold SDP record cannot be saved to the
receiving buffer,
o Stop the SDP discovery if the `BT_SDP_DISCOVER_UUID_STOP` is
returned by upper layer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In current implementation, after parsing the received service search
pattern and all matched SDP records are saved in the local variable
`matching_recs`. The max count of SDP records within its SDP
database that match the given service search pattern is
BT_SDP_MAX_SERVICES when parsing the received Service Search Pattern.
And it causes the max count registered SDP records is limited to
BT_SDP_MAX_SERVICES.
Refactor the parsing of service search pattern to remove the
limitation with the following steps.
1. Save the service search pattern to a simple buffer by calling
the function `parse_service_search_pattern()`.
2. Traverse all registered SDP record and check for each SDP record
if it is matched with given service search pattern by calling
function `service_search_pattern_matched()`.
3. Use the matched SDP records to response the SDP request.
And also remove the limitation of the max count of registered SDP
records.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Use slist instead of custom singly linked list to manage SDP records.
Check if the SDP record has been registered in the function
`bt_sdp_register_service()`.
Append the new SDP record to the tail of the SDP record list.
Check if the index of SDP record is overflow in the function
`bt_sdp_register_service()`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Migrate support from crc library to new crc subsystem
Add hardware acclerator backend for crc subsystem
Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
Fix incorrect LLL scheduling of subsequent subevents when
using single timer implementation, due to missing call to
accumulate the last PDU end timestamp which is essential to
setup next radio start and to setup header complete timeout.
Relates to commit 373dc0db71 ("Bluetooth: Controller:
Single timer use Extended Advertising nRF54L support").
Relates to commit 6e8f081385 ("Bluetooth: Controller: Fix
peripheral assert under single timer use").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Only upload to `slot1_ns_partition` if we're building for TF-M nonsecure
and we're doing split images. Single images need to upload to the whole
`slot1_partition`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
This default value 2 of WIFI_NM_MAX_MANAGED_INTERFACES
ensures WiFi network manager can properly handle both
access point and station interfaces.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
The bt_csip_set_member_unregister function unregisters
a CSIS instance and restores the attributes to the original
state (the attributes may change during registration).
The previously solution had some issues with a check when
using picolib (‘__ssp_bos_check3’ undeclared), and this
fixes that by using a proper variable for the memcpy.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of re-implementing or assuming that POPCOUNT is available
we now use the generic function from Zephyr.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the big_disconnect function to do cleanup_big before
calling the `stopped` callback. This will allow the ISO channels,
as well as the BIG itself, to be reused for other purposes directly
in the stopped callback, without having to offload such actions
to a separate thread.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a new ec_host_cmd backend based on USB. The backend uses the new USB
device stack.
The backend implements a vendor-specific (Google) USB interface. It uses
three endpoints:
- bulk OUT to transfer a host command request
- bulk IN to transfer a host command response
- interrupt IN to signal an event and readiness of the response
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
move variable declaration out of if,
because it will be optimized away, when
optimisation is enabled and leads to
undefined and unwanted behavior.
In my case `send_buf` of `http_client_req`
was put at the same address and the
http request was malformed.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Do not directly include and use APIs from ksched.h outside of the
kernel. For now do this using more suitable (ipi.h and
kernel_internal.h) internal APIs until more cleanup is done.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adds a function that verifies if an endpoint pointer is
part of ASCS before performing CONTAINER_OF operations on it.
Adds checks for this in the BAP Unicast server public API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_ascs_ase_status was stored directly in the
struct bt_bap_ep, which was an issue as
bt_ascs_ase_status is a variable sized struct.
The struct could have been moved to the end of
bt_bap_ep to avoid the issues it caused, but
there is no actual reason to use that struct
rather than storing the ID and state as
seperate values.
The ascs_ep_get_state exists but was not widely
used in ascs. Modify places to use the function
instead of directly accessing the state.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
CTF tracing relies on all packet timestamps being increasing- if a
timestamp of a later packet is less than the prior packet, the CTF
parser assumes the timestamp field has overflowed and adds to the
overall timestamp to account for this.
When taking a timestamp for a CTF packet, it was possible for an interrupt
to occur before the packet was submitted to the tracing core framework
but after the timestamp was generated. The interrupt itself would
generate a tracing event with a later timestamp then the packet in
question, leading to the packets being recorded out of order.
To resolve this, take an IRQ lock before generating the timestamp and
release it after submitting the packet to the tracing core.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
This moves the declaration of the utf8 utils defined in lib/utils/utf8.c
in their own header. Main reason to do this is that the current setup
requried adding an include for sys/types.h in util.h, which can result
in a build falure due to a circular header depdenecy when using:
CONFIG_POSIX_API=y
CONFIG_NEWLIB_LIBC=y
_GNU_SOURCE
the loop and error are:
- include/sys/types.h:50: <- this is a NEWLIB one
- include/zephyr/posix/sys/select.h:9:
- include/zephyr/posix/posix_types.h:30:
- include/zephyr/kernel.h:17:
- include/zephyr/kernel_includes.h:25:
- include/zephyr/sys/atomic.h:18:
include/zephyr/sys/util.h:705:1:
error: unknown type name 'ssize_t'
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Some applications might require cleanup prior to performing a system
reboot. Add an option that disables hawkbits automatic reboots so that
it can be postponed until the application is ready.
Signed-off-by: Mandus Börjesson <borjessonmandus@gmail.com>
Fix missing ISO Receiver access address capture that caused
ISO PDU reception error. Missing access address capture for
subsequent subevent when prior subevent did not have an
anchor point sync prevent proper drift compensation hence
causing ISO PDU reception error for the entire BIG event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the jitter considered in the PDU reception in the
subevents of ISO Sync Receiver to not exceed such that the
reception is scheduled late (causing assertion).
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
RFC4330 section 10 states:
A client MUST NOT under any conditions use a poll interval less then 15
seconds.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
sdp matching_recs maybe filled with uninitialized record. if
sdp_svc_search_req come from remote with invalid max_rec_count,
which is greater than num_services, matching_recs would response
uninitialized record result.
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
ARM CMSIS 6 has different ITM and TPI register definition comparing
with CMSIS 5. Update the swo initialization to use CMSIS 6 defines.
For the Cortex-M cores which are higher than Cortex-CM7, the LAR
has been removed from ITM.
Signed-off-by: Aaron Ye <aye@ambiq.com>
Introduce a new Kconfig option CPU_CORTEX_A78 to enable support for the
Arm Cortex-A78 CPU architecture within Zephyr. This configuration can be
selected by boards or SoCs that utilize the Cortex-A78 core, enabling
architecture-specific features and optimizations as needed.
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
Hide the mutex lock details inside a wrapper call, like done for the
device stack API. This is not used for the per-device lock of the host
stack which use a different mutex lock.
Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
In the while loop parsing descriptors, check that the descriptor is past
the end just before dereferencing it to check if it is seemingly valid.
Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
Make the struct name match the device naming for ease of use, although
slightly longer name. Propagate the change to the subsystem, includes,
tests and samples.
Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
Commit 39cb574 changed the log level from LOG_DBG to LOG_ERR in
bt_le_adv_resume(). This causes the error log
"No valid legacy adv to resume" to appear during normal connection
establishment when using bt_le_ext_adv_start(), even though the
system is functioning correctly.
Revert the change to restore the original LOG_DBG level.
Fixes: #94954
Signed-off-by: Samuel Tsai <stsai@atmosic.com>
If the cmd fail to receive response (for example: timeout), the buf is
NULL, then need to callback the result.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
If pm action fails within put_sync_locked, usage count should be
reset to reflect the state of the device.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Add a CPU frequency scaling subsystem, allowing a policy
algorithm to control the frequency of a given SoC/MCU
automatically at runtime.
Implement a basic, "on-demand" policy algorithm which
iterates through the P-states supported by the SoC and
selects the first P-state where it's trigger threshold is
less than the CPU load.
The CPU frequency scaling subsystem does not currently
support SMP. The CPU load measurement can be made to support
SMP since statistics are measured from the scheduler.
Co-authored-by: Eric Hay <Eric.Hay@analog.com>
Signed-off-by: Sean Kyer <Sean.Kyer@analog.com>
Implement CPU load measurement subsystem. The statistics
used to calcualte the load are taken from the scheduler.
Specifically, the number of cycles used by the idle thread.
Co-authored-by: Sean Kyer <Sean.Kyer@analog.com>
Signed-off-by: Eric Hay <Eric.Hay@analog.com>
Rate limit the get_recv_buf() callback from the application to
reduce system trash when buffer pressure gets high.
Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>
Adds support for images signed with SHA512.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Used simple vlanX for vlan interface name. What interface the
vlan interface was attached to could be checked by "net iface"
or "net vlan".
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
There were two problems about vlan interface naming currently.
1. When there were more than 1 vlan interfaces. It's not able to
initialze name for all of them to same name VLAN-<free>.
2. When enabled vlan with tag, the name VLAN-xxx was used.
However we may need to support multiple physical interfaces
in the future. So, it's not able to use same name VLAN-xxx
either for same tag on different physical interfaces.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Add support for setting and getting the bearer provider
name. For now the name will be duplicated by the TBS
implementation, but will be optimizied in the future
so only one copy of the name exists.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The interface descriptor and its associated string descriptor are shared
between different speed configurations. Do not try to add a string
descriptor if it has already been added and the index is not zero.
Similar to commit ec851ba7c7
("usb: device_next: avoid false error logging in CDC ACM").
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>