Add limits.h and irq.h to fix build errors for boards/tests that include
the zephyr,nativer-_posix-counter driver.
Signed-off-by: Keith Short <keithshort@google.com>
Warnings being treated as errors when building :
Error this 'for' clause does not guard...
[-Werror=misleading-indentation]
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Our application (posix-naive/debug) ran into segmentaion faults,
because the socket was closed between the "wait for sockets" and the
second if in the first loop. Added the check also to line 690
and 720.
The other uses of sock_ctx[i] are already checked against NULL
Signed-off-by: Peter Tönz <peter.tonz@husqvarnagroup.com>
The macro STRUCT_SECTION_ITERABLE can only store items in ROM if a
const specifier is added to the struct declaration.
Also it does not create the iterable section itself, but adds an
element to the section.
This commit clarifies the documentation.
Signed-off-by: Martin Jäger <martin@libre.solar>
This commit loads the CMakeCache of Zephyr projects.
This allows sysbuild to fetch information from Zephyr projects into
sysbuild itself.
This commit is a first step in the process of sharing more knowledge
between images and sysbuild, and pave the way for closer sharing of
settings between images.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
According to Core 5.3 Vol 4, Part E, section 7.8.82 slot_durations,
switch_pattern_len and ant_ids are used only for AoA and do not affect
reception of AoD CTE.
To improve interoperability checking of correctness of these parameters
is not required. It will not affect lower link layer in case the AoA
CTE reception feature is not enabled in Kconfig.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix the scope of some variables in various STM32 drivers including:
- SDMMC
- DMA
- OSPI/QSPI Flash
- Interrupt controller
The variables are set static instead of global and const if appropriate.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
This function exposes list pointer, so that it allows the user to modify
the internal list. This adds bt_audio_foreach_capability iterator finction
that can be used instead.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The LLDN frame has been obsoleted in IEEE 802.15.4-2015f. This change
removes it from the code, introduces frame types from current spec
levels and updates the frame validation rules in accordance with the
spec.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
This change re-orders attributes in struct ieee802154_context to
completely optimize struct padding away. This is done in a way that does
not impact readability.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
Several attributes in the ieee802154_context struct may potentially be
accessed from different threads and/or ISR context. Only some of these
attributes were properly guarded against race conditions.
This may not have been to problematic in the past but as other changes
in this PR introduce additional attributes and mutate several attributes
in a single atomic transaction, leaving such changes unprotected seems
dangerous.
This change therefore introduces systematic locking of the
ieee802154_context structure.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
IEEE 802.15.4 short address support is incomplete in several places.
This change improves short address support without claiming to fix
it everywhere. Future iterations will have to continue where this change
leaves off.
The purpose of this change was to:
* use the short address returned by association responses,
* automatically bind IEEE 802.15.4 datagram sockets to the short
address if available,
* use the short address in outgoing packages where applicable,
* improve validation of association/disassociation frames,
* model association more closely to the spec by tying it to the
existence of a short address in the MAC PIB thereby removing
redundancy in the PIB (which makes race conditions less probable),
* keep both, the short and extended addresses, of the coordinator.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
This change introduces an additional function into the API that allows
to test and clear a net_if flag atomically. A similar function already
exists to test and set a flag. So this change actually improves symmetry
of the API.
The change is required in later commits of this PR.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
This changes fixes several bugs and inconsistencies in the IEEE 802.15.4
L2 implementation. These bugs were revealed while documenting intended
endianness of driver, IP, socket and L2 attributes (see previous
changes).
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
This is a preparatory change that fixes one aspect of short address
handling before fixing endianness so that the endianness fix can be
applied consistently in this method.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
The WPAN-USB sample did not document endianness of some user space
variables. As the IEEE 802.15.4 stack uses attributes in several
different encodings, the endianness should be documented.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
The IEEE 802.15.4 L2 code stores representation of attributes like
PAN id, short address and extended address in different encodings:
* big endian for extended address and CPU byte order for everything
else whenever such attributes enter user space (except for IP/socket
link layer addresses which are always big endian - even in case of
short addresses - to maintain POSIX compatibility).
* little endian for everything that is close to the radio driver as
IEEE 802.15.4 frames are little endian encoded.
Endianness was almost nowhere documented which led to several bugs and
inconsistencies where assignments of different byte order were not
converted (or sometimes converted, sometimes not).
This change documents endianness wherever possible within the realm of
the IEEE 802.15.4 L2 code. Conversion bugs and inconsistencies that were
revealed by the improved documentation will be fixed in a separate
commit.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
To maintain POSIX compatibility, link-layer addresses are encoded in big
endian in the IP stack and socket API.
The intended endianness was however not documented everywhere which led
to bugs and inconsistencies. The IEEE 802.15.4 L2 stack, for example,
sometimes stores addresses in little endian in structures that intend
them to be stored in POSIX-compliant big endian byte order.
This change documents intended endianness within the realm of the
IP and sockets stack. Conversion bugs are fixed in a separate commit.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
The IEEE 802.15.4 radio driver encodes attributes in:
* little endian for everything that is close to the protocol as
IEEE 802.15.4 frames are little endian encoded.
* mixed big and little endian in its configuration where extended
addresses are being represented. These inconsistencies are unfortunate
but cannot be easily fixed in a backwards compatible way so will be
left untouched in this change.
Endianness was almost nowhere documented which explains these
inconsistencies and led to several bugs where assignments of different
byte order are not converted (or sometimes converted, sometimes not).
This change documents intended endianness within the realm of the
IEEE 802.15.4 radio driver code. Conversion bugs are fixed in a separate
commit.
Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
Ethernet MAC dts definition for STM32F107, similar to STM32F207 but with
different clocks, especially no PTP clock.
Signed-off-by: Pierre-Emmanuel Novac <piernov@piernov.org>
STM32F107 has an Ethernet MAC but no PTP clock, so remove hard requirement
on PTP clock definition in preparation for STM32F107 Ethernet MAC support.
Signed-off-by: Pierre-Emmanuel Novac <piernov@piernov.org>
Add support for setting the target mode for a PMIC regulator. Some
regulators support multiple modes, each with distinctive voltage and
current configuration data. This function allows the consumer to switch
the PMIC into a new mode. The PMIC can then be configured to use a new
set of voltages.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Update regulator binding definitions for PCA9420 to support mode setting
features. This will allow the 4 voltage modes present on the PCA9420 PMIC
to be utilized.
Note that bindings have also been updated to indicate the default
register value and target voltage for each regulator on the PCA9420.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add mode selection properties for regulator-pmic compatible. These
mode selection properties will be used with regulators that support
multiple modes, with each mode enabling specific voltage and current
limits.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Move I2C register reads to regulator_read_register in regulator driver,
to enable better abstraction of regulator I2C reads
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Refactor binding to use root PMIC IC, so that properties can be shared
between regulator devices. Each individual regulator output is still
created as an individual device, since the regulator API aligns with
these devices better than the PMIC IC itself.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The code was missing #include <zephyr/kernel.h> which
caused a compilation error. Missing header has been added.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Some minor housekeeping prior to adding an http server
implementation. There are already a number of http headers
and that number will likely increase with subsequent work.
Moving them into a common directory cleans up the
`include/net` directory a bit.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add a script to extract HTTP status values and format them
in a way that is both human readable and machine parseable.
Each line of output is of the form:
```
HTTP_{key}_{upper_val} = {key}, /**< val */
```
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Previously, HTTP method enumerations were only defined within
the `http_parser.h`, which may not be ideal for all use cases.
This commit moves the `enum http_method` definition to a
dedicated header in a dedicated `http` subdirectory.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The can_set_timing_data() API function is optional and is not supported by
all CAN controller drivers.
On a board with only either classic CAN or CAN-FD capable controllers the
current behavior is fine, but on boards with a mix of classic CAN and
CAN-FD capable controllers/drivers, calling can_set_timing_data() on a
classic CAN controller will lead to a NULL pointer dereference.
To ensure a proper behavior when calling can_set_timing_data() on classic
CAN controller drivers, change the API wrapper function to return -ENOSYS
if the CAN driver does not implement CAN-FD support.
Note that the data phase timing calculation functions are fine as-is, as
the timing calculations will fail due to minimum/maximum data phase timing
parameters being all zeros for drivers only supporting classic CAN.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Changes in device_service have triggered MISRA 5.7 violation CI error
(Tag name should be unique). Renamed shell to sh, same as some other
modules.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
All init entries are already prepended with `__init_`, there's no point
in pre-pending 2 prefixes.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Use the `init_id`, in line with recent device changes, as the argument
is being used as a unique identifier.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
- Create a sys_init entry, as init API is not strictly related to the
device model (device model re-uses it)
- Hide internals (Z_*) from public API docs.
- Give overview within the group definition of allowed levels, meaning,
etc.
- Properly document struct init_entry.
- Multiple style issues
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The _SYS_INIT_LEVEL* definitions were used to indicate the index entry
into the levels array defined in init.c (z_sys_init_run_level). init.c
uses this information internally, so there is no point in exposing this
in a public header. It has been replaced with an enum inside init.c. The
device shell was re-using the same defines to index its own array. This
is a fragile design, the shell needs to be responsible of its own data
indexing. A similar situation happened with some unit tests.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The function in charge of calling all init function was defined in
device.c, had a public prototype and was just used in init.c. Since this
is really an internal function tied to Kernel init code, move it to
init.c and make it static, there's no need to expose it publicly.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>