Commit graph

32 commits

Author SHA1 Message Date
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
Jukka Rissanen 64423e269e hostap: Remove commented Kconfig options
Some crypto Kconfig options were commented out, so remove them.
These will be re-introduced later when adding crypto support
properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen 0e51913a18 hostap: Temporary kconfig options to pass the compliance checker
Compliance checker does not allow compile definitions without
a Kconfig option. So add dummy values for time being. These should
be removed at some point and replaced with properly namespaced
options.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen 6fdb6d5169 hostap: Replace the command line cmd macro
Zephyr compliance checker does not like macros that have control
structures like goto. So change the macro to align with this rule.
Also rename the macro and remove the __ prefix as it not needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen bf58765b6c hostap: Change the name of the control api struct
Zephyr requires that the name of the variable is not the
same as the struct as seen by this warning:

modules/hostap/src/supp_api.c:64:WARNING:
  Violation to rule 5.7 (Tag name should be unique)
  tag: wpa_supp_api_ctrl

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen 7fad50fe4c hostap: Avoid DHCPv4 related warnings if DHCPv4 is disabled
If the DHCPv4 is disabled, then avoid linking warning about
missing DHCPv4 functions. Also include dhcpv4.h so that the
DHCPv4 function prototypes are found by the zephyr supplicant
driver.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen d5ba20b9be hostap: Align to Zephyr coding style
Tweaked the code to be more readable and align to
Zephyr coding style.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen 1f79c110a7 hostap: Various changes to the API to wpa_supplicant
Changed the names of the API functions between wpa_supplicant
and Zephyr upper layers. For example replaced the z_ prefix
by zephyr_ as the z_ is only meant for internal kernel
functions.

Changed the wpa_supplicant startup so that we do not poll
but wait the network interface add event which then adds
the network interfaces to the supplicant.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen e352a6e8e9 wifi: Have a separate wifi_drv_ops in wifi_mgmt_offload struct
There is no need to hide the wpa_supplicant interface
struct so add it directly to net_wifi_mgmt_offload struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Chaitanya Tata e2f4711629 hostap: Add Zephyr support
Add new files from hostap to Zephyr build.
Add wifi mgmt thread that communicates with supplicant.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 15:52:54 +00:00
Jukka Rissanen 83c875adab hostap: Move the relevant config options away from hostap
Moving the Zephyr specific config options from
modules/hostap/Kconfig to corresponding Kconfig where the
option is specified.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-26 09:48:47 +02:00
Sridhar Nuvusetty ab5821a8c8 hostap: Add build support for Zephyr
Only adds basic build support using Zephyr. Crypto support is disabled
till the MbedTLS integration is complete.

Signed-off-by: Sridhar Nuvusetty <sridhar.nuvusetty@nordicsemi.no>
Signed-off-by: Sachin Kulkarni <sachin.kulkarni@nordicsemi.no>
Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-10-26 09:48:47 +02:00