Commit graph

21541 commits

Author SHA1 Message Date
Lars Knudsen
e0a262b33f Bluetooth: Audio: Fix initial Broadcast source values
If the Broadcast ID is initially set to 0x000000,
which is valid, comparison logic on add of an
actual Broadcast ID of 0x000000 fails.

Likewise for SID.

Moving INVALID_BROADCAST_ID define to bap.h

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-10-14 13:04:31 +02:00
Christoph Seitz
74ca0a499a net: ethernet: Add 2.5G and 5G hardware capabilities.
Add the 2.5G and 5G link speeds as possible capabilities
to ethernet drivers.

Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
2024-10-14 13:02:50 +02:00
Christoph Seitz
2dca6d64c7 net: shell: Add missing hw_cap strings.
Two ethernet capabilities were missing. Added them to allow
the 2.5G and 5G strings to appended.

Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
2024-10-14 13:02:50 +02:00
Robert Lubos
c4803752a8 net: Deprecate CONFIG_NET_SOCKETS_POLL_MAX
CONFIG_ZVFS_POLL_MAX is now used to control the maximum number of poll()
entires. Thereby, CONFIG_NET_SOCKETS_POLL_MAX is redundant and shall
be deprecated.

Modify the defaults for NET_SOCKETS_POLL_MAX and ZVS_POLL_MAX so that
the deprecation actually makes sense instead of symbol removal. In case
the application still sets the old config, it will modify the
ZVS_POLL_MAX default.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-14 13:01:51 +02:00
Chris Friedt
b3d3d4fff7 net: sockets: move select() implementation to zvfs
Move the implementation of zsock_select() to zvfs_select(). This
allows other types of file descriptors to also make use of
select() functionality even when the network subsystem is not
enabled.

Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-14 13:01:51 +02:00
Chris Friedt
881dc1fa7a net: sockets: move poll implementation to zvfs
Move the implementation of zsock_poll to zvfs_poll. This allows
other types of file descriptors to also make use of poll()
functionality even when the network subsystem is not enabled.

Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-14 13:01:51 +02:00
Yonatan Schachter
00800d4818 bindesc: Add support for reading binary descriptors
This commit adds support for reading and parsing binary descriptors.
It can be used for reading the descriptors of another image, or for
iterating over one's own descriptors.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Yonatan Schachter
fd68fc486c bindesc: Add maximum data size and assertion
Add a Kconfig symbol to limit the maximum size of a descriptor's
data, enforced by a build assertion.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Yonatan Schachter
c8c25b5c52 bindesc: Fix placing of the descriptors end tag
Prior to this fix the descriptors end tag was placed in the binary
using LONG. This was wrong because the tag is of type short, and
the size of the descriptor (0), should have also been placed.
It so happened that on little endian machines the incorrect linker
script yielded correct results, as the extra zeros added to make
the value a long ended up as the correct byte sequence
(FF FF 00 00). On big endian machines however, the wrong sequence
is generated (00 00 FF FF).
This patch correct this issue.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Jordan Yates
a1d6f8081a fs: fatfs: additional ELM FAT options
Make additional ELM FAT library options configurable to the user.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-11 13:20:08 -04:00
Jordan Yates
4235dbfd2b fs: fatfs: add missing dependency
Add a missing dependency on `!FS_FATFS_READ_ONLY`` for `FS_FATFS_MKFS`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-11 13:20:08 -04:00
Jamie McCrae
646f116cca mcuboot: Add support for RAM load mode
Adds supporting code that allows the RAM load mode of MCUboot to
be used and for applications to build successfully with it.
Sysbuild can be used to build images for this mode

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-11 13:19:39 -04:00
Marek Pieta
341f1f502d bluetooth: conn: Use a separate workqueue for connection TX notify
Use a separate workqueue instead of system workqueue for connection TX
notify processing. This makes Bluetooth stack more independent from the
system workqueue.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2024-10-11 13:16:26 -04:00
Vinayak Kariappa Chettimada
ad6c0512ad Bluetooth: Controller: Fix CIS payload count under skipped events
Fix CIS payload count calculation under skipped events that
caused CIS disconnection with reason MIC failure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-10 20:23:36 -04:00
Kevin ORourke
3399e0614a shell: backend: telnet: Don't assert if connection closed
The code in shell_ops.c that calls telnet_write will assert if it
returns non-zero. For a telnet shell it's normal that the
network might disconnect unexepectedly, so that should not
trigger an assert.

Fixes #67637

Link: https://github.com/zephyrproject-rtos/zephyr/issues/67637

Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
2024-10-10 20:23:18 -04:00
Lars Knudsen
405492f009 Bluetooth: Audio: Shell: Fix BIS sync bit field validity check
NO PREF (0xFFFFFFFF) and BIT(0) was wrongly rejected.

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-10-10 20:22:39 -04:00
Lars Knudsen
7f1589e23b Bluetooth: ISO: Add ISO BIS bitfield check macro
Checks validity of ISO BIS bitfield (BIT(0)|...|BIT(30))

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-10-10 20:22:39 -04:00
Jordan Yates
257c5e6aff bluetooth: conn: increase log level of timeout ignore
Notifying users that the supplied timeout is being ignored is worthy of
a higher log level than debug. Any such usage should be changed at the
application level.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-10 14:59:16 -04:00
Pavel Vasilyev
74972e694b bluetooth: host: l2cap: Check conn state before queueing PDU
In case of UATT, if a connection was lost while user was holding a read
or write attribute callback, `bt_l2cap_send_pdu` (called from
`att.c::chan_send`) will anyway queue a PDU and trigger tx work. The PDU
won't be sent eventually, but neither will hold an error code, which
will allow it to bypass the error check in `att_on_sent_cb` and call
`att_sent` function.

For EATT `bt_l2cap_chan_send` is used which already handles this case
and the error code is passed to `att_on_sent_cb`.

This change adds connection state check to `bt_l2cap_send_pdu`
preventing from unnecessary code execution when connection does not
exist anymore.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-10-10 14:59:02 -04:00
Pavel Vasilyev
f7e8a8717b tests: bsim: bluetooth: host: att: Add ATT timeout test
This commit tests that the host correctly disconnects from peer when ATT
timeout happens.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-10-10 14:59:02 -04:00
Pavel Vasilyev
f712bde122 bluetooth: host: att: Implement disconnect on ATT timeout
The timeout state is local and can block new ATT operations, but does
not affect the remote side. Disconnecting the GATT connection upon ATT
timeout simplifies error handling for developers. This reduces rare
failure conditions to a common one, without needing special cases for
ATT timeouts.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-10-10 14:59:02 -04:00
Jordan Yates
e45ab126ea zbus: optional publishing statistics
Add optional statistics around the channel publishing action. Store the
time a channel was last published to, and a total publish count.

This information can be used to determine how old a given channels data
is, and an average channel publishing frequency.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-10 14:57:13 -04:00
Rodrigo Peixoto
e0b5c67dda zbus: add HEAP_MEM_POOL_ADD_SIZE_ZBUS
ZBus currently does not have a `HEAP_MEM_POOL_ADD_SIZE_ZBUS` when using
message subscribers or runtime observers, forcing the developer to set that
manually. Adding the configuration option to zbus would improve its
usability and make zbus easier to use. With this feature, zbus aligns with
the other Zephyr subsystems' heap memory allocation approach.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-10-10 10:08:02 +02:00
Nithin Ramesh Myliattil
de14efef98 Bluetooth: BASS: add scan cb to scan delegator module.
Add scan cb to scan delegator so that Application
can be notified  when assistant starts or stops
scanning.
Also state information of Broadcast Assistant
is removed as info is not used.

Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
2024-10-10 10:06:43 +02:00
Robert Lubos
66ff30efb4 net: sockets: Move msghdr_non_empty_iov_count() to common file
msghdr_non_empty_iov_count() is used by TLS sockets too therefore should
be available regardless of native IP sockets being enabled or not.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-10-09 18:37:58 +01:00
Krzysztof Chruściński
8652e8e413 logging: Fix LOG_OUTPUT dependency
When CONFIG_LOG_OUTPUT is set, it indicates that logging strings
are formatted by the application (using log_output module). It is
not needed when backend works in the dictionary mode. So far
LOG_OUTPUT was set also when dictionary mode was used and that
prevented removing of the logging strings from binary which is
an important feature of the dictionary logging.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-09 18:37:49 +01:00
Krzysztof Chruściński
df683fd7f8 logging: log_output: Move flushing and writing to the header
Move log_output_flush and log_output_write (renamed internal
buffer_write() function) to the header as inline functions.
Those function are used by log_output_dict.c and there are cases
when log_output.c is not compiled in.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-09 18:37:49 +01:00
Robert Lubos
f4335d22ca net: if: Don't require native IP stack support for IPv6 lookups
IPv6 based interface lookups doesn't require native IP stack support,
hence reflect that in the API.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-10-09 18:37:30 +01:00
Vinayak Kariappa Chettimada
247037bd3e Bluetooth: Controller: Fix incorrect elapsed events value
Fix incorrect elapsed events value when event prepare are
aborted in the pipeline. This caused premature supervision
timeouts.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-09 18:23:10 +01:00
Vinayak Kariappa Chettimada
e21ff7067d Bluetooth: Controller: Fix BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN
Fix BT_CTLR_SCAN_AUX_SYNC_RESERVE_MIN such that event is not
aborted when near supervision timeout conditions.

Relates to commit ddf04997a5 ("Bluetooth: Controller: Add
abort fairness in overlapping Periodic Sync").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-09 18:23:10 +01:00
Vinayak Kariappa Chettimada
468b60087e Bluetooth: Controller: Introduce BT_CTLR_PERIPHERAL_ISO_RESERVE_MAX
Introduce BT_CTLR_PERIPHERAL_ISO_RESERVE_MAX Kconfig option
so that disabling this option will use minimum time
reservation and exercise the peripheral ISO connection event
continuation using is_abort_cb mechanism.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-09 18:23:10 +01:00
Vinayak Kariappa Chettimada
cadef5a64f Bluetooth: Controller: Introduce BT_CTLR_PERIPHERAL_RESERVE_MAX
Introduce BT_CTLR_PERIPHERAL_RESERVE_MAX Kconfig option so
that disabling this option will use minimum time reservation
and exercise the peripheral connection event continuation
using is_abort_cb mechanism.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-09 18:23:10 +01:00
Fin Maaß
d28c0cf08c mgmt: hawkbit: move HAWKBIT_JSON_URL
move HAWKBIT_JSON_URL out of the header.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
94bad9d9ac mgmt: hawkbit: seperate header files
seperate the hawkbit header files, to make
it clearer.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
dce3d2de66 mgmt: hawkbit: seperate autohandler
seperate the autohandler from the main
hawkbit source. This way the autohandler can
be disabled if it is not needed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
621cf5baec mgmt: hawkbit: get poll interval
Add function to get the poll interval.
This is needed to seperate the autohandler
from the main hawkbit code.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
421ab502e4 mgmt: hawkbit: delay autohandler
Be able to delay the next run of
the hawkbit autohandler.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
f5a3d7dd8f mgmt: hawkbit: log start of autohandler from shell
If the run of the autohandler is started from shell,
it will be logged.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
4655ef317e mgmt: hawkbit: also use workqueue for shell run
Also use a workqueue, when execution of
hawkBit is requested via shell.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
6cc2bb53b4 mgmt: hawkbit: add hawkbit_autohandler_wait
Add hawkbit_autohandler_wait() to be able
to wait for the autohandler to finish.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
cf5f6aad23 mgmt: hawkbit: add option for autohandler
add option for autohandler to only run once.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Fin Maaß
35d05b7198 mgmt: hawkbit: use K_WORK_DELAYABLE_DEFINE
staticly init hawkbit_work_handle

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-09 18:10:30 +01:00
Yago Fontoura do Rosario
029540abec Bluetooth: Controller: Handle overlapping buffers on ull_adv{.c,_aux.c}
* Setting the adv data, scan rsp and adv aux ad data can happen on
overlapping buffers
* There can be other memcpy's that need to be changed to memmove but
these are the only ones I could reproduce the issue and since memmove
has a performance penalty, I left the others as is.

Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
2024-10-09 13:59:07 +02:00
Ayush Singh
5b5d6366e3 net: l2: ieee802154: shell: Fix stringop-truncation
- Fix the warning stringop-truncation
- Leave space for NULL terminator.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-09 13:50:00 +02:00
Jordan Yates
4953389b1e net: socket_service: remove work_q parameter
Remove the `work_q` parameter from `NET_SOCKET_SERVICE_SYNC_DEFINE` and
`NET_SOCKET_SERVICE_SYNC_DEFINE_STATIC` as this feature was dropped
during review but the removal was not 100% complete.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-09 13:48:54 +02:00
Jakub Rzeszutko
5bb721264b shell: add generic RX buffer flush function
Added a generic function `z_shell_backend_rx_buffer_flush` to clear
the RX buffer when resuming the shell. The function repeatedly calls
the backend's `read` API until the buffer is empty or a maximum of
1000 iterations is reached. This prevents unintended command
execution after `shell_start`.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2024-10-09 13:48:41 +02:00
Krzysztof Chruściński
ddf753cdac debug: mipi_stp_decoder: Avoid potential 64bit unaligned access
Decoder was casting uint8_t pointers to uint64_t pointers which could
result in double word instruction which does not support unaligned
access on Cortex-M. Issue was revealed when -O3 optimization was
used instead of -Os. In size optimized version, compiler was
using word load and store instructions which support unaligned
access and issue was not visible.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-09 13:45:04 +02:00
Pisit Sawangvonganan
ea2d785a28 modem: cmux: replace crc8 with crc8_rohc for FCS calculation
To improve performance in FCS calculation, this commit replaces
the usage of the generic `crc8` function with the specific `crc8_rohc`
function in `modem_cmux.c`.
The `crc8_rohc` function utilizes a small table approach, enhancing
the efficiency of CRC-8/ROHC variant calculations while optimizing
memory usage.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-10-09 09:48:00 +02:00
Emil Gydesen
e7e7386352 Bluetooth: BAP: Modify unicast client callbacks to slist
Modify the BAP unicast client callback structure to be a
linked list. The purpose of this is to have multiple listeners
of the unicast client changes and notifications.
This is needed for the CAP initiatior.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-09 09:42:30 +02:00
Valerio Setti
ec3dea2b45 jwt: reshape and add alternative for ECDSA using PSA
This commit:

- creates 2 new files, jwt_ecdsa.c and jwt_rsa.c, to hold the
  implementations of the corresponding ECDSA/RSA signature
  algorithms;
- RSA signature is stil done through Mbed TLS's PK module which
  can optionally make use of PSA (if enabled);
- ECDSA signature will instead use PSA, if possible, or TinyCrypt
  as fallback.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-10-08 18:10:32 -04:00