Commit Graph

756 Commits

Author SHA1 Message Date
Gaetan Perrot
bac20e419e drivers: wifi: nrf_wifi: wifi_mgmt: remove redundant null check
Deleted a redundant check for 'rpu_ctx_zep' pointer after it was already
dereferenced.

Clarifies code logic in nrf_wifi_get_power_save_config function.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-11 16:32:06 -05:00
Marcin Niestroj
5e25a3e24a drivers: esp_at: fix net_if_get_by_iface() typo
s/net_if_get_by_ifindex/net_if_get_by_iface/

Fixes: 0e57844b2d ("drivers: wifi: esp_at: Bind DNS to device net
  interface")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2025-07-11 08:19:06 -10:00
Chaitanya Tata
e728f80416 drivers: nrf_wifi: Fix TX drop statistics
In case FMAC API fails, increment the TX drop counter, helpful in
debug.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-08 13:39:17 -05:00
Chaitanya Tata
4bd1d39c67 wifi: nrf70: Fix system work queue stack size override
Defaults cannot be overidden (even with configdefault extension), they
only work if the original symbol is defined after the override e.g.,
"drivers and then subsys/net" but for kernel symbols,the default value
overrides don't work due "kernel and drivers" order, the kernel defines
the original symbol with the default and then it cannot be overridden.

Move the kernel symbol override to the original definition to make it
affect. Else any sample that uses nRF70 but doesn't enable WPA
supplicant ends up with 1024 and crashes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-01 19:04:00 -05:00
Qiankun Li
d5a9a0fa87 drivers: wifi: nxp: Fix embedded supplicant stations link mode issue.
The link mode of legacy staions is specifically
divided into Wi-Fi_1, Wi-Fi_2 and Wi-Fi_3.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 22:07:09 -05:00
Qiankun Li
26f4d9b551 drivers: wifi: nxp: Fix getting error stations twt capability issue.
When external station connects to soft ap,
fill ap_sta_info.twt_capable with external
station HE capability.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 22:07:09 -05:00
Qiankun Li
f1b781577e drivers: wifi: nxp: Fix embedded supplicant link mode issue.
1. When external stations connect to soft ap,
   Wi-Fi driver will send UAP_CLIENT_ASSOC event with data.
   nxp_wifi_wlan_event_callback will be called to process this event.
2. The data should include some basic station information
   but not only mac address of station.
3. Fill ap_sta_info with information of
   connected station but not soft ap self.
4. Fix: Wi-Fi driver send UAP_CLIENT_ASSOC event
   with basic station information.
5. Fix: ap_sta_info with information of connected station.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 22:07:09 -05:00
Jérôme Pouiller
ffebf73079 drivers: wifi: siwx91x: Assign variable on declaration
When a variable is assigned once, we try to assign it during the
declaration.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
8d1d8d2b86 drivers: wifi: siwx91x: Prefer WIFI_MAC_ADDR_LEN
The preferred way to reference the size of the MAC address is
WIFI_MAC_ADDR_LEN.

For consistency, replace ARRAY_SIZE(mac.octet) with WIFI_MAC_ADDR_LEN.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
2ae23f7c58 drivers: wifi: siwx91x: Do not set unused values
We avoid to assign unused values during declaration. Hence, the reader
knows that every value assigned are meaningful. It also allow compile to
raise true warning if a value is used uninitialized.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
0b8f7d85bc drivers: wifi: siwx91x: Uniformize error management
Usually, the exception are treated in a condition before the nominal
case:

    ret = f();
    if (ret) {
        return -EXXX;
    }
    ... nominal case ...

siwx91x_on_join_ipv4() and siwx91x_on_join_ipv6() didn't follow this
pattern.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
a89dc21a2b drivers: wifi: siwx91x: Uniformize declaration of 'interface'
sl_wifi_interface_t interface is always initialized with
sl_wifi_get_default_interface().

Let's assign the value during the declaration everywhere.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
56fb22fba8 drivers: wifi: siwx91x: Group ARG_UNUSED() after declarations
We want to avoid declarations after statements.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
db2472209a drivers: wifi: siwx91x: Align the ways errors are managed
Unify the way the error code are tested:
  - sl_status_t is an alias to an int. The compiler won't complain if an
    int is assigned or compared to a sl_status_t. In the other hand,
    "int" is well known to manage error code. So, just use "int"
    everywhere.
  - Always name the return code "ret"
  - Unless it is meaningful, test the value of ret against 0
    (SL_STATUS_OK is just a convoluted way to say 0).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
dd0afec087 drivers: wifi: siwx91x: Clean up included files
To avoid confusion, we prefer to only keep header files really used by the
source file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
9cee7a1e57 drivers: wifi: siwx91x: Extract station related functions
siwx91x_wifi.c starts to contains to much code. Let' simplify it by
grouping all the station related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
5818738668 drivers: wifi: siwx91x: Extract Power Save related functions
siwx91x_wifi.c starts to contains to much code. Let's simplify it by
grouping all the power-save related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
9a1ebee72b drivers: wifi: siwx91x: Extract AP related functions
siwx91x_wifi.c starts to contains to much code. Let' simplify it by
grouping all the Access Point related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
6dd601c9f1 drivers: wifi: siwx91x: Extract scan related functions
siwx91x_wifi.c starts to contains to much code. Let's simplify it by
grouping all the scan related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
f6f387993f drivers: wifi: siwx91x: Fix siwx91x_wifi_socket.h syntax
Functions in siwx91x_wifi_socket.h are not declared static. So it create
duplicated symbols if the file is included twice.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jukka Rissanen
cdc6c324d7 net: dns: Save info about source when configuring DNS servers
Remember which DNS server was added by a source like DHCPv4 or v6
message. This will allow system to remove DNS servers that were added by
that source. Then when stopping for example DHCP, we can remove those
specific DNS servers and not leaving DNS servers hanging in the system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-06-26 14:08:19 +02:00
Chun-Chieh Li
2fd79998d0 drivers: wifi: esp_at: fix +CIPRECVDATA parsing for AT 1.7
This fixes +CIPRECVDATA parsing for AT 1.7. Per AT 1.7 spec,
remote ip/port is not replied.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-26 11:19:56 +02:00
Qiankun Li
702221da2d drivers: wifi: nxp: Fix TWT setup issue.
When try to set twt, system will try to
get interface status firstly.
In shim driver, miss filling twt_capable field.
The twt_capable is set as false by default.
Failed to set twt because of incorrect
twt_capable.

Add enhance code to fill twt_capable field
in shim driver.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 11:19:48 +02:00
Chun-Chieh Li
8a9dc13e91 drivers: wifi: esp_at: fix rx_sock not ref-counted
This fixes rx_sock is not reference-counted, or crash error on reference
to released socket.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-25 15:49:26 -10:00
Chun-Chieh Li
db59acba5e drivers: wifi: esp_at: fix deadlock in socket close path
This fixes deadlock in socket close path. In the scenario:
1. on_cmd_ipd/esp_socket_rx invokes esp_socket_ref_from_link_id
   and increments refcount.
2. zvfs_close/esp_put locks cond.lock.
3. zvfs_close/esp_put waits on sem_free.
4. on_cmd_ipd/esp_socket_rx waits on cond.lock before esp_socket_unref.
5. sem_free waits on esp_socket_unref for refcount reaching zero.

As we detect socket is closing, we can ignore last rx data and escape
from the trap.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-25 15:49:26 -10:00
Chun-Chieh Li
622fddb0b8 drivers: wifi: esp_at: fix premature socket release
This fixes premature socket release. Without this fix, system will crash
because esp_rx thread can still hold reference to the socket in the
following cases:
1. esp_rx thread has got the socket reference but hasn't unref'ed
   via esp_socket_unref.
2. esp_rx thread can still get the socket reference for refcount not
   being zero in esp_socket_ref.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-25 15:49:26 -10:00
Gang Li
75ac644ee3 drivers: wifi: nxp: enable net monitor mode on IW610
Enable CONFIG_NXP_WIFI_NET_MONITOR,
       CONFIG_NXP_WIFI_HOST_TXRX_MGMT_FRAME,
       CONFIG_NXP_WIFI_MMSF on IW610.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2025-06-24 15:36:04 -05:00
Maochen Wang
1e5b21f487 drivers: wifi: nxp: add Kconfig of NXP_WIFI_AUTO_INIT
Automatically initialize NXP Wi-Fi driver and FW for Wi-Fi networking
operation. Disable this setting if Wi-Fi module will be used for
non-Wi-Fi use cases (manufacturing/calibration/test).

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-06-24 14:20:02 +02:00
Maochen Wang
f4a0beb2b7 samples: net: wifi: Enable NXP_WIFI_TX_RX_ZERO_COPY for IW610
Enable NXP_WIFI_TX_RX_ZERO_COPY for IW610, which will reduce extra memcpy
between net stack and driver in TX data path and avoid the allocation of
RXPD and mlan_buffer in RX data path, to improve the throughput
performance.
Increase CONFIG_NET_BUF_DATA_SIZE to hold one packet in one buffer.
NXP_WIFI_TX_RX_ZERO_COPY can be enabled not only for NXP_RW610 case.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-06-24 09:17:03 +02:00
Pisit Sawangvonganan
d0b9a4e43e drivers: wifi: nxp: use IS_ENABLED() for CONFIG_NXP_WIFI_SOFTAP_SUPPORT
Replaced conditional compilation of `CONFIG_NXP_WIFI_SOFTAP_SUPPORT`
where applicable with IS_ENABLED() macro to improve code readability.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-06-24 09:13:58 +02:00
Pisit Sawangvonganan
2265dd7a93 drivers: wifi: nxp: fix include guard typo in nxp_wifi_drv.h
Fix include guard name and added trailing comment to final #endif.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-06-24 09:13:58 +02:00
Ravi Dondaputi
11a3969221 drivers: wifi: Introduce option to use K_HEAP
Provide option to revert to K_HEAP instead of using
dedicated heaps in Wi-Fi driver.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2025-06-24 09:13:20 +02:00
Benjamin Cabé
533fcc9a3f drivers: wifi: update non-inclusive language
use "Accept/block List" terminology instead of white/black list

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 16:31:16 -05:00
Muzaffar Ahmed
56a0160e30 drivers: wifi: siwx91x: Fix buffer overflow in client disconnect
Copy only WIFI_MAC_ADDR_LEN bytes to sta_info.mac instead of dynamic
length

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-06-23 12:46:10 -07:00
Muzaffar Ahmed
73a1bef079 drivers: wifi: siwx91x: Raise AP enable event from driver
Raising event from driver itself after successful AP start,
instead of waiting for an event from SDK/TA FW. TA used to send an
asynchronous event earlier but currently does not.

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-06-23 12:46:10 -07:00
Kapil Bhatt
39e6f0170f drivers: nrf_wifi: Add Kconfig for Dynamic ED
Add Kconfig to enable/disable Dynamic ED which add support for
proprietary algorithm to enhance performance in high-traffic channels.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-06-23 09:46:47 +02:00
Jérôme Pouiller
fbc70337e8 modules: hal_silabs: Update WiseConnect SDK
Import the new version of the WiseConnect SDK.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-20 13:22:57 -04:00
Maochen Wang
7e3f5814e4 drivers: wifi: nxp: only enable NXP_WIFI_TC_RELOCATE for RW612
Only by default enable NXP_WIFI_TC_RELOCATE for RW612, which will
relocate traffic API into RAM. But for other platform, for example
the RT series, the ITCM/DTCM is a more suitable place for critical
code.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-06-20 16:23:52 +02:00
Qingling Wu
2016f05860 drivers: nxp: wifi: Enable 11AX density config by default for IW610
Enable NXP_WIFI_MMSF by default for IW610

Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
2025-06-20 08:52:53 +02:00
Marek Matej
720db7bf5e drivers: wifi: esp32: Fix buffer config
Prevent to allocate buffers cache if Wi-Fi heap is not used.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-06-18 17:46:03 -04:00
Hui Bai
4868c8acae drivers: wifi: nxp: Host sleep handshake enhancement
To reduce low power current value, added host sleep handshake
enhancement. If CPU3 is wokenup by WLAN, do host sleep handshake with
CPU1 as before. For other wakeup sources, skip host sleep handshake.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2025-06-18 09:30:28 -04:00
Kapil Bhatt
1037a0cca6 drivers: nrf_wifi: Add Kconfig for Dynamic Bandwidth Signalling
Add Kconfig to enable/disable  Dynamic Bandwidth Signalling.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-06-18 11:22:25 +01:00
Gang Li
a5dd932314 drivers: wifi: add support for fetching inactivity duration
In SAP mode, need to fetch the inactivity duration.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2025-06-18 10:56:14 +02:00
Maochen Wang
736058de7d drivers: wifi: nxp: add download countryinfo
When set 'wifi reg_domain' CMD, need to create and download countryinfo
to sync driver and FW for embedded supplicant case

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-06-18 10:54:55 +02:00
Jukka Rissanen
5a9a39caf3 net: mgmt: Convert the mgmt API to use 64-bit masks
Instead of using 32 bit enum values for event numbers, convert
the code to use 64 bit long bit fields. This means that the
user API is changed to use 64 bit event values instead of 32
bit event values.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-06-18 10:54:44 +02:00
Benjamin Cabé
8d6316c5b7 drivers: nrf_wifi: put driver ops in flash
Add const qualifiers to the driver ops to save on RAM usage.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-17 16:12:44 +02:00
Jukka Rissanen
0e57844b2d drivers: wifi: esp_at: Bind DNS to device net interface
Make sure received DNS server information is bound to the
wifi network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-06-17 16:08:56 +02:00
Keith Packard
ec38e9ef64 wifi/esp32: Fix overflow in SSID copy
In the previous code, strnlen could have returned WIFI_SSID_MAX_LEN, and
the following statement ensuring NUL termination would have written one
past the end of the array.

Replace this with code that ensures a NUL termination within the bounds
of the array and then use strlen to compute the length.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-06-17 16:06:21 +02:00
Xinyu Hong
95d945504d drivers: wifi: nxp: add channel load support
Add WIFI_CHANNEL_LOAD macro to support wifi channel load feature

Signed-off-by: Xinyu Hong <xinyu.hong@nxp.com>
2025-06-17 16:05:45 +02:00
Rex Chen
cc5b1477ff drivers: wifi: nxp: support monitor mode tx frame
Add WIFI_HOST_TXRX_MGMT_FRAME macro to support tx frame
in monitor mode.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2025-06-17 16:04:54 +02:00