Commit graph

928 commits

Author SHA1 Message Date
Chaitanya Tata e5972171ca hostap: Fix RSSI check for STA mode
RSSI should only be retrieved for STA mode, but the check was wrong.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Kapil Bhatt 8a5a5fb4b8 hostap: Add interactive keyword for commands
The keyword is added into array argv of wpa_cli.
The commands which require to be interactive
this keyword will allow ro print output for them.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata f0d856ff72 hostap: Skip searching for exiting networks
Before starting AP mode, we don't need to search for existing networks
and join them, as the use-case is starting SoftAP.

This speeds up the AP mode operation significantly.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 03304184bb hostap: Skip RSSI retrieval for AP mode
RSSI is only applicable for STA mode, as for AP there are multiple
peers. This causes failure and unnecessary delay, so just skip the
retrieval.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Jukka Rissanen e648f0c24a hostap: Make sure CONFIG_AP gets enabled in AP mode
If user enables AP mode, make sure CONFIG_AP symbol
is enabled so that access point sources get compiled etc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata f35de25ff1 hostap: Basic AP mode support
Implement AP mode Wi-Fi management operations.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata e59910aaa4 hostap: Refactor disconnect and Remove unused variable
WPA supplicant handle is not used anymore.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 8607327721 hostap: Move WPA CLI commands to helper function
This prepares for the upcoming AP mode support and moves re-usable code
to a common helper function.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata d99ba9ca4f hostap: Fix the configuration macro
hostapd macros should be used directly without prefixing with CONFIG.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 6eedef1bb6 hostap: Add missing sources for AP mode
These were missed in the original support.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata bb4eed2eb1 hostap: Move to data driven design
Instead of assuming that the array is perfectly aligned with enum, moved
to a data driven design, this decouples from the enum numbering and also
helps avoid repetition of the event string while parsing.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 3ae757aae8 hostap: Convert the unsupported event to warning
This is a implementation gap and shouldn't be exposed to customers.
But when we run with debug it still helps to identify any important
events that are not handled.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata e4698b414c hostap: Use the new enum for timeout
For connection timeout use the newly added enumeration.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 046edbb1b7 hostap: Implement detailed disconnection result
Use the newly added enumerations to translate from WPA supplicant status
codes to Zephyr Wi-Fi management status codes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata e5c90db6d6 hostap: Implement detailed connection result
Use the newly added enumerations to translate from WPA supplicant status
codes to Zephyr Wi-Fi management status codes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 74f83259a1 hostap: Fix build warnings
Using "%02x" needs an unsigned integer, but all MAC addresses use
"unsigned char/char" as the data type, so, to avoid warnings, use a
temporary array.

Also, the macro from the WPA supplicant doesn't use the address of the
array element and causes warnings, so re-define the macro with address
of the element.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata dc24fba40e hostap: Fix MAC address parsing with newlib nano
If the WPA supplicant internal event has a MAC address, and the sample
is compiled with newlib-nano then then the parsing fails because of lack
of support for C99 formatting options in nano [1].

Fix this by using supported specifier, even the code that encodes the
message uses the same format specifier.

[1] - https://docs.zephyrproject.org/latest/develop/languages/c/newlib.html#formatted-output

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Ravi Dondaputi 51731525ad hostap: Set frequency before enabling the network
Enabling a network would trigger a scan. Since frequency is being
set after enable_network, first scan is issued without any
specific frequency.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 9e9a067c02 hostap: Fix WPA-PSK handling
WPA-PSK was added a bit late, so, it wasn't properly implemented, use
both key management and protocol version to properly handle WPA-PSK in
both connection and also in the status.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 786fee7ae5 hostap: Fix WFA mandatory features
MBO and WMM-AC are mandatory for WFA certification, so cannot be
disabled for memory saving.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Emanuele Di Santo ef5dda3378 hostap: kconfig: let entry be a menuconfig
wpa_supplicant has a lot of entries, and it appears in the top-level menu.
Let it be a menuconfig, so that it gets its own menu page with
all the options, instead of expanding in the top-level menu when
selected.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 2559fafb13 hostap: Check for band and channel compatibility
If a user provides both band and channel then check if they are
compatible or not.

Also, move the multiple remove network cleanup to goto.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 5c24db3b1f hostap: Fix supported channels for unknown band
By default Wi-Fi works on all bands, so, the band will be unknown, in
which case no need to configure a specific frequency list to WPA
supplicant.

Only when a use provides a specific band then this is needed.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 99e472b79e hostap: Add support for MbedTLS builtin
This allows the WPA supplicant to build using the builtin MbedTLS.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Ravi Dondaputi 028d3a4f0f hostap: Automatically fetch support channels
If a specific band is configured, automatically fetch and configure the
supported channels.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata c1a0ac883f hostap: Add an option to remove advanced features
For a memory constrained system, basic Wi-Fi is enough, so, add a
configuration option to compiled out advanced Wi-Fi features.

This also supports choosing individual features if needed.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 65ebae81dc hostapd: Use dedicated WPA supplicant workqueue
This should solve latency issues with using system workqueue and can now
closely implement the configured timeout.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 68fb2e97ae hostap: Fix the macro rename
The macro for crypto has been renamed (and as a choice), so, use the
new macro to see if the crypto has been enabled.

Fixes WPA2/WPA3 association.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 73e89a2416 hostap: Enable TLS only for Enterprise
This hardly saves flash but helps us in doing PSA port stagewise,
personal first and then enterprise.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata a9e282c285 hostap: Fix missing dependencies for PSA
Due to a bug in Kconfig, both legacy and PSA crypto were enabled
earlier, so, the dependencies for PSA were missed as they were provided
by legacy.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Vivekananda Uppunda c8d0e5f5fc hostap: Add channel set support
This set of changes introduces an API to set the channel when
the device is working in independent Monitor or TX injection mode

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Vivekananda Uppunda 5ffecde140 hostap: Add Packet filter support
This set of changes brings in packet filter API for Monitor and
promiscuous mode operation

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Vivekananda Uppunda 5a87ce5e10 hostap: Provide setting mode related changes to hostap module
This change provides mode setting API to hostap module.

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Chaitanya Tata 8b16d8cffa hostap: Fix memory leak
The control interface is initialized on every interface add but only
de-initialized on WPA supplicant termination. This leaks all cleanups in
the control interface dei-init.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Joakim Andersson 103a8606d9 hostap: kconfig: Enable AES key type for AES block cipher support
Enable the PSA key type which enables AES block cipher support.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Joakim Andersson 465c59f947 hostap: Kconfig: Fix PSA dependency on random numbers
Fix PSA dependency on random number support.
Random number generated is wanted, instead of a specific PRNG algorithm.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Krishna T c99aac00c4 hostap: Switch to PSA Kconfig
We need to use PSA MbedTLS template to get entropy working.
Rather than having a single set of options which makes dependency
management tough, have a separate entry for PSA based MbedTLS which
is enabled by for NS variants only.

Also, don't use MbedTLS APIs for entropy, instead use the Zephyr APIs
that can work for both NS and S builds.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Jukka Rissanen 864af13666 Revert "hostap: Remove commented Kconfig options"
The following commits will re-introduce functionality that
the earlier commit removed, so revert the earlier commit.

This reverts commit 64423e269e.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-20 09:00:52 +01:00
Erik Tamlin cb99303dd4 west: percepio: update module
Update the percepio module to use TraceRecorder v4.8.2
and DevAlert (DFM) v2.1.0

Signed-off-by: Erik Tamlin <erik.tamlin@percepio.com>
2024-03-19 06:50:19 -04:00
Magdalena Pastula 92f1b3ff96 modules: hal_nordic: nrfx: propagate new configs to nrfx
Add support for propagating SOC_NRF54LX_DISABLE_FICR_TRIMCNF and
SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE values to nrfx.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-03-19 09:47:58 +01:00
Andrzej Głąbek cec6ab0dcd modules: hal_nordic: Remove support for nRF54H20 EngA
This was a preview revision of the SoC that will no longer
be supported.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-03-18 19:11:36 +00:00
Andrzej Głąbek eac91bf8ac modules: hal_nordic: Add nrfx configuration needed for nRF54H20
Add cmake and nrfx_config entries that allow building for the nRF54H20
SoC.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-03-18 19:11:36 +00:00
Andrzej Głąbek e3d7c3b6e9 modules: hal_nordic: Align nRF54H20 nrfx_configs with nrfx templates
- add new entries that appeared in nrfx 3.4.0
- correct the default IRQ priority value for PPR (it is intended to be
  the lowest prority, so unlike for ARM cores, for RISC-V it should be
  the lowest value)

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-03-18 19:11:36 +00:00
Nikodem Kastelik ca147ff637 modules: hal_nordic: nrfx: include config for nrf54l15
Both nRF54L15 and nRF54L15 EngA uses same nrfx config file.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-03-15 06:26:44 -04:00
Reto Schneider 2d9a2cec8d modules: tf-m: Prevent unwanted updating of HAL
Since the move to HW model v2, the MCUxpresso NXP SDK drivers got
updated during the build due to a missed rename. This caused parallel
builds and CI to become flaky.

This fixes issue #70215.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-14 11:04:29 -05:00
Mahesh Mahadevan f93e37e84b soc: mcxn947: Add support for NXP MCXN947
Add initial support for NXP MCXN947 SoC

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-03-13 22:38:46 +00:00
Declan Snyder 5f53afca0a soc: nxp: Add RW SOC Family
Add SOC definition for NXP RW Family

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-03-13 16:45:13 +00:00
Daniel DeGrasse dae5c29959 boards: nxp: lpcxpresso55s69: fix TF-M support
Fix TF-M support for lpcxpresso55s69 target. The following issues were
resolved:

- lpcxpresso55s69 ns defconfig did not explicitly disable
  CONFIG_TRUSTED_EXECUTION_SECURE (which is set in the secure cpu0
  defconfig file)
- CONFIG_TFM_BOARD was not being set correctly for the NS target

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-12 11:04:13 -04:00
Andrzej Głąbek 6692d880e9 modules: hal_nordic: Enable support for DPPI on nRF54H20
Include into compilation the nrfx_gppi_dppi_ppib helper and related
interconnect layers when DPPIC nodes are enabled in DTS. Provide macro
definitions required by those interconnect layers based on information
from devicetree (the nrf_grtc_timer is only modified because a macro
that it uses became more generic).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-03-12 14:27:16 +00:00
Maciej Baczmanski ba2a8bd795 manifest: openthread: Regular openthread upmerge
Adds `CONFIG_OPENTHREAD_SRP_ADV_PROXY` option

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2024-03-11 15:21:46 +00:00