Commit graph zephyr/drivers/wifi
Author SHA1 Message Date
Ibrahim Abdalkader
8018ec2dea drivers: wifi: st67w611m1: add AT command shell
Add an optional "st67 atcmd" shell command that sends a raw AT command
to the module and prints the reply. This is useful for debugging and for
reading module state the driver has no API for, such as the module's
free heap. Example usage: st67 atcmd AT+SYSRAM?

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2026-10-29 19:44:47 -04:00
Kapil Bhatt
49c811ea15 wifi: nrf_wifi: Add Kconfig for VHT-to-HT fallback on 802.11ac links
Introduce WIFI_NRF70_VHT_HT_FALLBACK (default y) so 802.11ac
connections may fall back from VHT to HT. It will only affects
802.11ac 80 MHz access points; no other modes are impacted. Intended
for certification testing.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-10-29 15:46:13 -04:00
Kapil Bhatt
f3180607d8 drivers: wifi: nrf_wifi: use wifi_utils_chan_to_freq
Replace nrf_wifi_utils_chan_to_freq() with the common
wifi_utils_chan_to_freq() helper in the display scan path.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-10-29 15:46:13 -04:00
Johan Hedberg
192ca77c69 soc: native: Add an option for drivers that interact with real time
NATIVE_SIM_SLOWDOWN_TO_REAL_TIME defaults to y when BT_USERCHAN or
WIFI_NATIVE_SIM is enabled, because both drivers talk to something that
runs in real time. The native_sim board thereby has to know about every
such driver.

Add NATIVE_SIMULATOR_PREFER_REAL_TIME for these drivers to select, and
let the board default to real time when it is set. The symbol lives in
Kconfig.soc, which every build sources, so that drivers can select it
unconditionally. No functional change.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-10-28 22:52:38 -04:00
Jordan Yates
4358001f10 random: use HAS_RANDOM_GENERATOR
Transition RNG dependencies to the new `HAS_RANDOM_GENERATOR` symbol.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-10-28 22:40:20 -04:00
Ibrahim Abdalkader
1618d91acc drivers: wifi: st67w611m1: make low power support optional
The current driver sends the sleep configuration commands at init
unconditionally. Module firmware without low power support rejects
them and the driver fails to initialize.

Add ST67W611M1_LOW_POWER to control the init commands and the power
save and TWT operations. It defaults to y to keep current behavior.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2026-10-28 22:38:10 -04:00
William Markezana
630e4ab8fd drivers: wifi: bflb: wifi4: enable HT20
Advertise HT with MCS0-7 and the short guard interval on 20 MHz, the
only channel width the firmware uses, and decode HT20 single-stream
rates in the reported TX rate.

On the M1S Dock the PHY TX rate goes from 48 to 72.2 Mbit/s and UDP
download from 12.5 to 17.9 Mbit/s at the same offered load.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-28 22:36:48 -04:00
William Markezana
1def90aaae drivers: wifi: bflb: wifi4: copy RX frames straight into net_pkts
Copy each received frame into a net_pkt from the firmware RX callback
instead of staging it in a ring drained by the system work queue. This
saves a copy and a thread hop per frame and the ring's RAM, 1600 bytes
per slot, along with WIFI_BFLB_WIFI4_RX_RING_CNT.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-28 22:36:48 -04:00
William Markezana
894a7bb323 soc: bflb: bl808: add WiFi platform support
Add the SoC glue for the BL808 wifi4 firmware blob on the wifi4 driver:
MAC clock ungate, PHY power tables from devicetree, the firmware task
running the blob's own wifi_main(), the WIFI_RAM sections, and the IPC
glue for the BL808 shared environment, whose TX path queues descriptors
on list_ongoing and recycles them from list_cfm. Data frames use all
four descriptors; only EAPOL frames wait for their confirmation, as the
PTK is installed once handshake message 4 has left.

blob_printf() moves from the BLE OS shim to bflb_rf.c, shared by the
BLE controller, the WiFi firmware and the PHY library, and is quiet
outside WiFi debug builds as both blobs trace every scanned channel.

The first RF calibration, run at bring-up, executes with interrupts
locked: preempting it hangs the SoC. Unlike the BL602 one, the BL808
firmware also recalibrates periodically while it tracks a BSS
(mm_sta_tbtt -> rfc_channel_ops -> rf_init). Those calibrations keep
interrupts enabled, as locking them stalls the MAC for the whole
calibration: firmware timers run late and auth/assoc responses are
missed (join status 11/14).

Provide link stubs for the firmware symbols the driver and SoC glue
reference, for CONFIG_BUILD_ONLY_NO_BLOBS builds.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-28 22:36:48 -04:00
William Markezana
73407df375 drivers: wifi: bflb: wifi4: decode the TX rate in the driver
The rate word format is the MAC's and the same on every wifi4 SoC, so
decode it once in the driver. The SoC glue only reads the rate word
from its station table, whose size differs per SoC.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-28 22:36:48 -04:00
William Markezana
baec55c3ba manifest: hal_bouffalolab: update revision for BL808 WiFi
Point the hal_bouffalolab module at the revision that moves the wifi4
firmware host interface headers to include/bouffalolab/common/wifi4,
shared by BL60x and BL808, and the BL808 WiFi blobs.

Update the BL60x include path accordingly and drop the lmac_types.h
includes, as the shared headers use the standard integer types.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-28 22:36:48 -04:00
Karl Von Richter
8abba3e51c drivers: wifi: infineon: preserve connection on duplicate requests
Return -EALREADY for duplicate connect requests after releasing the common
semaphore. Avoid the connection failure path so the active interface is
preserved without emitting a failed connection event.

Tested on Pico 2 W through CMSIS-DAP and USB: duplicate-connect rejection
preserved the IP address and active interface without a connection event.
Four DHCP reconnects and 12,214 matching UDP echoes passed with no payload
mismatches.

Assisted-by: Codex:gpt-6.1-sol
Signed-off-by: Karl Von Richter <karl@embeint.com>
2026-10-28 22:35:57 -04:00
Karl Von Richter
1802fe6f80 drivers: wifi: infineon: fix buffer release
Use net_buf_unref to release AIROC buffers through the normal reference-
counted pool path and preserve NET_BUF_POOL_USAGE accounting. Calling
net_buf_destroy directly bypasses reference counting and can cause
incorrect available-buffer counts and assertions during radio startup.

Tested on Pico 2 W through CMSIS-DAP and USB: 4,096 buffer allocation and
release cycles and shared-reference checks passed.

Assisted-by: Codex:gpt-6.1-sol
Signed-off-by: Karl Von Richter <karl@embeint.com>
2026-10-28 22:35:57 -04:00
Fin Maaß
6a935e6180 drivers: wifi: nxp: use net_if_get_config()
The members of struct net_if are internal to the network subsystem.
Get the interface configuration through net_if_get_config() instead of
accessing the config member directly.

Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-10-21 12:04:57 +02:00
Fin Maaß
b3317e743d drivers: wifi: eswifi: use net_if_get_config()
The members of struct net_if are internal to the network subsystem.
Get the interface configuration through net_if_get_config() instead of
accessing iface->config directly.

Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-10-21 12:04:57 +02:00
Sylvio Alves
a915b2f126 drivers: wifi: esp32: keep a driver copy of the key password
The supplicant stores the private key password pointer and reads
it with strlen() at every later TLS handshake, but the pointer
belongs to the caller's connect request, whose memory can be
reused once the connect call returns. Keep a NUL-terminated copy
owned by the driver, and wipe it whenever enterprise mode is
disabled.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-10-16 15:53:07 -05:00
Sylvio Alves
d6a6881d86 drivers: wifi: esp32: refuse enterprise creds while in use
The supplicant keeps pointers to the driver's certificate and key
buffers from the moment an enterprise connect configures them,
and parses them again on every reconnect or re-authentication.
Replacing the credentials during an enterprise connection frees
memory it still uses.

Track when the supplicant may reference the buffers. Return
-EBUSY while such a connection is connecting, connected or
roaming, and disable enterprise mode before replacing the
credentials otherwise. All paths now disable enterprise mode
through one helper that keeps this state in sync, and a mutex
serializes the credential update against the enterprise setup
of a connect.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-10-16 15:53:07 -05:00
Maochen Wang
ed10e8d30a drivers: wifi: nxp: disable WLS default on AArch64 targets
The NXP_WIFI_WLS Kconfig option defaults to y when NXP_IW61X
and WIFI_NM_WPA_SUPPLICANT are both enabled. This causes a
link failure on AArch64 targets (e.g. i.MX93 Cortex-A55 with
IW612) because the WLS feature pulls in libcsi.a, which is
only available as a Cortex-M7/M33 pre-compiled archive.

The linker reports 'file in wrong format' when it tries to
link the elf32-littlearm libcsi.a into an AArch64 image.

Add !ARM64 to the default condition so that WLS is not
auto-enabled on AArch64 platforms where no compatible
libcsi archive exists.

Fixes: #122076

Assisted-by: WChat:Claude
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2026-10-16 09:19:07 +02:00
Sylvio Alves
c9822285b4 drivers: wifi: esp32: select psa pbkdf2 for mbedtls crypto
With ESP32_WIFI_MBEDTLS_CRYPTO the supplicant derives the WPA2
PMK through PSA PBKDF2-HMAC-SHA1, but the algorithm is never
enabled. The derivation fails and every WPA2-PSK connection is
rejected as a wrong password once enterprise or WPA3 support is
enabled. Select PSA_WANT_ALG_PBKDF2_HMAC.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-10-15 16:40:59 +02:00
Martin Hoff
8c1003ded9 drivers: wifi: siwx91x: translate unknown MFP before WiseConnect
WIFI_MFP_UNKNOWN is a Zephyr sentinel (not 0/1/2). Casting it into
sl_wifi_set_mfp() stored an invalid mode. Map an unknown request from
the security type instead: optional/capable for WPA2 and transition,
required for SAE, and disabled otherwise.

Assisted-by: Cursor:Grok-4.6
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-10-15 14:13:54 +02:00
Martin Hoff
22e30d6c4e drivers: wifi: siwx91x: accept SAE and SAE-H2E on connect
Scan reports WPA3 as WIFI_SECURITY_TYPE_SAE. Connect only handled
SAE_AUTO, so Matter's reused scan metadata returned -ENOTSUP. Treat
SAE, SAE-H2E, and SAE_AUTO as WPA3.

Assisted-by: Cursor:Grok-4.6
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-10-15 14:13:54 +02:00
Martin Hoff
7b48fc4b45 drivers: wifi: siwx91x: fix scan type for mixed and transition networks
Scan used to advertise WPA2/WPA3 transition APs as SAE, so Matter reused
that metadata and tried a WPA3-only join. Map both WPA3 transition and
WPA/WPA2 mixed scan results to WPA auto-personal so connect can use
the matching WiseConnect security mode.

Assisted-by: Cursor:Grok-4.6
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2026-10-15 14:13:54 +02:00
Madhab Sharma
f6d40e11f8 drivers: wifi: esp32: zero enterprise credentials before freeing
Wipe the CA cert, client cert and private key buffers before k_free().

Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
2026-10-15 00:58:37 +02:00
Muhammad Waleed Badar
f1dd8d688b drivers: wifi: esp32: report the scan done status to the caller
scan_done_handler() ignored the status carried by WIFI_EVENT_SCAN_DONE
and always completed the scan request with status 0, so a scan the
Wi-Fi stack reported as failed looked successful to the caller.

Pass the event data to the handler and complete the request with -EIO
when the stack reports a failure.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-10-15 00:50:12 +02:00
Muhammad Waleed Badar
833155eb76 drivers: wifi: esp32: track the scan callback on the station data
esp32_wifi_scan() stored the callback in the runtime data of the
interface the request arrived on, while scan_done_handler() only reads
esp32_data.scan_cb. With CONFIG_ESP32_WIFI_AP_STA_MODE a scan issued on
the softAP interface therefore looked like an internally triggered scan
to the handler, which returned without draining the results, without
calling esp_wifi_clear_ap_list() and without reporting completion. The
AP record list allocated by the Wi-Fi stack stayed in memory until the
next scan replaced it, and the stale scan_cb made every further scan on
that interface fail with -EINPROGRESS.

Scanning always runs on the station, so keep the callback on esp32_data
regardless of the requesting interface. Remember the requesting
interface next to it and report the results and the scan completion
through that interface instead of the station interface, so a caller
waiting on the softAP interface sees the completion rather than timing
out.

Tested on doit_esp32_devkit_v1 with samples/net/wifi/shell,
CONFIG_ESP32_WIFI_AP_STA_MODE=y and
CONFIG_WIFI_NM_MAX_MANAGED_INTERFACES=2. With the softAP enabled,
"wifi scan -i <softAP index>" never completed and the next request
failed; with this change both requests complete and report results,
and station scans keep working.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-10-15 00:50:12 +02:00
Mikey Sklar
83ae588dbb drivers: wifi: siwx91x: fix sign of reported RSSI
WiSeConnect reports rssi_val as an unsigned magnitude:

    uint8_t rssi_val;      ///< RSSI value of the AP

but struct wifi_scan_result.rssi is int8_t dBm. Assigning straight across
reports every AP as positive, so an AP at -76 dBm surfaces as +76. Any
consumer that sorts or thresholds by signal strength gets the ordering
backwards, and nothing above the driver can recover the sign.

Negate on assignment.

Verified on a SiWx917-DK2605A: scan results now match what a phone reports
at the same spot within a couple of dBm, and move in the right direction as
the board is walked away from the AP.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Mikey Sklar <mikeysklar@gmail.com>
2026-10-09 16:50:42 +02:00
Flavio Ceolin
9b032dd227 drivers: wifi: winc1500: validate socket IDs
Accept, connect, recv and send replies indexed gastrSockets[] with the
socket ID from the firmware, and winc1500_close() lacked an upper bound.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-10-07 04:58:43 +02:00
Pavel Vasilyev
bb5ea086a0 drivers: wifi: nrf_wifi: initialize signal poll info
nrf_wifi_wpa_supp_signal_poll() receives an uninitialized struct
wpa_signal_info from wpa_supplicant_signal_poll() and fills in only part
of it. current_tx_rate is set from the get_station event, which is
requested only when the cached RSSI is older than
CONFIG_NRF70_RSSI_STALE_TIMEOUT_MS. On the fresh-RSSI path it keeps
whatever was on the stack, so SIGNAL_POLL reports a random LINKSPEED and
`wifi status` prints values such as 537121.8 Mbps. current_noise is never
set at all.

Zero the struct on entry and mark the noise as invalid, as documented for
the current_noise field.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Assisted-by: Claude:claude-opus-5
2026-10-06 10:05:24 +02:00
Pisit Sawangvonganan
894020886d drivers: {video, wifi}: fix typo
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/video`
- `drivers/wifi`

Assisted-by: Claude:claude-sonnet-5-5 codespell
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-10-03 13:17:18 -05:00
William Markezana
9feef73e23 drivers: wifi: bflb: wifi4: keep the connect target in the scan cache
With more BSSes in range than the scan cache holds, the weakest entries
are evicted, so an AP of the requested network weaker than its
neighbours was dropped and the connection failed with "AP not found".
Pass the SSID the supplicant scans for down to the cache and never evict
entries of that network. Advertise two scan SSIDs so that each scan the
supplicant issues carries it next to the wildcard.

A hidden AP only reveals its SSID in probe responses, so probe for the
target SSID directly and fill in the SSID of an entry first seen through
its empty beacon.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-02 22:00:48 -05:00
William Markezana
5a688015ba drivers: wifi: bflb: wifi4: flag the AP as MFP capable on SAE links
The firmware clears the MFP flag of the connect request while matching
beacons, so it adds the AP station without its MFP capability and sends
robust management frames to it unprotected. The AP drops the
deauthentication sent on disconnect and keeps the association, and the
next connection to it times out after SAE (status 11). Set the
capability once the SAE connection is up.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-02 22:00:48 -05:00
William Markezana
91af2a37ce drivers: wifi: bflb: wifi4: install the IGTK through the IGTK API
The generic firmware key API derives the cipher from the key length and
stores a group key in slot vif * 4 + key_idx. The IGTK (key_idx 4) thus
went in as a CCMP key over the pairwise key of station 0 whenever the
link used interface 1, as the first connection after boot always does:
the link came up but no unicast frame decrypted and DHCP never completed.
Install it with bl_wifi_set_igtk_internal() instead.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-02 22:00:48 -05:00
William Markezana
c80eadbd5b drivers: wifi: bflb: wifi4: clear the firmware scan cache after a scan
The firmware caches only a handful of BSSes seen while scanning, and
drops every frame from a BSS it cannot cache. A scan leaves that cache
full and a join scan does not clear it, so joining an AP the scan did
not happen to cache failed with status 14, typically on the first
connect after a scan. Clear the cache once a scan completes.

Add scanu_cached_scanresult_clear() to the BL60x no-blobs link stubs,
along with the sm_env the driver already referenced, whose absence
broke CONFIG_BUILD_ONLY_NO_BLOBS builds on BL60x.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-10-02 22:00:48 -05:00
Josuah Demangeon
a90cd40a5f drivers: wifi: bflb/wifi6: ignore RX-only key
In the hostap repo, since commit 13a30f10ce523ed341d907796d8dabcf382dd78f,
it now presents a key to the driver to avoid a race condition:

To avoid a race condition, wpa_supplicant now sends the key at step 3/4
instead of 4/4 to load the key before encrypted traffic abunds, but
requires to complete the TX message (4/4) unencrypted, so hardware has to
support setting the key for RX path only, not supported there, skipping,
waiting the key to be presented again in step 4/4.

This is explained in detail in the hostap commit.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-10-02 08:43:39 -05:00
Josuah Demangeon
98b420e0b3 drivers: wifi: bflb/wifi6: Allocate memory for hostap to free
modules/hostap/src/supp_main.c is calling os_free() on everything filled
in events, so the values passed need to be os_malloc()'ed.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-10-02 08:43:39 -05:00
Andrey Dodonov
4fb675be79 drivers: wifi: simplelink: fix errno sign in sendmsg
errno values are positive. Set ENOTSUP instead of -ENOTSUP so that
callers returning -errno report the failure.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Andrey Dodonov <Andrey.Dodonov@endress.com>
2026-09-30 19:43:53 +02:00
Marek Matej
3d6bd16af6 drivers: wifi: esp32: roaming support initial
Add 802.11k/v/r support to the station path: advertise radio
measurement and BSS transition capability on association, and
implement the neighbor report, BSS transition query and
capability management operations on top of the supplicant.

A low RSSI watch reports a worsening signal to the application,
which decides when to roam; the driver never picks an AP on its
own. Over a BSS transition the address is kept and DHCP is not
restarted, which the application can turn off when the access
points are in different subnets.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2026-09-30 11:01:59 +02:00
William Markezana
92a7e51369 soc: bflb: bl61x: add IEEE 802.15.4 support
Enable the IEEE 802.15.4 radio on the BL61x (BL616) series: add the
ieee802154 devicetree node, RF/PHY init via the shared wl_api blobs, the
TCM code section, and link the lmac154 blob. The GLB reset / memcpy shims
required by the BL616 blobs live with the other HAL shims.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-09-29 15:49:54 +02:00
Benjamin Cabé
997484ac1b drivers: wifi: esp32: mesh: disallow root conflicts by default
The mesh stack allows multiple roots by default, so nodes booting at the
same time can each elect themselves root and stay in separate networks.
Disallow root conflicts so one root yields and rejoins as a child, with
a Kconfig option to restore the previous behavior.

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-29 13:35:58 +02:00
Sylvio Alves
1eb49d7299 drivers: wifi: esp32: warn when the heap cannot hold rx buffers
With the Wi-Fi heap in the system heap, static RX buffers are
taken at init and dynamic RX buffers on every received frame.
HEAP_MEM_POOL_ADD_SIZE_ESP_WIFI covers the default of 10 static
RX buffers. With more of them and a fixed HEAP_MEM_POOL_SIZE,
init still succeeds, but most frames are dropped and throughput
collapses without any hint about the cause.

At build time, add about 1.6 KB per static RX buffer above the
default to the heap requirements and warn when
CONFIG_HEAP_MEM_POOL_SIZE is below that, naming the options to
change. Document in Kconfig where the buffers come from and how
the heap has to grow with the static RX buffers.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-29 13:35:36 +02:00
William Markezana
909bbf9215 drivers: wifi: add Bouffalo Lab wifi4 WiFi driver
Add a WiFi driver for the Bouffalo Lab wifi4 MACSW firmware blob,
initially supporting BL60x: net_if integration with the Ethernet L2,
the IPC command mailbox (MM/ME/SM/SCANU message flow), scan with a
result cache feeding both wifi_mgmt and the supplicant, SAE bridging
and hostap supplicant integration; the 4-way handshake runs in the
Zephyr supplicant through the firmware's wpa_funcs bridge.

The driver core lives in drivers/wifi/bflb/wifi4 behind the hidden
WIFI_BFLB_WIFI4 symbol carrying its selects; the blob-ABI-specific IPC
seeding/ISR and TX path hook in from soc/bflb/<series>/wifi.  System
defaults the driver needs (work queue and net_mgmt stacks, PSA key
slots, net buffer counts) live in the SoC Kconfig.defconfig, and the
wifi shell sample board fragments only carry the per-board RAM budget
plus overrides of values the sample's own prj.conf pins.

Signed-off-by: William Markezana <william.markezana@gmail.com>
2026-09-29 07:45:19 +02:00
Jukka Rissanen
c19437c149 net: zperf: Move the UDP rate control into its own file
The UDP uploader's rate control is interleaved with the iperf2 header
handling, so another UDP sender would have to copy it. Move it into
zperf_udp_pacing.c and have the uploader call it. The NXP Wi-Fi driver
relocates the compensation helper by file name, so it relocates the
new file instead.

The logic is unchanged. In the icount loopback scenario on qemu_x86 the
two calls per packet cost 0.2% of the UDP throughput, and TCP is within
0.02%.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-09-27 08:54:01 -04:00
Jukka Rissanen
6c85d7465a net: zperf: Merge the iperf2 sources into a client and a server file
zperf has a source file per transport and role: a UDP and a TCP
uploader, and a UDP and a TCP receiver. Put the uploaders into
zperf_iperf2_client.c and the receivers into zperf_iperf2_server.c, so
that the file names say which protocol and which end they implement.

The code is unchanged apart from the names the two halves had in
common: the send buffers, the poll arrays and the socket index macros
get a udp_ or tcp_ prefix. Each half is built under the transport it
needs, as the separate files were.

Update the paths in the NXP Wi-Fi driver's code relocation. The
functions it names keep their names.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-09-27 08:54:01 -04:00
Kapil Bhatt
545fb948fe drivers: wifi: nrf_wifi: Fix vif_lock init and unlock paths
vif_lock was initialised in nrf_wifi_if_start_zep() while that same
function held it. k_mutex_init() clears the owner and lock count and
re-initialises the wait queue, so the lock was silently dropped
mid-function and any thread pending on it was left unwakeable. It was
also the only initialiser, so the first lock on boot ran on a mutex
that had never been set up. Initialise it once in
nrf_wifi_if_init_zep(), which runs from net_if_init() before any
net_if_up().

Fix three wrong goto targets while at it. nrf_wifi_if_start_zep()
unlocked from checks that run before the lock is taken, and
nrf_wifi_if_stop_zep() did the same when k_mutex_lock() failed; the
promiscuous-mode branches of nrf_wifi_if_set_config_zep() skipped the
unlock entirely.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Assisted-by: Cursor:Opus-5
2026-09-26 00:46:13 +02:00
Kapil Bhatt
cb6a7b8800 drivers: wifi: nrf_wifi: Guard set_if_callbk_fn as the module declares it
The callback was assigned under CONFIG_NRF70_SYSTEM_MODE while the
nrf_wifi module both declares and dispatches it under NRF70_STA_MODE ||
NRF70_RAW_DATA_RX.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-09-26 00:46:13 +02:00
Kapil Bhatt
99ea67e2ec drivers: wifi: nrf_wifi: Fix raw TX with controlled-port dormant logic
A station went operational on carrier ON, which is at association, so
the IP stack transmitted during the 4-way handshake and the TX path had
to drop those frames. Wait for the controlled port instead; EAPOL is
unaffected as it flows out-of-band through nrf_wifi_wpa_tx_control_port().

Injection has neither an association nor a controlled port, so keep the
interface operational for it, gated on the carrier to match the
CARR_STATE_ON check in nrf_wifi_if_send(). Read txinjection_mode from
the FMAC VIF context, since a driver-side copy would go stale across
down/up and MODE_SET_DONE.

Move the decision into nrf_wifi_iface_operational() and let callers just
request a re-evaluation. Start and stop clear the per-session state,
because net_if_up() and net_if_down() leave the dormant flag as they
found it.

Take vif_lock for the oper-state decision. The handler reads
txinjection_mode through rpu_ctx, and nrf_wifi_fmac_dev_rem_zep() frees
that context before clearing the pointer, so a handler in flight could
dereference freed memory. nrf_wifi_if_stop_zep() frees under vif_lock,
so holding it for the read serialises the two.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Assisted-by: Cursor:Opus-5
2026-09-26 00:46:13 +02:00
Benjamin Cabé
4e0b29a942 drivers: wifi: bflb: do not select deprecated WEP support
WIFI_NM_WPA_SUPPLICANT_WEP is deprecated and insecure, and selecting it
from the driver forces it on for every application, failing twister
now that deprecated Kconfig symbols are treated as errors. Drop the
select; applications needing WEP can still enable it.

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-26 00:41:14 +02:00
Humphrey Chiramba
af866b6222 drivers: wifi: esp32: notify app on mesh layer change
Map the vendor MESH_EVENT_LAYER_CHANGE event to a new
ESP_WIFI_MESH_EVENT_LAYER_CHANGE notification so the application
learns when this node's tree depth changes, not just on
attach/detach. The mesh samples log the new layer.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Humphrey Chiramba <humphrey@plentify.co.za>
2026-09-24 15:47:10 -07:00
Sylvio Alves
13860e699c drivers: wifi: esp32: define the 5 GHz capability in the tree
The 5 GHz gate used a soc capability defined only by the HAL.
Add it to the esp32c5 caps, the only part that has it, under
the SOC_ESP32 prefix the soc folder uses.

Read the modem sleep frequency from the HAL as well, dropping
a second option that the HAL provided.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-24 15:38:41 -07:00
Jukka Rissanen
f1faf89e5a drivers: wifi: native_sim: Instantiate from devicetree
Make the native_sim Wi-Fi driver devicetree-instantiated and opt-in, and
take its MAC address from devicetree instead of Kconfig.

Previously CONFIG_WIFI_NATIVE_SIM defaulted to y for any ARCH_POSIX build
with the supplicant, so it was pulled into unrelated builds (e.g.
tests/net/wifi/wifi_nm and tests/net/wifi/configs). The fallback MAC was
chosen by Kconfig, and CONFIG_WIFI_NATIVE_SIM_SUPPLICANT_CONF_FILE was
dead (host_wifi_drv_init() ignored it now that only the Zephyr
supplicant runs).

Add a "zephyr,native-sim-wifi" binding (including ethernet-controller.yaml
for the MAC properties) with a required "host-interface" string, and
instantiate the driver with DT_INST_FOREACH_STATUS_OKAY /
ETH_NET_DEVICE_DT_INST_DEFINE. The driver now depends on
DT_HAS_ZEPHYR_NATIVE_SIM_WIFI_ENABLED, so it is built only when a node is
present - add one via an overlay to enable it.

The host interface name comes from the "host-interface" property and the
fallback MAC from "local-mac-address" / "zephyr,random-mac-address" (the
driver still overrides it with the host interface MAC at init). Remove
the WIFI_NATIVE_SIM_INTERFACE_COUNT, _DRV_NAME, _RANDOM_MAC, _MAC_ADDR
and _SUPPLICANT_CONF_FILE options and the now-unused config_file argument
of host_wifi_drv_init().

The interop test gains a native_sim.overlay defining the node
(host-interface = "zwifi", random MAC).

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-09-23 19:17:14 +02:00