Commit graph

22,555 commits

Author SHA1 Message Date
WenBin Zhang
d01edb10e1 tracing: Fix k_mem_slab_free tracing systemview
Fix k_mem_slabe_free tracing error.

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-07-31 10:53:30 +01:00
Hui Bai
1198d78898 hostap: Update 11k roaming mechanism
With this changes, device will check if AP support Neighbor Report or
not before trigger roaming. No need to issue 11k command to enable 11k,
if AP supports Neighbor Report, device will trigger 11k roaming with
priority.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2025-07-31 10:53:19 +01:00
Flavio Ceolin
56e2b01e53 bt: controller: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-07-31 10:52:49 +01:00
Flavio Ceolin
4ae867b12d bt: audio: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-07-31 10:52:49 +01:00
Flavio Ceolin
39cf9bd0c0 net: ip: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2025-07-31 10:52:49 +01:00
Flavio Ceolin
1ccf9391bc shell: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2025-07-31 10:52:49 +01:00
Flavio Ceolin
805701da49 bt: host: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio.ceolin@gmail.com>
2025-07-31 10:52:49 +01:00
Luis Ubieda
d3628fc284 rtio: multishot: Stop resubmitting multishot items on error
As an error-handling strategy. The client then can recover from this
depending on the error and the number of occurrences.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-07-31 10:52:08 +01:00
Luis Ubieda
7b4644cb50 rtio: executor: split handling of one-shot and multi-shot completions
As their handling is not that similar and mixing them both affects
code readability. This patch does not affect functionality and does
not break any testsuite under rtio API.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-07-31 10:52:08 +01:00
Luis Ubieda
5505182b43 rtio: Assert multishot flag is not combined with txn or chained
There's no use-case covering this case and enforcing it will allow
simplify the logic for processing items with each of these items when
mutually exclusive.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-07-31 10:52:08 +01:00
Andrey Dodonov
286362087d net: http: service: extend HTTP service with config
Update the HTTP service API to allow setting per-service configuration,
currently it is only custom socket creation callback,
but in the future it can be extended with other parameter

Signed-off-by: Andrey Dodonov <Andrey.Dodonov@endress.com>
2025-07-30 17:32:43 -04:00
Bjarki Arge Andreasen
cd16d17dca pm: device: introduce pm_device_driver_deinit()
Introduce pm_device_driver_deinit() which is required to fully
support device_deinit(). This function shall be called by drivers
when device_deinit() is called.

If PM_DEVICE is enabled, it will
simply check whether the device is either SUSPENDED or OFF, this
will prevent device_deinit() on a device which is currently in
use, and ensure the device is in the correct state if device_init()
is called later.

If PM_DEVICE is not enabled, it will invoke the SUSPEND action which
mirrors the pm_device_driver_init() behavior. Note that TURN_OFF
action is not called since the device is deinitialized after this
call.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-29 22:56:02 -04:00
Yago Fontoura do Rosario
d3cc63ac71 Bluetooth: PACS: Fix duplicated entries in client list
The client list is filled from the bonding table at registration
but this should only be done once like the callback registration

Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
2025-07-29 11:21:58 +01:00
Lyle Zhu
af42036ca6 Bluetooth: Classic: SDP: Improve UUID 128 support
In current implementation, the UUID 128 is not well supported. The
found issue includes,
Issue 1: No clear byte order of the UUID 128 in local SDP record.
Issue 2: No clear byte order of the UUID 128 of the SDP discover
parameter.

For issue 1,
Add the description to note that if the SDP attribute type is
`BT_SDP_UINT128`, `BT_SDP_INT128`, and `BT_SDP_UUID128`, the byte
order should be little-endian.

And swap the 128bit from little-endian to big-endian when responding
the peer SDP discovery request.

For issue 2,
Add the description to note that if the SDP discovery type is
`Service Search` and `Service Search Attribute`, and UUID is UUID 128,
the passed UUID data of the discovery request parameter should be
represented as the little-endian byte-order sequence.

And swap the 128bit from little-endian to big-endian when packing the
SDP discovery packet.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-07-29 11:21:37 +01:00
Tomasz Moń
223d23a34d usb: device_next: uac2: Double buffering on feedback endpoint
Enable double buffering on isochronous feedback endpoint to avoid
sending ZLP instead of feedback information.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-07-29 11:20:56 +01:00
Tomasz Moń
f9ac3181ff usb: device_next: uac2: Do not leak buffer on failed enqueue
Release receive buffer on failed endpoint enqueue.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-07-29 11:20:56 +01:00
Tomasz Moń
2f343bf572 usb: device_next: uac2: Double buffering on data OUT endpoints
Enable double buffering on data OUT endpoints to allow USB stack to
enqueue next transfer as soon as possible. This is especially useful
when operating at High-Speed where there is significantly less time
between subsequent SOF packets.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-07-29 11:20:56 +01:00
Tomasz Moń
673f32428c usb: device_next: uac2: Remove unnecessary plus signs
Change the macros to have only one plus operator per term. This is
purely stylistic change, no functional changes.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-07-29 11:20:56 +01:00
Yusuke Omae
bd432c2727 net: gptp: add missing stepsRemoved assignment
The stepsRemoved of masterPriorityVector was
left unassigned when the best_port is not itself.

Signed-off-by: Yusuke Omae <s1413091@gmail.com>
2025-07-29 11:20:32 +01:00
Robert Lubos
279de669b5 net: lwm2m: Stop the LwM2M engine in case of fatal network error
In case of fatal network error (i.e. when the LwM2M client runs out of
retries), call lwm2m_engine_stop() to cleanup any allocated resources
for the client. The engine is dead at that point anyway so the
application needs to recover.

If this isn't done, it is theoretically possible to restart the LwM2M
client (with lwm2m_rd_client_start() which does not report an error in
such case), which in turn could lead to resource leaks (like for
example the observer list is reinitialized) if the application
didn't call lwm2m_rd_client_stop() first. Calling lwm2m_engine_stop()
ensures that all resources are freed even if the application doesn't
call stop before restarting.

Stopping the engine is also needed when the network error occurs when
de-registering - in such case the engine goes straight into the IDLE
state, where it's possible to restart the client and thus reinitialize
the observer lists.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-29 11:18:36 +01:00
James Roy
2ebf82ca5f subsystem: usb: device_next: Fix unchecked return value in usbd_cdc_ecm
Fix unchecked return value scanned by Coverity.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-07-29 11:18:20 +01:00
Emil Gydesen
220571efcb Bluetooth: CCP: Check conn type before access by index
Ensure that the connection type of the provided bt_conn is
an LE connection.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-07-28 16:45:17 -04:00
Emil Gydesen
0347d92072 Bluetooth: BAP: SD: Add missing error checks for mutex locks
Add missing error checks for mutex locks after the mutexes
were changed to not use K_FOREVER which should not be done in
the BT RX thread.

A larger overhaul of how mutexes are using within the scan delegator
should be considered, as there are a lot of locks and unlocks when
handling the callbacks.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-07-28 16:44:58 -04:00
Cheng Chang
afcce53220 bluetooth: host: a2dp:error_code should be detailed in set_config_rsp
Error codes fall into two main categories:
case 1: NOT_SUPPORT_XXX. This means that the configuration of the
parameter is not supported locally.
case 2: INVALID_XXX. This means that the parameter is not configured or
duplicated in the set_config_req command.

Currently the protocol only supports SBC, so it is only checked for SBC
parameters.

Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
2025-07-28 16:43:29 -04:00
Cheng Chang
f4153476cd bluetooth: host: a2dp: Fix null ops before calling configured callback
If stream->ops is NULL and not checked, it works fail.

Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
2025-07-28 16:40:39 -04:00
Jukka Rissanen
ec4d6786fd tests: net: ipv6: Test packet queing when sending NS
Add tests to make sure that if neighbor cache does not contain
info for neighbor link layer address, we can queue packets
and re-send them when the neighbor cache contains the data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-07-28 08:53:19 -04:00
Jukka Rissanen
31329e6acb net: ipv6: Allow NS timeout to be configured
Allow user to configure how long to wait for neighbor
advertisement.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-07-28 08:53:19 -04:00
Jukka Rissanen
255253b108 net: ipv6: Add packet queueing while waiting NA
If we do not know the neighbor link address, we need to send
neighbor solicitation message to net. While waiting neighbor
advertisement, there might be other packets that we want to
send to that neighbor. Queue those packets so that all of them
can be sent when NA message is received.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-07-28 08:53:19 -04:00
Cheng Kai
cf61573ce9 Bluetooth: L2CAP: add br l2cap unregister interface
It needs to do l2cap unregister operation from app

Signed-off-by: Cheng Kai <chengkai@xiaomi.com>
2025-07-28 08:52:01 -04:00
Sean Madigan
3adae8bd9a bluetooth: host: Add support for extended feature set feature
This commit adds support for the extended feature set
feature. This includes:
- hci boilerplate
- kconfigs, including one for a max local feature page
- reading remote features is done by a command and callback
- this is not linked into the auto feature request on
connection as this procedure can take quite a few connection
events, and we do not want to delay the user
- added the commands to the bt shell

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2025-07-28 08:48:30 -04:00
Sean Madigan
cddea431eb bluetooth: host: hci_core: allow both orders of version and feature events
Previously, the version complete event had to come after
the remote feature complete event for the notify_remote_info
function to be called.

This becomes less practical when adding the read all remote
features complete event, as this can take some time. Meaning
the order of events is not predictable.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2025-07-28 08:48:30 -04:00
Gang Li
84d4592373 net: l2: wifi: add wifi config command
- Added "wifi config" command.
- Add OKC parameter to "wifi config" command.
  Set okc to 1 to enable opportunistic key caching.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2025-07-28 08:46:37 -04:00
Vinayak Kariappa Chettimada
5b1c209498 Bluetooth: Controller: Add missing atomic_get call
Add missing atomic_get call to access atomic value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-28 08:45:59 -04:00
Vinayak Kariappa Chettimada
0a2934d1d2 Bluetooth: Controller: Fix assertion in ull_conn on HCI Reset
Fix assertion in ull_conn under race between connection
termination and processing of HCI Reset command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-28 08:45:47 -04:00
Vinayak Kariappa Chettimada
e1541cc712 Bluetooth: Controller: Fix ULL Tx Ack index corruption under race
Fix ULL Tx Ack FIFO's first index being advanced beyond a
recorded ack_last value in a node_rx when under race.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-28 08:45:33 -04:00
Robert Lubos
d93c5d6072 net: tcp: Fix handling of keep-alive probes
Keep-alive probes have seq number set to SND.NXT - 1 and may or may not
contain an octet of data. The latter case was not handled properly
therefore add a special case when validating seq number to response to
keep-alive probes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-28 08:44:41 -04:00
Fengming Ye
6e079f3ed6 net: wifi: fix 11k cannot be set before connection
Support the case that 11k parameter can be set before wifi connection.
This field should not be cleared by connection.
Neighbor report will be cleared before start_roaming.
So wifi_connect don't need to clear 11k params.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2025-07-28 08:39:39 -04:00
Victor Brzeski
c0e1268d9f usb: device_next: hid: Fix endpoint address getters
This commit resolves a bug where the USB Endpoint
provided by the HID driver was incorrect when in
High Speed mode.

Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>
2025-07-27 17:57:05 -04:00
Anas Nashif
a096b34835 tracing: ctf: trace k_sleep()
Trace sleep events in CTF:

[19:00:00.181375400] (+0.000044700) k_sleep_enter: ...
..
[19:00:00.290203800] (+0.000031500) k_sleep_exit: ...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-25 23:29:14 +02:00
Ajay Parida
c70b3504bb net: l2: wifi: Configure BSS max idle period
Support to configure BSS max idle period at runtime.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Triveni Danda
3f037430b6 net: l2: wifi: Refactor certificates processing code into common file
Refactor certificate processing code to eliminate duplication and
enable reuse across modules that require enterprise support.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Kapil Bhatt
fbd34dac0f wifi: Fix fractional part of Tx rate by converting to float
The Tx rate was previously stored as an integer, which caused loss of
precision for rates like 8.6 Mbps or 34.4 Mbps due to integer division.
The change will update data type to float.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Jeremy Bettis
aab1dc6858 shell: Restore uninit_cb that was lost in #93154
The sh->ctx->uninit_cb needs to be set before posting the
SHELL_SIGNAL_KILL to the event, like the k_poll based code did prior to

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2025-07-25 17:02:31 +01:00
Aleksandr Khromykh
c02ec1f645 bluetooth: mesh: remove persisted psa key if mesh does not own it
Commit adds destruction of the persisted in PSA ITS key if
mesh does not own it (zero bit in the bitmap of persisted keys).

This is not standard mesh behavior, but might happen
if something happens between removing key data in mesh and
in the crypto library (for example power off in bettwen).

Previously, mesh wasn't able to import key with gotten stuck
key id. The current fix reproduces more robust behavior.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-07-25 08:17:24 -04:00
Alexander Paschoaletto
8c03410af0 tracing: msgq: adding dedicated tracing for k_msgq_put_front
This commit adds the tracing macros and functions related
specifically to the k_msgq_put_front API.

Signed-off-by: Alexander Paschoaletto <axelpinheiro@gmail.com>
2025-07-25 08:16:58 -04:00
Omkar Kulkarni
602fd0d889 Bluetooth: Mesh: Blob Server considers friendship
Fix Max Chunk reporting during Block_Information_Get:
If friendship is established, then max possible chunk size for transfer
is reported according to friend's queue size.

ChunkSize = (FndQ sz * Bytes per seg (12)) - Opcode(1) - Chunk_Num (2)-
            8 byte MIC (max)
	  = (FndQ sz * 12) - 11

This allows all segments of Chunk_Transfer messages to fit in a friend
queue. If this is not done, friend queue keeps overflowing
systematically causing unstable PULL_MODE transfers.

Fix Chunk requests:
Adapt number of requested chunks according to current friend queue size.
If friend queue is too small, at least 1 chunk is requested.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2025-07-25 08:14:26 -04:00
Tom Burdick
be4c3804de rtio: Fix syscall verify misra-c:2004 12.4 issue
MISRA-C says the right hand of a logical and should not contain side
effect operations. Instead nest the branches to get the same logic
without the MISRA-C rule breakage.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-07-25 08:09:41 -04:00
Lorenz Clijnen
be38568577 net: openthread: Fix build with CONFIG_OPENTHREAD_INTERFACE_EARLY_UP
When building with CONFIG_OPENTHREAD_INTERFACE_EARLY_UP enabled,
`is_up` is undefined (since 596844a).

Signed-off-by: Lorenz Clijnen <github@lorc.be>
Signed-off-by: Lorenz Clijnen <l.clijnen@edna.eu>
2025-07-24 17:01:59 +01:00
Robert Lubos
1e77663c87 net: lwm2m: Optimize value attributes verification
As lwm2m_notify_observer_path() now reads attributes for the updated
resource, value_conditions_satisfied() does not need to read the
attributes again, it can just reuse the already available data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 17:01:07 +01:00
Robert Lubos
b633f3a9de net: lwm2m: Verify pmin for updated resource on notify check
When updating a resource, the LwM2M library verified pmin attribute on
all resources/objects in the observer path list and chose the smallest
value. While this make sense for determining the lower-boundary for the
next notification time, it could lead to unnecessary notifications being
generated too early if the updated resource had a higher pmin value
configured on it.

Therefore, when checking notification criteria for an updated resource,
check the pmin value for that resource path and if set and higher than
the lowest pmin value evaluated for the observer list, use it instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 17:01:07 +01:00