After several fixes of the re-ordering logic in TCP, the receive queue
works as intended and cleans itself up properly. Previously the default
timeout was 100 ms, which pretty much disables it for real applications.
Increase the timeout to 2 seconds to actually enable it for in practice.
This should help pass much more of the Maxwell Pro tests.
This is the first step before removing the timeout completely.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
This removes the tinycbor module and replaces references in it
e.g. in sample text to use the zcbor replacement.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
In case that CONFIG_BT_AUDIO_UNICAST_CLIENT_ASE_SNK_COUNT or
CONFIG_BT_AUDIO_UNICAST_CLIENT_ASE_SRC_COUNT is set to NULL, the
unicast client implementation in the shell would have compile
warnings, since the arrays would be 0 and we would attempt to
access it some places (or rather the compiler/linker would
think that, but it would never happen at runtime).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The stm32l562e_dk and b_u585i_iot02a boards have same external NOR
memory. This harmonize both definitions and fix total partition size
to correct 64MB.
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Array 'days_in_month' of size 12 may use index value bigger then
count of its elements.
Signed-off-by: PawelX Dobrowolski <pawelx.dobrowolski@intel.com>
Add IS_BIT_MASK() macro for determining whether a value is set bits
continuously from the LSB.
This macro is not dependent on bit-width and works in contrast to
BIT_MASK() and BIT64_MASK().
IS_SHIFTED_BIT_MASK() is a version of IS_BIT_MASK() that allows setting
the start bit of continuous bits.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Changes one of the callback register/unregister functions to use
2 events OR'd together instead of 2 events registered separately,
this is to help test that grouped events are working.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Improves the documentation when OR'ing multiple events of the same
group together to describe that this is only supported for events
that are part of the same group, giving example of correct and
incorrect usage.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes an issue whereby event ID was not checked properly, meaning
that OR'd events would not work as one would expect.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
After adopting the `<sys/stat.h>` header from picolibc, there is
a possibility that the following types are not defined.
```cpp
typedef int dev_t;
typedef int ino_t;
typedef unsigned short nlink_t;
typedef unsigned short uid_t;
typedef unsigned short gid_t;
typedef unsigned long blksize_t;
typedef unsigned long blkcnt_t;
```
Of the above missing types, the oonly ones that are used today
in Zephyr are `blksize_t` and `blkcnt_t`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The original format of this file as imported from PicoLibC was not
compatible with Zephyr's coding stytle. This change fixes
compliance issues listed below:
- whitespace formatting
- block comment formatting
- named parameters
Introduction of new typedefs should be considered false-negatives
as these are existing standard POSIX types.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
This may be getting ahead of the curve a bit, but here we adopt
the `<sys/stat.h>` header from picolibc. It is mostly the same
as that of newlib but the picolibc variant seemed to be slightly
more "inclusive".
Removed the `<_ansi.h>` include.
The commit immediately following this declares a few missing types
only if they are not already declared.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Previously, `<sys/stat.h>` was declaring the following constants
which should be declared in `<fcntl.h>` according to POSIX.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The remaining types that needed to be harmonized between
Newlib and Zephyr's POSIX definitions are:
* `struct sched_param`
- don't re-define if using minimal libc
* `pthread_attr_t`
- convert to `struct pthread_attr`
- define type if using minimal libc
- assert acceptible object size
* `pthread_mutexattr_t`
- convert to `struct pthread_mutexattr`
- define type if using minimal libc
- assert acceptible object size
* `pthred_condattr_t`
- convert to `struct pthread_condattr`
- define type if using minimal libc
- assert acceptible object size
* `pthread_once_t`
- adopt newlib definition
- define type if using minimal libc
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Zephyr's `SCHED_RR` and `SCHED_FIFO` definitions were slightly
different than Newlib's. Additionally, the test had hard-coded
magic numbers instead of using symbolic values.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Part of the POSIX Roadmap for LTSv3 is to adopt POSIX-related
headers from Newlib. The strategy to get there is to first make
the existing POSIX subsystem work in the presence of Newlib POSIX
types.
Part of the strategy involved adopting Newlib's `uint32_t`
abstraction for some Zephyr POSIX types.
However, some types are declared as structures. Luckily, the API
only passes those structures around in the form of pointers, and
the API only mutates those structures via global functions. With
that, we are able to alias Newlib POSIX types as Zephyr POSIX
structures.
One of the caveats to doing that without introducing stack
corruption is to ensure that the Zephyr POSIX types are <= their
respective Newlib counterparts.
There was only one Zephyr structure for which that requirement
did not hold: `pthread_attr_t`. We left `pthread_attr_t` as the
Newlib definition, and named the Zephyr variant
`struct pthread_attr`.
On 32-bit machines, both structures were 32-bytes.
```
sizeof(pthread_attr_t): 32 sizeof(struct pthread_attr): 32
```
However, on 64-bit machines, `pthread_attr_t` was 40 bytes, while
`struct pthread_attr` was 48 bytes.
```
sizeof(pthread_attr_t): 40 sizeof(struct pthread_attr): 48
```
That triggered the following assertion.
```
BUILD_ASSERT(sizeof(pthread_attr_t)
>= sizeof(struct pthread_attr));
```
The `stacksize` field was subsequently changed from `size_t` to
`uint32_t`, and that reduced the latter to 40 bytes as well,
solving the last real problem.
```
sizeof(pthread_attr_t): 40 sizeof(struct pthread_attr): 40
```
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Define `PTHREAD_CREATE_DETACHED` and
`PTHREAD_CREATE_JOINABLE` to be compatible with the Newlib
definitions.
This is a temporary workaround for #51211 until Newlib
headers are pulled in.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `fcntl.h` header has never been a part of ISO C so move it to
`include/zephyr/posix`.
To ensure a smooth migration, a header was left in
`lib/libc/minimal/include` that prints a deprecation warning.
Users should either include `<zephyr/posix/fcntl.h>` or switch to
`CONFIG_POSIX_API=y`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The `sys/stat.h` header has never been a part of ISO C so move it
to `zephyr/include/posix/sys/`.
To ensure a smooth migration, leave a stub header in
`lib/libc/minimal/include/sys/` that prints a deprecation warning
suggesting developers either include `<zephyr/posix/sys/stat.h>`
or use `CONFIG_POSIX_API=y`.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
There was a second call to `pthread_attr_init()` that reallly had
no sense being there. Also, it seems that there was a call to
`pthread_attr_destroy()` out of perhaps paranoia.
The duplicate call and `pthread_attr_destroy()` can be removed.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
The code used the name DFDSPBRCP referring to the DSP Boot / Recovery
Capability Pointer register from DSP Subsystem Capability / Status
Registers range. The address used, however, pointed to DSP Core Shim
(DSPCS) registers block. Changed define names to not be misleading.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
In case user didn't set mac address in any way (locally defined or
randomly generated), define mac address using device unique id.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Deprecate Kconfig mac address related symbols and replace by existing
device tree properties:
- local-mac-address
- zephyr,random-mac-address
User who wants to keep using deprecating method of defining random
MAC address using Kconfig should set CONFIG_ETH_STM32_HAL_RANDOM_MAC=y.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
In order to ease deprecation of these methods (in favor of dt based
configuration), introduce a choice for MAC address configuration method.
Default to random method (no change).
User wanting to still use ETH_STM32_HAL_MACX symbols should define
CONFIG_ETH_STM32_HAL_USER_STATIC_MAC=y
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Align configuration for nrf52840dk to use the same loopback pins
for uart_async_api and uart_mix_fifo_poll tests.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
RISC-V has a modular design. Some hardware with a custom interrupt
controller needs a bit more work to lock / unlock IRQs.
Account for this hardware by introducing a set of new
z_soc_irq_* functions that can override the default behaviour.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Setting a detected packet family (ipv4 or ipv6) in net_context level
instead in lower layers for AF_PACKET/SOCK_RAW/IPPROTO_RAW type sockets
when sending data.
Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>