Commit graph

15409 commits

Author SHA1 Message Date
Evgeniy Paltsev
52fabbfda0 linker: fix shared interrupts for MWDT toolchain
MWDT toolchain adds additional suffix to sections name in case of
ffunction-sections / fdata-sections are enabled.

Let's pick a single set of rules and syntax that work for all
toolchain.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2024-07-11 13:10:45 -04:00
Evgeniy Paltsev
d698c32e0e linker: fix device deferred init for MWDT toolchain
MWDT toolchain adds additional suffix to sections name in case of
ffunction-sections / fdata-sections are enabled.

Let's pick a single set of rules and syntax that work for all
toolchain.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-11 13:10:45 -04:00
Robert Lubos
be7175351a net: lib: http_server: Fix HTTP1 POST request handling
In previous batch of fixes it was overlooked that streams are
HTTP2-specific concept. While for HTTP2 we need to track headers reply
state for each individual stream, at HTTP1 level we need to track this
at the client level. Hence, reintroduce respective flags to track
headers reply state, but only for HTTP1.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-11 13:10:09 -04:00
Luca Burelli
f257c997b5 doc: llext: improve Doxygen comments
Review and improve comments in source code to better describe the API
and the functionality provided by the llext library.

No actual code changes are performed in this commit.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-07-11 16:17:52 +02:00
Chris Friedt
3b54d2b4b9 fs: fcb: rename variables differently than struct tag
Even just making minor edits to fcb, warnings are triggered
from Coding Guidelines of the form

Violation to rule 5.7 (Tag name should be unique) tag: fcb

Rename pointer variable names to fcbp.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-07-11 16:14:55 +02:00
Fabio Baltieri
367c9d7fa6 input: event-codes: add few missing button codes
Add few missing button codes, these matches the ones used in Linux to
cover HID mouse buttons 1 to 8.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-11 12:39:59 +02:00
Pisit Sawangvonganan
db6a3cb054 include: fix typo in multiple directories
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the `include/zephyr` directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-10 11:48:03 -04:00
Pisit Sawangvonganan
28eb0eaffd include: fix typo in (logging, mgmt)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the `include/zephyr/logging` and `mgmt`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-10 11:48:03 -04:00
Pisit Sawangvonganan
ccc2419465 include: arch: fix typo in multiple directories
Utilize a code spell-checking tool to scan for and correct spelling errors
in various files within the `include/zephyr/arch` directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-10 11:48:03 -04:00
Pisit Sawangvonganan
0b24762ed6 include: net: fix typo in multiple directories
Utilize a code spell-checking tool to scan for and correct spelling errors
in various files within the `include/zephyr/net` directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-10 11:48:03 -04:00
Pisit Sawangvonganan
631dfb67f2 include: dt-bindings: fix typo in multiple directories
Utilize a code spell-checking tool to scan for and correct spelling errors
in various files within the `include/zephyr/dt-bindings` directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-10 11:48:03 -04:00
Emil Gydesen
6c71a88ef3 Bluetooth: ISO: Fix and format iso.h documentation
Fixed a few bad or missing documentation parts of iso.h
Also formatted some parts to be consistent with not just
the file itself, but also with bluetooth.h

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-10 14:38:23 +02:00
Johann Fischer
1248e26b89 include: usbd: add missing macro documentation
Add missing documentation to USBD_DEVICE_DEFINE,
USBD_CONFIGURATION_DEFINE and USBD_DEFINE_CLASS macros.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-07-10 14:36:46 +02:00
Ben Marsh
8c0d3de0fb posix: sys: sysconf: Unconditionally define POSIX macros
The POSIX macros PAGE_SIZE and PAGESIZE (queriable through
sysconf()) were conditionally defined only if an existing definition
did not already exist. These should be defined unconditionally in their
header to ensure they get the correct values.

If these macros are defined elsewhere with a different meaning, that's a
problem. There was an issue where PAGESIZE was already defined with a
different meaning. See #74623 and #74428.

The POSIX macro ATEXIT_MAX is also conditionally defined and should be
unconditionally defined, but there is currently a definition in picolibc
(picolibc/newlib/libc/include/stdlib.h) so this change will be done
separately.

This commit defines PAGE_SIZE and PAGESIZE unconditionally.

Signed-off-by: Ben Marsh <ben.marsh@helvar.com>
2024-07-10 14:36:35 +02:00
Jukka Rissanen
794d7cf3c5 net: sockets: Remove async service support
As found in PR #75525, we should not modify the polled fd array
in multiple places. Because of this fix, the async version of
the socket service could start to trigger while it is being handled
by the async handler. This basically means that the async version
cannot work as intended so remove its support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-07-10 11:36:59 +02:00
Luis Ubieda
3646b63217 rtio: Add RTIO Work-queues service
Adds ability to process synchronous requests in an asynchronous
fashion, relying on dedicated P4WQ's and pre-allocated work items.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda
cc139b85df sensor: Enable RTIO Semaphores for Async API
In order to decouple the read request from its implementation, we need
to be able to yield to potential lower-priority threads, which is not
possible with k_yield() itself. As such, using RTIO Consume semaphore
enables us to achieve this.

This patch also refactors blocking API (sensor_read) to also block upon
consumption, so as not to require RTIO_SUBMIT_SEM enabled.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Robert Lubos
9db2dc4aa2 net: lib: http_server: Move stream-specific flags to stream context
The information about replied headers or END_OF_STREAM flag are
stream-specific and not general for a client. Hence, need to move them
to the stream context.

For the upgrade case, we need to allocate a new stream now when HTTP1
request /w upgrade field is received. The stream ID in such case is
assumed to be 1 according to RFC.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
0e1c0a7b6b net: lib: http_server: Fix trailing headers frame processing
In case client decides to send a trailing headers frame, the last data
frame will not carry END_STREAM flag. In result, with current logic
server would not include END_STREAM flag either, causing the connection
to stall. This commit fixes this logic, so that the server replies
accordingly in case END_STREAM flag is present in the trailing headers
frame.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
b4cfee090d net: lib: http_server: Implement proper CONTINUATION frame processing
CONTINUATION frames are tricky, because individual header fields can be
split between HEADERS frame and CONTINUATION frame, or two CONTINUATION
frames. Therefore, some extra logic is needed when header parsing
returns -EAGAIN, as we may need to remove the CONTINUATION frame header
from the stream before proceeding with headers parsing.

This commit implements the above logic and additionally adds more checks
to detect when CONTINUATION frame is expected. Not receiving a
CONTINUATION frame when expect should be treated as a protocol error.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
ccf2e9b025 net: lib: http_server: Implement proper RST_STREAM frame processing
In case RST_STREAM frame is received it should not be ignored, but the
corresponding stream should be closed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
b98edfd951 net: lib: http_server: Fix parsing of HTTP2 header frames with priority
In case priority flag is present in the HTTP2 headers frame header, we
should expect additional priority fields before the actual frame
content.

The stream priority signalling has been deprecated by RFC 9113, however
we should still be able to handle this in case some implementation
(nghttp for instance) sends them.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
2e288aed08 net: lib: http_server: Fix handling of HTTP2 frames with padding
Data and header frames can contain padding - we need to take this into
account when parsing them, otherwise the stream is broken.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
adfdc54434 net: lib: http_server: Update HTTP2-specific structs/enums naming
For HTTP2-specific structures and enums, use "http2_" prefix to clearly
indicate the distinction from the generic HTTP stuff.

Additionally, some structures/enums describing HTTP2 protocol details
had "server" in the name, while in reality they describe nothing
server-specific. Hence, drop the "server" part where applicable.

Remove unused macros.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos
e1e50bdda9 net: lib: http_server: Simplify HTTP2 frame header parsing
* Remove unneeded variable.
* Use system utilities to read big endian numbers instead of parsing
  manually.
* Remove `payload` member from the http_frame structure. It's not used
  for anything useful, and could actually be misleading, as in case of
  large frames, where not entire frame is parsed at once it will point
  to incorrect location.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Chaitanya Tata
a63a96428e wifi_nm: Fix Wi-Fi interface backward compatibility
If newly introduced interface type is unset then return the first Wi-Fi
interface as a fallback, this fixes backward compatibility.

Also, add NM APIs and use them for type checks, rather than directly
using the type enumeration.

Fixes #75332.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-07-09 13:07:11 -04:00
Brandon Allen
19d49114a6 net: net_mgmt: fixed typo in doxygen
Replaced "tight" with "tied"

Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
2024-07-09 19:06:56 +02:00
Emil Gydesen
bbf599a3de Bluetooth: TBS: Remove BT_TBS_TECHNOLOGY_IP
BT_TBS_TECHNOLOGY_IP is not a valid technology value
for TBS since it's not defined by the spec.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-09 19:06:29 +02:00
Pisit Sawangvonganan
9b2ab20f23 bluetooth: fix typo in (include/zephyr/bluetooth, subsys/bluetooth/)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the `include/zephyr/bluetooth` and `subsys/bluetooth`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-09 17:20:38 +02:00
Pieter De Gendt
058bfc8065 zbus: Fix ZBUS_CHAN_DEFINE alignment
Align trailing backslashes.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 14:03:33 +02:00
Pieter De Gendt
990c5e13cb zbus: Static channel data initialization
Init the channel data semaphore and observer list statically.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 14:03:33 +02:00
Krzysztof Chruściński
347eeababf logging: Fix runtime filtering when frontend and userspace is used
When userspace is used and frontend was used for logging then runtime
filtering was failing because in user context filtering data was
accessed and filtering data is in the kernel space. Fixing that and
adding runtime filtering to the pre frontend function which is
already executed in the kernel space and filter data can be
accessed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 14:01:56 +02:00
Emil Gydesen
62da8152d0 Bluetooth: BAP: Remove doc for past_sync in pa_sync_req
The past_sync field is no longer there and should not
be documented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-09 08:50:06 +02:00
Marc Herbert
c1852b83cd pm: device.h: fix pm_device designated initializers order for C++
Fixes the following error appearing in the test coverage added by the
next commit:

In file included from zephyr/tests/lib/cpp/cxx/src/main.cpp:18:
```
zephyr/include/zephyr/pm/device.h:275:9: error: designator order for
  field 'pm_device_base::state' does not match declaration order
                        in 'pm_device_base'
  275 |         }
      |         ^
zephyr/include/zephyr/pm/device.h:315:17: note: in expansion of
                                                macro 'Z_PM_DEVICE_INIT'
  315 |              Z_PM_DEVICE_INIT(Z_PM_DEVICE_NAME(dev_id), node_id,
```

Note this failure is observed with any g++ -std=c++NN standard value -
even before C++20.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Marc Herbert
c275eaac2d device.h: conditionally remove init braces for C++20 compatibility
Conditionally remove braces for designated initializers of anonymous
unions. This makes it compatible with C++20 while not breaking pre-C11
gcc.

This does for device.h what commit c15f029a71 ("init.h: restore
designated initializers in SYS_INIT_NAMED()") did for init.h

See https://docs.zephyrproject.org/latest/develop/languages/cpp/ and
long discussion in #69411 for more obscure C/C++ compatibility details.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Pieter De Gendt
0e9a6ee802 net: buf: Add const to net_buf API
Some public API functions do not modify the net_buf instances and can
declare these arguments as const.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-08 16:02:39 +02:00
Alberto Escolar Piedras
3da87b9779 kernel kconfig: Do not enable STATIC_INIT_GNU w the old native_posix
native_posix (unlike native_sim) or its breathen (NATIVE_APPLICATION)
link together the "runner" code and the embedded code.
This means that when CONFIG_STATIC_INIT_GNU is set,
any host library code (like the llvm fuzzer) constructors will get
postponed to the Zephyr initialization.
These libraries are unlikely to work if we do this.
(the llvm fuzzer does not)

So let's instead not enable STATIC_INIT_GNU for these targets.
This means possible embedded library constructors will continue to be
picked during the link and be still called during the native runner
initialization instead of during the Zephyr OS initialization as they
were just before we introduced STATIC_INIT_GNU in
6e977ae2d5

Note that native_posix will be deprecated shortly and its users
are strongly encouraged to move to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-06 17:03:18 +02:00
Pisit Sawangvonganan
41b941f9d2 include: drivers: fix typo
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the `include/zephyr/drivers` directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-06 17:03:10 +02:00
Jonathan Rico
be61ae4c9c Bluetooth: host: disallow scan with timeout when BT_PRIVACY=y
See comment in code.

Fixes #73634

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-07-05 18:43:40 +02:00
Emil Gydesen
877895afa5 Bluetooth: GATT: Add additional documention to bt_gatt_unsubscribe
The subscribe parameters shall be a struct that has previously
been subscribed to, as it works as a linked list.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-05 18:41:52 +02:00
Sigmund Klåpbakken
5100f1185d arch: arm: cortex_a_r: Set XPSR endianness bit
When this bit is not set, it defaults to 0 (little endian). This
causes issues for big-endian devices, as data will be accessed using
little endian.

Signed-off-by: Sigmund Klåpbakken <sigmundklaa@outlook.com>
2024-07-04 18:01:51 -04:00
Joakim Andersson
1f07347746 logging: Fix missing CONFIG_ prefix
Fix missing CONFIG_ prefix for log format section strip check.
Logging was still operating on invalid flash addresses.

Fixes #75161

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2024-07-04 18:08:55 +02:00
Alberto Escolar Piedras
1df86af309 Revert "net: sockets: move poll implementation to zvfs"
This reverts commit 93973e2ead.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
14e4de6415 Revert "net: sockets: move select() implementation to zvfs"
This reverts commit 49ac1912b2.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
1a2d508e68 Revert "posix: device_io: implement pselect()"
This reverts commit 305ec62a6b.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
ade54b35ca Revert "posix: device_io: use mode argument correctly in open()"
This reverts commit 499a633976.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Alberto Escolar Piedras
772ba464f7 Revert "posix: add stubs for signal.h functions that need process support"
This reverts commit b2243af32d.

PR #73978 introduced a regression.
Unfortunately this PR cannot be reverted without reverting also
Let's revert both PRs to stabilize main again towards the 3.7 release.

For more details on the issue see
https://github.com/zephyrproject-rtos/zephyr/issues/75205

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-03 15:03:05 -04:00
Yong Cong Sin
4f1ee4b753 arch: riscv: irq: include util_macro.h for the macros
Macros like `BIT()` & `BIT64()` from the `util_macro.h` are
used, include their header to compile properly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-02 14:14:35 +02:00
Krzysztof Chruściński
0bb25d2e17 lib: os: spsc_pbuf: Clarify using cache management in the module
Packet buffer can be used for sharing data between cores. In that
case when any core has data cache then data cache handling must
be enabled in the module. However, it shall never be enabled when
the packet buffer is used on a single core. Adding that information
to the documentation.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-01 16:07:30 -04:00
Nikolay Agishev
80fe531119 ARCMWDT: Fix issues with posix types
Fix posix pid_t type redifiniton (zephyr vs arcmwdtlib).
Add omitted in arcmwdtlib type sigevent.

This Fixes https://github.com/zephyrproject-rtos/zephyr/issues/75105

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2024-07-01 18:14:34 +02:00