This provides the infrastructure to create network packet filter rules
and to apply them to the RX and TX packet paths. Rules are made of
simple condition tests that can be linked together, creating a facility
similarly to the Linux iptables functionality.
A couple of generic and Ethernet-specific condition tests are also
provided.
Additional tests can be easily created on top of this.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Cleanup in log_instance.h:
- prefixing internal macros with Z_
- adding doxygen documentation
- using COND_CODE_1 instead of ifdefs
Additionally, added LOG_INSTANCE_PTR macro which allows to get
pointer to instance. It can be used to reuse single instance
for multiple module layers when doing instance logging.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
- Supporting multiple instances of ivShMem virtual devices.
- Introduces DT based configuration for ivShMem devices.
- Add DTS overlay file to test new multiple ivshmem instance capability.
- Enable BDF unspecified device initialization.
(limited to one instance. An improved version of pcie_bdf_lookup()
will come soon that fixes this limitation)
- Make PCIE DTS file macros available for a proper ivshmem device
properties parsing.
Sample for dts file:
pcie0 {
label = "PCIE_0";
#address-cells = <1>;
#size-cells = <1>;
compatible = "intel,pcie";
ranges;
ivshmem0: ivshmem@800 {
compatible = "qemu,ivshmem";
reg = <PCIE_BDF_NONE PCIE_ID(0x1af4,0x1110)>;
label = "IVSHMEM";
status = "okay";
};
};
Signed-off-by: Michael Schmidt <michael1.schmidt@intel.com>
When the case machine timer clock uses the divided system clock,
k_cycle_get_32() can't measure accurately how many cycles elapsed.
For example, use the value as timer clock obtained by dividing
the system clock by 4.
In this case, measuring a duration with k_cycle_get32() has up to 3
(4-1) cycles systematic error.
To run this test, we need to insert an appropriate of nops
with consideration for the errors.
'nop' can not repeat with for loop.
Must insert as separated statement.
But we don't have a convenient function such as
BOOST_PP_REPEAT in C++.
At this time, Implementing a generic test is a bit difficult.
Skipping this test in the case.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Implemented driver for the simcom sim7080 modem.
This driver features Socket offloading, TCP, UDP, DNS,
SMS, GPS and FTP.
Signed-off-by: Lukas Gehreke <lk.gehreke@gmail.com>
Remove the requirement for specifying #address-cells and #size-cells
properties for CAN controller devicetree nodes.
CAN controllers do not have a common concept of devicetree child nodes
and thus have no need for these properties. This is in line with
upstream Linux kernel devicetree bindings.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Verify that Route Info data received in Router Advertisment creates a
route and correctly populates the net_route_entry structure.
Additionally, extend the MTU on the test interface, to accomodate the
extended Router Advertisement message.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Implement a concept of Route Preference, as specified in RFC 4191. The
Zephyr host will prefer routes with higher preference, if they lead to
the same prefix through different neighbours.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit adds 3 tests that check:
- Publish period state
- Publish retransmit count and interval steps states
- Canceling periodic publication and publication retransmission
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit introduces the following changes:
* nrf_rtc_timer is extended with a capability to handle RTC overflow,
allowing it to operate on absolute RTC ticks, rather than relative
ticks.
* overflow handling is ZLI-proof and relies on the sys clock
handler being executed twice every RTC counter's overflow.
* callbacks are given an absolute RTC tick value as a parameter instead
of CC register's value. The absolute RTC tick value is the RTC counter
value set during CC channel configuration extended to 64 bits.
* in case the timer's target time is in the past or is the current tick,
the timer fires as soon as possible, however still from the RTC's ISR
context.
* in case an active timer is set again with the same target time, it is
not scheduled again - only its event data is updated. Otherwise, the
timer is scheduled as usual.
* a scheduled timer can be aborted.
* system clock functions are now using 64 bit values internally.
Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
Adding cmake_minimum_required() as this is required by CMake.
CMP0000 is a deprecated policy which allows to omit this function call,
however doing so will result in CMake printing a warning.
Adding cmake_minimum_required() to tests missing this call will remove
the warning and also allow us to remove the policy setting.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
* add generic heap event listener module that can be used
for notifying an application of heap-related events
* use the listener module in newlib libc hooks
* add a unit test
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Adding support for the TI TMP108 temperature sensor. This includes
over/under temp interrupt support as well as one shot, continuous
conversion and power down modes.
Signed-off-by: Jimmy Johnson <catch22@fastmail.net>
Various obsolote and misnamed platfomrs in test filters theat went
undetected for a while.
Fixes#41222
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Check that DT_INST_PARENT behavior is correct. Re-uses existing overlay
definitions (child of TEST_SPI_BUS_0) to test the behavior.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The pm_device_runtime_enable did not suspend devices, so it assumed that
the device was in a physically suspended state. This change makes sure
that device is left in a suspended state if the device is initially
active.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
In case runtime PM is not enabled (or not built-in), the get/put
functions always return 0 (instead of -ENOTSUP/-ENOSYS). When runtime PM
is disabled, a device is left into active state. Similarly, when device
runtime PM is not built-in, it is safe to assume that a device will
be active when it is called. If a user implements a custom solution, it
is its responsability to make sure that a device is active when using
it. For all these reasons, the -ENOTSUP/-ENOSYS are error codes that
should always be ignored by devices using get/put, since in practice it
means that: device is active, function is a no-op. The example below
illustrates how error handling is simplified:
```c
/* before: safe to ignore -ENOSYS/-ENOTSUP since device is active (we
* can continue)
*/
ret = pm_device_runtime_get(dev);
if ((ret < 0) && (ret != -ENOSYS) && (ret != -ENOTSUP)) {
return ret;
}
/* now */
ret = pm_device_runtime_get(dev);
if (ret < 0) {
return ret;
}
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Increase the L2CAP buffer count, for the media control shell to work.
(The buffer count was set to an even higher value in the
topic-le-audio branch, but that setting was not upmerged.)
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
The le-audio host shell enables extended advertising. Therefore, for
the shell to be usable, extended and periodic advertising must also be
enabled for the controller.
The controller configuration are added to board-specific files for the
time being, as the advertising features are still experimental
upstream.
Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
Change the function pm_device_runtime_enable() to return 0 on
success or an error code in case of error.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Create an explicit ina230 driver which is supposed to
work with 230 and 231 variants. While at it switch
to i2c_dt_spec helpers and change device-tree node
names to use - instead of _ in order to follow
convention.
Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
When CONFIG_TRACING_OBJECT_TRACKING is enabled, the kernel will keep
lists of some objects (detailed below), so that debuggers or other tools
can keep track of them.
The lists of objects are:
struct k_timer *_track_list_k_timer;
struct k_mem_slab *_track_list_k_mem_slab;
struct k_sem *_track_list_k_sem;
struct k_mutex *_track_list_k_mutex;
struct k_stack *_track_list_k_stack;
struct k_msgq *_track_list_k_msgq;
struct k_mbox *_track_list_k_mbox;
struct k_pipe *_track_list_k_pipe;
struct k_queue *_track_list_k_queue;
Note that while CONFIG_TRACING is needed, one can always use
CONFIG_TRACE_NONE=y. Also, tracking will only be done for objects that
are also being traced (so, to prevent tracking of some type of object,
such as k_timer, just make CONFIG_TRACING_TIMER=n).
Some simple "sanity checking" tests are also added in this patch.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Exclude hifive1 board from tests/kernel/workq/work/kernel.work,
this board has a issue with this test suite and block all related
CI.
Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
PA1 is connected to ethernet RMII Reference Clock signal
and it impacts the TIMER signal.
Change to PA3 on Arduino A0 connector
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
In test_queue_append_list_error function, try to append an unnormal
list to check if the data is successful to append, and improve the
coverage for queue.c
Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
Adds a disk driver test, intended for the NXP USDHC driver but valid for
any disk device. The test performs multiple reads and writes to the
disk, and verifies that the driver does not write out of bounds to the
provided buffer.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
RT1xxx SOCs using the GPT timer require a custom ISR table for the arm
irq_vector_table test, since they use a custom system timer implemented
using the GPT peripheral. Implement the required vector tables within
the irq_vector_table test to enable it to run.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Thread APIs test for k_busy_wait incorrectly asserted that a delay of
100 us should produce a delay in cycles less than or equal to to 100 cycles
of the hardware clock. Since most hardware clocks are fast, this assertion
was valid, but it does not test for the actual delay.
Fix the assertion to verify that a delay of 100 us produces a delay in
cycles less than or equal to 100 us worth of hardware clock cycles.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The coredump tests output quite a large amount of data into
the console. However, the ACRN console only has very limited
history (comparatively), such that twister is unable to
match the necessary strings to consider the tests passed.
So skip those tests on acrn_ehl_crb.
Fixes#40887
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Prepare the driver to upcoming support of more mux references.
Rename all TCA9546A related files to TCA954x.
Keep ti,tca9546a and ti,tca9546a-channel compatible
for backward compatibility reasons.
New tca954x-base binding embedding common properties,
tca9546a binding inherits from it and define its own compatibles fields.
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
Replace deprecated macro USBD_CFG_DATA_DEFINE by
USBD_DEFINE_CFG_DATA which places usb_cfg_data structures
in specific iterable section.
Replace __usb_data_start, __usb_data_end usage patterns
size_t size = (__usb_data_end - __usb_data_start);
for (size_t i = 0; i < size; i++) {...}
by
STRUCT_SECTION_FOREACH(usb_cfg_data, ...) {...}
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The warning below appears once -Waddress-of-packed-mem is enabled:
/__w/zephyr/zephyr/tests/lib/mpsc_pbuf/src/main.c: In function
'item_put_data_overwrite':
/__w/zephyr/zephyr/tests/lib/mpsc_pbuf/src/main.c:497:3: error:
converting a packed 'struct test_data_ext' pointer (alignment 1) to a
'uint32_t' {aka 'const unsigned int'} pointer (alignment 4) may result
in an unaligned pointer value [-Werror=address-of-packed-member]
497 | mpsc_pbuf_put_data(&buffer, (uint32_t *)&item, len);
To avoid the warning, as well as several others related to the same
problem, use an intermediate void * variable.
More info in #16587.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The warning below appears once -Waddress-of-packed-mem is enabled:
/__w/zephyr/zephyr/tests/kernel/mem_protect/userspace/src/main.c: In
function 'test_main':
/__w/zephyr/zephyr/tests/kernel/mem_protect/userspace/src/main.c:1024:17:
error: converting a packed 'k_thread_stack_t' {aka 'struct
z_thread_stack_element'} pointer (alignment 1) to a 'struct
z_x86_thread_stack_header' pointer (alignment 4096) may result in an
unaligned pointer value [-Werror=address-of-packed-member]
1024 | hdr = ((struct z_x86_thread_stack_header *)ztest_thread_stack);
To avoid the warning, use an intermediate void * variable.
More info in #16587.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>