The native_sim USB driver gives this error currently if one
enables CONFIG_POSIX_API.
drivers/usb/device/usb_dc_native_posix_adapt.c:22:10: \
fatal error: sys/un.h: No such file or directory
22 | #include <sys/un.h>
| ^~~~~~~~~~
compilation terminated.
Disable the netusb support from networking shells for native_sim
board for now so that CI can pass.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Changing remaining users of fcntl.h to use the include from our own
POSIX file so that the values in there are consistent in all parts
of the sources.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use only Zephyr specific POSIX header files so that the whole
system is getting values from the same files. There was an issue with
native_sim run of tests/net/socket/af_packet which had O_BLOCKING set
to 0x4000 from include/zephyr/posix/fcntl.h, but then the file
subsys/net/lib/socket/sockets.c was having O_BLOCKING set to 0x0800
because different header files were used.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If enabling CONFIG_POSIX_API, we get three file descriptors open
before any socket descriptors. The sample exit criteria checks
socket 0 and 1 which is no longer a valid one, so change the
check to be either 0 or 3, and 1 or 4 so that the test can be
run in both when POSIX API is enabled or disabled.
Also disable color printing for the test run so that it is
easier to read the output log.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The syscall name has _impl postfix so adjusting the stub
name.
zephyr-sdk-0.16.5-1/x86_64-zephyr-elf/bin/../lib/gcc/
x86_64-zephyr-elf/12.2.0/../../../../x86_64-zephyr-elf/bin/ld.bfd:
app/libapp.a(lwm2m_engine.c.obj): in function `zsock_fcntl_impl':
.../syscalls/socket.h:363: undefined reference to `z_impl_zsock_fcntl_impl'
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This fixes this error printed by CI:
Too many thread objects (21)
Increase CONFIG_MAX_THREAD_BYTES to 3
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit fixes this error seen in CI so that things
work even if CONFIG_POSIX_API is enabled.
subsys/shell/backends/shell_mqtt.c:727:12: error:
conflicting types for 'write'; have
'int(const struct shell_transport *, const void *, size_t, size_t *)'
727 | static int write(const struct shell_transport *transport,
const void *data, size_t length)
include/zephyr/posix/unistd.h:230:9: note: previous declaration
of 'write' with type
'ssize_t(int, const void *, size_t)'
230 | ssize_t write(int file, const void *buffer, size_t count);
subsys/shell/backends/shell_mqtt.c:787:12: error:
conflicting types for 'read'; have
'int(const struct shell_transport *, void *, size_t, size_t *)'
787 | static int read(const struct shell_transport *transport,
void *data, size_t length, size_t *cnt)
include/zephyr/posix/unistd.h:231:9: note: previous declaration
of 'read' with type
'ssize_t(int, void *, size_t)'
231 | ssize_t read(int file, void *buffer, size_t count);
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The library should be using internal socket API functions
so that we do not need to depend on POSIX_API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Change the sample applications that use network socket API to
use the POSIX_API config because the NET_SOCKETS_POSIX_NAMES is
deprecated. Convert also the zsock_ API calls to plain BSD
socket API calls when applicable.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The setting is deprecated so change the code to either use the
native zsock_* API or enable POSIX_API to use the BSD socket API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The test expects to use various POSIX APIs so enable the config.
Enabling POSIX_API requires also increase of max file descriptors.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Currently the socks library does not use sockets so there
is no need to select socket symbols.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The library should be using internal socket API functions
so that we do not need to depend on POSIX_API inside the
network stack.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Have special wrappers for zsock_fcntl and zsock_ioctl functions
so that gcc warning can be avoided.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Avoid circular inclusion of socket related header files.
This way applications can still continue to include
zephyr/net/socket.h and not need to separately include
POSIX socket headers.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The CONFIG_NET_SOCKETS_POSIX_NAMES option is marked as deprecated in
favor of using normal POSIX socket API includes found under the
include/zephyr/posix directory. If you want to use BSD socket API calls,
you need to select POSIX_API and use the socket headers found in the
POSIX subsystem. If you do not want to or cannot enable POSIX_API,
then you must use zsock_ prefix when working with BSD socket calls.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
linkserver is hardcoded to probe ID, now with #70343 merged
the probe ID restriction can be removed.
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Remove ethernet-fixed-link binding as it is redundant with the
phy bindings. Clearly, ethernet does not work without the L1
layer, which is a phy device, or an integrated mac/phy device,
and all of these things should be described properly in DT.
The schema did not even come with a compatible, meaning nodelabels
were hardcoded into the drivers, which is unacceptable.
- Remove the binding file for ethernet-fixed-link.yaml.
- Remove fixed link functionality from the nxp s32 gmac driver.
Since this functionality is already covered by the phy support,
it is redundant.
- Remove fixed link include from the s32 gmac binding.
- Remove fixed link include from the nuvoton numaker binding.
As far as I can tell the corresonding driver does not even
use it anyways, and I did not find any board with this device
that describes a "fixed link".
- Move the definition into the nxp,kinetis-ethernet binding
as the eth_mcux driver, which is already being deprecated,
does use this, contain the debt to the legacy driver.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
If `args.quiet` is set, suppress the useless `print` statements output
by `imgtool` (mcuboot script) by capturing `stdout`.
Old output:
```
[44/44] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 415192 B 824 KB 49.21%
RAM: 163124 B 256 KB 62.23%
IDT_LIST: 0 GB 2 KB 0.00%
image.py: sign the payload
image.py: sign the payload
```
New output:
```
[44/44] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 415192 B 824 KB 49.21%
RAM: 163124 B 256 KB 62.23%
IDT_LIST: 0 GB 2 KB 0.00%
```
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Addresses an issue where attempts to transmit data fail.
The identified cause of this failure is the handling of the
`rx_irq_enable` and `tx_irq_enable` flags. The `else if` handling the
`tx_irq_enable` was replaced by an `if` so both flags can be true,
and both functions can be called. This fix was tested with the
`cellular_modem` example successfully.
Signed-off-by: Fabian Kainka <kainka@cognid.de>
Added a check for duplication of add source operation in the Scan
Delagator. BAP 6.5.4 states that an assistant may not perform add
source operation if it results in a duplication of a source. While
this is not mentioned for the Scan Delegator, the spirit of the spec.
must be that no duplications can exists in the recv_state, which is
what this commit fixes.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
On the request of the maintainer.
Background:
We have recently had issues with tests timing out because of the
difference of speed between CI runners and a standard developer machine.
In that case, the logs are printed, and some tests (by yours truly) are
a bit on the chatty side. Github's UI chokes (for a good minute or more
lol) on more than a few hundred lines, so it's a bad experience for
contributors.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
By using `getopt_state` to access `optarg`, offering a better alternative
to direct global `optarg` access.
This approach mitigates the risks associated with concurrent access to
the global variable.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change marks each instance of the `struct option` as `static const`.
The rationale is that `struct option` is a read-only variable.
By using `static const`, we ensure immutability, leading to usage of only
the `.rodata` section and a reduction in the `.data` area.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This commit simplifies the access to structure members and omits
unnecessary variable initializations.
Specific adjustments include:
- Moving from pointer-based access (`(®d)->chan_info`) to
direct structure member access (`regd.chan_info`).
- Removing explicit initializations where not required.
- Removing excess backslashes '\' before '%' in the format string.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This test is an attempt at formalizing at least part of the behavior
described in commit 6a79c3deae.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
When setting a name to a network interface, verify that no other
interface has the same name as that would make very difficult to
select an interface by a name.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Added configuration of long press reset functionality.
Includes ship/hibernate to wake debounce time and
disabled/one_button/two_button mode selection.
Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
Multicast rule as 01:00:00:00:00:00 is actually shadowing
broadcast rule, enabling broadcast packets to be received/forwarded
even if broadcast rule/filter is not set.
Set the multicast filter with an appropriate mask.
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
This commit should fix configuration conflicts that
came up upon merging both MIPI DBI and display panel
drivers.
1. Board's display/LVGL Kconfigs should be enabled when
needed based on the selected display interface.
2. Overwrite the touch controller's I2C pins to avoid
conflicts with the display panel signals.
Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
The DHT20 sensor is a temperature and humidity sensor that uses I2C to
communicate with a microcontroller. The DHT20 sensor is Aosong.
use standard crc
update description to add reference to AHT20 and AM2301B
clean code, use defines and bit manipulation
add dht20 to i2c test suite for build tests
update bit manipulation
use more defines instead of raw numbers
add bindings to allow aht20 or am2301b to be used in devicetree
in all 3 cases, the same dht20.c driver is compiled
Signed-off-by: Nathan Olff <nathan@kickmaker.net>
The current implementation can raise a warning as the compiler sees
an attempt to index an array with a size of zero. This can be fixed by
giving `gdb_mem_num_regions` a default value of zero, but this gets
flagged by CI checks. Disable the warning around the array access.
Signed-off-by: Robert Zieba <robertzieba@google.com>
Mark the POSIX_NETWORKING Option Group as supported. The
POSIX_NETWORKING Option Group is required for PSE53 Conformance.
Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
Uncomment the check for sockatmark() to ensure that the function
is declared in sys/socket.h, as a stub implementation was added
in the previous commit.
Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>