Correct inline comment that should refer to DT_DRV_INST() macro
instead of DT_DRV_COMPAT macro.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
airoc_mgmt_scan() sets data->scan_rslt_cb before calling whd_wifi_scan().
If whd_wifi_scan() fails, the function returnes -EAGAIN without clearing
scan_rslt_cb. The next scan request may return -EINPROGRESS even if no scan
was actually running.
Clear data->scan_rslt_cb in the whd_wifi_scan() error path so driver
state remains consistent.
Signed-off-by: Daniele Cloralio <d.cloralio@arduino.cc>
When CONFIG_NXP_WIFI_IPV6 is not enabled, the
WIFI_EVENT_UAP_NET_ADDR_CONFIG message is never sent to wlcmgr_task
because it relies solely on the NET_EVENT_IPV6_DAD_SUCCEED callback.
This causes WLAN_REASON_UAP_SUCCESS to never be triggered, leaving
applications waiting indefinitely for WIFI_STATUS_AP_SUCCESS.
Send WIFI_EVENT_UAP_NET_ADDR_CONFIG directly in
net_configure_address() when IPv6 is disabled, so the uAP state
machine can proceed to CM_UAP_IP_UP and emit the success event
regardless of IPv6 configuration.
Assisted-by: WChat:Claude
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Replace wifi_get_country_code() with wlan_get_country_code() in the
shim driver. The shim driver should call WLAN layer APIs (wlan.h)
rather than internal wifi driver APIs (wifi.h) directly.
Assisted-by: WChat:Claude
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Add support for CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS in the NXP WiFi
driver. When enabled, the driver emits NET_EVENT_WIFI_RAW_SCAN_RESULT
events containing reconstructed 802.11 beacon frames with raw IEs
from each scanned BSS.
This allows applications to access information not available in the
standard wifi_scan_result struct, such as country code, RSN IE, and
mobility domain.
When CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS_ONLY is set, normal parsed
scan results are suppressed.
The raw frame data includes a reconstructed 802.11 MAC header (24B)
and fixed fields (12B) prepended to the IEs, making it compatible
with the existing wifi shell raw scan result handler.
Assisted-by: WChat:Claude
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
siwx91x_send() incorrectly unrefs a caller-owned TX net_pkt after
transmit. In the TX path, the packet is owned by the networking/L2
stack, while the driver only borrows it long enough to read or copy the
frame data.
As a result, the packet may be returned to the pool prematurely while
upper layers still consider it valid. Once released, the same memory can
be reused for a different allocation, creating a packet lifetime bug
similar to a use-after-free condition. This memory reuse can lead to
unexpected behavior and explain hangs in the transmit path.
Signed-off-by: Swamidas Nampalli <Swami.Das@silabs.com>
Use <> operator to include a Zephyr header file instead of "" that
is intended to local header files, not header files relative to
specifically defined search paths.
This change was made running the sed shell command below:
$ sed -i -E 's/#include "zephyr\/([^"]+)\.h"/#include <zephyr\/\1.h>/g' \
`grep -rsl "#include \"zephyr/" drivers/`
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
The `thread` field is not initialized, if it's being animated via
k_work_queue_run instead of k_work_queue_start.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
airoc_wifi_host_buffer_get() returns WHD_BUFFER_ALLOC_FAIL when
net_buf_alloc_len() yields a buffer smaller than the requested size, but
it does so without releasing that buffer, leaking it from the fixed
airoc_pool. Release the undersized buffer with net_buf_unref() before
returning the failure.
Found while characterizing airoc_pool exhaustion under sustained traffic
on rpi_pico2/rp2350a/m33/w (CYW43439). Build- and runtime-tested on that
board: WiFi associate + DHCP + sustained ping with no pool exhaustion
from this path.
Assisted-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Jonathan Beri <jmberi@gmail.com>
PR#107029 is merged, it provide supporting wpa_supplicant.
That means wifi shell sample should be able to support
two different mechanism. One use wpa_supplicant,
another one use wifi_mgmt_ops directly without wpa_supplicant.
Some structures like wpa_supp_event_supported_band or functions
in airoc_wifi.c belongs to wpa_supplicant only.
Therefore if we compile wifi shell without wpa_supplicant,
it causes build error.
Signed-off-by: Kevin Chan <kevin.chan3@infineon.com>
On mimxrt1060_evk, CONFIG_CODE_DATA_RELOCATION_SRAM
is enabled by the board configuration, which causes arm_core_mpu.c
to reference __ram_text_reloc_start and __ram_text_reloc_size.
These symbols are only generated when at least one function
is relocated to RAM_TEXT. Since no code was previously placed
there, the build fails with undefined reference errors.
Fix this by relocating hot-path functions from ipv6_fragment.c
and ipv4_fragment.c to RAM_TEXT using function-level FILTER,
Only throughput-critical functions in the RX/TX fragment path
are selected, which also improves throughput performance.
Signed-off-by: Xinyu Hong <xinyu.hong@nxp.com>
Move the hot functions to ITCM_TEXT (SRAM) to improve
throughput for UDP TX.
net_arp_prepare() is called on every IPv4 TX packet
from ethernet_send() for MAC address resolution.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
Some review showed there were some small issues in the airoc_wifi
driver. A duplicated semaphore give on error and a memory leak when not
releasing a buffer.
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
hostapd clears the AUTHORIZED flag while a station is being torn
down (e.g. the EAP-Failure that ends every WPS/WSC exchange), by
which point the peer may already be gone from the driver peer
table. Clearing a flag on an absent peer is a harmless no-op, so
treat it as success instead of logging "Unknown PEER" and failing
the op. Setting a flag on a missing peer remains a logged error.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Claude:claude-opus-4.8
Resolve ITCM overflow (2928 bytes) on mimxrt1060_evk by applying
function-level FILTER to relocate only hot-path functions instead
of entire files. This reduces ITCM usage from 100% to 70.09%
with no throughput regression.
Use FILTER for net stack, socket, SDIO, and zperf files
Keep kernel primitives as whole-file (inline dependencies)
Add zvfs, poll, condvar, timeout to relocation list
Restrict to CONFIG_SPEED_OPTIMIZATIONS only
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Start the Wi-Fi driver during initialization so coexistence is
enabled early. Without it the Wi-Fi pp task blocks at boot when BLE
is also used, hanging the device.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Copy beacon/probe data under vif_lock, then post the net_mgmt
event without holding the lock. Avoids stalling firmware RX when
the event queue backs up during raw scan floods.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
Clear scan_in_progress and notify the application when
nrf_wifi_disp_scan_res_get_zep() fails. Do not clear the flag
early on success; let the final result event own teardown.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
Expose the chunk size used when downloading the nRF70 firmware patches
to the RPU as NRF70_PATCH_DL_CHUNK_SIZE. It defaults to 4096 bytes, and
to 2048 bytes on the nRF54H.
Each chunk maps to a single SPI/QSPI transfer, so it has to fit both the
host EasyDMA MAXCNT and any DMA bounce region the bus driver relies on.
The previous hard-coded 8192 overran the 13-bit EasyDMA MAXCNT on nRF91
(max 8191 bytes) and the 4 KB cpuapp DMA bounce region on nRF54H20. The
oversized transfer was rejected and the error dropped on the write path,
leaving the RPU with a corrupt patch and a bad boot signature.
On the nRF54H the bounce buffer comes from the small 4 KB cpuapp DMA
region that is shared with the console UART and other peripherals, so
even a 4096 byte chunk cannot find contiguous space there. Default to
2048 on that SoC and keep 4096 elsewhere, which also stays within the
nRF91 MAXCNT while keeping the chunk count low.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
Enable Wi-FI keep-alive by default. If not configured,
devices may experience unintended disconnections from certain APs.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Add NXP_WIFI_SLIM and NXP_WIFI_SLIM_DISABLE_DEBUG Kconfig options
for resource-constrained platforms.
NXP_WIFI_SLIM disables some advanced Wi-Fi features by default.
NXP_WIFI_SLIM_DISABLE_DEBUG disables Wi-Fi error and warning logs.
Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
Remove obsolete Kconfig options that are no longer referenced
in the codebase:
- NXP_WIFI_CAPA: uAP Wi-Fi Capability
- NXP_WIFI_EU_VALIDATION: EU Validation Support
Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
Adds OWE security mapping for scan, connect and SoftAP security
configuration in the NXP Wi-Fi driver.
Signed-off-by: Anton Rejoe <antonrejoe@gmail.com>
Adds OWE security mapping for scan, connect and status operations
in the ESP32 Wi-Fi driver. OWE is supported for STA mode only;
AP mode is not supported.
Signed-off-by: Anton Rejoe <antonrejoe@gmail.com>
Wire the ESP32 Wi-Fi driver to Espressif's Enterprise EAP client APIs.
This adds support for WPA2/WPA3 Enterprise station connections through
Zephyr Wi-Fi management, including EAP-TLS, PEAP, TTLS, and WPA3
Enterprise mode selection.
Signed-off-by: Siddhant Modi <siddhant.modi@gmail.com>
Replace direct ethernet context manipulation with new
net_eth_set_if_type_wifi() API across all Wi-Fi drivers.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
Currently, restrict_tx_outside_tsp is false by default, and with that,
the NWP may transmit data during TWT sleep time. Many APs do not support
this also should not be the default behavior.
Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
In the SL_WIFI_SCAN_TYPE_ADV_SCAN path, the Kconfigs
ADV_ACTIVE_SCAN_DURATION / ADV_PASSIVE_SCAN_DURATION were used only as
a fallback when the per-call wifi_scan_params dwell fields were 0, so
any non-zero per-call value would override them and reach the radio.
BG-scan dwell is a system-tuned policy controlled by Kconfig (like
trigger_level and enable_multi_probe); per-call dwell fields belong to
the foreground scan path only. Always use the Kconfig values for
advanced_scan_config and ignore per-call params on this path.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
WiseConnect zeros the BT half of its cached coex performance profile
on every Wi-Fi disconnect, leaving BT out of power save and preventing
the NWP from sleeping after re-association.
Delegate Wi-Fi power-save to siwx91x_nwp_apply_power_profile(), which
already owns both BT and Wi-Fi halves of the coex profile. Extend the
helper to accept an optional sl_wifi_performance_profile_v2_t override
so the Wi-Fi driver can pass its tailored profile (listen_interval,
dtim_aligned_type, monitor_interval); BT-only and init call sites pass
NULL to keep their current behaviour.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
Currently, there was no check in place if set_power_save()
was called in AP mode which might result in undefined
behavior.
Additionally, esp_wifi_get_config() doesn't return an
error when querying for STA config in AP mode.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
The NWP ignored the host programmed listen_interval and fell back to
its ~1s default, so both WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL and
WIFI_PS_WAKEUP_MODE_DTIM woke the device roughly once per second
regardless of the AP's DTIM period or the host-requested LI.
Set SL_WIFI_JOIN_FEAT_PS_CMD_LISTEN_INTERVAL_VALID in
siwx91x_iface_init() so the NWP honors the listen_interval supplied
via the host-side power-save command path (i.e. the value programmed
through sl_wifi_set_performance_profile_v2()) instead of substituting
its built-in default.
Signed-off-by: Tejus Subramanya <ters@silabs.com>
The NXP Wi-Fi middleware unconditionally accesses IPv4 network
structures and DHCPv4 APIs, causing compiler and linker failures
when CONFIG_NET_IPV4 is disabled (e.g., in IPv6-only environments).
This commit introduces Kconfig guards around the IPv4-specific
logic. Functionally, when IPv4 is disabled, the middleware now
safely bypasses IPv4 static address assignment, IPv4 address and
netmask retrieval, and DHCPv4 client initialization.
Additionally, variables that become unused in IPv6-only builds
are properly suppressed using the ARG_UNUSED() macro.
Fixes#87647
Signed-off-by: T Madhusudhan Rao <tetakalam@aerlync.com>
esp_wifi_set_mode can fail silently if esp_wifi_init was not successful.
Move the mode set and handle its return value post esp_wifi_init error
checking.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
Use net_eth_set_if_type_wifi() instead of directly accessing
ethernet_context->eth_if_type to set the interface type.
Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
kernel.h implies kernel_structs.h via kernel_includes.h, making
explicit inclusion of kernel_structs.h unnecessary whenever kernel.h
is already included in the same translation unit.
Remove the redundant includes across arch, boards, drivers, kernel,
lib, samples, subsys, and tests trees.
in include/zephyr/kernel_structs.h:
* 2. kernel.h shall imply kernel_structs.h, such that it shall not be
* necessary to include kernel_structs.h explicitly when kernel.h is
* included.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>