Commit Graph

3871 Commits

Author SHA1 Message Date
Fin Maaß 0012e1ff76 mgmt: hawkbit: reset action id
Be able to reset the hawkBit action id.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-02 09:32:18 +01:00
Aurelien Jarno e94fe44805 subsys/settings: add a function to save subtree
When running multiple subsystems or applications on a MCU, the usual
strategy is to use different settings subtrees.

The API provides a way to load or commit a subtree, to avoid adding
dependencies between subsystems or applications, but lacks the way to
save a subtree only. Fix that by adding a settings_save_subtree()
function.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-01 22:56:19 +01:00
Yong Cong Sin f98fd62c73 include: sys: util: add note and test for NUM_VA_ARGS_LESS_1
Notes that `NUM_VA_ARGS_LESS_1` support up to 64 arguments,
and added test for it in `tests/lib/sys_util`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-01 22:56:00 +01:00
Yong Cong Sin ae2cb14381 include: sys: util: implement `NUM_VA_ARGS`
This macro count the number of arguments in the variable
arguments list.

Added test for it in `tests/lib/sys_util`.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-05-01 22:56:00 +01:00
Nicolas Pitre 1964d1fab5 sys: sflist: allow usage of all available flag bits
Room for flag bits is function of the struct sfnode alignment.
Define the flag mask accordingly. This gives 2 available bits on 32-bit
architectures and 3 bits on 64-bit architectures.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-05-01 22:55:34 +01:00
Nicolas Pitre 6dd1a467f8 sys: sflist: replace unative_t with uintptr_t
We already have uintptr_t which purpose is exactly what we need here.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-05-01 22:55:34 +01:00
Peter Mitsis 0e51610bd5 kernel: Drop non-negative from timeout descriptions
Drops "non-negative" from a few stray kernel API timeout descriptions
as a negative timeout is actually valid and represents an absolute
timeout.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-05-01 19:48:46 +01:00
Omkar Kulkarni 11eed84775 Bluetooth: Mesh: Update models metadata API
This commit updates models metadata API to simplify the usage and
removes the metadata pointer in health server model context.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-05-01 10:54:50 -04:00
Abramo Bagnara 47896e4584 coding guidelines: comply with MISRA C:2012 Rule 12.2
- explicit with a cast the destination bitwidth of left shift
  ensuring to not break DTS

Signed-off-by: Abramo Bagnara <abramo.bagnara@bugseng.com>
2024-05-01 10:53:37 -04:00
Hess Nathan c878e3fcad coding guidelines: comply with MISRA Rule 20.9
- avoid to use undefined macros in #if expressions

Signed-off-by: Hess Nathan <nhess@baumer.com>
2024-05-01 10:52:54 -04:00
Pisit Sawangvonganan 3d39926f94 bluetooth: hci: refactored bluetooth hci packet type indicators
Introduced a unified definition for HCI packet type indicators in
'bluetooth/hci_types.h. This change streamlines the code in
'drivers/bluetooth/hci/', reducing redundancy.
Enhances maintainability and consistency across all HCI drivers.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-01 10:33:12 +02:00
Fabio Baltieri df819a8609 pm: device_runtime: add an access function to get the usage counter
Add a pm_device_usage_get() to get the current usage counter.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-05-01 10:31:03 +02:00
Fabio Baltieri 48e2f67869 shell: add a callback-filter variant of shell_device_lookup
Add a shell_device_filter variant of the shell device lookup helper that
takes a callback as an argument. This allows more complex filtering on
the device than the existing name prefix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-04-30 19:30:15 -05:00
Aurelien Jarno ada2c78235 drivers: hwinfo: Add device EUI64 ID support
Some devices, mostly with radio support, have an EUI64 ID (unique and
attributed by IEEE), in addition to the standard device ID.

Add support for reading it through the hwinfo API. As the size is always
the same (8 bytes), there is no need to pass the size in the function,
nor return the number of bytes copied.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2024-04-30 19:29:10 -05:00
Zhang Lixu 3cde0f7f18 sensing: fix doxygen warnings
Add missing doxygen comments in various sensing headers.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
2024-04-30 14:32:24 -04:00
Raffael Rostagno f4a6fd1f3f drivers: esp32: SDHC implementation
Implementation of SDHC driver for ESP32

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-04-30 18:23:06 +02:00
Jukka Rissanen 4b157b9099 net: lib: http_server: Initial HTTP server support
Original code developed as a GSoC 2023 project by Emna Rekik.

Code refactored in order to provide better bisectability
as the origical commits were not bisectable.

The server supports static and dynamic resources, managed by
HTTP_SERVICE/HTTP_RESOURCE macros.

Fixes #59685
Fixes #59686
Fixes #59688
Fixes #59690
Fixes #59670
Fixes #59700
Fixes #59684
Fixes #59693
Fixes #59693
Fixes #59694
Fixes #59699
Fixes #59696
Fixes #59688
Fixes #59690
Fixes #59670
Fixes #59700
Fixes #59685
Fixes #59686
Fixes #59688
Fixes #59691

Signed-off-by: Emna Rekik <emna.rekik007@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-04-30 13:25:22 +02:00
Robert Lubos 318dcb6336 net: lib: http_server: Add HPACK and Huffman code encoder/decoder
Add HTTP/2 helper libraries to encode and decode HPACK encoded headers,
according to RFC7541.

HPACK string encoding requires to support certain set of Huffman codes,
therefore implement Huffman encoder/decoder as well.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-04-30 13:25:22 +02:00
Jukka Rissanen 392f0ced2c net: http: service: Allow user to set TLS security tag list
Have separate macros to setup a HTTPS service.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-04-30 13:25:22 +02:00
Anas Nashif 9bc237abe8 doc: various doxygen fixes
Fix paramters and syntax of doxygen in various headers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-04-30 12:00:58 +02:00
Anas Nashif 49d443d56f clock_control: nrf: fix references to kconfig
Fix references to kconfig variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-04-30 12:00:58 +02:00
Anas Nashif ad63db9808 zbus: doxygen reference to kconfig
Fix references to kconfig variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-04-30 12:00:58 +02:00
Jiafei Pan 91c081833e drivers: clock_control: imx_ccm_rev2: add tpm clock
Add TPM clock support on i.MX 93 platform.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-04-30 08:53:59 +02:00
Jiafei Pan 073725e00f drivers: clock_control: imx_ccm_rev2: clean up header file
Peripheral mask is 0xFF00, so reorder the peripheral definitions to
be consecutive.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-04-30 08:53:59 +02:00
Flavio Ceolin a458d892e6 pm: device_runtime: Check busy status in runtime_enable
We can't enable device runtime power management in a device that is
set busy since it may suspend this device.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-04-30 08:53:18 +02:00
Declan Snyder 3ef9880457 include: mdio.h: Make bus functions optional
Make bus_enable and bus_disable optional for drivers
to implement by checking if it is NULL in the api struct.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-04-29 22:31:16 +01:00
Patryk Duda ef258166ba posix: Introduce getentropy() function
The function writes random data to the provided buffer. Maximum
permitted buffer size is 256 bytes. On success the function returns 0,
otherwise it returns -1 and sets errno to appropriate value.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-04-29 11:46:06 +01:00
Ajay Parida 1542140e4e net: wifi: Unicast frames statistics
Unicast RX stats
It represents total number of unicast (any type data, action or
any other unicast frames) frames received at firmware level.
The actual frames passed to host will be different as firmware
may drop packets or some packets may be dropped because of
errors.

Unicast TX stats
Transmission side the unicast packets count states the packets
handed over to firmware. The stats taken at firmware level.
Actual packets transmission may vary depending upon various factors.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-04-29 12:17:18 +03:00
Chris Friedt cdb1193f3e posix: add stubs for asynchronous io
Add stubs for POSIX asynchronous io that return -1 and set
errno to ENOTSUP.

The functions and structures in aio.h are required by the
_POSIX_ASYNCHRONOUS_IO Option as detailed in Section E.1 of
IEEE-1003.1-2017.

The _POSIX_ASYNCHRONOUS_IO interface is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 11:02:11 +02:00
Johan Hedberg d590bcb5e0 Bluetooth: Remove BT_HCI_RESERVE and BT_HCI_RAW_RESERVE
In most cases these were defined as 1. Saving one byte for the rest
doesn't really justify the added complexity that comes with these
options. Removing them also simplifies the interface between HCI
transports/drivers and the host stack, which in turn helps pave the way
for having HCI as a proper Zephyr driver API.

Fixes #71907

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-04-29 11:01:27 +02:00
Eric Johnson 69c5c6d511 kernel: Remove duplicate execution_cycles write and improve docstring
There is a duplicate write in `z_sched_thread_usage()` that can be
removed. Also modified the docstrings to `k_thread_runtime_stats` to
help better describe the differences between execution_cycles and
total_cycles when getting stats for the CPU or a thread

Signed-off-by: Eric Johnson <eric@memfault.com>
2024-04-28 13:04:20 -04:00
Karthikeyan Krishnasamy fc5ae0c165 net: mqtt: add user_data in mqtt client
add user_data to mqtt client to store
application related info

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-04-26 19:21:26 -04:00
Yong Cong Sin 9b7638f049 devicetree: implement `DT_INST_NODE_HAS_COMPAT`
Implement `DT_INST_NODE_HAS_COMPAT` to check if a node has a
compatible. This is helpful when a node has more than one
compatible, which can be used to enable additional features
in the driver.

Updated the devicetree test to play with the new API.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-04-26 20:04:38 +01:00
Tom Burdick c2c95e18ed rtio: Use CONCAT in place of ## in macros
Found issues when using ## to concatenate tokens in macros where the
resulting symbolic names were including the ## tokens themselves. Using
CONCAT everywhere fixes the issue.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-04-26 16:22:20 +02:00
Arunmani Alagarsamy 04931a54ee drivers: pinctrl: pinctrl_gecko: Add support for using pinctrl api
This update integrates I2C support with the pinctrl_configure_pins api
within the pinctrl_gecko driver.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@capgemini.com>
2024-04-25 18:07:48 -04:00
Phi Bang Nguyen de29ffb033 drivers: video_common: Add aligned allocation API
For some hardwares, it is very common that some aligment on the allocated
memory is required. For example, the PxP and eLCDIF of NXP require aligned
buffers so that their performances can be optimal.

Add a new video_buffer_aligned_alloc() API for these needs.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-04-25 17:58:57 -04:00
Mohamed ElShahawi 9ba4653243 kernel: work_queue: make thread essential flag configurable
Allow the creator of a work_queue instance to choose whether
the work_queue thread should be marked as ESSENTIAL or not.

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2024-04-25 21:40:24 +02:00
Jukka Rissanen 07599e3a53 net: vlan: Add a function to check if interface is VLAN one
We were missing a helper function that can be used to check
whether the given function is the virtual VLAN interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-04-25 11:06:23 +00:00
Dominik Ermel 68be1711c8 storage/stream_flash: Document write flush as mandatory
There is no need to make this optional just inform user that
this has to be called to complete write of buffers.
The commit also adds info that there should be no more write
attempts done with use of "flushed", as it may return write
errors anyway.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-25 09:53:57 +00:00
Al Semjonovs 0bca04635d shell: Allow extension of shell APIs
Similar to logging module, allow application specific extension of
shell fprintf APIs at a macro level.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2024-04-24 16:04:03 -04:00
Alvis Sun 3ed5f8a948 drivers: clock_control: npcx: add MCLKD as i3c source clock
1. The only valid values of MCLKD clock frequency
   are between 40Mhz to 50Mhz.
2. If DMA is used, the APB4_CLK clock frequency must
   be equal to or higher than 20Mhz.

Signed-off-by: Alvis Sun <yfsun@nuvoton.com>
2024-04-24 19:40:28 +00:00
Tomi Fontanilles a986905df5 modem: chat: implement helper defines/structs
Those helpers allow to define some typical kinds of chat matches and
scripts with more ease/less boilerplate.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-04-24 15:00:10 -04:00
Carles Cufi d20889d26f arm: irq: Disable clang warning on VFP clobbering
Clang warns the user whenever an ISR invokes a function that is not
marked with the `interrupt` attribute. This applies to the whole call
chain, which makes it unfeasible to add the attribute to add it to all
functions.

Instead, disable the clang warning just like it was done for the
equivalent GCC one in 5b3f80094e.

See also:
https://reviews.llvm.org/D28820

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-04-24 14:59:19 -04:00
Henrik Brix Andersen cba3a831e2 drivers: can: remove the use of bitfields from struct can_filter
Remove the use of bitfields in the can_filter struct.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-04-24 09:53:06 +02:00
Henrik Brix Andersen 09604d4044 drivers: can: validate arguments in can_add_rx_filter()
Validate the CAN ID and CAN ID mask used in the can_filter struct before
passing it to the driver.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-04-24 09:53:06 +02:00
Henrik Brix Andersen c8af469ce4 drivers: can: remove the use of bitfields from struct can_frame
Remove the use of bitfields in the can_frame struct.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-04-24 09:53:06 +02:00
Jonathan Rico b08b1c21a0 net: buf: Disallow blocking allocation in syswq
Work items on the syswq should always run-to-completion.

Override the timeout value to always be K_NO_WAIT.

Allocating with K_FOREVER leads to deadlocks if the freeing also happens
from the syswq. Non-zero timeouts are also not nice for the other users
of the syswq.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-23 19:47:24 -04:00
Fabio Baltieri 4a5fa01694 input: add a paw32xx driver
Add a driver for PAW32xx sensors.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-04-23 22:13:51 +00:00
Alberto Escolar Piedras f9d350f29e Revert "sys_sem: add a for-loop-like macro similar to spinlocks"
This reverts commit 3c6fdf27d0.

This PR:
https://github.com/zephyrproject-rtos/zephyr/pull/71718
introduced a regression breaking CI:
https://github.com/zephyrproject-rtos/zephyr/issues/71814
Let's just revert it until a better fix is done.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-23 11:51:44 -04:00
Jędrzej Ciupis f18ea95758 drivers: timer: nrf_grtc_timer: fix return type signedness
Negative error codes cannot be returned if the function returns an
unsigned integer. Change function's API to return the read compare
register value through a pointer and the actual result as a signed
integer.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2024-04-23 11:07:37 +00:00