Commit graph

22,555 commits

Author SHA1 Message Date
Ashirwad Paswan
21da2d056d Bluetooth: Controller: Fix missing null pointer check
Added a check for null pointer in ull_sync_iso.c file
to avoid potential crashes.

Fixes: #81997

Signed-off-by: Ashirwad Paswan <ashi06712@gmail.com>
2025-10-01 08:27:33 +02:00
Charles Hardin
f06840221e net: dns: swallow packets that have no useful records in them
There are some poorly compliant mdns responders on the network
that will respond with zero counts on the answers and the additional
records (in addition to the qdcount). So, this removes the checks
in the unpack method since this is a "valid" DNS packet but the
logic is already partially handled in the dns_read code already.

An example packet can be seen in this decode

  0000   33 33 00 00 00 fb 9a f8 c3 0c 07 0b 86 dd 60 07   33............`.
  0010   c4 e4 00 14 11 ff fe 80 00 00 00 00 00 00 98 f8   ................
  0020   c3 ff fe 0c 07 0b ff 02 00 00 00 00 00 00 00 00   ................
  0030   00 00 00 00 00 fb 14 e9 14 e9 00 14 f1 64 00 00   .............d..
  0040   84 00 00 00 00 00 00 00 00 00                     ..........

  User Datagram Protocol, Src Port: 5353, Dst Port: 5353
    Source Port: 5353
    Destination Port: 5353
    Length: 20
    Checksum: 0xf164 [unverified]
    [Checksum Status: Unverified]
    [Stream index: 2]
    [Stream Packet Number: 1]
    [Timestamps]
    UDP payload (12 bytes)
  Multicast Domain Name System (response)
    Transaction ID: 0x0000
    Flags: 0x8400 Standard query response, No error
        1... .... .... .... = Response: Message is a response
        .000 0... .... .... = Opcode: Standard query (0)
        .... .1.. .... .... = Authoritative: Server is an authority
                              for domain
        .... ..0. .... .... = Truncated: Message is not truncated
        .... ...0 .... .... = Recursion desired: Don't do query recursively
        .... .... 0... .... = Recursion available: Server can't do
                              recursive queries
        .... .... .0.. .... = Z: reserved (0)
        .... .... ..0. .... = Answer authenticated: Answer/authority
                              portion was not authenticated by the server
        .... .... ...0 .... = Non-authenticated data: Unacceptable
        .... .... .... 0000 = Reply code: No error (0)
    Questions: 0
    Answer RRs: 0
    Authority RRs: 0
    Additional RRs: 0

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-10-01 08:20:34 +02:00
Seppo Takalo
dac7a0fe06 modem: cmux: Clean debugging a bit
Full CMUX frames are way too much to fill the debug log
so disable those by default.
Sometimes it is enough to see the CMD and response types, without
hexdump.
Added also debug messages for opening and closing events.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-09-30 17:57:40 +03:00
Grzegorz Swiderski
335e1c2a97 Revert "fs: zms: Add FLASH_MAP dependency"
This reverts commit 77f19eb1b5.

This dependency was misplaced. See the parent commit.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-09-30 15:29:59 +03:00
Grzegorz Swiderski
4a7126d457 settings: zms: Add FLASH_MAP dependency
The ZMS backend for Settings uses the `flash_area` API, which means it
requires CONFIG_FLASH_MAP to be enabled, so update Kconfig accordingly.
Note that ZMS itself does not depend on this.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-09-30 15:29:59 +03:00
Tomasz Chyrowicz
cbcf81e3a4 mcumgr: Enable permanent updates in overwrite mode
It is essential for the overwrite mode to allow confirming the secondary
slot to provide the permanent update.
This types of updates is the only mode in which the application may be
upgraded.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-09-30 15:29:33 +03:00
Tomasz Chyrowicz
2e0d9ed2cf mgmt: Add missing CONFIG_ prefixes
Fix the incorrect usage of Kconfig symbols and revert back the default
behavior to allow for non-active slot confirmation.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-09-30 15:29:33 +03:00
Loic Domaigne
bfbc6365ac Bluetooth: Controller: fix assertion check for ptc value
Fix the issue reported by Coverity CID 487708. The LL_ASSERT was
performed on lll->ptc, which is a 4-bit bitfield and therefore always
succeeds. Instead, the computation (lll->nse - nse) should be checked
to ensure it falls within the 4-bit value range before assigning it
to lll->ptc.

Signed-off-by: Loic Domaigne <tech@domaigne.com>
2025-09-30 15:28:36 +03:00
Tim Pambor
00a9905f83 usb: device_next: cdc_acm: init uart config from default line coding
Initialize the UART configuration from the default line coding
when the CDC ACM device is started. This ensures that the UART
configuration matches the default line coding until the host sets
the line coding for the first time.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-09-30 15:27:33 +03:00
Emil Gydesen
87e6bff4ef Bluetooth: CAP: Shell: Change to use default_unicast_group
Use default_unicast_group everywhere in the CAP shell, and mark
all creation of it as default_unicast_group.is_cap = true.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-30 11:02:29 +02:00
Emil Gydesen
ca80d25bd9 Bluetooth: CAP: Shell: Move ac_create_unicast_group to CAP
Move the function bap_ac_create_unicast_group to the CAP
shell, as that was the only user of it, and rename it to
cap_ac_create_unicast_group, and make it use the CAP API.

Also rename bap_unicast_ac_param to cap_unicast_ac_param

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-30 11:02:29 +02:00
Emil Gydesen
bf19edc8d8 Bluetooth: BAP: Shell add common unicast_group struct
Add a common unicast_group struct for both the BAP and
CAP shell, similar to the broadcast_source.

The purpose of this is to be able to use the appropriate type
for both the CAP and BAP shells, instead of using the BAP
unicast group for the CAP shell.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-30 11:02:29 +02:00
Seppo Takalo
b8541c53ee modem: modem_cellular: Allow PPP interface to wake up the device
Allow PPP device to wake up the underlying cellular modem.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-09-29 12:47:57 -04:00
Michael Zimmermann
9735cb313e net: mqtt_sn: handle timestamp being 0
When running just the test mqtt_sn_client::test_mqtt_sn_wait_suback on
native_sim, the current timestamp is still 0. That caused the test to fail,
because 0 is used as an indicator, that the message has never been sent,
thus sending it every time process_work is executed.

Instead of adding additional variables and complexity, the code now simply
treats now==0 special and waits 1ms until doing anything.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-29 12:45:15 -04:00
Michael Zimmermann
9b3b5b4447 net: mqtt_sn: scope msg_id to client instance
- The paho client does that, too.
- This allows running single tests, because they don't rely on previous
  ones having incremented the msg_id a certain number of times.
- The variable already existed in the client struct, but wasn't used. I
  guess it was intended that way but never implemented.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-29 12:45:15 -04:00
Michael Zimmermann
0e2e3c2ece net: mqtt_sn: implement predefined topics
Making the assumption, that mqtt_sn_connect does not process any incoming
data allows for this to be a very simple, additional API function instead
of adding more complexity to the connect function. This also means that the
user has to re-add predefined topics upon reconnects which don't reuse the
old session though.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-29 12:45:15 -04:00
Daniel Leung
cf7e2e63c1 soc: intel_adsp: rework host IPC using IPC service
This reworks the Intel audio DSP host IPC driver as a backend of
the IPC service. This is the first step to rework IPC in SOF
(Sound Open Firmware) into using a more generic IPC API instead
of a SoC specific one.

For now, it keeps the old interface to maintain usability
as it is going to be a multiple process to rework IPC
over there.

Also, the structure of the new IPC backend resembles
the SoC specific driver to make it easier to compare
between them at this first iteration. Future optimizations
will probably be needed once we start modifying the SOF
side to utilize the IPC interface.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-09-29 12:42:00 -04:00
Håvard Reierstad
ff17e601d0 Bluetooth: Host: Add userdefined fixed l2cap chans
Adds support for the user defining their own channels within the
fixed L2CAP channel range. To make this possible, the
`bt_l2cap_fixed_chan` struct and `BT_L2CAP_CHANNEL_DEFINE` macro
needed to converted to public API. In the process of doing so, the
`_destroy` parameter was removed from the `BT_L2CAP_CHANNEL_DEFINE`
macro as it was never used (fixed channels will not be destroyed over
the lifetime of the connection). `BT_L2CAP_CHANNEL_DEFINE` is renamed
`BT_L2CAP_FIXED_CHANNEL_DEFINE` to avoid confusion

The `bt_l2cap_chan_send` function is updated to be able to send data
on fixed l2cap channels.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-09-29 12:38:19 -04:00
Emil Gydesen
881a24270c Bluetooth: BAP: Rename and fix bt_bap_is_x_ep
Rename the bt_bap_is_x_ep functions to better match the
modules where they are implemented.

Additionally modify the check to use IS_ARRAY_ELEMENT
in the broadcast sink and source for a stricter check.
IS_ARRAY_ELEMENT cannot easily be used in the unicast
client and server, as the endpoints are part of another
structure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-29 12:38:06 -04:00
Emil Gydesen
6c1cd61792 Bluetooth: BAP: Add missing check for unicast server ep
We check for all other roles when checking whether
an endpoint can send or receive, except for the unicast server.
It is technically implied, but if the ep is not a valid pointer,
then we may access invalid memory.

Add check for bt_bap_ep_is_unicast_server (which uses the new
bt_ascs_has_ep function).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-29 12:38:06 -04:00
Emil Gydesen
55a72f6103 Bluetooth: CAP: Implement broadcast to unicast handover
Implement the broadcast to unicast handover procedure,
as per the Bluetooth CAP specificiation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-29 12:36:00 -04:00
Andrew Featherstone
d7176c729a tests: kernel: gen_isr_table: Add support for hazard3
Extend the gen_isr_table test to support the Hazard3 cores on the
RP2350A. This allows some testing when building and running using flash,
but it seems like Twister builds with different flags. It's unclear if
this is intended or not.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2025-09-29 12:30:28 -04:00
Robert Lubos
e27f8ccf91 net: context: Fix IPv4-to-IPv6 mapped sendto()
Commit 48897a9090 fixed the address
mapping for dual-stack sockets when sendmsg() was used, however the same
similar issue appears (cannot check for AF_INET family for mapped
addresses as those are AF_INET6) for regular sendto() calls.

Therefore, for the sendto() case, where dst_addr is specified, check if
the address is mapped with net_ipv6_addr_is_v4_mapped() function as
well.

This also fixes another bug in sendmsg() case, where msghdr->msg_name
could've been dereferenced even if it was NULL (for example in case
of a connected socket).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-09-29 09:58:06 +02:00
Jordan Yates
584aa3e342 testsuite: ztest: disable ZTEST_NO_YIELD for COVERAGE_DUMP
Don't enable `ZTEST_NO_YIELD` when `COVERAGE_DUMP` is enabled, since
this option spins forever at the end of `main`, while `COVERAGE_DUMP`
occurs after `main` returns into `bg_thread_main`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-26 09:35:41 -04:00
Jukka Rissanen
ed6b4a2abd net: websocket: Send CLOSE back to server when received one
When zephyr receives WS CLOSE, send it back to server and close
the TCP connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:35:24 -04:00
Jukka Rissanen
688bc4bf86 net: websocket: Fix the typo in function name
s/interal/internal/g

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:35:24 -04:00
Tomi Fontanilles
3ced42c5e5 secure_storage: remove experimental status
The subsystem has been out for a year.
It has been taken into use by various parties and has gone through
additional downstream testing.
It is considered stable and mature enough to not be experimental
anymore.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Tomi Fontanilles
fd0bf8b2f9 secure_storage: add version to psa_secure_storage Doxygen group
Align the version with the current latest published specification.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Tomi Fontanilles
98e48e8c90 secure_storage: document psa/error.h
Add Doxygen documentation to everything defined in this header file.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Tomi Fontanilles
03a349624a secure_storage: its: small language improvements to function comments
Minor tweaks for clarity.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Tomi Fontanilles
d38fb888a8 secure_storage: its: improve return codes
Instead of returning storage-related error codes, return ones which
make it clear that it's not about the storage itself.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Tomi Fontanilles
2cad6fab0b secure_storage: remove NULL pointer checks
It is the caller's responsibility to ensure pointers are valid.
Save on code size.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-09-26 13:24:06 +02:00
Iuliana Prodan
a795046143 ipc: move Open AMP from lib/ to subsys/ipc/
Moved the Open AMP code from lib/ to subsys/ipc/ to better
organize IPC-related components.

Updated build and config files to reflect the new location.

Adjusted path in MAINTAINERS.yml.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2025-09-26 13:22:55 +02:00
Heghedus Razvan
5430400579 shell: add option to toggle logs output
When logging through shell is enabled, it is inconvenient to use
the shell when there are logs coming in. Having a mechanism for
easy disabling/re-enabling the shell logs is a nice quality of life
feature.

To toggle the logs, `CTRL+T` combination can be used. This is
available only when meta key feature is enabled.

Signed-off-by: Heghedus Razvan <heghedus.razvan@protonmail.com>
2025-09-26 09:10:50 +02:00
Jukka Rissanen
c155dfa3a3 net: tcp: Print relative seq and ack numbers
It is easier to debug things when both the relative and absolute
TCP seq and ack numbers are printed in debug prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Jukka Rissanen
fe932ddbf0 net: context: Remember socket shutdown status
Use the socket eof flag to determine whether the receive
callback should be installed. If the receive cb is not installed,
then the socket cannot receive any data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Jukka Rissanen
a08d48ed19 logging: backend: net: Discard all received data from TCP or UDP socket
If there is received data in the TCP or UDP socket, discard it in order to
avoid leaking net_bufs because we are only sending data out and should
not receive anything.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Jukka Rissanen
f7c14319a3 logging: backend: net: Do not bind local socket
The logging net backend will send syslog messages to syslog server and
it is not meant to receive anything. If we bind to a local socket, it will
create UDP server socket that can receive data. Unfortunately there is no
one reading the data so we will eventually run out of memory in this case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-09-26 09:09:38 +02:00
Mark Wang
e82a9951e8 bluetooth: a2dp: fix spelling error of STEREO
change A2DP_SBC_CH_MODE_STREO as A2DP_SBC_CH_MODE_STEREO

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-09-26 06:40:29 +02:00
Cristian Bulacu
18f1abdc30 net: l2: openthread: Fix nat64 API compile warning
This PR includes OpenThread's NAT64 header file when
NAT64_TRANSLATOR is enabled. This is done to avoid compile
warnings when OT NAT64 API is used.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-09-25 14:18:45 -04:00
Declan Snyder
a4225b1ee8 pm: Add constraint lists and APIs
Some pieces of the system may have custom types of constraints that they
define based on different effects and reasons than just the standard
"zephyr,disabling-states". To avoid every single one of these component
reinventing the wheel, make some common APIs to handle these type of
custom constraint lists.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-25 14:18:05 -04:00
Declan Snyder
ae1f13149f pm: Extend pm notifier to be able to report substate
I am surprised this notifier didn't already report the substate id, it
seems important since different substate obviously are defined for a
reason, they can be having a different effect on the system.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-25 14:18:05 -04:00
Grzegorz Swiderski
620bf58a1e zms: Initial support for 64 bit IDs
Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t`
is added, so that the maximum ID width can be controlled using Kconfig.

The current ATE structure is already large enough that it is possible to
reserve 64 bits for IDs without increasing its total size (128 bits).
This makes the feature a natural, low footprint alternative to Settings,
for cases where the supported key namespace must be larger than 32 bit
but not arbitrarily large.

The ATE format does have to be altered to accommodate larger IDs, but
the default "32 bit" format is left as is. Now, the `struct zms_ate`
describes one of two supported formats, selected by an `#if` condition.
In the future, it may be possible to support multiple ATE formats at
runtime, in which case the structure can be turned into a union.

In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved
into a union, because they are found to be mutually exclusive. With the
old format, the same fields are in different locations, but one of them
always gets filled with a dummy value, depending on the given ATE type.
To cover both cases, a `memset` is used, which should be optimized away
by the compiler when appropriate.

The only limitation is that the new ATE format has no room for data CRC,
but an alternative integrity check can be implemented by the caller.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-09-25 14:17:24 -04:00
Yangbo Lu
dddb4a5a9d net: ethernet: drop duplicated bridge forwarding in TX
Ethernet TX should not handle bridge forwarding. The bridge layer
had already handled forwarding.

Current code is causing duplicated TX if sending is via bridge
interface, or causing needless TX on other bridge ports if sending
is via one bridge port.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-25 12:01:31 +01:00
Yangbo Lu
401cbbb6c5 net: bridge: fix pkt management during forwarding
There were several problems of pkt management during forwarding.

1. No need to do net_pkt_ref/net_pkt_unref around net_if_queue_tx.
2. Finally when completed forwarding, there was a net_pkt_unref for
   pkt using cloning. However it also applied to pkt not using
   cloning. This was causing pkt was released before sending.
3. Whether pkt cloning used or not, should not be decided by bridge
   interfaces count. It's should be decided by interface count to
   forward.
   An example was sending pkt via bridge interface. If there were
   two interfaces attached to bridge, cloning was needed but current
   code won't.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-25 12:01:31 +01:00
Emil Gydesen
a738b2641e Bluetooth: BAP: Add NULL check in bt_bap_stream_detach
If stream->ep is NULL, which is really shouldn't be,
then we should not attempt to dereference it.
Add simple NULL check to ensure behavior, and make
Sonarcloud happy.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-25 11:01:10 +02:00
Mike J. Chen
c6206c220d bluetooth: BAP: fix select bug
Change 4c86a5cc8d moved a select
from Kconfig.asc to Kconfig.bap (amongst some other changes
from select to depends), but inverted the PAC_{SRC,SNK} from
ASCS_ASE_{SRC,SNK} condition.

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-09-25 09:21:42 +02:00
Vinayak Kariappa Chettimada
15d3b57e90 Bluetooth: Controller: Fix inter-operability when BT_PHY_UPDATE=n
Fix inter-operability, when BT_PHY_UPDATE=n the feature bits
contained 2M and Coded PHY when Advertising Extensions where
enabled, and Central devices did not progress with any data
packet transfers when PHY_REQ was rejected as unknown PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-09-24 15:51:13 +01:00
Cristian Bulacu
4cec954e2b net: l2: openthread: Add DHCP6_PD, DNS upstream resolver and SRP server
- Initialize platform requirements and start OpenThread DHCP6_PD
  feature.
- Added initialization logic for DNS upstream resolver.
	OTBR message data structure has been updated to store a user data
	structure, if needed.
- Added SRP server initialization call.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-09-24 15:50:18 +01:00
James Roy
889a713ca2 subsystem: fs: Use better wrapper macros
Replace `DT_INST_PROP(inst, mount_point)` with
`FSTAB_ENTRY_DT_INST_MOUNT_POINT(inst)`.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-09-24 15:49:36 +01:00