Commit graph

83032 commits

Author SHA1 Message Date
Daniel Leung f0e0c57ad2 samples: boards: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 081d5a32f0 samples: arch: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 16bd0c861f x86: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung c32e28d079 usb: host: fixes shadow variables
This fixes a shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung b819a00b06 storage: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 93677ef58f settings: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 030223740f rtio: rename shadow variables
Rename shadow variables found by -Wshadow, as the ones in
the macros have a tendency to conflict with outer scope ones
when used. So they need to be more descriptive.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 50a20f7b62 openthread: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 842a65914f net: lwm2m: ignore -Wshadow for cbor type header file
There are a few structs, unions, and enums where -Wshadow would
complain. Since names being the same are intentional, we need
to tell compiler to ignore -Wshadow for those names.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 2b09426fca net: zperf: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 5395ddfeb2 lorawan: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 8bfdb23a08 logging: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 8cdcf1a8cb ipc: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung f02d40017f fs: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 3c3f480be8 esp32: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Daniel Leung 729fd4c574 counter: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Jędrzej Ciupis a41475507a modules: hal_nordic: remove 802.15.4 gpiote platform
This commit removes deprecated GPIOTE platform abstraction for nRF IEEE
802.15.4 radio driver.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-08-22 11:39:33 +02:00
Thomas Ebert Hansen 32b1c575fe tests: Bluetooth: Test invalid enc. pause
Add test to verify that
1) A peripheral role cannot initiate an encryption pause
2) A peripheral role rejects a LL_PAUSE_ENC_REQ while a CIS is
   established

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-22 10:53:47 +02:00
Thomas Ebert Hansen 8ae2eb53dc Bluetooth: controller: Handle invalid enc. pause
Reject LL_PAUSE_ENC_REQ while the ACL is associated with a CIS that is
created.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-22 10:53:47 +02:00
Thomas Ebert Hansen ff861304c3 tests: Bluetooth: Use FFF in ctrl_encrypt
Replace Ztest Mock with FFF.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-22 10:53:47 +02:00
Thomas Ebert Hansen 34fc97b2a0 tests: Bluetooth: Mock ISO streams with FFF
Update test_cc_create_periph_rem_host_accept to use mocked
ll_conn_iso_stream_get()

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-22 10:53:47 +02:00
Fabian Blatz 63bb74c69a modules: lvgl: Handle errors on fs_tell
Changes the lvgl filesystem `tell()` wrapper to check for errors returned
by zephyr filesystem subsystem.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-08-22 10:01:29 +02:00
Fabian Blatz ab6d99ffde modules: lvgl: Unify memory management strategy for filesystem
Changes the memory management for the lvgl filesystem wrapper to use the
memory management strategy selected by kconfig. Additionally fixes memory
leaks if fs_{file,dir}_t initialization failed.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-08-22 10:01:29 +02:00
Daniel Leung 307708c450 xtensa: sample_controller: smaller intermediate build artifacts
For some weird reasons, if the sections in linker script are not
in memory address order, there are lots of padding involved in
zephyr_pre0.elf. This moves the .intList section to its memory
ordered location. When building hello_world, this shrinks
zephyr_pre0.elf from 512MB to 339KB.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 10:00:46 +02:00
Marc Desvaux e8c9508b10 tests: drivers: i2c: i2c_target_api add nucleo_g474re
Adds necessary overlay nucleo_g474re in i2c_target_api test case
to enables the board.

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-08-22 10:00:38 +02:00
Marc Desvaux 8606ab5df6 tests: drivers: i2c: i2c_target_api add nucleo_g474re
Adds nucleo_g474re in i2c_target_api test case
to enables the board.

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-08-22 10:00:38 +02:00
Sjors Hettinga 2adc95ae7a tests: net: tcp: Add testcase for validating retransmitted FIN seq
Implemented testcase to check if the retransmitted FIN packet
from the FIN1 state has the correct sequence number.
Also fix the endianness conversion of sequence numbers in the
tests to use 32-bit as it should instead of 16-bit.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2023-08-22 10:00:14 +02:00
Sjors Hettinga 330561e47a tests: net: tcp: Add a testcase for data beyond TCP socket closure
After the TCP socket has been closed, it should not accept any new data
and send a RST packet if it does receive some.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2023-08-22 10:00:14 +02:00
Sjors Hettinga a8b03b7b93 net: tcp: Restructure the close FIN sequence
When the application closes the connection, it enters the FIN1 state.
Restructure this sequence to RST on data received after the application
has closed the socket.
Next to that deal with packets that contain both data and a FIN flag.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2023-08-22 10:00:14 +02:00
Mariusz Skamra 8540682f18 tests: Bluetooth: tester: Fix missing metadata validation on Enable
This fixes missing metadata validation on Enable operation callback.

Fixes: BAP/USR/SPE/BI-04-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Mariusz Skamra 02f399dc1d tests: Bluetooth: ascs: Add prohibited audio context metadata test
This adds for receiving and handling Enable operation with
prohibited audio context value.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Mariusz Skamra d28f180473 Bluetooth: audio: ascs: Move metadata validation to stack
As the metadata has to be validated anyway, let the initial vaidation of
metadata to be done in ASCS. The application can still reject the
metadata, but the length validation and supported type validation can be
performed by the stack.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Mariusz Skamra 914dc408fd tests: Bluetooth: ascs: Fix improperly formatted metadata
This fixes improperly formatted metadata. The Stream Context value is 2
bytes in size.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-08-22 09:59:53 +02:00
Christopher Friedt 9d16fbb70c tests: net: socket: tcp: reduce number of file descriptors
For some reason, tests/net/socket/tcp/net.socket.tcp.preempt
was failing to link for vmu_rt1170 with these changes, and
for some reason reducing CONFIG_POSIX_MAX_FDS from 20 to 10
resolves that issue.

ld.bfd: scripts/build/gen_kobject_placeholders.py \
  did not reserve enough space for kobject rodata.
Memory region         Used Size  Region Size  %age Used
           FLASH:      287860 B        64 MB      0.43%
             RAM:       86460 B       512 KB     16.49%
           OCRAM:          0 GB       256 KB      0.00%
          OCRAM1:          0 GB       512 KB      0.00%
          OCRAM2:          0 GB       512 KB      0.00%
            ITCM:          0 GB       256 KB      0.00%
            DTCM:       13908 B       256 KB      5.31%
        IDT_LIST:          0 GB         2 KB      0.00%
collect2: error: ld returned 1 exit status

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 4cc5102225 net: sockets: udp: test FIONREAD with ipv4 and ipv6 sockets
The FIONREAD ioctl (or rather ZFD_IOCTL_FIONREAD) returns the
number of bytes available on the socket that can be read
immediately.

Test that the ioctl behaves according to the expectation.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 0f139736f3 tests: net: socket: udp: clear fdtable in after()
Add an `after()` function that is executed after each test in
the testsuite.

Previously, even if one one test failed, it would calls almost
all subsequent tests to fail. This way, other tests can still
succeed.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt e7182beb40 tests: net: socket: tcp: clear fdtable in after()
Add an `after()` function that is executed after each test in
the testsuite.

Previously, even if one one test failed, it would calls almost
all subsequent tests to fail. This way, other tests can still
succeed.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 37ca8e0697 net: sockets: tcp: test FIONREAD with ipv4 and ipv6 TCP sockets
The FIONREAD ioctl (or rather ZFD_IOCTL_FIONREAD) returns the
number of bytes available on the socket that can be read
immediately.

Test that the ioctl behaves according to the expectation.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt f1d7c0b196 tests: net: socketpair: use a test fixture to deduplicate code
A fair bit of setup / teardown code was being duplicated in many
test cases in the socketpair testsuite.

Take advantage of the `setup()`, `before()`, and `after()`
functions in the new ZTest API.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 4a095bb34b net: sockets: support fionbio and fionread
The `ioctl()` interface is already supported by the network
subsystem but there was no `zsock_` interface available for it.

Add the `zsock_ioctl()` syscall.

Implement two somewhat commont ioctl requests for socket
file descriptors; namely

- `FIONBIO` set non-blocking I/O mode
- `FIONREAD` get the number of available bytes

In the process, added `net_pkt_ip_proto_hdr_len()`

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 501c56cce7 net: socketpair: support for fionbio
Support for setting non-blocking mode via `ZFD_IOCTL_FIONBIO`.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 09e4f8fada syscalls: include stdarg.h for va_list type
Include the standard `<stdarg.h>` header to get the
correct definition for `va_list`, etc.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 2116c553a1 tests: net: socketpair: add fionread test
Add a test to exercise
`zsock_ioctl(fd, ZFD_IOCTL_FIONREAD, &avail)`.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 0f143c9ec9 tests: net: socketpair: reduce requirements for test
Reduce additional requirements for the socketpair testsuite.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt e0ac4eb5cd net: sockets: socketpair: support querying bytes available
In order to get a semi-accurate assessment of how many
bytes are available on a socket prior to performing a read,
BSD and POSIX systems have typically used

`ioctl(fd, FIONREAD, &avail)`

We can support this in Zephyr as well with little effort, so
add support for `socketpair()` sockets as an example.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt bd0df542ce posix: ioctl: use fdtable.h FIONBIO and FIONREAD definitions
Rather than defining FIONBIO and FIONREAD at the POSIX layer,
define them at the Zephyr layer, in the Zephyr namespace, and
make the POSIX layer a simple wrapper.

This facilitates having a common dependency between POSIX and
networking rather than a cyclic one.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 52cc49e1ad fdtable: add ioctl numbers for FIONBIO, FIONREAD
Rather than defining these constants in the POSIX layer,
define them in the Zephyr layer, and make the POSIX layer a
simple wrapper.

This will allow the POSIX layer and networking to have a
common dependency rather than a cyclic one.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Christopher Friedt 1fa2ea1c82 net: sockets: tcp: split recv_stream into immediate and timed
Previously, if a net_context had multiple packets already in
the receive queue, and a call to zsock_recvfrom() was made with
a buffer large enough to receive content from multiple packets,
only the content from a single receive buffer would be received.

Since zsock_recvfrom() is a system call, which has a
non-negligible overhead, it makes sense to receive as many bytes
as possible per system call.

Add zsock_recv_stream_immediate() as a shorthand for
"fill this receive buffer with as many bytes as possible without
blocking". Allow nullable buffer parameters so that we can also
have a shorthand for "count how many bytes are immediately
available".

With minor refactoring, zsock_recv_stream_timed() is a simple
wrapper around zsock_recv_stream_immediate() that handles timing
and error conditions.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-22 09:59:44 +02:00
Benjamin Lemouzy d4e33c5708 drivers: watchdog: add WDT shell commands
Add shell commands to setup, disable, install timeout and feed a
watchdog device.
These commands reflect watchdog API.

Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>
2023-08-21 15:01:30 -05:00
David Leach adf0b6d957 CODEOWNERS: cleanup NXP boards owners
Removed NXP board\docs owners to default to board owners.

Signed-off-by: David Leach <david.leach@nxp.com>
2023-08-21 14:59:43 -05:00