Commit graph

106248 commits

Author SHA1 Message Date
Pieter De Gendt
e9e64bab35 drivers: bluetooth: hci: Place API into iterable section
Add wrapper DEVICE_API macro to all bt_hci_driver_api instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-29 14:49:53 +01:00
Fabio Baltieri
3146a5552f input: prevent the caller from sleeping in sysworkq
Sleeping in sysworkq is a very bad idea, it can trash any hope of
realtimeness at best, deadlock the whole system at worse.

Add a check to input_report to downgrade the event to K_NO_WAIT
automatically when called from the sysworkq, similarly to what's done by
other APIs (netbuf and bluetooth), though only log if messages are
actually dropped.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-11-29 14:49:43 +01:00
Ludvig Jordet
dac8d7c397 Tests: Bluetooth: Mesh: Add Subnet Bridge KRP tests
This adds a test that checks that the Subnet Bridge behaves correctly
when one or more of the involved subnets are undergoing the Key Refresh
Procedure.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2024-11-29 14:49:34 +01:00
Ludvig Jordet
1453f6e4ea Tests: Bluetooth: Mesh: Refactor and cleanup of test_brg
This introduces a global variable controlling the number of remote nodes
used in a given test case. This allows removal of the `TEST_TYPE_...`
enums and further tests in the future that can use different remote node
counts.

This also cleans up the test source by extracting common tester
initialization to separate functions, avoiding repetition.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2024-11-29 14:49:34 +01:00
Ludvig Jordet
88f62a1a5e Bluetooth: Mesh: Fix cfg_cli KRP not working for key_net_idx != 0
Initializes the `net_idx` field of the ack context properly for KRP
functions in the Config Client.

This fixes a problem where `bt_mesh_cfg_cli_krp_get` and
`bt_mesh_cfg_cli_krp_set` would always fail the ack ctx comparison if
`key_net_idx` was != 0.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2024-11-29 14:49:34 +01:00
Chaitanya Tata
619cdb64f4 wifi: Fix current PHY rate handling
Fix the name to include TX and also add units to the shell display.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-29 11:45:58 +01:00
Chaitanya Tata
2e7f6311bf modules: hostap: Add support to read TX PHY rate
Useful for matter applications.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-29 11:45:58 +01:00
Chaitanya Tata
54b21b6a54 Revert "hostap: Add currnet PHY rate to status"
This reverts commit ec0b9ccbc1.

This commit has two issues:

1. We already query signal poll just above, so, wastes time querying the
   infor from the firmware.
2. Doesn't handle modes, i.e., queries even for AP mode as well.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-29 11:45:58 +01:00
Pieter De Gendt
2c276718a1 submanifests: optional: Add zephyr-keep-sorted check for projects
Use the regex mode for zephyr-keep-sorted to verify alphabetical order
of projects.
Sort accordingly

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-29 11:45:46 +01:00
Pieter De Gendt
c689387149 manifest: Add zephyr-keep-sorted check for projects
Use the regex mode for zephyr-keep-sorted to verify alphabetical order
of projects.
Sort accordingly

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-29 11:45:46 +01:00
James Roy
5df9611dc9 drivers: sensor: st: Fix uninitialized variable in lsm6dsv16x
Fix uninitialized val variables scanned by Coverity.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-11-29 11:45:32 +01:00
Jonny Gellhaar
9bb5d1e784 soc: stm32wb: fix ble low-power
Release HSI CLK48 semaphore when going to sleep to allow C2 (M0)
core to start and stop clock as needed while C1 core is not running.

CLK48 is shared between RNG and USB. RNG is needed by M0 during BLE
advertisement. If semaphore is locked, C2 core can start it when it
needs to but not stop it.

Fixes zephyrproject-rtos#69955.

Signed-off-by: Jonny Gellhaar <jonny.gellhaar@prevas.se>
2024-11-29 11:45:20 +01:00
Chew Zeh Yang
0d02cdca46 drivers: udc_ambiq: defer enqueue event if the endpoint is stalled
Ambiq USB HAL do not expect endpoint transaction request when an
endpoint is stalled. This commit addresses this behavior in shim driver
by checking for endpoint's stall status when enqueue request is
received, and defer it until endpoint stall is cleared.

Signed-off-by: Chew Zeh Yang <zeon.chew@ambiq.com>
2024-11-29 11:45:10 +01:00
Adam Kondraciuk
0bb3a1ccff dts: nordic: nrf54h20: Update pm policy values
Apply nRF54H20 `min-residency-us` and `exit-latency-us` values for
existing power states.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-11-29 11:44:59 +01:00
Krzysztof Chruściński
923d313a04 dts: common: nordic: nrf54l: Add hfpll clock source
Add 128 MHz clock source and use it for uart00. Baudrate setting
must be adjusted based on uart clock source so without this
change there is wrong baudrate on uart00.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-11-29 11:44:49 +01:00
Robert Lubos
860233d0c8 doc: migration-guide-4.1: Add note about default netmask value
Add an entry about a default IPv4 netmask value.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-29 11:44:39 +01:00
Robert Lubos
6ac2ab70a2 tests: net: misc: Use different subnets on test interfaces
The test interfaces registered addresses within the same subnet. As now
only the subnet part of the address is verified when choosing source
address or interface, it was not deterministic which interface would be
selected. Therefore, make the two interfaces use two different subnets
so that tests that verified which address/interface was used work
reliably as earlier.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-29 11:44:39 +01:00
Robert Lubos
a32d339c34 net: ipv4: Specify default netmask for IPv4 addresses registered
When IPv4 address is added, currently the netmask remains empty. This
makes it impossible to use the address now that the netmask is
considered during address selection if the application does not
specify the netmask manually. Therefore specify a default netmask for
IPv4 addresses added to an interface with Kconfig.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-29 11:44:39 +01:00
Robert Lubos
68241fb1e2 net: ipv4: Filter the subnet part of the IPv4 addr when choosing src
Bit-wise comparing of the entire IPv4 addresses doesn't make much sense
as when selecting the source address for communication, what really
matters is the subnet part.

Doing so may actually lead to unexpected results, i. e. two addresses
within the same subnet should be considered equally good for
communication within the subnet, yet comparing the unique part of
the address (beyond the netmask) may lead to different results.
This is a problem for the mechanism of preferring the default interface
for LL communication if two interfaces have LL addresses with the
default subnet mask.

Fix this by filtering out the subnet from the IPv4 address before
passing it to net_if_ipv4_get_best_match() function.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-29 11:44:39 +01:00
Robert Lubos
0ee17d9aa3 tests: net: ip-addr: Add test case verifying default iface is preferred
Add a test case which validates that if two network interfaces are
equally good wrt net mask for LL IPv4 communication, the default
interface is preferred.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-29 11:44:39 +01:00
Robert Lubos
a909b538dc net: ipv4: Rework source address matching for LL addresses
Currently we blindly return the LL address found on the default
interface or else on the first interface that has a valid LL address
configured.

This doesn't work well, if different interfaces have LL addresses
configured with a different subnet mask. Therefore, instead of blindly
selecting the address based on the first LL address encountered, use
net_if_ipv4_get_best_match() function for LL addresses to find the best
match for the given interface.

The rework takes into account current behavior, i. e. default interface
still gets the preference if there is no better candidate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-29 11:44:39 +01:00
Robert Lubos
9db7f8d0a0 tests: net: ip-addr: Add test case for an IPv4 LL address selection
Add a test case verifying that a proper source IPv4 address and
interface is selected for a given LL destination address.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-11-29 11:44:39 +01:00
Tomasz Moń
df36b162bd drivers: udc_dwc2: Wait for USBHS clock start
Accessing DWC2 otg core registers before the clock starts results in
complete system hang. Add a 1 us busy wait to make sure that software
won't access registers before the clock is started.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-11-29 11:44:26 +01:00
Ilya Tagunov
065bd32220 tests: secure_storage: psa: enable malloc arena for Mbed TLS
The PSA Crypto implementation provided by Mbed TLS generally requires
some amount of heap to function, so enable the arena unconditionally
to make the test compatible with MINIMAL_LIBC configurations where the
arena is disabled by default.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-11-29 09:21:13 +01:00
Armando Visconti
b7ffb3d59d sensor/st: lsm6dsv16x: Fix lsm6dsv16x_attr_get() API
Fix a couple of typos when getting the accelerometer configuration.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-11-29 09:21:03 +01:00
Marvin Ouma
8faa486430 tests: posix: common: separate posix signal tests into a smaller testsuite
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves signal tests into a singular
testsuite at tests/posix/signals app directory.

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2024-11-29 05:42:17 +01:00
Chaitanya Tata
9762c32115 wifi: Update help/notes for forcing regulatory domain
With recent changes the regulatory domain is handled via the hostap
rather than by passing and going through the driver and hostap doesn't
have any option for forcing the regulatory domain, so, add a note to
reflect that this is implementation dependent to cover both hostap as
well other offloaded implementations.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-29 05:42:03 +01:00
Gerard Marull-Paretas
6b11e91ce0 boards: microchip: remove CONFIG_PINCTRL=y entries
They are no longer needed, drivers select this as needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-29 05:41:53 +01:00
Gerard Marull-Paretas
c4c53f87fe soc: microchip: mec*: remove redundant PINCTRL/GPIO defconfigs
These options must be selected by drivers that use the associated
APIs.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-29 05:41:53 +01:00
Gerard Marull-Paretas
4f6de0169c drivers: microchip xec: select PINCTRL
All drivers using the pinctrl API must select the PINCTRL option.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-29 05:41:53 +01:00
Rex Chen
03482705f7 modules: hostap: fix eap server ttls macro typo
Fix typo of CONFIG_EAP_SERVER_TTLS macro in CMakeList.txt.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-11-28 20:53:41 +01:00
Gerard Marull-Paretas
9465610d9f samples, tests: lora: remove CONFIG_SPI|GPIO=y
This is no longer needed, drivers selects SPI and GPIO as needed.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-28 20:53:11 +01:00
Gerard Marull-Paretas
55cdc5a93e drivers: lora: sx12xx: select SPI and GPIO
Instead of depending on SPI/GPIO. This allows to just enable
CONFIG_LORA=y + DT node in the application layer. The same
pattern is nowadays followed by most drivers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-28 20:53:11 +01:00
Gerard Marull-Paretas
e913a97489 dts: arm: rakwireless: add RAK3172 LoRaWAN module
Add DT definitions for the RAK3172 LoRaWAN module, based on
STM32WLE5.

Ref. https://docs.rakwireless.com/product-categories/wisduo/
             rak3172-module/low-level-development/

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-11-28 20:52:54 +01:00
Jukka Rissanen
16669ec4d5 tests: net: dns: Add test for invalid DNS answer parsing
Make sure we catch invalid answer during parsing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
6e7fcff579 net: dns: Check DNS answer properly
The dns_unpack_answer() did not check the length of the message
properly which can cause out of bounds read.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
43c2b9cfe8 net: dns: Validate source buffer length properly
Make sure that when copying the qname, the source buffer is large
enough for the data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
6f96915a14 tests: net: dns: Add checking of malformed packet
Make sure we test malformed packet parsing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
eb2550a441 net: dns: Check parsing error properly for response
If the packet parsing fails in dns_unpack_response_query(), then
do not continue further but bail out early.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:20 +01:00
Jukka Rissanen
3c59bd4fb5 net: wifi_cred: Decrease flash usage for error print strings
As the error print strings are very similar, construct the final
output at runtime to save some flash space.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Jukka Rissanen
8deebcec21 net: wifi_cred: Remove extra empty lines
Follow net coding style and remove extra new lines between
variable set and checking its value.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Jukka Rissanen
b2056e0966 net: wifi_cred: Introduce variables at the start of function
Follow the net coding style and declare the variables at the start
of the function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Jukka Rissanen
3aa0c8670e net: wifi_cred: Check null before access
We must do null check before trying to access the fields.

Fixes #81980
Coverify-CID: 434549

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-11-28 20:52:06 +01:00
Andy Ross
b4fb833eb9 soc/mediatek/adsp: Source timer rate from DTS
These devices have an architecturally fixed 13 MHz clock device.  But
thankfully you can put a default into a DTS binding so we don't have
to repeat it for all of them.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
09495c9e48 soc/mediatek: Ruffify python scripts
These in-tree scripts fail the new ruff checks.  Clean things up so
modifications can merge.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
fe5c11db05 boards/mediatek: Add mt8196_adsp
Add Zephyr support for the Audio DSP on the MT8196 SOC.  This is a
very similar device to previous designs.  Most of this patch is just
DTS.

The biggest delta is the more complicated second level interrupt
controller, though it is still able to be represented using some
vaguely clever DTS config over the older intc_mtk_adsp driver.

Also the memory layout is slightly different, requiring a little
indirection to set the initial boot stack address and log output
buffer.  And the timer "irq_ack" register bits moved.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
e35de00f86 soc/mtk_adsp: Update gen_img.py address space rules
New platform has different mappings.  Auto-detect rather than parse
dts or similar, as this is is really just a simple format for testing.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
3c0269f4f6 soc/mtk_adsp: Add missing z_prep_c() prototype
The early boot function got renamed to a pseudo-standard "z_prep_c",
but this isn't an actual API and doesn't have a prototype in the
headers anywhere, so the compiler started whining about an undeclared
function.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
4b3874b9ea boards/mediated: Add twister.yaml
Add a twister YAML file for these devices.  Right now they're flagged
as xt-clang only, though xcc and SOF-derived gcc toolchains are known
to work too.  We'll enable the zephyr SDK once sdk-ng support lands.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00
Andy Ross
cc43e3a527 soc/mediatek: Add missing snippets sections
This got missed by the first version, but recent SOF needs it for
STRUCT_SECTION_ITERABLE usage.

Signed-off-by: Andy Ross <andyross@google.com>
2024-11-28 20:51:50 +01:00