Commit graph

22,555 commits

Author SHA1 Message Date
Daniel Mangum
2522bb0f1b net: support configuring offloaded network device as default interface
Adds Kconfig option for making an offloaded network device the default
interface.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2025-01-08 19:11:15 +01:00
Emil Gydesen
cc042a6a70 Bluetooth: Host: Refactor provacative comment
There is no reason to call people who disable
asserts for animals.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-08 07:51:17 +01:00
Emil Gydesen
e45830893f Bluetooth: CCP: Introduce new CCP API
The CCP API for the Call Control Profile works on top of the
TBS API, and will eventually replace parts of the TBS API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-08 07:50:32 +01:00
Martin Jäger
0a838bc000 task_wdt: Kconfig: Increase TASK_WDT_HW_FALLBACK_DELAY range
If a time-intensive task (like coredump storage over logging interface)
is run in the task watchdog callback, the hardware watchdog might
reset the system before the task finishes.

Increasing the delay from 1s to 10s, which should be sufficient for any
use case.

Signed-off-by: Martin Jäger <martin@libre.solar>
2025-01-07 20:34:41 +01:00
Dominik Ermel
bb0fa0746b stream_flash: Enforce size to be explicitly present on init
The commit changes requirements for stream_flash_init, where size
can no longer be 0 and has to be explicitly set, to avoid situation
where size autodetection, invoked by size == 0, would miss changes in
layout and silently allow overflow of Stream Flash into other partitions.

There has also been new Kconfig option CONFIG_STREAM_FLASH_INSPECT,
set to y by default to keep legacy behaviour, that can be used to turn
off stream_flash_ctx vs device inspection, allowing user to shed
inspection code once it is not useful anymore.

Fixes: #71042

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-01-07 15:56:49 +01:00
Dominik Ermel
ce971850fb storage/stream_flash: Initialize settings at point of use
The commit moves Settigns initialization out of stream_flash
initialization function into: stream_flash_progress_clear
 stream_flash_progress_load and stream_flash_progress_save.

This slightly increases code size (~56 bytes on Arm) but allows
to initialize Stream Flash even if Settings subsystem fails
to initialize and continue providing its basic functionality.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-01-07 10:10:15 +01:00
Triveni Danda
3a2a7c1855 net: ip: Add a name to existing Kconfig choice
Update kconfig choice name to enable overriding
from other parts of the code.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-01-07 08:08:58 +01:00
Emil Gydesen
a0b1e75268 Bluetooth: MPL: Fix build issues with the MPL shell
If logging (CONFIG_LOGGING) was disabled, then the shell
could not build. Ideally the (test) functions should not
depend on logging, but rather only CONFIG_BT_TESTING.

The shell commands were also properly guarded.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-07 00:27:17 +01:00
Matt Rodgers
b7b3449f48 net: websocket: don't mask data sent from server via zvfs write
RFC6455 section 5.1 specifies that "A server MUST NOT mask any frames
that it sends to the client". Implement this for websocket write calls
via ZVFS, by storing in the websocket_context whether a socket is acting
in the client or server role, and using this to determine if sent data
should be masked.

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2025-01-03 13:26:43 +01:00
Chaitanya Tata
b28f246f53 net: l2: wifi: Fix PHY rate display
The WPA supplicant already converts this to Mbps.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-01-03 11:39:13 +01:00
Jamie McCrae
5871037426 mgmt: mcumgr: grp: os_mgmt: Add error code for invalid responses
Adds a new error code that can be used to signify that a query was
valid but the response was not valid

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-01-03 10:02:23 +01:00
Kris Wolff
991fd8d4d5 net: dhcpv4: update DNS address assignment to be optional
The DHCPv4 options always assigns the DNS address if the router
provides one through the DHCP callback. There are times a developer
may not always want to assign the server from the router, but only
manually assign them. Adding a Kconfig option for assigning the DNS
address and defaulting to true to not interfere with previously
expected functionality.

Signed-off-by: Kris Wolff <kwolff@wavelynx.com>
2025-01-02 16:03:25 +01:00
Maochen Wang
f9901e8e9b net: sockets: change socketpair related buffer and heap size
Latest supplicant uses 1K buffer size for sending control message via
socketpair, so reducing the NET_SOCKETPAIR_BUFFER_SIZE to save memory
footprint. There are 4 socketpairs for supplicant only case, and 6
socketpairs for hostapd case, update the heap size correspondingly.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-01-02 12:35:46 +01:00
Vinayak Kariappa Chettimada
9678ff2041 Bluetooth: Controller: Include mem and ecb in-system tests
Include mem and ecb implementation in-system tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-01-01 02:04:33 +01:00
Vinayak Kariappa Chettimada
17846ed1f4 Bluetooth: Controller: nRF54L: Fix ecb tag name should be unique
Fix ecb tag name for violation to rule 5.7 (Tag name should
be unique) tag: ecb.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-01-01 02:04:33 +01:00
Vinayak Kariappa Chettimada
de13d36865 Bluetooth: Controller: Refactor isr_ecb and unit testing
Refactor the NRF_ECB isr_ecb function to reduce redundant
common code.

Updated the unit tests to use Bluetooth Specification
defined test vectors.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-01-01 02:04:33 +01:00
Vinayak Kariappa Chettimada
1dfebd6c1a Bluetooth: Controller: Add NRF_ECB crypto support in nRF54L15 SoC
Add NRF_ECB crypto support in nRF54L15 SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-01-01 02:04:33 +01:00
Simone Orru
354a47cfcf tracing: sysview: Clang-format tracing_sysview_ids.h
Run clang-format over the tracing_sysview_ids.h.

Signed-off-by: Simone Orru <simone.orru@secomind.com>
2024-12-30 17:32:03 +01:00
Simone Orru
f53aa42b8b tracing: Add calloc
Add the calloc tracing functions.

Signed-off-by: Simone Orru <simone.orru@secomind.com>
2024-12-30 17:32:03 +01:00
Xudong Zheng
6231a9ee19 fs: shell: Add configuration option for mount subcommand
The mount subcommand requires the heap to be present. Excluding it reduces
flash and RAM usage.

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2024-12-29 05:49:58 +01:00
Fabio Baltieri
5a8671e7ed usb: device_next: cdc_acm: set the thread name after initializing it
The cdc-acm workqueue thread name is set before initializing it right
now, which results in an empty thread name as apparently it gets cleared
by k_work_queue_init. Fix it by moving the thread name setting after the
workqueu is initialized and started.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-12-27 14:10:05 +01:00
Emil Gydesen
8c38d1b9a3 Bluetooth: TMAP: Add role validation for bt_tmap_register
Add validation that the device supports the role
set by bt_tmap_register.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-27 14:09:13 +01:00
Emil Gydesen
abe2e0df57 Bluetooth: BAP: BA: Add validation of add/mod src
The functions did not verify the provided parameters before
sending it as a control point operation.

This also fixes a bug where BT_BAP_BIS_SYNC_NO_PREF was not
allowed when pa_sync=0.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-27 14:08:57 +01:00
Emil Gydesen
2b197aff02 Bluetooth: BAP: Modify range of BT_BAP_BROADCAST_SNK_SUBGROUP_COUNT
The range of BT_BAP_BROADCAST_SNK_SUBGROUP_COUNT should be relative to
BT_BAP_BASS_MAX_SUBGROUPS. The broadcast sink depends on the scan
delegator, and thus it does not make sense for the broadcast sink
to support more subgroups than what the scan delegator supports.

Since this no longer relates to the number of streams, there
may be new runtime errors if applications attempt
to sync to more subgroups than the number of ISO channels
supported.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-27 12:36:40 +01:00
Henrik Brix Andersen
52abef2f54 usb: device: next: reduce log level for vendor requests
Reduce the log level from error to debug for received vendor requests.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-12-25 03:37:26 +01:00
Fin Maaß
b500f4c557 mgmt: hawkbit: use settings_save_subtree()
use settings_save_subtree() instead of settings_save() to
only save the hawkbit settings

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-25 03:37:14 +01:00
Théo Battrel
18c2ea2336 Tests: Bluetooth: Check GATT settings cleanup
Check that the GATT settings added when bonding to a peer and
subscribing to a CCC are correctly deleted when calling `bt_unpair`.

Testing hooks have been added in the Bluetooth settings abstraction
layer to know which key are being added/deleted.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-12-24 16:07:32 +01:00
Théo Battrel
65334e0104 Bluetooth: Host: Clear settings CF instead of CCC
`bt_gatt_clear_cf` was calling `bt_settings_delete_ccc` instead of
`bt_settings_delete_cf`. This was causing some settings to be left over.

Fix the issue by using the correct function.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-12-24 16:07:32 +01:00
Seppo Takalo
4a7ef5c010 net: lwm2m: Convert tickeless to use eventfd()
For waking up the poll() use eventfd() instead of socketpair()
so we save some buffer space and one file descriptor.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-12-24 13:54:39 +01:00
Make Shi
3f4ff78c1b Bluetooth: classic: Kconfig: set BT_RFCOMM_DLC_STACK_SIZE default 512
For the shell RFCOMM case, these is a stack overflow problem when do
disconnect, so need to increase the CONFIG_BT_RFCOMM_DLC_STACK_SIZE.
Set CONFIG_BT_RFCOMM_DLC_STACK_SIZE default 512.

Signed-off-by: Make Shi <make.shi@nxp.com>
2024-12-24 04:22:37 +01:00
Szymon Janc
eccd8adc68 Bluetooth: Host: Fix not sending Service Changed indication
gatt_unregister() clears handles if those were auto-assigned by host.
This resulted in Service Changed indication not beding sent since
call to sc_indicate() pass already cleared handles.

This was affecting GATT/SR/GAS/BV-01-C and GATT/SR/GAS/BV-07-C test
cases.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-12-23 17:10:28 +01:00
Øyvind Rønningstad
617df3b5c1 scripts: Remove zcbor requirement from requirements-extras.txt
lwm2m_README: Add instructions to install zcbor when needed

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-12-23 17:09:43 +01:00
Emil Gydesen
1f4ca01c86 Bluetooth: BAP: Fix BIS_Sync value in update_recv_state_base
The BASE doesn't affect the BIS sync value, and should thus not
change it.

This fixes a bug where the broadcast sink may prematurely
set the BIS sync value to e.g. 1 before actually
syncing to the BIG.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-23 13:23:47 +01:00
Fin Maaß
6dce233265 mgmt: hawkbit: use flash_area from flash_ctx
don't assume, that the slot to upload is the second.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-23 09:17:14 +01:00
Fin Maaß
49f5bc9698 mgmt: hawkbit: add callbacks for events
add callbacks for events.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-23 09:17:14 +01:00
Fin Maaß
a3acb67f62 mgmt: hawkbit: rename close to cancel
rename close to cancel, as it is more fitting.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-23 09:17:14 +01:00
Fin Maaß
fb573f5d64 mgmt: hawkbit: allow different tenants
allow the use of other tenants.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-23 09:17:14 +01:00
Fin Maaß
41f7ae9488 mgmt: hawkbit: use SMF
use smf for hawkbit.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-23 09:17:14 +01:00
Cory Andrew Mayer
58514c291c fs: nvs: Add recovery path for corrupted NVS
When all sectors have non-zero data, NVS would fail to init.
Add recovery path option to erase the all sectors and reinitialize.
This could occur due to non-empty sectors, or corrupted data.

Signed-off-by: Cory Andrew Mayer <corymayer@meta.com>
2024-12-23 09:15:48 +01:00
Mark Wang
19dee0e937 tests: bluetooth: shell: add a2dp new features test
add test for reconfigure, release, suspend, abort and disconnect.
app_config_req and app_reconfig_req always accept the req,
so don't need to handle reject case.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-12-23 09:15:35 +01:00
Mark Wang
70c73aa317 Bluetooth: A2DP: implement close, suspend and abort
implement avdtp close, suspend and abort and the a2dp
interfaces.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-12-23 09:15:35 +01:00
Mark Wang
6a6f2c2fca Bluetooth: A2DP: implement reconfig and optimize codes
Implement the bt_a2dp_stream_reconfig: Modify reconfig_req callback to
pass codec_cfg to application. Remove reconfig_rsp callback,
config_rsp is used. Remove reconfigured callback,
configured callback is used.

move the status to common struct bt_avdtp_req,
use same bt_avdtp_ctrl_params to process control-like avdtp
cmds (start, open etc), use the same a2dp_ctrl_ind to process
control-like cmds (start, open etc), use the same
bt_a2dp_ctrl_cb to process control-like cmds (start, open etc),
use the same bt_avdtp_ctrl to process control-like cmds
(start, open etc), optimize getting a2dp conn by index,
use sem to replace mutex and optimze the lock codes to be
based on context/instance.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-12-23 09:15:35 +01:00
Mark Wang
b8399c31a2 Bluetooth: A2DP: clang-format the codes
run clang-format

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-12-23 09:15:35 +01:00
Dominik Ermel
196fc5c36c storage/stream_flash: Make write callback optional
The commit adds Kconfig option CONFIG_STREAM_FLASH_POST_WRITE_CALLBACK
that allows to turn off support for callback invoked after data
is written to storage device.
If the feature is not used disabling it allows to save some storage.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-12-21 20:48:53 +01:00
Aleksander Wasaznik
e8c5405609 Bluetooth: Controller: Fix headroom reservation for ISO
Calling `net_buf_reserve` removed any previous reservation, which
includes the reservation by hci_ipc to hold the H4 type byte. This
resulted in a out-of-bounds net_buf_push in hci_ipc.

This commit also enables asserts in hci_ipc in the audio bsim test,
which reveal the out-of-bounds write.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-12-21 05:52:37 +01:00
Make Shi
14e9840a4b Bluetooth: Shell: BR: channel is not used in register command
Cmd_register uses a fixed channel as the rfcomm channel. Cmd_register
doesn't require parameters for channels.

Signed-off-by: Make Shi <make.shi@nxp.com>
2024-12-20 16:06:26 +01:00
Adam Wojasinski
690a854c7c net: lib: ptp: Fix array boundry check in PTP Port initialization
Before it was possible to overrun array by one element.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-12-20 16:06:17 +01:00
Adam Wojasinski
c6d6a3c27c net: lib: ptp: Fix wrong type casting in potential overflow
Previously added type casting was still causing coverity to complain.
This time casting multiplication before bitshift operation.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-12-20 16:06:17 +01:00
Adam Wojasinski
1946e04756 net: lib: ptp: Fix potential NULL dereference in transport prot addr
Retreiving IP address from the networking interface assigned to
a PTP port could result in NULL dereference or undefined behaviour
when passing NULL to `memcpy()` function. Added check on addresses
returned from functions retreiving IP address from an interface.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-12-20 16:06:17 +01:00
Emil Gydesen
6bcfdaf37a Bluetooth: ISO: Add support for cis_established_v2 in host
Add support for the bt_hci_evt_le_cis_established_v2 event in
the host.

This provided additional information to the host and application
about the CIS paramters. Especially the peripheral gets new an
important information such as the SDU size and interval.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-20 10:19:23 +01:00