Drop the Espressif-specific ESP32_WIFI_STA_AUTO_DHCPV4 Kconfig and
switch the driver to the generic WIFI_STA_AUTO_DHCPV4 option added
in the Wi-Fi L2 layer. The new option provides the same behavior
across all in-tree Wi-Fi drivers, allowing applications to control
automatic DHCPv4 start uniformly regardless of the underlying SoC.
A migration note is added so applications that previously disabled
the vendor option know to disable the generic one instead.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Update Infineon AIROC Wi-Fi driver to use the new WIFI_STA_AUTO_DHCPV4
config option instead of directly checking CONFIG_NET_DHCPV4 when
deciding whether to automatically restart the DHCPv4 client after STA
connection is established.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Update NXP Wi-Fi driver to use the new WIFI_STA_AUTO_DHCPV4 config
option instead of directly checking CONFIG_NET_DHCPV4.
This allows the driver to respect the application's preference for
automatic DHCPv4 startup behavior, while still supporting the DHCPv4
functionality when enabled in the network stack.
The driver now only manages the DHCP timer and automatic DHCP client
startup when CONFIG_WIFI_STA_AUTO_DHCPV4 is enabled. When disabled,
the DHCPv4 client can still be used if CONFIG_NET_DHCPV4 is enabled,
but must be manually controlled by the application layer.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Include zephyr/logging/log.h in the AIROC WHD HAL files that use
LOG_MODULE_DECLARE() and LOG_ERR().
This fixes builds of samples/net/wifi/shell for
cy8cproto_062_4343w/cy8c624abzi_s2d44.
Fixes#109151
Signed-off-by: Shan Pen <bricle031@gmail.com>
Set pmf_cfg.capable for WPA2-PSK so the station advertises PMF
capability, which transition-mode APs require to associate.
Add WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL handling. STA path uses
WPA2-PSK threshold with PMF capable so it can still associate to
WPA2-only and transition APs. AP path advertises WPA2/WPA3 mixed
mode, guarded by CONFIG_ESP32_WIFI_SOFTAP_SAE_SUPPORT.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The original net.c in hal_nxp contains Zephyr-specific code, which
violates the rule that HAL 'Zephyr modules should not contain code that
is written exclusively for Zephyr'.
Move the network porting layer and Zephyr relocation related CMakelist
change into drivers/wifi/nxp to align with Zephyr architecture.
Also fix build issues and switch to Zephyr-defined configurations.
Add nxp_net_if_get_device() wrapper API.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Reject malformed nrf_wifi_umac_event_power_save_info payloads before
copying TWT entries into struct wifi_ps_config. The handler previously
trusted num_twt_flows and indexed twt_flow_info[] without checking
WIFI_MAX_TWT_FLOWS or event_len, which could overflow the fixed Zephyr
twt_flows buffer and read past the event buffer.
Fix issue #108848.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
Switch interface gating from carrier on/off to the dormant flag,
matching nrf_wifi/nxp/airoc/esp_at/esp_hosted. Carrier is set
once at init; dormant toggles per association on STA and per
AP_START/AP_STOP on AP. This preserves IP and IPv6 link-local
state across transient drops instead of tearing them down.
Allow AP TX in AP_STARTED and AP_DISCONNECTED (no clients yet,
or last client left) in addition to AP_CONNECTED, so broadcast
traffic is not rejected with -EIO.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add promisc mode capability for bridge.
There's no filtering really so enabling promisc is a noop but
pretending to have support is needed to allow these
to be added to a bridge.
Signed-off-by: Fengming Ye <frank.ye@nxp.com>
as the ethernet api already includes
struct net_if as a argument for its
functions also add it to struct wifi_mgmt_ops.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
WPA3 (aka SAE) uses different fields for password and password length,
pass the proper ones to whd_wifi_join depending on usr_result.security.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The supplicant's mbedTLS crypto backend always compiles
crypto_mbedtls-ec.c when ESP32_WIFI_MBEDTLS_CRYPTO is enabled, so
the ECC PSA primitives it references are required regardless of
WPA3-SAE. Building with only ESP32_WIFI_MBEDTLS_CRYPTO=y previously
emitted PSA warnings because the ECC selects lived solely under
ESP32_WIFI_ENABLE_WPA3_SAE.
Move the always-needed ECC selects (ECDH, ECDSA, SECP_R1_256,
KEY_PAIR_BASIC, KEY_PAIR_IMPORT, PUBLIC_KEY) onto
ESP32_WIFI_MBEDTLS_CRYPTO. Keep KEY_PAIR_GENERATE and
KEY_PAIR_EXPORT under ESP32_WIFI_ENABLE_WPA3_SAE since those paths
are exercised only by SAE/DPP keypair generation.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
For ethernet and wifi drivers the carrier
is on by default, no need to set it up in the
iface init again.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add #ifdef guards around WMM_UAPSD specific API calls in power save
functions to fix compilation errors when CONFIG_NXP_WIFI_WMM_UAPSD
is disabled.
Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
When CONFIG_NXP_WIFI_HOST_SLEEP is disabled:
- Provide a stub implementation of device_wlan_pm_action()
- Conditionally compile nxp_wifi_wlan_wakeup() helper function
This preserves PM device infrastructure while avoiding references to
host sleep symbols that are conditionally compiled in wifi_nxp module.
Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
In 'drivers/wifi/nxp/Kconfig.nxp', 'NXP_WIFI_SOFTAP_SUPPORT'
currently uses 'select NET_DHCPV4_SERVER', but this can be restrictive.
This tightly couples L2 behavior (AP) and L3 (IP).
It shouldn't matter which node acts as the DHCP server once those
nodes are linked at L2. This commit introduces a new Kconfig option
to make the DHCP server optional.
Signed-off-by: Mori Fumita <mfumita@electromag.com.au>
The NWP does not deliver advanced (background) scan results to the host
when instant BG scan is disabled, so Zephyr never gets SCAN_RESULT /
SCAN_DONE for that path.
- Hardcode enable_instant_scan to 1 in advanced_scan_config with a
short comment explaining the NWP requirement.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
Instead of generic success/error status use the appropriate wifi
manangement status codes that can be used to overwrite the status.
Signed-off-by: Martin Koloska <martin.koloska@bytesatwork.ch>
When ESP32_WIFI_STA_AUTO_DHCPV4 is
enabled functions from the dhcpv4 clients are
used, therefore we need to depend on it, otherwise
a user could activate that Kconfig without the dhcpv4
client being enabled, which would lead to a build error.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Coverity reported a potential out-of-bounds access in
drivers/wifi/esp_at/esp_offload.c when accessing sin_addr
without validating the sockaddr family.
ESP-AT offload supports IPv4 only, so add an explicit
NET_AF_INET check before dereferencing the IPv4-specific
structure to prevent invalid memory access.
Fixes: #100001
Signed-off-by: Om Srivastava <srivastavaom97714@gmail.com>
Fix build error when independent reset is enabled on custom host.
Add out-of-band reset kconfig option to guard dependency on host GPIO,
so that in-band independent reset can be supported by default.
Signed-off-by: Fengming Ye <frank.ye@nxp.com>
The twt_capable field in wifi status earlier was hardcoded to true. It
seems better to set it to true only when the link mode is 802.11ax or
higher.
Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/w1`
- `drivers/watchdog`
- `drivers/wifi`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
reset data->scan_cb on fail, otherwise we can't
try it again, because we check it at the begining
and return when it is already set.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
set band info in scaned aps.
As the esp32-c5 supports 5 Ghz, the info can there otherwise
be wrong.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
As net_if_set_link_addr() is now already done by the
overlaying net_mgmt, we no longer need to do it
in the drivers
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Fix WPA3-SAE authentication handling for both STA and SoftAP
modes to properly use the PSA crypto backend.
STA mode: handle WIFI_SECURITY_TYPE_SAE, SAE_H2E and SAE_AUTO
security types with proper PMF configuration and SAE password
element derivation method selection (hunt-and-peck,
hash-to-element, or both). Also handle PSK_SHA256 as a
WPA2-PSK variant.
SoftAP mode: add WPA3-SAE authentication with the same PWE
method selection, guarded by ESP32_WIFI_SOFTAP_SAE_SUPPORT.
New Kconfig entries:
- ESP32_WIFI_ENABLE_SAE_H2E: hash-to-element derivation
- ESP32_WIFI_SOFTAP_SAE_SUPPORT: WPA3-SAE for AP mode
- ESP32_WIFI_WPA3_COMPATIBLE: WPA2/WPA3 transition mode
Update west.yml hal_espressif revision to include the
corresponding PSA crypto migration changes.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Fix PSA crypto algorithm and key type selects required by the
wpa_supplicant's mbedTLS crypto backend. These are needed for
AES cipher operations, ECDH/ECDSA, SHA-1/SHA-256, HMAC and CMAC
used during WPA key derivation and handshake.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
- replace legacy Kconfigs with corresponding PSA_WANT ones.
- extend Mbed TLS' CMake file in order to include these legacy ecdh module
that was removed from TF-PSA-Crypto when ESP32 BT and WiFi drivers are
built.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
If user selects a band, then we should restrict scanning channels to
that band. This can be used to speed up scanning by limiting scans
to specific channels when the network is known to not use all possible
channels.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
The previous 40 KB default heap was at the edge for the Wi-Fi driver,
which can lead to allocation failures. Increase to 50 KB to provide
adequate memory for Wi-Fi operation.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>